8238{
8240 {
8241 return true;
8242 }
8243};
8244
8245
8246
8248{
8252
8254
8257
8258
8259
8260
8261
8270
8276
8281
8286
8307 protected bool m_IsResultOfSplit
8308
8310
8315
8316
8317
8319
8323
8324
8325
8327
8330
8331
8332
8338
8339
8347
8350
8351
8353
8354
8356
8357
8362
8363
8368
8369
8371
8372
8374 {
8379
8380 if (!
GetGame().IsDedicatedServer())
8381 {
8383 {
8385
8387 {
8389 }
8390 }
8391
8394 }
8395
8396 m_OldLocation = null;
8397
8399 {
8401 }
8402
8403 if (ConfigIsExisting("headSelectionsToHide"))
8404 {
8407 }
8408
8410 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8411 {
8413 }
8414
8416
8417 m_IsResultOfSplit = false;
8418
8420 }
8421
8423 {
8424 super.InitItemVariables();
8425
8431 m_Count = ConfigGetInt(
"count");
8432
8435
8440
8443
8448
8460
8464
8465
8468 if (ConfigIsExisting("canBeSplit"))
8469 {
8472 }
8473
8475 if (ConfigIsExisting("itemBehaviour"))
8477
8478
8481 RegisterNetSyncVariableInt("m_VarLiquidType");
8482 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8483
8484 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8485 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8486 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8487
8488 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8489 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8490 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8491 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8492
8493 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8494 RegisterNetSyncVariableBool("m_IsTakeable");
8495 RegisterNetSyncVariableBool("m_IsHologram");
8496
8499 {
8502 }
8503
8505
8507 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8509
8510 }
8511
8513 {
8515 }
8516
8518 {
8521 {
8526 }
8527 }
8528
8529 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8530 {
8532 {
8535 }
8536
8538 }
8539
8541 {
8547 }
8548
8550
8552 {
8554
8555 if (!action)
8556 {
8557 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8558 return;
8559 }
8560
8562 if (!ai)
8563 {
8565 return;
8566 }
8567
8569 if (!action_array)
8570 {
8571 action_array = new array<ActionBase_Basic>;
8573 }
8574 if (LogManager.IsActionLogEnable())
8575 {
8576 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8577 }
8578
8579 if (action_array.Find(action) != -1)
8580 {
8581 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8582 }
8583 else
8584 {
8585 action_array.Insert(action);
8586 }
8587 }
8588
8590 {
8592 ActionBase action = player.GetActionManager().GetAction(actionName);
8595
8596 if (action_array)
8597 {
8598 action_array.RemoveItem(action);
8599 }
8600 }
8601
8602
8603
8605 {
8606 ActionOverrideData overrideData = new ActionOverrideData();
8610
8612 if (!actionMap)
8613 {
8616 }
8617
8618 actionMap.Insert(this.
Type(), overrideData);
8619
8620 }
8621
8623
8625
8626
8628 {
8631
8634
8635 string config_to_search = "CfgVehicles";
8636 string muzzle_owner_config;
8637
8639 {
8640 if (IsInherited(Weapon))
8641 config_to_search = "CfgWeapons";
8642
8643 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8644
8645 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8646
8648
8649 if (config_OnFire_subclass_count > 0)
8650 {
8651 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8652
8653 for (int i = 0; i < config_OnFire_subclass_count; i++)
8654 {
8655 string particle_class = "";
8657 string config_OnFire_entry = config_OnFire_class + particle_class;
8658 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8659 WPOF_array.Insert(WPOF);
8660 }
8661
8662
8664 }
8665 }
8666
8668 {
8669 config_to_search = "CfgWeapons";
8670 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8671
8672 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8673
8675
8676 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8677 {
8678 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8679
8680 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8681 {
8682 string particle_class2 = "";
8684 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8685 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8686 WPOBE_array.Insert(WPOBE);
8687 }
8688
8689
8691 }
8692 }
8693 }
8694
8695
8697 {
8700
8702 {
8703 string config_to_search = "CfgVehicles";
8704
8705 if (IsInherited(Weapon))
8706 config_to_search = "CfgWeapons";
8707
8708 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8709 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8710
8711 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8712 {
8713
8715
8717 {
8719 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8721 return;
8722 }
8723
8726
8727
8728
8730 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8731
8732 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8733 {
8734 string particle_class = "";
8736 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8738
8739 if (entry_type == CT_CLASS)
8740 {
8741 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8742 WPOOH_array.Insert(WPOF);
8743 }
8744 }
8745
8746
8748 }
8749 }
8750 }
8751
8753 {
8755 }
8756
8758 {
8760 {
8762
8765
8768
8769 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8770 }
8771 }
8772
8774 {
8776 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8777
8779 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8780
8782 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8783
8785 {
8787 }
8788 }
8789
8791 {
8793 }
8794
8796 {
8799 else
8801
8803 {
8806 }
8807 else
8808 {
8811
8814 }
8815
8817 }
8818
8820 {
8822 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8823 }
8824
8826 {
8828 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8830 }
8831
8833 {
8835 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8836 }
8837
8839 {
8842
8843 OverheatingParticle OP = new OverheatingParticle();
8848
8850 }
8851
8853 {
8856
8857 return -1;
8858 }
8859
8861 {
8863 {
8866
8867 for (int i = count; i > 0; --i)
8868 {
8869 int id = i - 1;
8872
8875
8876 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8877 {
8878 if (p)
8879 {
8882 }
8883 }
8884 }
8885 }
8886 }
8887
8889 {
8891 {
8893 {
8894 int id = i - 1;
8896
8897 if (OP)
8898 {
8900
8901 if (p)
8902 {
8904 }
8905
8906 delete OP;
8907 }
8908 }
8909
8912 }
8913 }
8914
8917 {
8918 return 0.0;
8919 }
8920
8921
8923 {
8924 return 250;
8925 }
8926
8928 {
8929 return 0;
8930 }
8931
8934 {
8936 return true;
8937
8938 return false;
8939 }
8940
8943 {
8946
8948 {
8950 }
8951 else
8952 {
8953
8955 }
8956
8958 }
8959
8966 {
8967 return -1;
8968 }
8969
8970
8971
8972
8974 {
8976 {
8978 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8979
8980 if (r_index >= 0)
8981 {
8982 InventoryLocation r_il = new InventoryLocation;
8983 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8984
8985 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8988 {
8989 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8990 }
8992 {
8993 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8994 }
8995
8996 }
8997
8998 player.GetHumanInventory().ClearUserReservedLocation(this);
8999 }
9000
9003 }
9004
9005
9006
9007
9009 {
9010 return ItemBase.m_DebugActionsMask;
9011 }
9012
9014 {
9015 return ItemBase.m_DebugActionsMask & mask;
9016 }
9017
9019 {
9020 ItemBase.m_DebugActionsMask = mask;
9021 }
9022
9024 {
9025 ItemBase.m_DebugActionsMask |= mask;
9026 }
9027
9029 {
9030 ItemBase.m_DebugActionsMask &= ~mask;
9031 }
9032
9034 {
9036 {
9038 }
9039 else
9040 {
9042 }
9043 }
9044
9045
9047 {
9048 if (GetEconomyProfile())
9049 {
9050 float q_max = GetEconomyProfile().GetQuantityMax();
9051 if (q_max > 0)
9052 {
9053 float q_min = GetEconomyProfile().GetQuantityMin();
9054 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9055
9057 {
9058 ComponentEnergyManager comp = GetCompEM();
9060 {
9062 }
9063 }
9065 {
9067
9068 }
9069
9070 }
9071 }
9072 }
9073
9076 {
9077 EntityAI parent = GetHierarchyParent();
9078
9079 if (parent)
9080 {
9081 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9082 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9083 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9084 }
9085 }
9086
9089 {
9090 EntityAI parent = GetHierarchyParent();
9091
9092 if (parent)
9093 {
9094 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9095 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9096 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9097 }
9098 }
9099
9101 {
9102
9103
9104
9105
9107
9109 {
9110 if (ScriptInputUserData.CanStoreInputUserData())
9111 {
9112 ScriptInputUserData ctx = new ScriptInputUserData;
9118 ctx.
Write(use_stack_max);
9121
9123 {
9124 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9125 }
9126 }
9127 }
9128 else if (!
GetGame().IsMultiplayer())
9129 {
9131 }
9132 }
9133
9135 {
9137 }
9138
9140 {
9142 }
9143
9145 {
9147 }
9148
9150 {
9151
9152 return false;
9153 }
9154
9156 {
9157 return false;
9158 }
9159
9163 {
9164 return false;
9165 }
9166
9168 {
9169 return "";
9170 }
9171
9173
9175 {
9176 return false;
9177 }
9178
9180 {
9181 return true;
9182 }
9183
9184
9185
9187 {
9188 return true;
9189 }
9190
9192 {
9193 return true;
9194 }
9195
9197 {
9198 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9200 }
9201
9203 {
9205 }
9206
9208 {
9210 if (!is_being_placed)
9212 SetSynchDirty();
9213 }
9214
9215
9217
9219 {
9221 }
9222
9224 {
9226 }
9227
9229 {
9230 return 1;
9231 }
9232
9234 {
9235 return false;
9236 }
9237
9239 {
9241 SetSynchDirty();
9242 }
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9279 {
9280 super.OnMovedInsideCargo(container);
9281
9282 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9283 }
9284
9285 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9286 {
9287 super.EEItemLocationChanged(oldLoc,newLoc);
9288
9289 PlayerBase new_player = null;
9290 PlayerBase old_player = null;
9291
9292 if (newLoc.GetParent())
9293 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9294
9295 if (oldLoc.GetParent())
9296 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9297
9299 {
9300 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9301
9302 if (r_index >= 0)
9303 {
9304 InventoryLocation r_il = new InventoryLocation;
9305 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9306
9307 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9310 {
9311 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9312 }
9314 {
9315 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9316 }
9317
9318 }
9319 }
9320
9322 {
9323 if (new_player)
9324 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9325
9326 if (new_player == old_player)
9327 {
9328
9329 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9330 {
9332 {
9333 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9334 {
9335 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9336 }
9337 }
9338 else
9339 {
9340 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9341 }
9342 }
9343
9344 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9345 {
9346 int type = oldLoc.GetType();
9348 {
9349 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9350 }
9352 {
9353 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9354 }
9355 }
9356 if (!m_OldLocation)
9357 {
9358 m_OldLocation = new InventoryLocation;
9359 }
9360 m_OldLocation.Copy(oldLoc);
9361 }
9362 else
9363 {
9364 if (m_OldLocation)
9365 {
9366 m_OldLocation.Reset();
9367 }
9368 }
9369
9371 }
9372 else
9373 {
9374 if (new_player)
9375 {
9376 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9377 if (res_index >= 0)
9378 {
9379 InventoryLocation il = new InventoryLocation;
9380 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9382 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9385 {
9386 il.
GetParent().GetOnReleaseLock().Invoke(it);
9387 }
9389 {
9391 }
9392
9393 }
9394 }
9396 {
9397
9399 }
9400
9401 if (m_OldLocation)
9402 {
9403 m_OldLocation.Reset();
9404 }
9405 }
9406 }
9407
9408 override void EOnContact(IEntity other, Contact extra)
9409 {
9411 {
9412 int liquidType = -1;
9414 if (impactSpeed > 0.0)
9415 {
9417 #ifndef SERVER
9419 #else
9421 SetSynchDirty();
9422 #endif
9424 }
9425 }
9426
9427 #ifdef SERVER
9428 if (GetCompEM() && GetCompEM().IsPlugged())
9429 {
9430 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9431 GetCompEM().UnplugThis();
9432 }
9433 #endif
9434 }
9435
9437
9439 {
9441 }
9442
9444 {
9445
9446 }
9447
9449 {
9450 super.OnItemLocationChanged(old_owner, new_owner);
9451
9452 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9453 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9454
9455 if (!relatedPlayer && playerNew)
9456 relatedPlayer = playerNew;
9457
9458 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9459 {
9461 if (actionMgr)
9462 {
9463 ActionBase currentAction = actionMgr.GetRunningAction();
9464 if (currentAction)
9466 }
9467 }
9468
9469 Man ownerPlayerOld = null;
9470 Man ownerPlayerNew = null;
9471
9472 if (old_owner)
9473 {
9474 if (old_owner.
IsMan())
9475 {
9476 ownerPlayerOld = Man.Cast(old_owner);
9477 }
9478 else
9479 {
9480 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9481 }
9482 }
9483 else
9484 {
9486 {
9488
9489 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9490 {
9491 GetCompEM().UnplugThis();
9492 }
9493 }
9494 }
9495
9496 if (new_owner)
9497 {
9498 if (new_owner.
IsMan())
9499 {
9500 ownerPlayerNew = Man.Cast(new_owner);
9501 }
9502 else
9503 {
9504 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9505 }
9506 }
9507
9508 if (ownerPlayerOld != ownerPlayerNew)
9509 {
9510 if (ownerPlayerOld)
9511 {
9512 array<EntityAI> subItemsExit = new array<EntityAI>;
9514 for (int i = 0; i < subItemsExit.Count(); i++)
9515 {
9518 }
9519 }
9520
9521 if (ownerPlayerNew)
9522 {
9523 array<EntityAI> subItemsEnter = new array<EntityAI>;
9525 for (int j = 0; j < subItemsEnter.Count(); j++)
9526 {
9529 }
9530 }
9531 }
9532 else if (ownerPlayerNew != null)
9533 {
9534 PlayerBase nplayer;
9535 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9536 {
9537 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9539 for (int k = 0; k < subItemsUpdate.Count(); k++)
9540 {
9542 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9543 }
9544 }
9545 }
9546
9547 if (old_owner)
9548 old_owner.OnChildItemRemoved(this);
9549 if (new_owner)
9550 new_owner.OnChildItemReceived(this);
9551 }
9552
9553
9555 {
9556 super.EEDelete(parent);
9557 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9558 if (player)
9559 {
9561
9562 if (player.IsAlive())
9563 {
9564 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9565 if (r_index >= 0)
9566 {
9567 InventoryLocation r_il = new InventoryLocation;
9568 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9569
9570 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9573 {
9574 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9575 }
9577 {
9578 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9579 }
9580
9581 }
9582
9583 player.RemoveQuickBarEntityShortcut(this);
9584 }
9585 }
9586 }
9587
9589 {
9590 super.EEKilled(killer);
9591
9594 {
9595 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9596 {
9597 if (IsMagazine())
9598 {
9599 if (Magazine.Cast(this).GetAmmoCount() > 0)
9600 {
9602 }
9603 }
9604 else
9605 {
9607 }
9608 }
9609 }
9610 }
9611
9613 {
9614 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9615
9616 super.OnWasAttached(parent, slot_id);
9617
9620
9622 }
9623
9625 {
9626 super.OnWasDetached(parent, slot_id);
9627
9630 }
9631
9633 {
9634 int idx;
9637
9638 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9639 if (inventory_slots.Count() < 1)
9640 {
9641 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9642 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9643 }
9644 else
9645 {
9646 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9647 }
9648
9649 idx = inventory_slots.Find(slot);
9650 if (idx < 0)
9651 return "";
9652
9653 return attach_types.Get(idx);
9654 }
9655
9657 {
9658 int idx = -1;
9659 string slot;
9660
9663
9664 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9665 if (inventory_slots.Count() < 1)
9666 {
9667 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9668 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9669 }
9670 else
9671 {
9672 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9673 if (detach_types.Count() < 1)
9674 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9675 }
9676
9677 for (int i = 0; i < inventory_slots.Count(); i++)
9678 {
9679 slot = inventory_slots.Get(i);
9680 }
9681
9682 if (slot != "")
9683 {
9684 if (detach_types.Count() == 1)
9685 idx = 0;
9686 else
9687 idx = inventory_slots.Find(slot);
9688 }
9689 if (idx < 0)
9690 return "";
9691
9692 return detach_types.Get(idx);
9693 }
9694
9696 {
9697
9699
9700
9701 float min_time = 1;
9702 float max_time = 3;
9703 float delay = Math.RandomFloat(min_time, max_time);
9704
9705 explode_timer.Run(delay, this, "DoAmmoExplosion");
9706 }
9707
9709 {
9710 Magazine magazine = Magazine.Cast(this);
9711 int pop_sounds_count = 6;
9712 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9713
9714
9715 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9716 string sound_name = pop_sounds[ sound_idx ];
9718
9719
9720 magazine.ServerAddAmmoCount(-1);
9721
9722
9723 float min_temp_to_explode = 100;
9724
9725 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9726 {
9728 }
9729 }
9730
9731
9732 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9733 {
9734 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9735
9736 const int CHANCE_DAMAGE_CARGO = 4;
9737 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9738 const int CHANCE_DAMAGE_NOTHING = 2;
9739
9741 {
9742 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9743 int chances;
9744 int rnd;
9745
9746 if (GetInventory().GetCargo())
9747 {
9748 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9749 rnd = Math.RandomInt(0,chances);
9750
9751 if (rnd < CHANCE_DAMAGE_CARGO)
9752 {
9754 }
9755 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9756 {
9758 }
9759 }
9760 else
9761 {
9762 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9763 rnd = Math.RandomInt(0,chances);
9764
9765 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9766 {
9768 }
9769 }
9770 }
9771 }
9772
9774 {
9775 if (GetInventory().GetCargo())
9776 {
9777 int item_count = GetInventory().GetCargo().GetItemCount();
9778 if (item_count > 0)
9779 {
9780 int random_pick = Math.RandomInt(0, item_count);
9782 if (!item.IsExplosive())
9783 {
9784 item.AddHealth("","",damage);
9785 return true;
9786 }
9787 }
9788 }
9789 return false;
9790 }
9791
9793 {
9794 int attachment_count = GetInventory().AttachmentCount();
9795 if (attachment_count > 0)
9796 {
9797 int random_pick = Math.RandomInt(0, attachment_count);
9798 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9799 if (!attachment.IsExplosive())
9800 {
9801 attachment.AddHealth("","",damage);
9802 return true;
9803 }
9804 }
9805 return false;
9806 }
9807
9809 {
9811 }
9812
9814 {
9816 return GetInventory().CanRemoveEntity();
9817
9818 return false;
9819 }
9820
9822 {
9823
9825 return false;
9826
9827
9829 return false;
9830
9831
9832
9834 if (delta == 0)
9835 return false;
9836
9837
9838 return true;
9839 }
9840
9842 {
9844 {
9845 if (ScriptInputUserData.CanStoreInputUserData())
9846 {
9847 ScriptInputUserData ctx = new ScriptInputUserData;
9852 ctx.
Write(destination_entity);
9856 }
9857 }
9858 else if (!
GetGame().IsMultiplayer())
9859 {
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
9924 if (split_quantity_new == 0)
9925 {
9926 if (!
GetGame().IsMultiplayer())
9927 player.PhysicalPredictiveDropItem(this);
9928 else
9929 player.ServerDropEntity(this);
9930 return;
9931 }
9932
9934 {
9936
9937 if (new_item)
9938 {
9939 new_item.SetResultOfSplit(true);
9940 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9943 new_item.PlaceOnSurface();
9944 }
9945 }
9946 }
9947 }
9948 }
9949
9951 {
9952 float split_quantity_new;
9956 InventoryLocation loc = new InventoryLocation;
9957
9958 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9959 {
9961 split_quantity_new = stack_max;
9962 else
9964
9966 {
9967 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9968 if (new_item)
9969 {
9970 new_item.SetResultOfSplit(true);
9971 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9973 new_item.
SetQuantity(split_quantity_new,
false,
true);
9974 }
9975 }
9976 }
9977 else if (destination_entity && slot_id == -1)
9978 {
9979 if (quantity > stack_max)
9980 split_quantity_new = stack_max;
9981 else
9982 split_quantity_new = quantity;
9983
9985 {
9987 {
9990 }
9991
9992 if (new_item)
9993 {
9994 new_item.SetResultOfSplit(true);
9995 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9997 new_item.
SetQuantity(split_quantity_new,
false,
true);
9998 }
9999 }
10000 }
10001 else
10002 {
10003 if (stack_max != 0)
10004 {
10006 {
10008 }
10009
10011 {
10013
10014 if (new_item)
10015 {
10016 new_item.SetResultOfSplit(true);
10017 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10020 new_item.PlaceOnSurface();
10021 }
10022 }
10023 }
10024 }
10025 }
10026
10028 {
10030 {
10031 if (ScriptInputUserData.CanStoreInputUserData())
10032 {
10033 ScriptInputUserData ctx = new ScriptInputUserData;
10038 dst.WriteToContext(ctx);
10040 }
10041 }
10042 else if (!
GetGame().IsMultiplayer())
10043 {
10045 }
10046 }
10047
10049 {
10051 {
10052 if (ScriptInputUserData.CanStoreInputUserData())
10053 {
10054 ScriptInputUserData ctx = new ScriptInputUserData;
10059 ctx.
Write(destination_entity);
10065 }
10066 }
10067 else if (!
GetGame().IsMultiplayer())
10068 {
10070 }
10071 }
10072
10074 {
10076 }
10077
10079 {
10081 float split_quantity_new;
10083 if (dst.IsValid())
10084 {
10085 int slot_id = dst.GetSlot();
10087
10088 if (quantity > stack_max)
10089 split_quantity_new = stack_max;
10090 else
10091 split_quantity_new = quantity;
10092
10094 {
10096
10097 if (new_item)
10098 {
10099 new_item.SetResultOfSplit(true);
10100 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10102 new_item.
SetQuantity(split_quantity_new,
false,
true);
10103 }
10104
10105 return new_item;
10106 }
10107 }
10108
10109 return null;
10110 }
10111
10113 {
10115 float split_quantity_new;
10117 if (destination_entity)
10118 {
10120 if (quantity > stackable)
10121 split_quantity_new = stackable;
10122 else
10123 split_quantity_new = quantity;
10124
10126 {
10127 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10128 if (new_item)
10129 {
10130 new_item.SetResultOfSplit(true);
10131 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10133 new_item.
SetQuantity(split_quantity_new,
false,
true);
10134 }
10135 }
10136 }
10137 }
10138
10140 {
10142 {
10143 if (ScriptInputUserData.CanStoreInputUserData())
10144 {
10145 ScriptInputUserData ctx = new ScriptInputUserData;
10150 ItemBase destination_entity =
this;
10151 ctx.
Write(destination_entity);
10155 }
10156 }
10157 else if (!
GetGame().IsMultiplayer())
10158 {
10160 }
10161 }
10162
10164 {
10166 float split_quantity_new;
10168 if (player)
10169 {
10171 if (quantity > stackable)
10172 split_quantity_new = stackable;
10173 else
10174 split_quantity_new = quantity;
10175
10177 {
10178 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10179 new_item =
ItemBase.Cast(in_hands);
10180 if (new_item)
10181 {
10182 new_item.SetResultOfSplit(true);
10183 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10185 new_item.SetQuantity(split_quantity_new, false, true);
10186 }
10187 }
10188 }
10189 }
10190
10192 {
10194 float split_quantity_new = Math.Floor(quantity * 0.5);
10195
10197 return;
10198
10200
10201 if (new_item)
10202 {
10203 if (new_item.GetQuantityMax() < split_quantity_new)
10204 {
10205 split_quantity_new = new_item.GetQuantityMax();
10206 }
10207
10208 new_item.SetResultOfSplit(true);
10209 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10210
10212 {
10215 }
10216 else
10217 {
10219 new_item.
SetQuantity(split_quantity_new,
false,
true);
10220 }
10221 }
10222 }
10223
10225 {
10227 float split_quantity_new = Math.Floor(quantity / 2);
10228
10230 return;
10231
10232 InventoryLocation invloc = new InventoryLocation;
10234
10236 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10237
10238 if (new_item)
10239 {
10240 if (new_item.GetQuantityMax() < split_quantity_new)
10241 {
10242 split_quantity_new = new_item.GetQuantityMax();
10243 }
10245 {
10248 }
10249 else if (split_quantity_new > 1)
10250 {
10252 new_item.
SetQuantity(split_quantity_new,
false,
true);
10253 }
10254 }
10255 }
10256
10259 {
10260 SetWeightDirty();
10262
10263 if (parent)
10264 parent.OnAttachmentQuantityChangedEx(this, delta);
10265
10267 {
10269 {
10271 }
10273 {
10274 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10276 }
10277 }
10278
10279 }
10280
10283 {
10284
10285 }
10286
10289 {
10291 }
10292
10294 {
10295 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10296
10298 {
10299 if (newLevel == GameConstants.STATE_RUINED)
10300 {
10302 EntityAI parent = GetHierarchyParent();
10303 if (parent && parent.IsFireplace())
10304 {
10305 CargoBase cargo = GetInventory().GetCargo();
10306 if (cargo)
10307 {
10309 {
10311 }
10312 }
10313 }
10314 }
10315
10317 {
10318
10320 return;
10321 }
10322
10323 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10324 {
10326 }
10327 }
10328 }
10329
10330
10332 {
10333 super.OnRightClick();
10334
10336 {
10338 {
10339 if (ScriptInputUserData.CanStoreInputUserData())
10340 {
10341 EntityAI root = GetHierarchyRoot();
10342 Man playerOwner = GetHierarchyRootPlayer();
10343 InventoryLocation dst = new InventoryLocation;
10344
10345
10346 if (!playerOwner && root && root == this)
10347 {
10349 }
10350 else
10351 {
10352
10353 GetInventory().GetCurrentInventoryLocation(dst);
10355 {
10358 {
10360 }
10361 else
10362 {
10364
10365
10366 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10367 {
10369 }
10370 else
10371 {
10372 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10373 }
10374 }
10375 }
10376 }
10377
10378 ScriptInputUserData ctx = new ScriptInputUserData;
10386 }
10387 }
10388 else if (!
GetGame().IsMultiplayer())
10389 {
10391 }
10392 }
10393 }
10394
10396 {
10397 if (root)
10398 {
10399 vector m4[4];
10400 root.GetTransform(m4);
10401 dst.SetGround(this, m4);
10402 }
10403 else
10404 {
10405 GetInventory().GetCurrentInventoryLocation(dst);
10406 }
10407 }
10408
10409 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10410 {
10411
10412 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10413 return false;
10414
10415 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10416 return false;
10417
10418
10420 return false;
10421
10422
10423 Magazine mag = Magazine.Cast(this);
10424 if (mag)
10425 {
10426 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10427 return false;
10428
10429 if (stack_max_limit)
10430 {
10431 Magazine other_mag = Magazine.Cast(other_item);
10432 if (other_item)
10433 {
10434 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10435 return false;
10436 }
10437
10438 }
10439 }
10440 else
10441 {
10442
10444 return false;
10445
10447 return false;
10448 }
10449
10450 PlayerBase player = null;
10451 if (CastTo(player, GetHierarchyRootPlayer()))
10452 {
10453 if (player.GetInventory().HasAttachment(this))
10454 return false;
10455
10456 if (player.IsItemsToDelete())
10457 return false;
10458 }
10459
10460 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10461 return false;
10462
10463 int slotID;
10465 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10466 return false;
10467
10468 return true;
10469 }
10470
10472 {
10474 }
10475
10477 {
10478 return m_IsResultOfSplit;
10479 }
10480
10482 {
10483 m_IsResultOfSplit = value;
10484 }
10485
10487 {
10489 }
10490
10492 {
10493 float other_item_quantity = other_item.GetQuantity();
10494 float this_free_space;
10495
10497
10499
10500 if (other_item_quantity > this_free_space)
10501 {
10502 return this_free_space;
10503 }
10504 else
10505 {
10506 return other_item_quantity;
10507 }
10508 }
10509
10511 {
10513 }
10514
10516 {
10518 return;
10519
10520 if (!IsMagazine() && other_item)
10521 {
10523 if (quantity_used != 0)
10524 {
10525 float hp1 = GetHealth01("","");
10526 float hp2 = other_item.GetHealth01("","");
10527 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10528 hpResult = hpResult / (
GetQuantity() + quantity_used);
10529
10530 hpResult *= GetMaxHealth();
10531 Math.Round(hpResult);
10532 SetHealth("", "Health", hpResult);
10533
10535 other_item.AddQuantity(-quantity_used);
10536 }
10537 }
10539 }
10540
10542 {
10543 #ifdef SERVER
10544 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10545 GetHierarchyParent().IncreaseLifetimeUp();
10546 #endif
10547 };
10548
10550 {
10551 PlayerBase p = PlayerBase.Cast(player);
10552
10553 array<int> recipesIds = p.m_Recipes;
10554 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10555 if (moduleRecipesManager)
10556 {
10557 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10558 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10559 }
10560
10561 for (int i = 0;i < recipesIds.Count(); i++)
10562 {
10563 int key = recipesIds.Get(i);
10564 string recipeName = moduleRecipesManager.GetRecipeName(key);
10566 }
10567 }
10568
10569
10570 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10571 {
10572 super.GetDebugActions(outputList);
10573
10574
10580
10581
10586
10591
10592
10596
10597
10599 {
10603 }
10604
10607
10608
10612
10614
10615 InventoryLocation loc = new InventoryLocation();
10616 GetInventory().GetCurrentInventoryLocation(loc);
10618 {
10619 if (Gizmo_IsSupported())
10622 }
10623
10625 }
10626
10627
10628
10629
10631 {
10632 super.OnAction(action_id, player, ctx);
10633
10635 {
10636 switch (action_id)
10637 {
10640 return true;
10643 return true;
10644 }
10645 }
10646
10648 {
10649 switch (action_id)
10650 {
10652 Delete();
10653 return true;
10654 }
10655 }
10656
10657 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10658 {
10659 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10660 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10661 PlayerBase p = PlayerBase.Cast(player);
10662 if (
EActions.RECIPES_RANGE_START < 1000)
10663 {
10664 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10665 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10666 }
10667 }
10668 #ifndef SERVER
10669 else if (action_id ==
EActions.WATCH_PLAYER)
10670 {
10671 PluginDeveloper.SetDeveloperItemClientEx(player);
10672 }
10673 #endif
10675 {
10676 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10677 {
10678 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10679 OnDebugButtonPressServer(id + 1);
10680 }
10681
10682 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10683 {
10684 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10686 }
10687
10688 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10689 {
10690 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10692 }
10693
10694 else if (action_id ==
EActions.ADD_QUANTITY)
10695 {
10696 if (IsMagazine())
10697 {
10698 Magazine mag = Magazine.Cast(this);
10699 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10700 }
10701 else
10702 {
10704 }
10705
10706 if (m_EM)
10707 {
10708 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10709 }
10710
10711 }
10712
10713 else if (action_id ==
EActions.REMOVE_QUANTITY)
10714 {
10715 if (IsMagazine())
10716 {
10717 Magazine mag2 = Magazine.Cast(this);
10718 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10719 }
10720 else
10721 {
10723 }
10724 if (m_EM)
10725 {
10726 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10727 }
10728
10729 }
10730
10731 else if (action_id ==
EActions.SET_QUANTITY_0)
10732 {
10734
10735 if (m_EM)
10736 {
10737 m_EM.SetEnergy(0);
10738 }
10739 }
10740
10741 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10742 {
10744
10745 if (m_EM)
10746 {
10747 m_EM.SetEnergy(m_EM.GetEnergyMax());
10748 }
10749 }
10750
10751 else if (action_id ==
EActions.ADD_HEALTH)
10752 {
10753 AddHealth("","",GetMaxHealth("","Health")/5);
10754 }
10755 else if (action_id ==
EActions.REMOVE_HEALTH)
10756 {
10757 AddHealth("","",-GetMaxHealth("","Health")/5);
10758 }
10759 else if (action_id ==
EActions.DESTROY_HEALTH)
10760 {
10761 SetHealth01("","",0);
10762 }
10763 else if (action_id ==
EActions.WATCH_ITEM)
10764 {
10766 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10767 #ifdef DEVELOPER
10768 SetDebugDeveloper_item(this);
10769 #endif
10770 }
10771
10772 else if (action_id ==
EActions.ADD_TEMPERATURE)
10773 {
10774 AddTemperature(20);
10775
10776 }
10777
10778 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10779 {
10780 AddTemperature(-20);
10781
10782 }
10783
10784 else if (action_id ==
EActions.FLIP_FROZEN)
10785 {
10786 SetFrozen(!GetIsFrozen());
10787
10788 }
10789
10790 else if (action_id ==
EActions.ADD_WETNESS)
10791 {
10793
10794 }
10795
10796 else if (action_id ==
EActions.REMOVE_WETNESS)
10797 {
10799
10800 }
10801
10802 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10803 {
10806
10807
10808 }
10809
10810 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10811 {
10814 }
10815
10816 else if (action_id ==
EActions.MAKE_SPECIAL)
10817 {
10818 auto debugParams = DebugSpawnParams.WithPlayer(player);
10819 OnDebugSpawnEx(debugParams);
10820 }
10821
10822 }
10823
10824
10825 return false;
10826 }
10827
10828
10829
10830
10834
10837
10838
10839
10841 {
10842 return false;
10843 }
10844
10845
10847 {
10848 return true;
10849 }
10850
10851
10853 {
10854 return true;
10855 }
10856
10857
10858
10860 {
10861 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10863 }
10864
10867 {
10868 return null;
10869 }
10870
10872 {
10873 return false;
10874 }
10875
10877 {
10878 return false;
10879 }
10880
10884
10885
10887 {
10888 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10889 return module_repairing.CanRepair(this, item_repair_kit);
10890 }
10891
10892
10893 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10894 {
10895 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10896 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10897 }
10898
10899
10901 {
10902
10903
10904
10905
10906
10907
10908
10909
10910 return 1;
10911 }
10912
10913
10914
10916 {
10918 }
10919
10920
10921
10923 {
10925 }
10926
10927
10936 {
10937 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10938
10939 if (player)
10940 {
10941 player.MessageStatus(text);
10942 }
10943 }
10944
10945
10954 {
10955 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10956
10957 if (player)
10958 {
10959 player.MessageAction(text);
10960 }
10961 }
10962
10963
10972 {
10973 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10974
10975 if (player)
10976 {
10977 player.MessageFriendly(text);
10978 }
10979 }
10980
10981
10990 {
10991 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10992
10993 if (player)
10994 {
10995 player.MessageImportant(text);
10996 }
10997 }
10998
11000 {
11001 return true;
11002 }
11003
11004
11005 override bool KindOf(
string tag)
11006 {
11007 bool found = false;
11008 string item_name = this.
GetType();
11011
11012 int array_size = item_tag_array.Count();
11013 for (int i = 0; i < array_size; i++)
11014 {
11015 if (item_tag_array.Get(i) == tag)
11016 {
11017 found = true;
11018 break;
11019 }
11020 }
11021 return found;
11022 }
11023
11024
11026 {
11027
11028 super.OnRPC(sender, rpc_type,ctx);
11029
11030
11031 switch (rpc_type)
11032 {
11033 #ifndef SERVER
11034 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11035 Param2<bool, string> p = new Param2<bool, string>(false, "");
11036
11038 return;
11039
11040 bool play = p.param1;
11041 string soundSet = p.param2;
11042
11043 if (play)
11044 {
11046 {
11048 {
11050 }
11051 }
11052 else
11053 {
11055 }
11056 }
11057 else
11058 {
11060 }
11061
11062 break;
11063 #endif
11064
11065 }
11066
11068 {
11070 }
11071 }
11072
11073
11074
11075
11077 {
11078 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11079 return plugin.GetID(
name);
11080 }
11081
11083 {
11084 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11085 return plugin.GetName(id);
11086 }
11087
11090 {
11091
11092
11093 int varFlags;
11094 if (!ctx.
Read(varFlags))
11095 return;
11096
11097 if (varFlags & ItemVariableFlags.FLOAT)
11098 {
11100 }
11101 }
11102
11104 {
11105
11106 super.SerializeNumericalVars(floats_out);
11107
11108
11109
11111 {
11113 }
11114
11116 {
11118 }
11119
11121 {
11123 }
11124
11126 {
11131 }
11132
11134 {
11136 }
11137 }
11138
11140 {
11141
11142 super.DeSerializeNumericalVars(floats);
11143
11144
11145 int index = 0;
11146 int mask = Math.Round(floats.Get(index));
11147
11148 index++;
11149
11151 {
11153 {
11155 }
11156 else
11157 {
11158 float quantity = floats.Get(index);
11159 SetQuantity(quantity,
true,
false,
false,
false);
11160 }
11161 index++;
11162 }
11163
11165 {
11166 float wet = floats.Get(index);
11168 index++;
11169 }
11170
11172 {
11173 int liquidtype = Math.Round(floats.Get(index));
11175 index++;
11176 }
11177
11179 {
11181 index++;
11183 index++;
11185 index++;
11187 index++;
11188 }
11189
11191 {
11192 int cleanness = Math.Round(floats.Get(index));
11194 index++;
11195 }
11196 }
11197
11199 {
11200 super.WriteVarsToCTX(ctx);
11201
11202
11204 {
11206 }
11207
11209 {
11211 }
11212
11214 {
11216 }
11217
11219 {
11220 int r,g,b,a;
11226 }
11227
11229 {
11231 }
11232 }
11233
11235 {
11236 if (!super.ReadVarsFromCTX(ctx,version))
11237 return false;
11238
11239 int intValue;
11240 float value;
11241
11242 if (version < 140)
11243 {
11244 if (!ctx.
Read(intValue))
11245 return false;
11246
11247 m_VariablesMask = intValue;
11248 }
11249
11251 {
11252 if (!ctx.
Read(value))
11253 return false;
11254
11256 {
11258 }
11259 else
11260 {
11262 }
11263 }
11264
11265 if (version < 140)
11266 {
11268 {
11269 if (!ctx.
Read(value))
11270 return false;
11271 SetTemperatureDirect(value);
11272 }
11273 }
11274
11276 {
11277 if (!ctx.
Read(value))
11278 return false;
11280 }
11281
11283 {
11284 if (!ctx.
Read(intValue))
11285 return false;
11287 }
11288
11290 {
11291 int r,g,b,a;
11293 return false;
11295 return false;
11297 return false;
11299 return false;
11300
11302 }
11303
11305 {
11306 if (!ctx.
Read(intValue))
11307 return false;
11309 }
11310
11311 if (version >= 138 && version < 140)
11312 {
11314 {
11315 if (!ctx.
Read(intValue))
11316 return false;
11317 SetFrozen(intValue);
11318 }
11319 }
11320
11321 return true;
11322 }
11323
11324
11326 {
11329 {
11331 }
11332
11333 if (!super.OnStoreLoad(ctx, version))
11334 {
11336 return false;
11337 }
11338
11339 if (version >= 114)
11340 {
11341 bool hasQuickBarIndexSaved;
11342
11343 if (!ctx.
Read(hasQuickBarIndexSaved))
11344 {
11346 return false;
11347 }
11348
11349 if (hasQuickBarIndexSaved)
11350 {
11351 int itmQBIndex;
11352
11353
11354 if (!ctx.
Read(itmQBIndex))
11355 {
11357 return false;
11358 }
11359
11360 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11361 if (itmQBIndex != -1 && parentPlayer)
11362 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11363 }
11364 }
11365 else
11366 {
11367
11368 PlayerBase player;
11369 int itemQBIndex;
11370 if (version ==
int.
MAX)
11371 {
11372 if (!ctx.
Read(itemQBIndex))
11373 {
11375 return false;
11376 }
11377 }
11378 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11379 {
11380
11381 if (!ctx.
Read(itemQBIndex))
11382 {
11384 return false;
11385 }
11386 if (itemQBIndex != -1 && player)
11387 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11388 }
11389 }
11390
11391 if (version < 140)
11392 {
11393
11394 if (!LoadVariables(ctx, version))
11395 {
11397 return false;
11398 }
11399 }
11400
11401
11403 {
11405 return false;
11406 }
11407 if (version >= 132)
11408 {
11410 if (raib)
11411 {
11413 {
11415 return false;
11416 }
11417 }
11418 }
11419
11421 return true;
11422 }
11423
11424
11425
11427 {
11428 super.OnStoreSave(ctx);
11429
11430 PlayerBase player;
11431 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11432 {
11434
11435 int itemQBIndex = -1;
11436 itemQBIndex = player.FindQuickBarEntityIndex(this);
11437 ctx.
Write(itemQBIndex);
11438 }
11439 else
11440 {
11442 }
11443
11445
11447 if (raib)
11448 {
11450 }
11451 }
11452
11453
11455 {
11456 super.AfterStoreLoad();
11457
11459 {
11461 }
11462
11464 {
11467 }
11468 }
11469
11471 {
11472 super.EEOnAfterLoad();
11473
11475 {
11477 }
11478
11481 }
11482
11484 {
11485 return false;
11486 }
11487
11488
11489
11491 {
11493 {
11494 #ifdef PLATFORM_CONSOLE
11495
11497 {
11499 if (menu)
11500 {
11502 }
11503 }
11504 #endif
11505 }
11506
11508 {
11511 }
11512
11514 {
11515 SetWeightDirty();
11517 }
11519 {
11522 }
11523
11525 {
11528 }
11530 {
11533 }
11534
11535 super.OnVariablesSynchronized();
11536 }
11537
11538
11539
11541 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11542 {
11543 if (!IsServerCheck(allow_client))
11544 return false;
11545
11547 return false;
11548
11551
11552 if (value <= (min + 0.001))
11553 value = min;
11554
11555 if (value == min)
11556 {
11557 if (destroy_config)
11558 {
11559 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11560 if (dstr)
11561 {
11563 this.Delete();
11564 return true;
11565 }
11566 }
11567 else if (destroy_forced)
11568 {
11570 this.Delete();
11571 return true;
11572 }
11573
11575 }
11576
11579
11581 {
11583
11584 if (delta)
11586 }
11587
11589
11590 return false;
11591 }
11592
11593
11595 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11596 {
11598 }
11599
11601 {
11604 }
11605
11607 {
11610 }
11611
11613 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11614 {
11615 float value_clamped = Math.Clamp(value, 0, 1);
11617 SetQuantity(result, destroy_config, destroy_forced);
11618 }
11619
11620
11623 {
11625 }
11626
11628 {
11630 }
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11642 {
11643 int slot = -1;
11644 if (GetInventory())
11645 {
11646 InventoryLocation il = new InventoryLocation;
11647 GetInventory().GetCurrentInventoryLocation(il);
11649 }
11650
11652 }
11653
11655 {
11656 float quantity_max = 0;
11657
11659 {
11660 if (attSlotID != -1)
11661 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11662
11663 if (quantity_max <= 0)
11665 }
11666
11667 if (quantity_max <= 0)
11669
11670 return quantity_max;
11671 }
11672
11674 {
11676 }
11677
11679 {
11681 }
11682
11683
11685 {
11687 }
11688
11690 {
11692 }
11693
11695 {
11697 }
11698
11699
11701 {
11702
11703 float weightEx = GetWeightEx();
11704 float special = GetInventoryAndCargoWeight();
11705 return weightEx - special;
11706 }
11707
11708
11710 {
11712 }
11713
11715 {
11717 {
11718 #ifdef DEVELOPER
11719 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11720 {
11721 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11723 }
11724 #endif
11725
11726 return GetQuantity() * GetConfigWeightModified();
11727 }
11728 else if (HasEnergyManager())
11729 {
11730 #ifdef DEVELOPER
11731 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11732 {
11733 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11734 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11735 }
11736 #endif
11737 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11738 }
11739 else
11740 {
11741 #ifdef DEVELOPER
11742 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11743 {
11744 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11745 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11746 }
11747 #endif
11748 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11749 }
11750 }
11751
11754 {
11755 int item_count = 0;
11757
11758 if (GetInventory().GetCargo() != NULL)
11759 {
11760 item_count = GetInventory().GetCargo().GetItemCount();
11761 }
11762
11763 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11764 {
11765 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11766 if (item)
11767 item_count += item.GetNumberOfItems();
11768 }
11769 return item_count;
11770 }
11771
11774 {
11775 float weight = 0;
11776 float wetness = 1;
11777 if (include_wetness)
11780 {
11781 weight = wetness * m_ConfigWeight;
11782 }
11784 {
11785 weight = 1;
11786 }
11787 return weight;
11788 }
11789
11790
11791
11793 {
11794 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11795 {
11796 GameInventory inv = GetInventory();
11797 array<EntityAI> items = new array<EntityAI>;
11799 for (int i = 0; i < items.Count(); i++)
11800 {
11802 if (item)
11803 {
11805 }
11806 }
11807 }
11808 }
11809
11810
11811
11812
11814 {
11815 float energy = 0;
11816 if (HasEnergyManager())
11817 {
11818 energy = GetCompEM().GetEnergy();
11819 }
11820 return energy;
11821 }
11822
11823
11825 {
11826 super.OnEnergyConsumed();
11827
11829 }
11830
11832 {
11833 super.OnEnergyAdded();
11834
11836 }
11837
11838
11840 {
11841 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11842 {
11844 {
11845 float energy_0to1 = GetCompEM().GetEnergy0To1();
11847 }
11848 }
11849 }
11850
11851
11853 {
11854 return ConfigGetFloat("heatIsolation");
11855 }
11856
11858 {
11860 }
11861
11863 {
11864 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11865 if (
GetGame().ConfigIsExisting(paramPath))
11867
11868 return 0.0;
11869 }
11870
11872 {
11873 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11874 if (
GetGame().ConfigIsExisting(paramPath))
11876
11877 return 0.0;
11878 }
11879
11880 override void SetWet(
float value,
bool allow_client =
false)
11881 {
11882 if (!IsServerCheck(allow_client))
11883 return;
11884
11887
11889
11890 m_VarWet = Math.Clamp(value, min, max);
11891
11893 {
11896 }
11897 }
11898
11899 override void AddWet(
float value)
11900 {
11902 }
11903
11905 {
11907 }
11908
11910 {
11912 }
11913
11915 {
11917 }
11918
11920 {
11922 }
11923
11925 {
11927 }
11928
11929 override void OnWetChanged(
float newVal,
float oldVal)
11930 {
11933 if (newLevel != oldLevel)
11934 {
11936 }
11937 }
11938
11940 {
11941 SetWeightDirty();
11942 }
11943
11945 {
11946 return GetWetLevelInternal(
m_VarWet);
11947 }
11948
11949
11950
11952 {
11954 }
11955
11957 {
11959 }
11960
11962 {
11964 }
11965
11967 {
11969 }
11970
11971
11972
11974 {
11975 if (ConfigIsExisting("itemModelLength"))
11976 {
11977 return ConfigGetFloat("itemModelLength");
11978 }
11979 return 0;
11980 }
11981
11983 {
11984 if (ConfigIsExisting("itemAttachOffset"))
11985 {
11986 return ConfigGetFloat("itemAttachOffset");
11987 }
11988 return 0;
11989 }
11990
11991 override void SetCleanness(
int value,
bool allow_client =
false)
11992 {
11993 if (!IsServerCheck(allow_client))
11994 return;
11995
11997
11999
12002 }
12003
12005 {
12007 }
12008
12010 {
12011 return true;
12012 }
12013
12014
12015
12016
12018 {
12020 }
12021
12023 {
12025 }
12026
12027
12028
12029
12030 override void SetColor(
int r,
int g,
int b,
int a)
12031 {
12037 }
12039 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12040 {
12045 }
12046
12048 {
12050 }
12051
12054 {
12055 int r,g,b,a;
12057 r = r/255;
12058 g = g/255;
12059 b = b/255;
12060 a = a/255;
12061 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12062 }
12063
12064
12065
12066 override void SetLiquidType(
int value,
bool allow_client =
false)
12067 {
12068 if (!IsServerCheck(allow_client))
12069 return;
12070
12075 }
12076
12078 {
12079 return ConfigGetInt("varLiquidTypeInit");
12080 }
12081
12083 {
12085 }
12086
12088 {
12090 SetFrozen(false);
12091 }
12092
12095 {
12096 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12097 }
12098
12099
12102 {
12103 PlayerBase nplayer;
12104 if (PlayerBase.CastTo(nplayer, player))
12105 {
12107
12108 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12109 }
12110 }
12111
12112
12115 {
12116 PlayerBase nplayer;
12117 if (PlayerBase.CastTo(nplayer,player))
12118 {
12119
12120 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12121
12122 }
12123
12124
12125 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12126
12127
12128 if (HasEnergyManager())
12129 {
12130 GetCompEM().UpdatePlugState();
12131 }
12132 }
12133
12134
12136 {
12137 super.OnPlacementStarted(player);
12138
12140 }
12141
12142 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12143 {
12145 {
12146 m_AdminLog.OnPlacementComplete(player,
this);
12147 }
12148
12149 super.OnPlacementComplete(player, position, orientation);
12150 }
12151
12152
12153
12154
12155
12157 {
12159 {
12160 return true;
12161 }
12162 else
12163 {
12164 return false;
12165 }
12166 }
12167
12168
12170 {
12172 {
12174 }
12175 }
12176
12177
12179 {
12181 }
12182
12184 {
12186 }
12187
12188 override void InsertAgent(
int agent,
float count = 1)
12189 {
12190 if (count < 1)
12191 return;
12192
12194 }
12195
12198 {
12200 }
12201
12202
12204 {
12206 }
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12250 {
12252 return false;
12253 return true;
12254 }
12255
12257 {
12258
12260 }
12261
12262
12265 {
12266 super.CheckForRoofLimited(timeTresholdMS);
12267
12269 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12270 {
12271 m_PreviousRoofTestTime = time;
12272 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12273 }
12274 }
12275
12276
12278 {
12280 {
12281 return 0;
12282 }
12283
12284 if (GetInventory().GetAttachmentSlotsCount() != 0)
12285 {
12286 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12287 if (filter)
12288 return filter.GetProtectionLevel(type, false, system);
12289 else
12290 return 0;
12291 }
12292
12293 string subclassPath, entryName;
12294
12295 switch (type)
12296 {
12298 entryName = "biological";
12299 break;
12301 entryName = "chemical";
12302 break;
12303 default:
12304 entryName = "biological";
12305 break;
12306 }
12307
12308 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12309
12311 }
12312
12313
12314
12317 {
12318 if (!IsMagazine())
12320
12322 }
12323
12324
12325
12326
12327
12332 {
12333 return true;
12334 }
12335
12337 {
12339 }
12340
12341
12342
12343
12344
12346 {
12347 if (parent)
12348 {
12349 if (parent.IsInherited(DayZInfected))
12350 return true;
12351
12352 if (!parent.IsRuined())
12353 return true;
12354 }
12355
12356 return true;
12357 }
12358
12360 {
12361 if (!super.CanPutAsAttachment(parent))
12362 {
12363 return false;
12364 }
12365
12366 if (!IsRuined() && !parent.IsRuined())
12367 {
12368 return true;
12369 }
12370
12371 return false;
12372 }
12373
12375 {
12376
12377
12378
12379
12380 return super.CanReceiveItemIntoCargo(item);
12381 }
12382
12384 {
12385
12386
12387
12388
12389 GameInventory attachmentInv = attachment.GetInventory();
12391 {
12392 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12393 return false;
12394 }
12395
12396 InventoryLocation loc = new InventoryLocation();
12397 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12398 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12399 return false;
12400
12401 return super.CanReceiveAttachment(attachment, slotId);
12402 }
12403
12405 {
12406 if (!super.CanReleaseAttachment(attachment))
12407 return false;
12408
12409 return GetInventory().AreChildrenAccessible();
12410 }
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12433 {
12434 int id = muzzle_owner.GetMuzzleID();
12435 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12436
12437 if (WPOF_array)
12438 {
12439 for (int i = 0; i < WPOF_array.Count(); i++)
12440 {
12441 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12442
12443 if (WPOF)
12444 {
12445 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12446 }
12447 }
12448 }
12449 }
12450
12451
12453 {
12454 int id = muzzle_owner.GetMuzzleID();
12456
12457 if (WPOBE_array)
12458 {
12459 for (int i = 0; i < WPOBE_array.Count(); i++)
12460 {
12461 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12462
12463 if (WPOBE)
12464 {
12465 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12466 }
12467 }
12468 }
12469 }
12470
12471
12473 {
12474 int id = muzzle_owner.GetMuzzleID();
12475 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12476
12477 if (WPOOH_array)
12478 {
12479 for (int i = 0; i < WPOOH_array.Count(); i++)
12480 {
12481 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12482
12483 if (WPOOH)
12484 {
12485 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12486 }
12487 }
12488 }
12489 }
12490
12491
12493 {
12494 int id = muzzle_owner.GetMuzzleID();
12495 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12496
12497 if (WPOOH_array)
12498 {
12499 for (int i = 0; i < WPOOH_array.Count(); i++)
12500 {
12501 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12502
12503 if (WPOOH)
12504 {
12505 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12506 }
12507 }
12508 }
12509 }
12510
12511
12513 {
12514 int id = muzzle_owner.GetMuzzleID();
12515 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12516
12517 if (WPOOH_array)
12518 {
12519 for (int i = 0; i < WPOOH_array.Count(); i++)
12520 {
12521 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12522
12523 if (WPOOH)
12524 {
12525 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12526 }
12527 }
12528 }
12529 }
12530
12531
12532
12534 {
12536 {
12537 return true;
12538 }
12539
12540 return false;
12541 }
12542
12544 {
12546 {
12547 return true;
12548 }
12549
12550 return false;
12551 }
12552
12554 {
12556 {
12557 return true;
12558 }
12559
12560 return false;
12561 }
12562
12564 {
12565 return false;
12566 }
12567
12570 {
12571 return UATimeSpent.DEFAULT_DEPLOY;
12572 }
12573
12574
12575
12576
12578 {
12580 SetSynchDirty();
12581 }
12582
12584 {
12586 }
12587
12588
12590 {
12591 return false;
12592 }
12593
12596 {
12597 string att_type = "None";
12598
12599 if (ConfigIsExisting("soundAttType"))
12600 {
12601 att_type = ConfigGetString("soundAttType");
12602 }
12603
12605 }
12606
12608 {
12610 }
12611
12612
12613
12614
12615
12621
12623 {
12626
12628 }
12629
12630
12632 {
12634 return;
12635
12637
12640
12643
12644 SoundParameters params = new SoundParameters();
12648 }
12649
12650
12652 {
12654 return;
12655
12657 SetSynchDirty();
12658
12661 }
12662
12663
12665 {
12667 return;
12668
12670 SetSynchDirty();
12671
12674 }
12675
12677 {
12679 }
12680
12682 {
12684 }
12685
12688 {
12689 if (!
GetGame().IsDedicatedServer())
12690 {
12691 if (ConfigIsExisting("attachSoundSet"))
12692 {
12693 string cfg_path = "";
12694 string soundset = "";
12695 string type_name =
GetType();
12696
12699 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12700 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12701
12702 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12703 {
12704 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12705 {
12706 if (cfg_slot_array[i] == slot_type)
12707 {
12708 soundset = cfg_soundset_array[i];
12709 break;
12710 }
12711 }
12712 }
12713
12714 if (soundset != "")
12715 {
12716 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12718 }
12719 }
12720 }
12721 }
12722
12724 {
12725
12726 }
12727
12728 void OnApply(PlayerBase player);
12729
12731 {
12732 return 1.0;
12733 };
12734
12736 {
12738 }
12739
12741 {
12743 }
12744
12746
12748 {
12749 SetDynamicPhysicsLifeTime(0.01);
12751 }
12752
12754 {
12755 array<string> zone_names = new array<string>;
12756 GetDamageZones(zone_names);
12757 for (int i = 0; i < zone_names.Count(); i++)
12758 {
12759 SetHealthMax(zone_names.Get(i),"Health");
12760 }
12761 SetHealthMax("","Health");
12762 }
12763
12766 {
12767 float global_health = GetHealth01("","Health");
12768 array<string> zones = new array<string>;
12769 GetDamageZones(zones);
12770
12771 for (int i = 0; i < zones.Count(); i++)
12772 {
12773 SetHealth01(zones.Get(i),"Health",global_health);
12774 }
12775 }
12776
12779 {
12780 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12781 }
12782
12784 {
12785 if (!hasRootAsPlayer)
12786 {
12787 if (refParentIB)
12788 {
12789
12790 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12791 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12792
12793 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12794 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12795
12798 }
12799 else
12800 {
12801
12804 }
12805 }
12806 }
12807
12809 {
12811 {
12812 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12813 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12814 {
12815 float heatPermCoef = 1.0;
12817 while (ent)
12818 {
12819 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12820 ent = ent.GetHierarchyParent();
12821 }
12822
12823 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12824 }
12825 }
12826 }
12827
12829 {
12830
12831 EntityAI parent = GetHierarchyParent();
12832 if (!parent)
12833 {
12834 hasParent = false;
12835 hasRootAsPlayer = false;
12836 }
12837 else
12838 {
12839 hasParent = true;
12840 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12841 refParentIB =
ItemBase.Cast(parent);
12842 }
12843 }
12844
12845 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12846 {
12847
12848 }
12849
12851 {
12852
12853 return false;
12854 }
12855
12857 {
12858
12859
12860 return false;
12861 }
12862
12864 {
12865
12866 return false;
12867 }
12868
12871 {
12872 return !GetIsFrozen() &&
IsOpen();
12873 }
12874
12876 {
12877 bool hasParent = false, hasRootAsPlayer = false;
12879
12880 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12881 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12882
12883 if (wwtu || foodDecay)
12884 {
12888
12889 if (processWetness || processTemperature || processDecay)
12890 {
12892
12893 if (processWetness)
12894 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12895
12896 if (processTemperature)
12898
12899 if (processDecay)
12900 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12901 }
12902 }
12903 }
12904
12907 {
12909 }
12910
12912 {
12915
12916 return super.GetTemperatureFreezeThreshold();
12917 }
12918
12920 {
12923
12924 return super.GetTemperatureThawThreshold();
12925 }
12926
12928 {
12931
12932 return super.GetItemOverheatThreshold();
12933 }
12934
12936 {
12938 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12939
12940 return super.GetTemperatureFreezeTime();
12941 }
12942
12944 {
12946 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12947
12948 return super.GetTemperatureThawTime();
12949 }
12950
12955
12957 {
12958 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12959 }
12960
12962 {
12963 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12964 }
12965
12968 {
12970 }
12971
12973 {
12975 }
12976
12978 {
12980 }
12981
12984 {
12985 return null;
12986 }
12987
12990 {
12991 return false;
12992 }
12993
12995 {
12997 {
13000 if (!trg)
13001 {
13003 explosive = this;
13004 }
13005
13006 explosive.PairRemote(trg);
13008
13009 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13010 trg.SetPersistentPairID(persistentID);
13011 explosive.SetPersistentPairID(persistentID);
13012
13013 return true;
13014 }
13015 return false;
13016 }
13017
13020 {
13021 float ret = 1.0;
13024 ret *= GetHealth01();
13025
13026 return ret;
13027 }
13028
13029 #ifdef DEVELOPER
13030 override void SetDebugItem()
13031 {
13032 super.SetDebugItem();
13033 _itemBase = this;
13034 }
13035
13037 {
13038 string text = super.GetDebugText();
13039
13041 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13042
13043 return text;
13044 }
13045 #endif
13046
13048 {
13049 return true;
13050 }
13051
13053
13055
13057 {
13060 }
13061
13062
13070
13086}
13087
13089{
13091 if (entity)
13092 {
13093 bool is_item = entity.IsInherited(
ItemBase);
13094 if (is_item && full_quantity)
13095 {
13098 }
13099 }
13100 else
13101 {
13103 return NULL;
13104 }
13105 return entity;
13106}
13107
13109{
13110 if (item)
13111 {
13112 if (health > 0)
13113 item.SetHealth("", "", health);
13114
13115 if (item.CanHaveTemperature())
13116 {
13118 if (item.CanFreeze())
13119 item.SetFrozen(false);
13120 }
13121
13122 if (item.HasEnergyManager())
13123 {
13124 if (quantity >= 0)
13125 {
13126 item.GetCompEM().SetEnergy0To1(quantity);
13127 }
13128 else
13129 {
13131 }
13132 }
13133 else if (item.IsMagazine())
13134 {
13135 Magazine mag = Magazine.Cast(item);
13136 if (quantity >= 0)
13137 {
13138 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13139 }
13140 else
13141 {
13143 }
13144
13145 }
13146 else
13147 {
13148 if (quantity >= 0)
13149 {
13150 item.SetQuantityNormalized(quantity, false);
13151 }
13152 else
13153 {
13155 }
13156
13157 }
13158 }
13159}
13160
13161#ifdef DEVELOPER
13163#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.