Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity reaches varQuantityMin or lower and the item config contains the varQuantityDestroyOnMin = true entry, the item gets destroyed. destroy_forced = true means item gets destroyed when quantity reaches varQuantityMin or lower regardless of config setting, returns true if the item gets deleted.
8152{
8154 {
8155 return true;
8156 }
8157};
8158
8159
8160
8162{
8166
8168
8171
8172
8173
8174
8175
8184
8190
8195
8200
8221 protected bool m_IsResultOfSplit
8222
8224
8229
8230
8231
8233
8237
8238
8239
8241
8244
8245
8246
8252
8253
8261
8264
8265
8267
8268
8270
8271
8276
8277
8282
8283
8285
8286
8288 {
8293
8294 if (!
GetGame().IsDedicatedServer())
8295 {
8297 {
8299
8301 {
8303 }
8304 }
8305
8308 }
8309
8310 m_OldLocation = null;
8311
8313 {
8315 }
8316
8317 if (ConfigIsExisting("headSelectionsToHide"))
8318 {
8321 }
8322
8324 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8325 {
8327 }
8328
8330
8331 m_IsResultOfSplit = false;
8332
8334 }
8335
8337 {
8338 super.InitItemVariables();
8339
8345 m_Count = ConfigGetInt(
"count");
8346
8349
8354
8357
8362
8374
8378
8379
8382 if (ConfigIsExisting("canBeSplit"))
8383 {
8386 }
8387
8389 if (ConfigIsExisting("itemBehaviour"))
8391
8392
8395 RegisterNetSyncVariableInt("m_VarLiquidType");
8396 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8397
8398 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8399 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8400 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8401
8402 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8403 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8404 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8405 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8406
8407 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8408 RegisterNetSyncVariableBool("m_IsTakeable");
8409 RegisterNetSyncVariableBool("m_IsHologram");
8410
8413 {
8416 }
8417
8419
8421 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8423
8424 }
8425
8427 {
8429 }
8430
8432 {
8435 {
8440 }
8441 }
8442
8443 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8444 {
8446 {
8449 }
8450
8452 }
8453
8455 {
8461 }
8462
8464
8466 {
8468
8469 if (!action)
8470 {
8471 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8472 return;
8473 }
8474
8476 if (!ai)
8477 {
8479 return;
8480 }
8481
8483 if (!action_array)
8484 {
8485 action_array = new array<ActionBase_Basic>;
8487 }
8488 if (LogManager.IsActionLogEnable())
8489 {
8490 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8491 }
8492
8493 if (action_array.Find(action) != -1)
8494 {
8495 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8496 }
8497 else
8498 {
8499 action_array.Insert(action);
8500 }
8501 }
8502
8504 {
8506 ActionBase action = player.GetActionManager().GetAction(actionName);
8509
8510 if (action_array)
8511 {
8512 action_array.RemoveItem(action);
8513 }
8514 }
8515
8516
8517
8519 {
8520 ActionOverrideData overrideData = new ActionOverrideData();
8524
8526 if (!actionMap)
8527 {
8530 }
8531
8532 actionMap.Insert(this.
Type(), overrideData);
8533
8534 }
8535
8537
8539
8540
8542 {
8545
8548
8549 string config_to_search = "CfgVehicles";
8550 string muzzle_owner_config;
8551
8553 {
8554 if (IsInherited(Weapon))
8555 config_to_search = "CfgWeapons";
8556
8557 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8558
8559 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8560
8562
8563 if (config_OnFire_subclass_count > 0)
8564 {
8565 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8566
8567 for (int i = 0; i < config_OnFire_subclass_count; i++)
8568 {
8569 string particle_class = "";
8571 string config_OnFire_entry = config_OnFire_class + particle_class;
8572 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8573 WPOF_array.Insert(WPOF);
8574 }
8575
8576
8578 }
8579 }
8580
8582 {
8583 config_to_search = "CfgWeapons";
8584 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8585
8586 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8587
8589
8590 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8591 {
8592 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8593
8594 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8595 {
8596 string particle_class2 = "";
8598 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8599 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8600 WPOBE_array.Insert(WPOBE);
8601 }
8602
8603
8605 }
8606 }
8607 }
8608
8609
8611 {
8614
8616 {
8617 string config_to_search = "CfgVehicles";
8618
8619 if (IsInherited(Weapon))
8620 config_to_search = "CfgWeapons";
8621
8622 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8623 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8624
8625 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8626 {
8627
8629
8631 {
8633 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8635 return;
8636 }
8637
8640
8641
8642
8644 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8645
8646 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8647 {
8648 string particle_class = "";
8650 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8652
8653 if (entry_type == CT_CLASS)
8654 {
8655 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8656 WPOOH_array.Insert(WPOF);
8657 }
8658 }
8659
8660
8662 }
8663 }
8664 }
8665
8667 {
8669 }
8670
8672 {
8674 {
8676
8679
8682
8683 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8684 }
8685 }
8686
8688 {
8690 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8691
8693 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8694
8696 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8697
8699 {
8701 }
8702 }
8703
8705 {
8707 }
8708
8710 {
8713 else
8715
8717 {
8720 }
8721 else
8722 {
8725
8728 }
8729
8731 }
8732
8734 {
8736 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8737 }
8738
8740 {
8742 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8744 }
8745
8747 {
8749 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8750 }
8751
8753 {
8756
8757 OverheatingParticle OP = new OverheatingParticle();
8762
8764 }
8765
8767 {
8770
8771 return -1;
8772 }
8773
8775 {
8777 {
8780
8781 for (int i = count; i > 0; --i)
8782 {
8783 int id = i - 1;
8786
8789
8790 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8791 {
8792 if (p)
8793 {
8796 }
8797 }
8798 }
8799 }
8800 }
8801
8803 {
8805 {
8807 {
8808 int id = i - 1;
8810
8811 if (OP)
8812 {
8814
8815 if (p)
8816 {
8818 }
8819
8820 delete OP;
8821 }
8822 }
8823
8826 }
8827 }
8828
8831 {
8832 return 0.0;
8833 }
8834
8835
8837 {
8838 return 250;
8839 }
8840
8842 {
8843 return 0;
8844 }
8845
8848 {
8850 return true;
8851
8852 return false;
8853 }
8854
8857 {
8860
8862 {
8864 }
8865 else
8866 {
8867
8869 }
8870
8872 }
8873
8880 {
8881 return -1;
8882 }
8883
8884
8885
8886
8888 {
8890 {
8892 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8893
8894 if (r_index >= 0)
8895 {
8896 InventoryLocation r_il = new InventoryLocation;
8897 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8898
8899 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8902 {
8903 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8904 }
8906 {
8907 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8908 }
8909
8910 }
8911
8912 player.GetHumanInventory().ClearUserReservedLocation(this);
8913 }
8914
8917 }
8918
8919
8920
8921
8923 {
8924 return ItemBase.m_DebugActionsMask;
8925 }
8926
8928 {
8929 return ItemBase.m_DebugActionsMask & mask;
8930 }
8931
8933 {
8934 ItemBase.m_DebugActionsMask = mask;
8935 }
8936
8938 {
8939 ItemBase.m_DebugActionsMask |= mask;
8940 }
8941
8943 {
8944 ItemBase.m_DebugActionsMask &= ~mask;
8945 }
8946
8948 {
8950 {
8952 }
8953 else
8954 {
8956 }
8957 }
8958
8959
8961 {
8962 if (GetEconomyProfile())
8963 {
8964 float q_max = GetEconomyProfile().GetQuantityMax();
8965 if (q_max > 0)
8966 {
8967 float q_min = GetEconomyProfile().GetQuantityMin();
8968 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8969
8971 {
8972 ComponentEnergyManager comp = GetCompEM();
8974 {
8976 }
8977 }
8979 {
8981
8982 }
8983
8984 }
8985 }
8986 }
8987
8990 {
8991 EntityAI parent = GetHierarchyParent();
8992
8993 if (parent)
8994 {
8995 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8996 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8997 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8998 }
8999 }
9000
9003 {
9004 EntityAI parent = GetHierarchyParent();
9005
9006 if (parent)
9007 {
9008 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9009 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9010 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9011 }
9012 }
9013
9015 {
9016
9017
9018
9019
9021
9023 {
9024 if (ScriptInputUserData.CanStoreInputUserData())
9025 {
9026 ScriptInputUserData ctx = new ScriptInputUserData;
9032 ctx.
Write(use_stack_max);
9035
9037 {
9038 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9039 }
9040 }
9041 }
9042 else if (!
GetGame().IsMultiplayer())
9043 {
9045 }
9046 }
9047
9049 {
9051 }
9052
9054 {
9056 }
9057
9059 {
9061 }
9062
9064 {
9065
9066 return false;
9067 }
9068
9070 {
9071 return false;
9072 }
9073
9077 {
9078 return false;
9079 }
9080
9082 {
9083 return "";
9084 }
9085
9087
9089 {
9090 return false;
9091 }
9092
9094 {
9095 return true;
9096 }
9097
9098
9099
9101 {
9102 return true;
9103 }
9104
9106 {
9107 return true;
9108 }
9109
9111 {
9112 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9114 }
9115
9117 {
9119 }
9120
9122 {
9124 if (!is_being_placed)
9126 SetSynchDirty();
9127 }
9128
9129
9131
9133 {
9135 }
9136
9138 {
9140 }
9141
9143 {
9144 return 1;
9145 }
9146
9148 {
9149 return false;
9150 }
9151
9153 {
9155 SetSynchDirty();
9156 }
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9193 {
9194 super.OnMovedInsideCargo(container);
9195
9196 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9197 }
9198
9199 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9200 {
9201 super.EEItemLocationChanged(oldLoc,newLoc);
9202
9203 PlayerBase new_player = null;
9204 PlayerBase old_player = null;
9205
9206 if (newLoc.GetParent())
9207 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9208
9209 if (oldLoc.GetParent())
9210 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9211
9213 {
9214 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9215
9216 if (r_index >= 0)
9217 {
9218 InventoryLocation r_il = new InventoryLocation;
9219 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9220
9221 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9224 {
9225 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9226 }
9228 {
9229 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9230 }
9231
9232 }
9233 }
9234
9236 {
9237 if (new_player)
9238 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9239
9240 if (new_player == old_player)
9241 {
9242
9243 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9244 {
9246 {
9247 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9248 {
9249 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9250 }
9251 }
9252 else
9253 {
9254 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9255 }
9256 }
9257
9258 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9259 {
9260 int type = oldLoc.GetType();
9262 {
9263 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9264 }
9266 {
9267 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9268 }
9269 }
9270 if (!m_OldLocation)
9271 {
9272 m_OldLocation = new InventoryLocation;
9273 }
9274 m_OldLocation.Copy(oldLoc);
9275 }
9276 else
9277 {
9278 if (m_OldLocation)
9279 {
9280 m_OldLocation.Reset();
9281 }
9282 }
9283
9285 }
9286 else
9287 {
9288 if (new_player)
9289 {
9290 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9291 if (res_index >= 0)
9292 {
9293 InventoryLocation il = new InventoryLocation;
9294 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9296 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9299 {
9300 il.
GetParent().GetOnReleaseLock().Invoke(it);
9301 }
9303 {
9305 }
9306
9307 }
9308 }
9310 {
9311
9313 }
9314
9315 if (m_OldLocation)
9316 {
9317 m_OldLocation.Reset();
9318 }
9319 }
9320 }
9321
9322 override void EOnContact(IEntity other, Contact extra)
9323 {
9325 {
9326 int liquidType = -1;
9328 if (impactSpeed > 0.0)
9329 {
9331 #ifndef SERVER
9333 #else
9335 SetSynchDirty();
9336 #endif
9338 }
9339 }
9340
9341 #ifdef SERVER
9342 if (GetCompEM() && GetCompEM().IsPlugged())
9343 {
9344 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9345 GetCompEM().UnplugThis();
9346 }
9347 #endif
9348 }
9349
9351
9353 {
9355 }
9356
9358 {
9359
9360 }
9361
9363 {
9364 super.OnItemLocationChanged(old_owner, new_owner);
9365
9366 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9367 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9368
9369 if (!relatedPlayer && playerNew)
9370 relatedPlayer = playerNew;
9371
9372 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9373 {
9375 if (actionMgr)
9376 {
9377 ActionBase currentAction = actionMgr.GetRunningAction();
9378 if (currentAction)
9380 }
9381 }
9382
9383 Man ownerPlayerOld = null;
9384 Man ownerPlayerNew = null;
9385
9386 if (old_owner)
9387 {
9388 if (old_owner.
IsMan())
9389 {
9390 ownerPlayerOld = Man.Cast(old_owner);
9391 }
9392 else
9393 {
9394 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9395 }
9396 }
9397 else
9398 {
9400 {
9402
9403 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9404 {
9405 GetCompEM().UnplugThis();
9406 }
9407 }
9408 }
9409
9410 if (new_owner)
9411 {
9412 if (new_owner.
IsMan())
9413 {
9414 ownerPlayerNew = Man.Cast(new_owner);
9415 }
9416 else
9417 {
9418 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9419 }
9420 }
9421
9422 if (ownerPlayerOld != ownerPlayerNew)
9423 {
9424 if (ownerPlayerOld)
9425 {
9426 array<EntityAI> subItemsExit = new array<EntityAI>;
9428 for (int i = 0; i < subItemsExit.Count(); i++)
9429 {
9432 }
9433 }
9434
9435 if (ownerPlayerNew)
9436 {
9437 array<EntityAI> subItemsEnter = new array<EntityAI>;
9439 for (int j = 0; j < subItemsEnter.Count(); j++)
9440 {
9443 }
9444 }
9445 }
9446 else if (ownerPlayerNew != null)
9447 {
9448 PlayerBase nplayer;
9449 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9450 {
9451 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9453 for (int k = 0; k < subItemsUpdate.Count(); k++)
9454 {
9456 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9457 }
9458 }
9459 }
9460
9461 if (old_owner)
9462 old_owner.OnChildItemRemoved(this);
9463 if (new_owner)
9464 new_owner.OnChildItemReceived(this);
9465 }
9466
9467
9469 {
9470 super.EEDelete(parent);
9471 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9472 if (player)
9473 {
9475
9476 if (player.IsAlive())
9477 {
9478 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9479 if (r_index >= 0)
9480 {
9481 InventoryLocation r_il = new InventoryLocation;
9482 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9483
9484 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9487 {
9488 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9489 }
9491 {
9492 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9493 }
9494
9495 }
9496
9497 player.RemoveQuickBarEntityShortcut(this);
9498 }
9499 }
9500 }
9501
9503 {
9504 super.EEKilled(killer);
9505
9508 {
9509 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9510 {
9511 if (IsMagazine())
9512 {
9513 if (Magazine.Cast(this).GetAmmoCount() > 0)
9514 {
9516 }
9517 }
9518 else
9519 {
9521 }
9522 }
9523 }
9524 }
9525
9527 {
9528 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9529
9530 super.OnWasAttached(parent, slot_id);
9531
9534
9536 }
9537
9539 {
9540 super.OnWasDetached(parent, slot_id);
9541
9544 }
9545
9547 {
9548 int idx;
9551
9552 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9553 if (inventory_slots.Count() < 1)
9554 {
9555 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9556 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9557 }
9558 else
9559 {
9560 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9561 }
9562
9563 idx = inventory_slots.Find(slot);
9564 if (idx < 0)
9565 return "";
9566
9567 return attach_types.Get(idx);
9568 }
9569
9571 {
9572 int idx = -1;
9573 string slot;
9574
9577
9578 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9579 if (inventory_slots.Count() < 1)
9580 {
9581 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9582 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9583 }
9584 else
9585 {
9586 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9587 if (detach_types.Count() < 1)
9588 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9589 }
9590
9591 for (int i = 0; i < inventory_slots.Count(); i++)
9592 {
9593 slot = inventory_slots.Get(i);
9594 }
9595
9596 if (slot != "")
9597 {
9598 if (detach_types.Count() == 1)
9599 idx = 0;
9600 else
9601 idx = inventory_slots.Find(slot);
9602 }
9603 if (idx < 0)
9604 return "";
9605
9606 return detach_types.Get(idx);
9607 }
9608
9610 {
9611
9613
9614
9615 float min_time = 1;
9616 float max_time = 3;
9617 float delay = Math.RandomFloat(min_time, max_time);
9618
9619 explode_timer.Run(delay, this, "DoAmmoExplosion");
9620 }
9621
9623 {
9624 Magazine magazine = Magazine.Cast(this);
9625 int pop_sounds_count = 6;
9626 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9627
9628
9629 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9630 string sound_name = pop_sounds[ sound_idx ];
9632
9633
9634 magazine.ServerAddAmmoCount(-1);
9635
9636
9637 float min_temp_to_explode = 100;
9638
9639 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9640 {
9642 }
9643 }
9644
9645
9646 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9647 {
9648 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9649
9650 const int CHANCE_DAMAGE_CARGO = 4;
9651 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9652 const int CHANCE_DAMAGE_NOTHING = 2;
9653
9655 {
9656 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9657 int chances;
9658 int rnd;
9659
9660 if (GetInventory().GetCargo())
9661 {
9662 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9663 rnd = Math.RandomInt(0,chances);
9664
9665 if (rnd < CHANCE_DAMAGE_CARGO)
9666 {
9668 }
9669 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9670 {
9672 }
9673 }
9674 else
9675 {
9676 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9677 rnd = Math.RandomInt(0,chances);
9678
9679 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9680 {
9682 }
9683 }
9684 }
9685 }
9686
9688 {
9689 if (GetInventory().GetCargo())
9690 {
9691 int item_count = GetInventory().GetCargo().GetItemCount();
9692 if (item_count > 0)
9693 {
9694 int random_pick = Math.RandomInt(0, item_count);
9696 if (!item.IsExplosive())
9697 {
9698 item.AddHealth("","",damage);
9699 return true;
9700 }
9701 }
9702 }
9703 return false;
9704 }
9705
9707 {
9708 int attachment_count = GetInventory().AttachmentCount();
9709 if (attachment_count > 0)
9710 {
9711 int random_pick = Math.RandomInt(0, attachment_count);
9712 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9713 if (!attachment.IsExplosive())
9714 {
9715 attachment.AddHealth("","",damage);
9716 return true;
9717 }
9718 }
9719 return false;
9720 }
9721
9723 {
9725 }
9726
9728 {
9730 return GetInventory().CanRemoveEntity();
9731
9732 return false;
9733 }
9734
9736 {
9737
9739 return false;
9740
9741
9743 return false;
9744
9745
9746
9748 if (delta == 0)
9749 return false;
9750
9751
9752 return true;
9753 }
9754
9756 {
9758 {
9759 if (ScriptInputUserData.CanStoreInputUserData())
9760 {
9761 ScriptInputUserData ctx = new ScriptInputUserData;
9766 ctx.
Write(destination_entity);
9770 }
9771 }
9772 else if (!
GetGame().IsMultiplayer())
9773 {
9775 }
9776 }
9777
9779 {
9780 float split_quantity_new;
9784 InventoryLocation loc = new InventoryLocation;
9785
9786 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9787 {
9789 split_quantity_new = stack_max;
9790 else
9792
9794 {
9795 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9796 if (new_item)
9797 {
9798 new_item.SetResultOfSplit(true);
9799 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9801 new_item.
SetQuantity(split_quantity_new,
false,
true);
9802 }
9803 }
9804 }
9805 else if (destination_entity && slot_id == -1)
9806 {
9807 if (quantity > stack_max)
9808 split_quantity_new = stack_max;
9809 else
9810 split_quantity_new = quantity;
9811
9813 {
9815 {
9818 }
9819
9820 if (new_item)
9821 {
9822 new_item.SetResultOfSplit(true);
9823 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9825 new_item.
SetQuantity(split_quantity_new,
false,
true);
9826 }
9827 }
9828 }
9829 else
9830 {
9831 if (stack_max != 0)
9832 {
9834 {
9836 }
9837
9838 if (split_quantity_new == 0)
9839 {
9840 if (!
GetGame().IsMultiplayer())
9841 player.PhysicalPredictiveDropItem(this);
9842 else
9843 player.ServerDropEntity(this);
9844 return;
9845 }
9846
9848 {
9850
9851 if (new_item)
9852 {
9853 new_item.SetResultOfSplit(true);
9854 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9857 new_item.PlaceOnSurface();
9858 }
9859 }
9860 }
9861 }
9862 }
9863
9865 {
9866 float split_quantity_new;
9870 InventoryLocation loc = new InventoryLocation;
9871
9872 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9873 {
9875 split_quantity_new = stack_max;
9876 else
9878
9880 {
9881 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9882 if (new_item)
9883 {
9884 new_item.SetResultOfSplit(true);
9885 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9887 new_item.
SetQuantity(split_quantity_new,
false,
true);
9888 }
9889 }
9890 }
9891 else if (destination_entity && slot_id == -1)
9892 {
9893 if (quantity > stack_max)
9894 split_quantity_new = stack_max;
9895 else
9896 split_quantity_new = quantity;
9897
9899 {
9901 {
9904 }
9905
9906 if (new_item)
9907 {
9908 new_item.SetResultOfSplit(true);
9909 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9911 new_item.
SetQuantity(split_quantity_new,
false,
true);
9912 }
9913 }
9914 }
9915 else
9916 {
9917 if (stack_max != 0)
9918 {
9920 {
9922 }
9923
9925 {
9927
9928 if (new_item)
9929 {
9930 new_item.SetResultOfSplit(true);
9931 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9934 new_item.PlaceOnSurface();
9935 }
9936 }
9937 }
9938 }
9939 }
9940
9942 {
9944 {
9945 if (ScriptInputUserData.CanStoreInputUserData())
9946 {
9947 ScriptInputUserData ctx = new ScriptInputUserData;
9952 dst.WriteToContext(ctx);
9954 }
9955 }
9956 else if (!
GetGame().IsMultiplayer())
9957 {
9959 }
9960 }
9961
9963 {
9965 {
9966 if (ScriptInputUserData.CanStoreInputUserData())
9967 {
9968 ScriptInputUserData ctx = new ScriptInputUserData;
9973 ctx.
Write(destination_entity);
9979 }
9980 }
9981 else if (!
GetGame().IsMultiplayer())
9982 {
9984 }
9985 }
9986
9988 {
9990 }
9991
9993 {
9995 float split_quantity_new;
9997 if (dst.IsValid())
9998 {
9999 int slot_id = dst.GetSlot();
10001
10002 if (quantity > stack_max)
10003 split_quantity_new = stack_max;
10004 else
10005 split_quantity_new = quantity;
10006
10008 {
10010
10011 if (new_item)
10012 {
10013 new_item.SetResultOfSplit(true);
10014 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10016 new_item.
SetQuantity(split_quantity_new,
false,
true);
10017 }
10018
10019 return new_item;
10020 }
10021 }
10022
10023 return null;
10024 }
10025
10027 {
10029 float split_quantity_new;
10031 if (destination_entity)
10032 {
10034 if (quantity > stackable)
10035 split_quantity_new = stackable;
10036 else
10037 split_quantity_new = quantity;
10038
10040 {
10041 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10042 if (new_item)
10043 {
10044 new_item.SetResultOfSplit(true);
10045 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10047 new_item.
SetQuantity(split_quantity_new,
false,
true);
10048 }
10049 }
10050 }
10051 }
10052
10054 {
10056 {
10057 if (ScriptInputUserData.CanStoreInputUserData())
10058 {
10059 ScriptInputUserData ctx = new ScriptInputUserData;
10064 ItemBase destination_entity =
this;
10065 ctx.
Write(destination_entity);
10069 }
10070 }
10071 else if (!
GetGame().IsMultiplayer())
10072 {
10074 }
10075 }
10076
10078 {
10080 float split_quantity_new;
10082 if (player)
10083 {
10085 if (quantity > stackable)
10086 split_quantity_new = stackable;
10087 else
10088 split_quantity_new = quantity;
10089
10091 {
10092 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10093 new_item =
ItemBase.Cast(in_hands);
10094 if (new_item)
10095 {
10096 new_item.SetResultOfSplit(true);
10097 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10099 new_item.SetQuantity(split_quantity_new, false, true);
10100 }
10101 }
10102 }
10103 }
10104
10106 {
10108 float split_quantity_new = Math.Floor(quantity * 0.5);
10109
10111 return;
10112
10114
10115 if (new_item)
10116 {
10117 if (new_item.GetQuantityMax() < split_quantity_new)
10118 {
10119 split_quantity_new = new_item.GetQuantityMax();
10120 }
10121
10122 new_item.SetResultOfSplit(true);
10123 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10124
10126 {
10129 }
10130 else
10131 {
10133 new_item.
SetQuantity(split_quantity_new,
false,
true);
10134 }
10135 }
10136 }
10137
10139 {
10141 float split_quantity_new = Math.Floor(quantity / 2);
10142
10144 return;
10145
10146 InventoryLocation invloc = new InventoryLocation;
10148
10150 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10151
10152 if (new_item)
10153 {
10154 if (new_item.GetQuantityMax() < split_quantity_new)
10155 {
10156 split_quantity_new = new_item.GetQuantityMax();
10157 }
10159 {
10162 }
10163 else if (split_quantity_new > 1)
10164 {
10166 new_item.
SetQuantity(split_quantity_new,
false,
true);
10167 }
10168 }
10169 }
10170
10173 {
10174 SetWeightDirty();
10176
10177 if (parent)
10178 parent.OnAttachmentQuantityChangedEx(this, delta);
10179
10181 {
10183 {
10185 }
10187 {
10188 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10190 }
10191 }
10192
10193 }
10194
10197 {
10198
10199 }
10200
10203 {
10205 }
10206
10208 {
10209 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10210
10212 {
10213 if (newLevel == GameConstants.STATE_RUINED)
10214 {
10216 EntityAI parent = GetHierarchyParent();
10217 if (parent && parent.IsFireplace())
10218 {
10219 CargoBase cargo = GetInventory().GetCargo();
10220 if (cargo)
10221 {
10223 {
10225 }
10226 }
10227 }
10228 }
10229
10231 {
10232
10234 return;
10235 }
10236
10237 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10238 {
10240 }
10241 }
10242 }
10243
10244
10246 {
10247 super.OnRightClick();
10248
10250 {
10252 {
10253 if (ScriptInputUserData.CanStoreInputUserData())
10254 {
10255 EntityAI root = GetHierarchyRoot();
10256 Man playerOwner = GetHierarchyRootPlayer();
10257 InventoryLocation dst = new InventoryLocation;
10258
10259
10260 if (!playerOwner && root && root == this)
10261 {
10263 }
10264 else
10265 {
10266
10267 GetInventory().GetCurrentInventoryLocation(dst);
10269 {
10272 {
10274 }
10275 else
10276 {
10278
10279
10280 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10281 {
10283 }
10284 else
10285 {
10286 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10287 }
10288 }
10289 }
10290 }
10291
10292 ScriptInputUserData ctx = new ScriptInputUserData;
10300 }
10301 }
10302 else if (!
GetGame().IsMultiplayer())
10303 {
10305 }
10306 }
10307 }
10308
10310 {
10311 if (root)
10312 {
10313 vector m4[4];
10314 root.GetTransform(m4);
10315 dst.SetGround(this, m4);
10316 }
10317 else
10318 {
10319 GetInventory().GetCurrentInventoryLocation(dst);
10320 }
10321 }
10322
10323 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10324 {
10325
10326 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10327 return false;
10328
10329 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10330 return false;
10331
10332
10334 return false;
10335
10336
10337 Magazine mag = Magazine.Cast(this);
10338 if (mag)
10339 {
10340 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10341 return false;
10342
10343 if (stack_max_limit)
10344 {
10345 Magazine other_mag = Magazine.Cast(other_item);
10346 if (other_item)
10347 {
10348 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10349 return false;
10350 }
10351
10352 }
10353 }
10354 else
10355 {
10356
10358 return false;
10359
10361 return false;
10362 }
10363
10364 PlayerBase player = null;
10365 if (CastTo(player, GetHierarchyRootPlayer()))
10366 {
10367 if (player.GetInventory().HasAttachment(this))
10368 return false;
10369
10370 if (player.IsItemsToDelete())
10371 return false;
10372 }
10373
10374 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10375 return false;
10376
10377 int slotID;
10379 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10380 return false;
10381
10382 return true;
10383 }
10384
10386 {
10388 }
10389
10391 {
10392 return m_IsResultOfSplit;
10393 }
10394
10396 {
10397 m_IsResultOfSplit = value;
10398 }
10399
10401 {
10403 }
10404
10406 {
10407 float other_item_quantity = other_item.GetQuantity();
10408 float this_free_space;
10409
10411
10413
10414 if (other_item_quantity > this_free_space)
10415 {
10416 return this_free_space;
10417 }
10418 else
10419 {
10420 return other_item_quantity;
10421 }
10422 }
10423
10425 {
10427 }
10428
10430 {
10432 return;
10433
10434 if (!IsMagazine() && other_item)
10435 {
10437 if (quantity_used != 0)
10438 {
10439 float hp1 = GetHealth01("","");
10440 float hp2 = other_item.GetHealth01("","");
10441 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10442 hpResult = hpResult / (
GetQuantity() + quantity_used);
10443
10444 hpResult *= GetMaxHealth();
10445 Math.Round(hpResult);
10446 SetHealth("", "Health", hpResult);
10447
10449 other_item.AddQuantity(-quantity_used);
10450 }
10451 }
10453 }
10454
10456 {
10457 #ifdef SERVER
10458 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10459 GetHierarchyParent().IncreaseLifetimeUp();
10460 #endif
10461 };
10462
10464 {
10465 PlayerBase p = PlayerBase.Cast(player);
10466
10467 array<int> recipesIds = p.m_Recipes;
10468 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10469 if (moduleRecipesManager)
10470 {
10471 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10472 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10473 }
10474
10475 for (int i = 0;i < recipesIds.Count(); i++)
10476 {
10477 int key = recipesIds.Get(i);
10478 string recipeName = moduleRecipesManager.GetRecipeName(key);
10480 }
10481 }
10482
10483
10484 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10485 {
10486 super.GetDebugActions(outputList);
10487
10488
10494
10495
10500
10505
10506
10510
10511
10513 {
10517 }
10518
10521
10522
10526
10528
10529 InventoryLocation loc = new InventoryLocation();
10530 GetInventory().GetCurrentInventoryLocation(loc);
10532 {
10533 if (Gizmo_IsSupported())
10536 }
10537
10539 }
10540
10541
10542
10543
10545 {
10546 super.OnAction(action_id, player, ctx);
10547
10549 {
10550 switch (action_id)
10551 {
10554 return true;
10557 return true;
10558 }
10559 }
10560
10562 {
10563 switch (action_id)
10564 {
10566 Delete();
10567 return true;
10568 }
10569 }
10570
10571 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10572 {
10573 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10574 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10575 PlayerBase p = PlayerBase.Cast(player);
10576 if (
EActions.RECIPES_RANGE_START < 1000)
10577 {
10578 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10579 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10580 }
10581 }
10582 #ifndef SERVER
10583 else if (action_id ==
EActions.WATCH_PLAYER)
10584 {
10585 PluginDeveloper.SetDeveloperItemClientEx(player);
10586 }
10587 #endif
10589 {
10590 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10591 {
10592 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10593 OnDebugButtonPressServer(id + 1);
10594 }
10595
10596 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10597 {
10598 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10600 }
10601
10602 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10603 {
10604 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10606 }
10607
10608 else if (action_id ==
EActions.ADD_QUANTITY)
10609 {
10610 if (IsMagazine())
10611 {
10612 Magazine mag = Magazine.Cast(this);
10613 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10614 }
10615 else
10616 {
10618 }
10619
10620 if (m_EM)
10621 {
10622 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10623 }
10624
10625 }
10626
10627 else if (action_id ==
EActions.REMOVE_QUANTITY)
10628 {
10629 if (IsMagazine())
10630 {
10631 Magazine mag2 = Magazine.Cast(this);
10632 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10633 }
10634 else
10635 {
10637 }
10638 if (m_EM)
10639 {
10640 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10641 }
10642
10643 }
10644
10645 else if (action_id ==
EActions.SET_QUANTITY_0)
10646 {
10648
10649 if (m_EM)
10650 {
10651 m_EM.SetEnergy(0);
10652 }
10653 }
10654
10655 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10656 {
10658
10659 if (m_EM)
10660 {
10661 m_EM.SetEnergy(m_EM.GetEnergyMax());
10662 }
10663 }
10664
10665 else if (action_id ==
EActions.ADD_HEALTH)
10666 {
10667 AddHealth("","",GetMaxHealth("","Health")/5);
10668 }
10669 else if (action_id ==
EActions.REMOVE_HEALTH)
10670 {
10671 AddHealth("","",-GetMaxHealth("","Health")/5);
10672 }
10673 else if (action_id ==
EActions.DESTROY_HEALTH)
10674 {
10675 SetHealth01("","",0);
10676 }
10677 else if (action_id ==
EActions.WATCH_ITEM)
10678 {
10680 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10681 #ifdef DEVELOPER
10682 SetDebugDeveloper_item(this);
10683 #endif
10684 }
10685
10686 else if (action_id ==
EActions.ADD_TEMPERATURE)
10687 {
10688 AddTemperature(20);
10689
10690 }
10691
10692 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10693 {
10694 AddTemperature(-20);
10695
10696 }
10697
10698 else if (action_id ==
EActions.FLIP_FROZEN)
10699 {
10700 SetFrozen(!GetIsFrozen());
10701
10702 }
10703
10704 else if (action_id ==
EActions.ADD_WETNESS)
10705 {
10707
10708 }
10709
10710 else if (action_id ==
EActions.REMOVE_WETNESS)
10711 {
10713
10714 }
10715
10716 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10717 {
10720
10721
10722 }
10723
10724 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10725 {
10728 }
10729
10730 else if (action_id ==
EActions.MAKE_SPECIAL)
10731 {
10732 auto debugParams = DebugSpawnParams.WithPlayer(player);
10733 OnDebugSpawnEx(debugParams);
10734 }
10735
10736 }
10737
10738
10739 return false;
10740 }
10741
10742
10743
10744
10748
10751
10752
10753
10755 {
10756 return false;
10757 }
10758
10759
10761 {
10762 return true;
10763 }
10764
10765
10767 {
10768 return true;
10769 }
10770
10771
10772
10774 {
10775 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10777 }
10778
10781 {
10782 return null;
10783 }
10784
10786 {
10787 return false;
10788 }
10789
10791 {
10792 return false;
10793 }
10794
10798
10799
10801 {
10802 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10803 return module_repairing.CanRepair(this, item_repair_kit);
10804 }
10805
10806
10807 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10808 {
10809 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10810 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10811 }
10812
10813
10815 {
10816
10817
10818
10819
10820
10821
10822
10823
10824 return 1;
10825 }
10826
10827
10828
10830 {
10832 }
10833
10834
10835
10837 {
10839 }
10840
10841
10850 {
10851 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10852
10853 if (player)
10854 {
10855 player.MessageStatus(text);
10856 }
10857 }
10858
10859
10868 {
10869 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10870
10871 if (player)
10872 {
10873 player.MessageAction(text);
10874 }
10875 }
10876
10877
10886 {
10887 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10888
10889 if (player)
10890 {
10891 player.MessageFriendly(text);
10892 }
10893 }
10894
10895
10904 {
10905 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10906
10907 if (player)
10908 {
10909 player.MessageImportant(text);
10910 }
10911 }
10912
10914 {
10915 return true;
10916 }
10917
10918
10919 override bool KindOf(
string tag)
10920 {
10921 bool found = false;
10922 string item_name = this.
GetType();
10925
10926 int array_size = item_tag_array.Count();
10927 for (int i = 0; i < array_size; i++)
10928 {
10929 if (item_tag_array.Get(i) == tag)
10930 {
10931 found = true;
10932 break;
10933 }
10934 }
10935 return found;
10936 }
10937
10938
10940 {
10941
10942 super.OnRPC(sender, rpc_type,ctx);
10943
10944
10945 switch (rpc_type)
10946 {
10947 #ifndef SERVER
10948 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10949 Param2<bool, string> p = new Param2<bool, string>(false, "");
10950
10952 return;
10953
10954 bool play = p.param1;
10955 string soundSet = p.param2;
10956
10957 if (play)
10958 {
10960 {
10962 {
10964 }
10965 }
10966 else
10967 {
10969 }
10970 }
10971 else
10972 {
10974 }
10975
10976 break;
10977 #endif
10978
10979 }
10980
10982 {
10984 }
10985 }
10986
10987
10988
10989
10991 {
10992 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10993 return plugin.GetID(
name);
10994 }
10995
10997 {
10998 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10999 return plugin.GetName(id);
11000 }
11001
11004 {
11005
11006
11007 int varFlags;
11008 if (!ctx.
Read(varFlags))
11009 return;
11010
11011 if (varFlags & ItemVariableFlags.FLOAT)
11012 {
11014 }
11015 }
11016
11018 {
11019
11020 super.SerializeNumericalVars(floats_out);
11021
11022
11023
11025 {
11027 }
11028
11030 {
11032 }
11033
11035 {
11037 }
11038
11040 {
11045 }
11046
11048 {
11050 }
11051 }
11052
11054 {
11055
11056 super.DeSerializeNumericalVars(floats);
11057
11058
11059 int index = 0;
11060 int mask = Math.Round(floats.Get(index));
11061
11062 index++;
11063
11065 {
11067 {
11069 }
11070 else
11071 {
11072 float quantity = floats.Get(index);
11073 SetQuantity(quantity,
true,
false,
false,
false);
11074 }
11075 index++;
11076 }
11077
11079 {
11080 float wet = floats.Get(index);
11082 index++;
11083 }
11084
11086 {
11087 int liquidtype = Math.Round(floats.Get(index));
11089 index++;
11090 }
11091
11093 {
11095 index++;
11097 index++;
11099 index++;
11101 index++;
11102 }
11103
11105 {
11106 int cleanness = Math.Round(floats.Get(index));
11108 index++;
11109 }
11110 }
11111
11113 {
11114 super.WriteVarsToCTX(ctx);
11115
11116
11118 {
11120 }
11121
11123 {
11125 }
11126
11128 {
11130 }
11131
11133 {
11134 int r,g,b,a;
11140 }
11141
11143 {
11145 }
11146 }
11147
11149 {
11150 if (!super.ReadVarsFromCTX(ctx,version))
11151 return false;
11152
11153 int intValue;
11154 float value;
11155
11156 if (version < 140)
11157 {
11158 if (!ctx.
Read(intValue))
11159 return false;
11160
11161 m_VariablesMask = intValue;
11162 }
11163
11165 {
11166 if (!ctx.
Read(value))
11167 return false;
11168
11170 {
11172 }
11173 else
11174 {
11176 }
11177 }
11178
11179 if (version < 140)
11180 {
11182 {
11183 if (!ctx.
Read(value))
11184 return false;
11185 SetTemperatureDirect(value);
11186 }
11187 }
11188
11190 {
11191 if (!ctx.
Read(value))
11192 return false;
11194 }
11195
11197 {
11198 if (!ctx.
Read(intValue))
11199 return false;
11201 }
11202
11204 {
11205 int r,g,b,a;
11207 return false;
11209 return false;
11211 return false;
11213 return false;
11214
11216 }
11217
11219 {
11220 if (!ctx.
Read(intValue))
11221 return false;
11223 }
11224
11225 if (version >= 138 && version < 140)
11226 {
11228 {
11229 if (!ctx.
Read(intValue))
11230 return false;
11231 SetFrozen(intValue);
11232 }
11233 }
11234
11235 return true;
11236 }
11237
11238
11240 {
11243 {
11245 }
11246
11247 if (!super.OnStoreLoad(ctx, version))
11248 {
11250 return false;
11251 }
11252
11253 if (version >= 114)
11254 {
11255 bool hasQuickBarIndexSaved;
11256
11257 if (!ctx.
Read(hasQuickBarIndexSaved))
11258 {
11260 return false;
11261 }
11262
11263 if (hasQuickBarIndexSaved)
11264 {
11265 int itmQBIndex;
11266
11267
11268 if (!ctx.
Read(itmQBIndex))
11269 {
11271 return false;
11272 }
11273
11274 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11275 if (itmQBIndex != -1 && parentPlayer)
11276 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11277 }
11278 }
11279 else
11280 {
11281
11282 PlayerBase player;
11283 int itemQBIndex;
11284 if (version ==
int.
MAX)
11285 {
11286 if (!ctx.
Read(itemQBIndex))
11287 {
11289 return false;
11290 }
11291 }
11292 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11293 {
11294
11295 if (!ctx.
Read(itemQBIndex))
11296 {
11298 return false;
11299 }
11300 if (itemQBIndex != -1 && player)
11301 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11302 }
11303 }
11304
11305 if (version < 140)
11306 {
11307
11308 if (!LoadVariables(ctx, version))
11309 {
11311 return false;
11312 }
11313 }
11314
11315
11317 {
11319 return false;
11320 }
11321 if (version >= 132)
11322 {
11324 if (raib)
11325 {
11327 {
11329 return false;
11330 }
11331 }
11332 }
11333
11335 return true;
11336 }
11337
11338
11339
11341 {
11342 super.OnStoreSave(ctx);
11343
11344 PlayerBase player;
11345 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11346 {
11348
11349 int itemQBIndex = -1;
11350 itemQBIndex = player.FindQuickBarEntityIndex(this);
11351 ctx.
Write(itemQBIndex);
11352 }
11353 else
11354 {
11356 }
11357
11359
11361 if (raib)
11362 {
11364 }
11365 }
11366
11367
11369 {
11370 super.AfterStoreLoad();
11371
11373 {
11375 }
11376
11378 {
11381 }
11382 }
11383
11385 {
11386 super.EEOnAfterLoad();
11387
11389 {
11391 }
11392
11395 }
11396
11398 {
11399 return false;
11400 }
11401
11402
11403
11405 {
11407 {
11408 #ifdef PLATFORM_CONSOLE
11409
11411 {
11413 if (menu)
11414 {
11416 }
11417 }
11418 #endif
11419 }
11420
11422 {
11425 }
11426
11428 {
11429 SetWeightDirty();
11431 }
11433 {
11436 }
11437
11439 {
11442 }
11444 {
11447 }
11448
11449 super.OnVariablesSynchronized();
11450 }
11451
11452
11453
11455 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11456 {
11457 if (!IsServerCheck(allow_client))
11458 return false;
11459
11461 return false;
11462
11465
11466 if (value <= (min + 0.001))
11467 value = min;
11468
11469 if (value == min)
11470 {
11471 if (destroy_config)
11472 {
11473 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11474 if (dstr)
11475 {
11477 this.Delete();
11478 return true;
11479 }
11480 }
11481 else if (destroy_forced)
11482 {
11484 this.Delete();
11485 return true;
11486 }
11487
11489 }
11490
11493
11495 {
11497
11498 if (delta)
11500 }
11501
11503
11504 return false;
11505 }
11506
11507
11509 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11510 {
11512 }
11513
11515 {
11518 }
11519
11521 {
11524 }
11525
11527 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11528 {
11529 float value_clamped = Math.Clamp(value, 0, 1);
11531 SetQuantity(result, destroy_config, destroy_forced);
11532 }
11533
11534
11537 {
11539 }
11540
11542 {
11544 }
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11556 {
11557 int slot = -1;
11558 if (GetInventory())
11559 {
11560 InventoryLocation il = new InventoryLocation;
11561 GetInventory().GetCurrentInventoryLocation(il);
11563 }
11564
11566 }
11567
11569 {
11570 float quantity_max = 0;
11571
11573 {
11574 if (attSlotID != -1)
11575 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11576
11577 if (quantity_max <= 0)
11579 }
11580
11581 if (quantity_max <= 0)
11583
11584 return quantity_max;
11585 }
11586
11588 {
11590 }
11591
11593 {
11595 }
11596
11597
11599 {
11601 }
11602
11604 {
11606 }
11607
11609 {
11611 }
11612
11613
11615 {
11616
11617 float weightEx = GetWeightEx();
11618 float special = GetInventoryAndCargoWeight();
11619 return weightEx - special;
11620 }
11621
11622
11624 {
11626 }
11627
11629 {
11631 {
11632 #ifdef DEVELOPER
11633 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11634 {
11635 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11637 }
11638 #endif
11639
11640 return GetQuantity() * GetConfigWeightModified();
11641 }
11642 else if (HasEnergyManager())
11643 {
11644 #ifdef DEVELOPER
11645 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11646 {
11647 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11648 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11649 }
11650 #endif
11651 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11652 }
11653 else
11654 {
11655 #ifdef DEVELOPER
11656 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11657 {
11658 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11659 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11660 }
11661 #endif
11662 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11663 }
11664 }
11665
11668 {
11669 int item_count = 0;
11671
11672 if (GetInventory().GetCargo() != NULL)
11673 {
11674 item_count = GetInventory().GetCargo().GetItemCount();
11675 }
11676
11677 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11678 {
11679 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11680 if (item)
11681 item_count += item.GetNumberOfItems();
11682 }
11683 return item_count;
11684 }
11685
11688 {
11689 float weight = 0;
11690 float wetness = 1;
11691 if (include_wetness)
11694 {
11695 weight = wetness * m_ConfigWeight;
11696 }
11698 {
11699 weight = 1;
11700 }
11701 return weight;
11702 }
11703
11704
11705
11707 {
11708 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11709 {
11710 GameInventory inv = GetInventory();
11711 array<EntityAI> items = new array<EntityAI>;
11713 for (int i = 0; i < items.Count(); i++)
11714 {
11716 if (item)
11717 {
11719 }
11720 }
11721 }
11722 }
11723
11724
11725
11726
11728 {
11729 float energy = 0;
11730 if (HasEnergyManager())
11731 {
11732 energy = GetCompEM().GetEnergy();
11733 }
11734 return energy;
11735 }
11736
11737
11739 {
11740 super.OnEnergyConsumed();
11741
11743 }
11744
11746 {
11747 super.OnEnergyAdded();
11748
11750 }
11751
11752
11754 {
11755 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11756 {
11758 {
11759 float energy_0to1 = GetCompEM().GetEnergy0To1();
11761 }
11762 }
11763 }
11764
11765
11767 {
11768 return ConfigGetFloat("heatIsolation");
11769 }
11770
11772 {
11774 }
11775
11777 {
11778 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11779 if (
GetGame().ConfigIsExisting(paramPath))
11781
11782 return 0.0;
11783 }
11784
11786 {
11787 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11788 if (
GetGame().ConfigIsExisting(paramPath))
11790
11791 return 0.0;
11792 }
11793
11794 override void SetWet(
float value,
bool allow_client =
false)
11795 {
11796 if (!IsServerCheck(allow_client))
11797 return;
11798
11801
11803
11804 m_VarWet = Math.Clamp(value, min, max);
11805
11807 {
11810 }
11811 }
11812
11813 override void AddWet(
float value)
11814 {
11816 }
11817
11819 {
11821 }
11822
11824 {
11826 }
11827
11829 {
11831 }
11832
11834 {
11836 }
11837
11839 {
11841 }
11842
11843 override void OnWetChanged(
float newVal,
float oldVal)
11844 {
11847 if (newLevel != oldLevel)
11848 {
11850 }
11851 }
11852
11854 {
11855 SetWeightDirty();
11856 }
11857
11859 {
11860 return GetWetLevelInternal(
m_VarWet);
11861 }
11862
11863
11864
11866 {
11868 }
11869
11871 {
11873 }
11874
11876 {
11878 }
11879
11881 {
11883 }
11884
11885
11886
11888 {
11889 if (ConfigIsExisting("itemModelLength"))
11890 {
11891 return ConfigGetFloat("itemModelLength");
11892 }
11893 return 0;
11894 }
11895
11897 {
11898 if (ConfigIsExisting("itemAttachOffset"))
11899 {
11900 return ConfigGetFloat("itemAttachOffset");
11901 }
11902 return 0;
11903 }
11904
11905 override void SetCleanness(
int value,
bool allow_client =
false)
11906 {
11907 if (!IsServerCheck(allow_client))
11908 return;
11909
11911
11913
11916 }
11917
11919 {
11921 }
11922
11924 {
11925 return true;
11926 }
11927
11928
11929
11930
11932 {
11934 }
11935
11937 {
11939 }
11940
11941
11942
11943
11944 override void SetColor(
int r,
int g,
int b,
int a)
11945 {
11951 }
11953 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11954 {
11959 }
11960
11962 {
11964 }
11965
11968 {
11969 int r,g,b,a;
11971 r = r/255;
11972 g = g/255;
11973 b = b/255;
11974 a = a/255;
11975 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11976 }
11977
11978
11979
11980 override void SetLiquidType(
int value,
bool allow_client =
false)
11981 {
11982 if (!IsServerCheck(allow_client))
11983 return;
11984
11989 }
11990
11992 {
11993 return ConfigGetInt("varLiquidTypeInit");
11994 }
11995
11997 {
11999 }
12000
12002 {
12004 SetFrozen(false);
12005 }
12006
12009 {
12010 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12011 }
12012
12013
12016 {
12017 PlayerBase nplayer;
12018 if (PlayerBase.CastTo(nplayer, player))
12019 {
12021
12022 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12023 }
12024 }
12025
12026
12029 {
12030 PlayerBase nplayer;
12031 if (PlayerBase.CastTo(nplayer,player))
12032 {
12033
12034 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12035
12036 }
12037
12038
12039 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12040
12041
12042 if (HasEnergyManager())
12043 {
12044 GetCompEM().UpdatePlugState();
12045 }
12046 }
12047
12048
12050 {
12051 super.OnPlacementStarted(player);
12052
12054 }
12055
12056 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12057 {
12059 {
12060 m_AdminLog.OnPlacementComplete(player,
this);
12061 }
12062
12063 super.OnPlacementComplete(player, position, orientation);
12064 }
12065
12066
12067
12068
12069
12071 {
12073 {
12074 return true;
12075 }
12076 else
12077 {
12078 return false;
12079 }
12080 }
12081
12082
12084 {
12086 {
12088 }
12089 }
12090
12091
12093 {
12095 }
12096
12098 {
12100 }
12101
12102 override void InsertAgent(
int agent,
float count = 1)
12103 {
12104 if (count < 1)
12105 return;
12106
12108 }
12109
12112 {
12114 }
12115
12116
12118 {
12120 }
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12164 {
12166 return false;
12167 return true;
12168 }
12169
12171 {
12172
12174 }
12175
12176
12179 {
12180 super.CheckForRoofLimited(timeTresholdMS);
12181
12183 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12184 {
12185 m_PreviousRoofTestTime = time;
12186 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12187 }
12188 }
12189
12190
12192 {
12194 {
12195 return 0;
12196 }
12197
12198 if (GetInventory().GetAttachmentSlotsCount() != 0)
12199 {
12200 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12201 if (filter)
12202 return filter.GetProtectionLevel(type, false, system);
12203 else
12204 return 0;
12205 }
12206
12207 string subclassPath, entryName;
12208
12209 switch (type)
12210 {
12212 entryName = "biological";
12213 break;
12215 entryName = "chemical";
12216 break;
12217 default:
12218 entryName = "biological";
12219 break;
12220 }
12221
12222 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12223
12225 }
12226
12227
12228
12231 {
12232 if (!IsMagazine())
12234
12236 }
12237
12238
12239
12240
12241
12246 {
12247 return true;
12248 }
12249
12251 {
12253 }
12254
12255
12256
12257
12258
12260 {
12261 if (parent)
12262 {
12263 if (parent.IsInherited(DayZInfected))
12264 return true;
12265
12266 if (!parent.IsRuined())
12267 return true;
12268 }
12269
12270 return true;
12271 }
12272
12274 {
12275 if (!super.CanPutAsAttachment(parent))
12276 {
12277 return false;
12278 }
12279
12280 if (!IsRuined() && !parent.IsRuined())
12281 {
12282 return true;
12283 }
12284
12285 return false;
12286 }
12287
12289 {
12290
12291
12292
12293
12294 return super.CanReceiveItemIntoCargo(item);
12295 }
12296
12298 {
12299
12300
12301
12302
12303 GameInventory attachmentInv = attachment.GetInventory();
12305 {
12306 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12307 return false;
12308 }
12309
12310 InventoryLocation loc = new InventoryLocation();
12311 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12312 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12313 return false;
12314
12315 return super.CanReceiveAttachment(attachment, slotId);
12316 }
12317
12319 {
12320 if (!super.CanReleaseAttachment(attachment))
12321 return false;
12322
12323 return GetInventory().AreChildrenAccessible();
12324 }
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12347 {
12348 int id = muzzle_owner.GetMuzzleID();
12349 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12350
12351 if (WPOF_array)
12352 {
12353 for (int i = 0; i < WPOF_array.Count(); i++)
12354 {
12355 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12356
12357 if (WPOF)
12358 {
12359 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12360 }
12361 }
12362 }
12363 }
12364
12365
12367 {
12368 int id = muzzle_owner.GetMuzzleID();
12370
12371 if (WPOBE_array)
12372 {
12373 for (int i = 0; i < WPOBE_array.Count(); i++)
12374 {
12375 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12376
12377 if (WPOBE)
12378 {
12379 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12380 }
12381 }
12382 }
12383 }
12384
12385
12387 {
12388 int id = muzzle_owner.GetMuzzleID();
12389 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12390
12391 if (WPOOH_array)
12392 {
12393 for (int i = 0; i < WPOOH_array.Count(); i++)
12394 {
12395 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12396
12397 if (WPOOH)
12398 {
12399 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12400 }
12401 }
12402 }
12403 }
12404
12405
12407 {
12408 int id = muzzle_owner.GetMuzzleID();
12409 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12410
12411 if (WPOOH_array)
12412 {
12413 for (int i = 0; i < WPOOH_array.Count(); i++)
12414 {
12415 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12416
12417 if (WPOOH)
12418 {
12419 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12420 }
12421 }
12422 }
12423 }
12424
12425
12427 {
12428 int id = muzzle_owner.GetMuzzleID();
12429 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12430
12431 if (WPOOH_array)
12432 {
12433 for (int i = 0; i < WPOOH_array.Count(); i++)
12434 {
12435 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12436
12437 if (WPOOH)
12438 {
12439 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12440 }
12441 }
12442 }
12443 }
12444
12445
12446
12448 {
12450 {
12451 return true;
12452 }
12453
12454 return false;
12455 }
12456
12458 {
12460 {
12461 return true;
12462 }
12463
12464 return false;
12465 }
12466
12468 {
12470 {
12471 return true;
12472 }
12473
12474 return false;
12475 }
12476
12478 {
12479 return false;
12480 }
12481
12484 {
12485 return UATimeSpent.DEFAULT_DEPLOY;
12486 }
12487
12488
12489
12490
12492 {
12494 SetSynchDirty();
12495 }
12496
12498 {
12500 }
12501
12502
12504 {
12505 return false;
12506 }
12507
12510 {
12511 string att_type = "None";
12512
12513 if (ConfigIsExisting("soundAttType"))
12514 {
12515 att_type = ConfigGetString("soundAttType");
12516 }
12517
12519 }
12520
12522 {
12524 }
12525
12526
12527
12528
12529
12535
12537 {
12540
12542 }
12543
12544
12546 {
12548 return;
12549
12551
12554
12557
12558 SoundParameters params = new SoundParameters();
12562 }
12563
12564
12566 {
12568 return;
12569
12571 SetSynchDirty();
12572
12575 }
12576
12577
12579 {
12581 return;
12582
12584 SetSynchDirty();
12585
12588 }
12589
12591 {
12593 }
12594
12596 {
12598 }
12599
12602 {
12603 if (!
GetGame().IsDedicatedServer())
12604 {
12605 if (ConfigIsExisting("attachSoundSet"))
12606 {
12607 string cfg_path = "";
12608 string soundset = "";
12609 string type_name =
GetType();
12610
12613 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12614 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12615
12616 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12617 {
12618 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12619 {
12620 if (cfg_slot_array[i] == slot_type)
12621 {
12622 soundset = cfg_soundset_array[i];
12623 break;
12624 }
12625 }
12626 }
12627
12628 if (soundset != "")
12629 {
12630 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12632 }
12633 }
12634 }
12635 }
12636
12638 {
12639
12640 }
12641
12642 void OnApply(PlayerBase player);
12643
12645 {
12646 return 1.0;
12647 };
12648
12650 {
12652 }
12653
12655 {
12657 }
12658
12660
12662 {
12663 SetDynamicPhysicsLifeTime(0.01);
12665 }
12666
12668 {
12669 array<string> zone_names = new array<string>;
12670 GetDamageZones(zone_names);
12671 for (int i = 0; i < zone_names.Count(); i++)
12672 {
12673 SetHealthMax(zone_names.Get(i),"Health");
12674 }
12675 SetHealthMax("","Health");
12676 }
12677
12680 {
12681 float global_health = GetHealth01("","Health");
12682 array<string> zones = new array<string>;
12683 GetDamageZones(zones);
12684
12685 for (int i = 0; i < zones.Count(); i++)
12686 {
12687 SetHealth01(zones.Get(i),"Health",global_health);
12688 }
12689 }
12690
12693 {
12694 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12695 }
12696
12698 {
12699 if (!hasRootAsPlayer)
12700 {
12701 if (refParentIB)
12702 {
12703
12704 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12705 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12706
12707 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12708 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12709
12712 }
12713 else
12714 {
12715
12718 }
12719 }
12720 }
12721
12723 {
12725 {
12726 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12727 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12728 {
12729 float heatPermCoef = 1.0;
12731 while (ent)
12732 {
12733 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12734 ent = ent.GetHierarchyParent();
12735 }
12736
12737 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12738 }
12739 }
12740 }
12741
12743 {
12744
12745 EntityAI parent = GetHierarchyParent();
12746 if (!parent)
12747 {
12748 hasParent = false;
12749 hasRootAsPlayer = false;
12750 }
12751 else
12752 {
12753 hasParent = true;
12754 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12755 refParentIB =
ItemBase.Cast(parent);
12756 }
12757 }
12758
12759 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12760 {
12761
12762 }
12763
12765 {
12766
12767 return false;
12768 }
12769
12771 {
12772
12773
12774 return false;
12775 }
12776
12778 {
12779
12780 return false;
12781 }
12782
12785 {
12786 return !GetIsFrozen() &&
IsOpen();
12787 }
12788
12790 {
12791 bool hasParent = false, hasRootAsPlayer = false;
12793
12794 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12795 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12796
12797 if (wwtu || foodDecay)
12798 {
12802
12803 if (processWetness || processTemperature || processDecay)
12804 {
12806
12807 if (processWetness)
12808 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12809
12810 if (processTemperature)
12812
12813 if (processDecay)
12814 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12815 }
12816 }
12817 }
12818
12821 {
12823 }
12824
12826 {
12829
12830 return super.GetTemperatureFreezeThreshold();
12831 }
12832
12834 {
12837
12838 return super.GetTemperatureThawThreshold();
12839 }
12840
12842 {
12845
12846 return super.GetItemOverheatThreshold();
12847 }
12848
12850 {
12852 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12853
12854 return super.GetTemperatureFreezeTime();
12855 }
12856
12858 {
12860 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12861
12862 return super.GetTemperatureThawTime();
12863 }
12864
12869
12871 {
12872 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12873 }
12874
12876 {
12877 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12878 }
12879
12882 {
12884 }
12885
12887 {
12889 }
12890
12892 {
12894 }
12895
12898 {
12899 return null;
12900 }
12901
12904 {
12905 return false;
12906 }
12907
12909 {
12911 {
12914 if (!trg)
12915 {
12917 explosive = this;
12918 }
12919
12920 explosive.PairRemote(trg);
12922
12923 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12924 trg.SetPersistentPairID(persistentID);
12925 explosive.SetPersistentPairID(persistentID);
12926
12927 return true;
12928 }
12929 return false;
12930 }
12931
12934 {
12935 float ret = 1.0;
12938 ret *= GetHealth01();
12939
12940 return ret;
12941 }
12942
12943 #ifdef DEVELOPER
12944 override void SetDebugItem()
12945 {
12946 super.SetDebugItem();
12947 _itemBase = this;
12948 }
12949
12951 {
12952 string text = super.GetDebugText();
12953
12955 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12956
12957 return text;
12958 }
12959 #endif
12960
12962 {
12963 return true;
12964 }
12965
12967
12969
12971 {
12974 }
12975
12976
12984
13000}
13001
13003{
13005 if (entity)
13006 {
13007 bool is_item = entity.IsInherited(
ItemBase);
13008 if (is_item && full_quantity)
13009 {
13012 }
13013 }
13014 else
13015 {
13017 return NULL;
13018 }
13019 return entity;
13020}
13021
13023{
13024 if (item)
13025 {
13026 if (health > 0)
13027 item.SetHealth("", "", health);
13028
13029 if (item.CanHaveTemperature())
13030 {
13032 if (item.CanFreeze())
13033 item.SetFrozen(false);
13034 }
13035
13036 if (item.HasEnergyManager())
13037 {
13038 if (quantity >= 0)
13039 {
13040 item.GetCompEM().SetEnergy0To1(quantity);
13041 }
13042 else
13043 {
13045 }
13046 }
13047 else if (item.IsMagazine())
13048 {
13049 Magazine mag = Magazine.Cast(item);
13050 if (quantity >= 0)
13051 {
13052 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13053 }
13054 else
13055 {
13057 }
13058
13059 }
13060 else
13061 {
13062 if (quantity >= 0)
13063 {
13064 item.SetQuantityNormalized(quantity, false);
13065 }
13066 else
13067 {
13069 }
13070
13071 }
13072 }
13073}
13074
13075#ifdef DEVELOPER
13077#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.