Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config(for Min 0 and Max 5000, value 2500 will result in 0.5)
8091{
8093 {
8094 return true;
8095 }
8096};
8097
8098
8099
8101{
8105
8107
8110
8111
8112
8113
8114
8123
8129
8134
8139
8160 protected bool m_IsResultOfSplit
8161
8163
8168
8169
8170
8172
8176
8177
8178
8180
8183
8184
8185
8191
8192
8200
8203
8204
8206
8207
8209
8210
8215
8216
8221
8222
8224
8225
8227 {
8232
8233 if (!
GetGame().IsDedicatedServer())
8234 {
8236 {
8238
8240 {
8242 }
8243 }
8244
8247 }
8248
8249 m_OldLocation = null;
8250
8252 {
8254 }
8255
8256 if (ConfigIsExisting("headSelectionsToHide"))
8257 {
8260 }
8261
8263 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8264 {
8266 }
8267
8269
8270 m_IsResultOfSplit = false;
8271
8273 }
8274
8276 {
8277 super.InitItemVariables();
8278
8284 m_Count = ConfigGetInt(
"count");
8285
8288
8293
8296
8301
8313
8317
8318
8321 if (ConfigIsExisting("canBeSplit"))
8322 {
8325 }
8326
8328 if (ConfigIsExisting("itemBehaviour"))
8330
8331
8334 RegisterNetSyncVariableInt("m_VarLiquidType");
8335 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8336
8337 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8338 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8339 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8340
8341 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8342 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8343 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8344 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8345
8346 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8347 RegisterNetSyncVariableBool("m_IsTakeable");
8348 RegisterNetSyncVariableBool("m_IsHologram");
8349
8352 {
8355 }
8356
8358
8360 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8362
8363 }
8364
8366 {
8368 }
8369
8371 {
8374 {
8379 }
8380 }
8381
8382 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8383 {
8385 {
8388 }
8389
8391 }
8392
8394 {
8400 }
8401
8403
8405 {
8407
8408 if (!action)
8409 {
8410 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8411 return;
8412 }
8413
8415 if (!ai)
8416 {
8418 return;
8419 }
8420
8422 if (!action_array)
8423 {
8424 action_array = new array<ActionBase_Basic>;
8426 }
8427 if (LogManager.IsActionLogEnable())
8428 {
8429 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8430 }
8431
8432 if (action_array.Find(action) != -1)
8433 {
8434 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8435 }
8436 else
8437 {
8438 action_array.Insert(action);
8439 }
8440 }
8441
8443 {
8445 ActionBase action = player.GetActionManager().GetAction(actionName);
8448
8449 if (action_array)
8450 {
8451 action_array.RemoveItem(action);
8452 }
8453 }
8454
8455
8456
8458 {
8459 ActionOverrideData overrideData = new ActionOverrideData();
8463
8465 if (!actionMap)
8466 {
8469 }
8470
8471 actionMap.Insert(this.
Type(), overrideData);
8472
8473 }
8474
8476
8478
8479
8481 {
8484
8487
8488 string config_to_search = "CfgVehicles";
8489 string muzzle_owner_config;
8490
8492 {
8493 if (IsInherited(Weapon))
8494 config_to_search = "CfgWeapons";
8495
8496 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8497
8498 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8499
8501
8502 if (config_OnFire_subclass_count > 0)
8503 {
8504 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8505
8506 for (int i = 0; i < config_OnFire_subclass_count; i++)
8507 {
8508 string particle_class = "";
8510 string config_OnFire_entry = config_OnFire_class + particle_class;
8511 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8512 WPOF_array.Insert(WPOF);
8513 }
8514
8515
8517 }
8518 }
8519
8521 {
8522 config_to_search = "CfgWeapons";
8523 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8524
8525 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8526
8528
8529 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8530 {
8531 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8532
8533 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8534 {
8535 string particle_class2 = "";
8537 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8538 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8539 WPOBE_array.Insert(WPOBE);
8540 }
8541
8542
8544 }
8545 }
8546 }
8547
8548
8550 {
8553
8555 {
8556 string config_to_search = "CfgVehicles";
8557
8558 if (IsInherited(Weapon))
8559 config_to_search = "CfgWeapons";
8560
8561 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8562 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8563
8564 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8565 {
8566
8568
8570 {
8572 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8574 return;
8575 }
8576
8579
8580
8581
8583 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8584
8585 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8586 {
8587 string particle_class = "";
8589 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8591
8592 if (entry_type == CT_CLASS)
8593 {
8594 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8595 WPOOH_array.Insert(WPOF);
8596 }
8597 }
8598
8599
8601 }
8602 }
8603 }
8604
8606 {
8608 }
8609
8611 {
8613 {
8615
8618
8621
8622 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8623 }
8624 }
8625
8627 {
8629 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8630
8632 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8633
8635 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8636
8638 {
8640 }
8641 }
8642
8644 {
8646 }
8647
8649 {
8652 else
8654
8656 {
8659 }
8660 else
8661 {
8664
8667 }
8668
8670 }
8671
8673 {
8675 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8676 }
8677
8679 {
8681 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8683 }
8684
8686 {
8688 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8689 }
8690
8692 {
8695
8696 OverheatingParticle OP = new OverheatingParticle();
8701
8703 }
8704
8706 {
8709
8710 return -1;
8711 }
8712
8714 {
8716 {
8719
8720 for (int i = count; i > 0; --i)
8721 {
8722 int id = i - 1;
8725
8728
8729 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8730 {
8731 if (p)
8732 {
8735 }
8736 }
8737 }
8738 }
8739 }
8740
8742 {
8744 {
8746 {
8747 int id = i - 1;
8749
8750 if (OP)
8751 {
8753
8754 if (p)
8755 {
8757 }
8758
8759 delete OP;
8760 }
8761 }
8762
8765 }
8766 }
8767
8770 {
8771 return 0.0;
8772 }
8773
8774
8776 {
8777 return 250;
8778 }
8779
8781 {
8782 return 0;
8783 }
8784
8787 {
8789 return true;
8790
8791 return false;
8792 }
8793
8796 {
8799
8801 {
8803 }
8804 else
8805 {
8806
8808 }
8809
8811 }
8812
8819 {
8820 return -1;
8821 }
8822
8823
8824
8825
8827 {
8829 {
8831 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8832
8833 if (r_index >= 0)
8834 {
8835 InventoryLocation r_il = new InventoryLocation;
8836 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8837
8838 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8841 {
8842 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8843 }
8845 {
8846 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8847 }
8848
8849 }
8850
8851 player.GetHumanInventory().ClearUserReservedLocation(this);
8852 }
8853
8856 }
8857
8858
8859
8860
8862 {
8863 return ItemBase.m_DebugActionsMask;
8864 }
8865
8867 {
8868 return ItemBase.m_DebugActionsMask & mask;
8869 }
8870
8872 {
8873 ItemBase.m_DebugActionsMask = mask;
8874 }
8875
8877 {
8878 ItemBase.m_DebugActionsMask |= mask;
8879 }
8880
8882 {
8883 ItemBase.m_DebugActionsMask &= ~mask;
8884 }
8885
8887 {
8889 {
8891 }
8892 else
8893 {
8895 }
8896 }
8897
8898
8900 {
8901 if (GetEconomyProfile())
8902 {
8903 float q_max = GetEconomyProfile().GetQuantityMax();
8904 if (q_max > 0)
8905 {
8906 float q_min = GetEconomyProfile().GetQuantityMin();
8907 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8908
8910 {
8911 ComponentEnergyManager comp = GetCompEM();
8913 {
8915 }
8916 }
8918 {
8920
8921 }
8922
8923 }
8924 }
8925 }
8926
8929 {
8930 EntityAI parent = GetHierarchyParent();
8931
8932 if (parent)
8933 {
8934 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8935 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8936 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8937 }
8938 }
8939
8942 {
8943 EntityAI parent = GetHierarchyParent();
8944
8945 if (parent)
8946 {
8947 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8948 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8949 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8950 }
8951 }
8952
8954 {
8955
8956
8957
8958
8960
8962 {
8963 if (ScriptInputUserData.CanStoreInputUserData())
8964 {
8965 ScriptInputUserData ctx = new ScriptInputUserData;
8971 ctx.
Write(use_stack_max);
8974
8976 {
8977 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8978 }
8979 }
8980 }
8981 else if (!
GetGame().IsMultiplayer())
8982 {
8984 }
8985 }
8986
8988 {
8990 }
8991
8993 {
8995 }
8996
8998 {
9000 }
9001
9003 {
9004
9005 return false;
9006 }
9007
9009 {
9010 return false;
9011 }
9012
9016 {
9017 return false;
9018 }
9019
9021 {
9022 return "";
9023 }
9024
9026
9028 {
9029 return false;
9030 }
9031
9033 {
9034 return true;
9035 }
9036
9037
9038
9040 {
9041 return true;
9042 }
9043
9045 {
9046 return true;
9047 }
9048
9050 {
9051 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9053 }
9054
9056 {
9058 }
9059
9061 {
9063 if (!is_being_placed)
9065 SetSynchDirty();
9066 }
9067
9068
9070
9072 {
9074 }
9075
9077 {
9079 }
9080
9082 {
9083 return 1;
9084 }
9085
9087 {
9088 return false;
9089 }
9090
9092 {
9094 SetSynchDirty();
9095 }
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9132 {
9133 super.OnMovedInsideCargo(container);
9134
9135 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9136 }
9137
9138 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9139 {
9140 super.EEItemLocationChanged(oldLoc,newLoc);
9141
9142 PlayerBase new_player = null;
9143 PlayerBase old_player = null;
9144
9145 if (newLoc.GetParent())
9146 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9147
9148 if (oldLoc.GetParent())
9149 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9150
9152 {
9153 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9154
9155 if (r_index >= 0)
9156 {
9157 InventoryLocation r_il = new InventoryLocation;
9158 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9159
9160 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9163 {
9164 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9165 }
9167 {
9168 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9169 }
9170
9171 }
9172 }
9173
9175 {
9176 if (new_player)
9177 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9178
9179 if (new_player == old_player)
9180 {
9181
9182 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9183 {
9185 {
9186 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9187 {
9188 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9189 }
9190 }
9191 else
9192 {
9193 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9194 }
9195 }
9196
9197 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9198 {
9199 int type = oldLoc.GetType();
9201 {
9202 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9203 }
9205 {
9206 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9207 }
9208 }
9209 if (!m_OldLocation)
9210 {
9211 m_OldLocation = new InventoryLocation;
9212 }
9213 m_OldLocation.Copy(oldLoc);
9214 }
9215 else
9216 {
9217 if (m_OldLocation)
9218 {
9219 m_OldLocation.Reset();
9220 }
9221 }
9222
9224 }
9225 else
9226 {
9227 if (new_player)
9228 {
9229 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9230 if (res_index >= 0)
9231 {
9232 InventoryLocation il = new InventoryLocation;
9233 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9235 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9238 {
9239 il.
GetParent().GetOnReleaseLock().Invoke(it);
9240 }
9242 {
9244 }
9245
9246 }
9247 }
9249 {
9250
9252 }
9253
9254 if (m_OldLocation)
9255 {
9256 m_OldLocation.Reset();
9257 }
9258 }
9259 }
9260
9261 override void EOnContact(IEntity other, Contact extra)
9262 {
9264 {
9265 int liquidType = -1;
9267 if (impactSpeed > 0.0)
9268 {
9270 #ifndef SERVER
9272 #else
9274 SetSynchDirty();
9275 #endif
9277 }
9278 }
9279
9280 #ifdef SERVER
9281 if (GetCompEM() && GetCompEM().IsPlugged())
9282 {
9283 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9284 GetCompEM().UnplugThis();
9285 }
9286 #endif
9287 }
9288
9290
9292 {
9294 }
9295
9297 {
9298
9299 }
9300
9302 {
9303 super.OnItemLocationChanged(old_owner, new_owner);
9304
9305 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9306 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9307
9308 if (!relatedPlayer && playerNew)
9309 relatedPlayer = playerNew;
9310
9311 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9312 {
9314 if (actionMgr)
9315 {
9316 ActionBase currentAction = actionMgr.GetRunningAction();
9317 if (currentAction)
9319 }
9320 }
9321
9322 Man ownerPlayerOld = null;
9323 Man ownerPlayerNew = null;
9324
9325 if (old_owner)
9326 {
9327 if (old_owner.
IsMan())
9328 {
9329 ownerPlayerOld = Man.Cast(old_owner);
9330 }
9331 else
9332 {
9333 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9334 }
9335 }
9336 else
9337 {
9339 {
9341
9342 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9343 {
9344 GetCompEM().UnplugThis();
9345 }
9346 }
9347 }
9348
9349 if (new_owner)
9350 {
9351 if (new_owner.
IsMan())
9352 {
9353 ownerPlayerNew = Man.Cast(new_owner);
9354 }
9355 else
9356 {
9357 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9358 }
9359 }
9360
9361 if (ownerPlayerOld != ownerPlayerNew)
9362 {
9363 if (ownerPlayerOld)
9364 {
9365 array<EntityAI> subItemsExit = new array<EntityAI>;
9367 for (int i = 0; i < subItemsExit.Count(); i++)
9368 {
9371 }
9372 }
9373
9374 if (ownerPlayerNew)
9375 {
9376 array<EntityAI> subItemsEnter = new array<EntityAI>;
9378 for (int j = 0; j < subItemsEnter.Count(); j++)
9379 {
9382 }
9383 }
9384 }
9385 else if (ownerPlayerNew != null)
9386 {
9387 PlayerBase nplayer;
9388 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9389 {
9390 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9392 for (int k = 0; k < subItemsUpdate.Count(); k++)
9393 {
9395 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9396 }
9397 }
9398 }
9399
9400 if (old_owner)
9401 old_owner.OnChildItemRemoved(this);
9402 if (new_owner)
9403 new_owner.OnChildItemReceived(this);
9404 }
9405
9406
9408 {
9409 super.EEDelete(parent);
9410 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9411 if (player)
9412 {
9414
9415 if (player.IsAlive())
9416 {
9417 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9418 if (r_index >= 0)
9419 {
9420 InventoryLocation r_il = new InventoryLocation;
9421 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9422
9423 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9426 {
9427 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9428 }
9430 {
9431 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9432 }
9433
9434 }
9435
9436 player.RemoveQuickBarEntityShortcut(this);
9437 }
9438 }
9439 }
9440
9442 {
9443 super.EEKilled(killer);
9444
9447 {
9448 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9449 {
9450 if (IsMagazine())
9451 {
9452 if (Magazine.Cast(this).GetAmmoCount() > 0)
9453 {
9455 }
9456 }
9457 else
9458 {
9460 }
9461 }
9462 }
9463 }
9464
9466 {
9467 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9468
9469 super.OnWasAttached(parent, slot_id);
9470
9473
9475 }
9476
9478 {
9479 super.OnWasDetached(parent, slot_id);
9480
9483 }
9484
9486 {
9487 int idx;
9490
9491 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9492 if (inventory_slots.Count() < 1)
9493 {
9494 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9495 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9496 }
9497 else
9498 {
9499 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9500 }
9501
9502 idx = inventory_slots.Find(slot);
9503 if (idx < 0)
9504 return "";
9505
9506 return attach_types.Get(idx);
9507 }
9508
9510 {
9511 int idx = -1;
9512 string slot;
9513
9516
9517 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9518 if (inventory_slots.Count() < 1)
9519 {
9520 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9521 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9522 }
9523 else
9524 {
9525 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9526 if (detach_types.Count() < 1)
9527 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9528 }
9529
9530 for (int i = 0; i < inventory_slots.Count(); i++)
9531 {
9532 slot = inventory_slots.Get(i);
9533 }
9534
9535 if (slot != "")
9536 {
9537 if (detach_types.Count() == 1)
9538 idx = 0;
9539 else
9540 idx = inventory_slots.Find(slot);
9541 }
9542 if (idx < 0)
9543 return "";
9544
9545 return detach_types.Get(idx);
9546 }
9547
9549 {
9550
9552
9553
9554 float min_time = 1;
9555 float max_time = 3;
9556 float delay = Math.RandomFloat(min_time, max_time);
9557
9558 explode_timer.Run(delay, this, "DoAmmoExplosion");
9559 }
9560
9562 {
9563 Magazine magazine = Magazine.Cast(this);
9564 int pop_sounds_count = 6;
9565 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9566
9567
9568 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9569 string sound_name = pop_sounds[ sound_idx ];
9571
9572
9573 magazine.ServerAddAmmoCount(-1);
9574
9575
9576 float min_temp_to_explode = 100;
9577
9578 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9579 {
9581 }
9582 }
9583
9584
9585 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9586 {
9587 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9588
9589 const int CHANCE_DAMAGE_CARGO = 4;
9590 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9591 const int CHANCE_DAMAGE_NOTHING = 2;
9592
9594 {
9595 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9596 int chances;
9597 int rnd;
9598
9599 if (GetInventory().GetCargo())
9600 {
9601 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9602 rnd = Math.RandomInt(0,chances);
9603
9604 if (rnd < CHANCE_DAMAGE_CARGO)
9605 {
9607 }
9608 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9609 {
9611 }
9612 }
9613 else
9614 {
9615 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9616 rnd = Math.RandomInt(0,chances);
9617
9618 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9619 {
9621 }
9622 }
9623 }
9624 }
9625
9627 {
9628 if (GetInventory().GetCargo())
9629 {
9630 int item_count = GetInventory().GetCargo().GetItemCount();
9631 if (item_count > 0)
9632 {
9633 int random_pick = Math.RandomInt(0, item_count);
9635 if (!item.IsExplosive())
9636 {
9637 item.AddHealth("","",damage);
9638 return true;
9639 }
9640 }
9641 }
9642 return false;
9643 }
9644
9646 {
9647 int attachment_count = GetInventory().AttachmentCount();
9648 if (attachment_count > 0)
9649 {
9650 int random_pick = Math.RandomInt(0, attachment_count);
9651 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9652 if (!attachment.IsExplosive())
9653 {
9654 attachment.AddHealth("","",damage);
9655 return true;
9656 }
9657 }
9658 return false;
9659 }
9660
9662 {
9664 }
9665
9667 {
9669 return GetInventory().CanRemoveEntity();
9670
9671 return false;
9672 }
9673
9675 {
9677 return;
9678
9680 {
9681 if (ScriptInputUserData.CanStoreInputUserData())
9682 {
9683 ScriptInputUserData ctx = new ScriptInputUserData;
9688 ctx.
Write(destination_entity);
9692 }
9693 }
9694 else if (!
GetGame().IsMultiplayer())
9695 {
9697 }
9698 }
9699
9701 {
9703 return;
9704
9705 float split_quantity_new;
9709 InventoryLocation loc = new InventoryLocation;
9710
9711 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9712 {
9714 split_quantity_new = stack_max;
9715 else
9717
9718 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9719 if (new_item)
9720 {
9721 new_item.SetResultOfSplit(true);
9722 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9724 new_item.SetQuantity(split_quantity_new);
9725 }
9726 }
9727 else if (destination_entity && slot_id == -1)
9728 {
9729 if (quantity > stack_max)
9730 split_quantity_new = stack_max;
9731 else
9732 split_quantity_new = quantity;
9733
9735 {
9738 }
9739
9740 if (new_item)
9741 {
9742 new_item.SetResultOfSplit(true);
9743 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9745 new_item.SetQuantity(split_quantity_new);
9746 }
9747 }
9748 else
9749 {
9750 if (stack_max != 0)
9751 {
9753 {
9755 }
9756
9757 if (split_quantity_new == 0)
9758 {
9759 if (!
GetGame().IsMultiplayer())
9760 player.PhysicalPredictiveDropItem(this);
9761 else
9762 player.ServerDropEntity(this);
9763 return;
9764 }
9765
9767
9768 if (new_item)
9769 {
9770 new_item.SetResultOfSplit(true);
9771 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9773 new_item.SetQuantity(stack_max);
9774 new_item.PlaceOnSurface();
9775 }
9776 }
9777 }
9778 }
9779
9781 {
9783 return;
9784
9785 float split_quantity_new;
9789 InventoryLocation loc = new InventoryLocation;
9790
9791 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9792 {
9794 split_quantity_new = stack_max;
9795 else
9797
9798 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9799 if (new_item)
9800 {
9801 new_item.SetResultOfSplit(true);
9802 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9804 new_item.SetQuantity(split_quantity_new);
9805 }
9806 }
9807 else if (destination_entity && slot_id == -1)
9808 {
9809 if (quantity > stack_max)
9810 split_quantity_new = stack_max;
9811 else
9812 split_quantity_new = quantity;
9813
9815 {
9818 }
9819
9820 if (new_item)
9821 {
9822 new_item.SetResultOfSplit(true);
9823 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9825 new_item.SetQuantity(split_quantity_new);
9826 }
9827 }
9828 else
9829 {
9830 if (stack_max != 0)
9831 {
9833 {
9835 }
9836
9838
9839 if (new_item)
9840 {
9841 new_item.SetResultOfSplit(true);
9842 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9844 new_item.SetQuantity(stack_max);
9845 new_item.PlaceOnSurface();
9846 }
9847 }
9848 }
9849 }
9850
9852 {
9854 return;
9855
9857 {
9858 if (ScriptInputUserData.CanStoreInputUserData())
9859 {
9860 ScriptInputUserData ctx = new ScriptInputUserData;
9865 dst.WriteToContext(ctx);
9867 }
9868 }
9869 else if (!
GetGame().IsMultiplayer())
9870 {
9872 }
9873 }
9874
9876 {
9878 return;
9879
9881 {
9882 if (ScriptInputUserData.CanStoreInputUserData())
9883 {
9884 ScriptInputUserData ctx = new ScriptInputUserData;
9889 ctx.
Write(destination_entity);
9895 }
9896 }
9897 else if (!
GetGame().IsMultiplayer())
9898 {
9900 }
9901 }
9902
9904 {
9906 }
9907
9909 {
9911 return this;
9912
9914 float split_quantity_new;
9916 if (dst.IsValid())
9917 {
9918 int slot_id = dst.GetSlot();
9920
9921 if (quantity > stack_max)
9922 split_quantity_new = stack_max;
9923 else
9924 split_quantity_new = quantity;
9925
9927
9928 if (new_item)
9929 {
9930 new_item.SetResultOfSplit(true);
9931 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9934 }
9935
9936 return new_item;
9937 }
9938
9939 return null;
9940 }
9941
9943 {
9945 return;
9946
9948 float split_quantity_new;
9950 if (destination_entity)
9951 {
9953 if (quantity > stackable)
9954 split_quantity_new = stackable;
9955 else
9956 split_quantity_new = quantity;
9957
9958 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9959 if (new_item)
9960 {
9961 new_item.SetResultOfSplit(true);
9962 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9964 new_item.SetQuantity(split_quantity_new);
9965 }
9966 }
9967 }
9968
9970 {
9972 return;
9973
9975 {
9976 if (ScriptInputUserData.CanStoreInputUserData())
9977 {
9978 ScriptInputUserData ctx = new ScriptInputUserData;
9983 ItemBase destination_entity =
this;
9984 ctx.
Write(destination_entity);
9988 }
9989 }
9990 else if (!
GetGame().IsMultiplayer())
9991 {
9993 }
9994 }
9995
9997 {
9999 return;
10000
10002 float split_quantity_new;
10004 if (player)
10005 {
10007 if (quantity > stackable)
10008 split_quantity_new = stackable;
10009 else
10010 split_quantity_new = quantity;
10011
10012 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10013 new_item =
ItemBase.Cast(in_hands);
10014 if (new_item)
10015 {
10016 new_item.SetResultOfSplit(true);
10017 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10019 new_item.SetQuantity(split_quantity_new);
10020 }
10021 }
10022 }
10023
10025 {
10027 return;
10028
10030 float split_quantity_new = Math.Floor(quantity * 0.5);
10031
10033
10034 if (new_item)
10035 {
10036 if (new_item.GetQuantityMax() < split_quantity_new)
10037 {
10038 split_quantity_new = new_item.GetQuantityMax();
10039 }
10040
10041 new_item.SetResultOfSplit(true);
10042 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10043
10045 {
10048 }
10049 else
10050 {
10053 }
10054 }
10055 }
10056
10058 {
10060 return;
10061
10063 float split_quantity_new = Math.Floor(quantity / 2);
10064
10065 InventoryLocation invloc = new InventoryLocation;
10067
10069 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10070
10071 if (new_item)
10072 {
10073 if (new_item.GetQuantityMax() < split_quantity_new)
10074 {
10075 split_quantity_new = new_item.GetQuantityMax();
10076 }
10078 {
10081 }
10082 else
10083 {
10086 }
10087 }
10088 }
10089
10092 {
10093 SetWeightDirty();
10095
10096 if (parent)
10097 parent.OnAttachmentQuantityChangedEx(this, delta);
10098
10100 {
10102 {
10104 }
10106 {
10107 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10109 }
10110 }
10111
10112 }
10113
10116 {
10117
10118 }
10119
10122 {
10124 }
10125
10127 {
10128 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10129
10131 {
10132 if (newLevel == GameConstants.STATE_RUINED)
10133 {
10135 EntityAI parent = GetHierarchyParent();
10136 if (parent && parent.IsFireplace())
10137 {
10138 CargoBase cargo = GetInventory().GetCargo();
10139 if (cargo)
10140 {
10142 {
10144 }
10145 }
10146 }
10147 }
10148
10150 {
10151
10153 return;
10154 }
10155
10156 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10157 {
10159 }
10160 }
10161 }
10162
10163
10165 {
10166 super.OnRightClick();
10167
10169 {
10171 {
10172 if (ScriptInputUserData.CanStoreInputUserData())
10173 {
10174 vector m4[4];
10176
10177 EntityAI root = GetHierarchyRoot();
10178
10179 InventoryLocation dst = new InventoryLocation;
10181 {
10182 if (root)
10183 {
10184 root.GetTransform(m4);
10186 }
10187 else
10188 GetInventory().GetCurrentInventoryLocation(dst);
10189 }
10190 else
10191 {
10193
10194
10195 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10196 {
10197 if (root)
10198 {
10199 root.GetTransform(m4);
10201 }
10202 else
10203 GetInventory().GetCurrentInventoryLocation(dst);
10204 }
10205 else
10206 {
10207 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10208 }
10209 }
10210
10211 ScriptInputUserData ctx = new ScriptInputUserData;
10219 }
10220 }
10221 else if (!
GetGame().IsMultiplayer())
10222 {
10224 }
10225 }
10226 }
10227
10228 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10229 {
10230
10231 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10232 return false;
10233
10234 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10235 return false;
10236
10237
10239 return false;
10240
10241
10242 Magazine mag = Magazine.Cast(this);
10243 if (mag)
10244 {
10245 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10246 return false;
10247
10248 if (stack_max_limit)
10249 {
10250 Magazine other_mag = Magazine.Cast(other_item);
10251 if (other_item)
10252 {
10253 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10254 return false;
10255 }
10256
10257 }
10258 }
10259 else
10260 {
10261
10263 return false;
10264
10266 return false;
10267 }
10268
10269 PlayerBase player = null;
10270 if (CastTo(player, GetHierarchyRootPlayer()))
10271 {
10272 if (player.GetInventory().HasAttachment(this))
10273 return false;
10274
10275 if (player.IsItemsToDelete())
10276 return false;
10277 }
10278
10279 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10280 return false;
10281
10282 int slotID;
10284 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10285 return false;
10286
10287 return true;
10288 }
10289
10291 {
10293 }
10294
10296 {
10297 return m_IsResultOfSplit;
10298 }
10299
10301 {
10302 m_IsResultOfSplit = value;
10303 }
10304
10306 {
10308 }
10309
10311 {
10312 float other_item_quantity = other_item.GetQuantity();
10313 float this_free_space;
10314
10316
10318
10319 if (other_item_quantity > this_free_space)
10320 {
10321 return this_free_space;
10322 }
10323 else
10324 {
10325 return other_item_quantity;
10326 }
10327 }
10328
10330 {
10332 }
10333
10335 {
10337 return;
10338
10339 if (!IsMagazine() && other_item)
10340 {
10342 if (quantity_used != 0)
10343 {
10344 float hp1 = GetHealth01("","");
10345 float hp2 = other_item.GetHealth01("","");
10346 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10347 hpResult = hpResult / (
GetQuantity() + quantity_used);
10348
10349 hpResult *= GetMaxHealth();
10350 Math.Round(hpResult);
10351 SetHealth("", "Health", hpResult);
10352
10354 other_item.AddQuantity(-quantity_used);
10355 }
10356 }
10358 }
10359
10361 {
10362 #ifdef SERVER
10363 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10364 GetHierarchyParent().IncreaseLifetimeUp();
10365 #endif
10366 };
10367
10369 {
10370 PlayerBase p = PlayerBase.Cast(player);
10371
10372 array<int> recipesIds = p.m_Recipes;
10373 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10374 if (moduleRecipesManager)
10375 {
10376 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10377 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10378 }
10379
10380 for (int i = 0;i < recipesIds.Count(); i++)
10381 {
10382 int key = recipesIds.Get(i);
10383 string recipeName = moduleRecipesManager.GetRecipeName(key);
10385 }
10386 }
10387
10388
10389 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10390 {
10391 super.GetDebugActions(outputList);
10392
10393
10398
10399
10403
10407
10408
10411
10412
10414 {
10417 }
10418
10420
10423
10427 }
10428
10429
10430
10431
10433 {
10434 super.OnAction(action_id, player, ctx);
10435 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10436 {
10437 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10438 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10439 PlayerBase p = PlayerBase.Cast(player);
10440 if (
EActions.RECIPES_RANGE_START < 1000)
10441 {
10442 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10443 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10444 }
10445 }
10446 #ifndef SERVER
10447 else if (action_id ==
EActions.WATCH_PLAYER)
10448 {
10449 PluginDeveloper.SetDeveloperItemClientEx(player);
10450 }
10451 #endif
10453 {
10454 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10455 {
10456 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10457 OnDebugButtonPressServer(id + 1);
10458 }
10459
10460 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10461 {
10462 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10464 }
10465
10466 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10467 {
10468 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10470 }
10471
10472 else if (action_id ==
EActions.ADD_QUANTITY)
10473 {
10474 if (IsMagazine())
10475 {
10476 Magazine mag = Magazine.Cast(this);
10477 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10478 }
10479 else
10480 {
10482 }
10483
10484 if (m_EM)
10485 {
10486 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10487 }
10488
10489 }
10490
10491 else if (action_id ==
EActions.REMOVE_QUANTITY)
10492 {
10493 if (IsMagazine())
10494 {
10495 Magazine mag2 = Magazine.Cast(this);
10496 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10497 }
10498 else
10499 {
10501 }
10502 if (m_EM)
10503 {
10504 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10505 }
10506
10507 }
10508
10509 else if (action_id ==
EActions.SET_QUANTITY_0)
10510 {
10512
10513 if (m_EM)
10514 {
10515 m_EM.SetEnergy(0);
10516 }
10517 }
10518
10519 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10520 {
10522
10523 if (m_EM)
10524 {
10525 m_EM.SetEnergy(m_EM.GetEnergyMax());
10526 }
10527 }
10528
10529 else if (action_id ==
EActions.ADD_HEALTH)
10530 {
10531 AddHealth("","",GetMaxHealth("","Health")/5);
10532 }
10533 else if (action_id ==
EActions.REMOVE_HEALTH)
10534 {
10535 AddHealth("","",-GetMaxHealth("","Health")/5);
10536 }
10537 else if (action_id ==
EActions.DESTROY_HEALTH)
10538 {
10539 SetHealth01("","",0);
10540 }
10541 else if (action_id ==
EActions.WATCH_ITEM)
10542 {
10544 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10545 #ifdef DEVELOPER
10546 SetDebugDeveloper_item(this);
10547 #endif
10548 }
10549
10550 else if (action_id ==
EActions.ADD_TEMPERATURE)
10551 {
10552 AddTemperature(20);
10553
10554 }
10555
10556 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10557 {
10558 AddTemperature(-20);
10559
10560 }
10561
10562 else if (action_id ==
EActions.FLIP_FROZEN)
10563 {
10564 SetFrozen(!GetIsFrozen());
10565
10566 }
10567
10568 else if (action_id ==
EActions.ADD_WETNESS)
10569 {
10571
10572 }
10573
10574 else if (action_id ==
EActions.REMOVE_WETNESS)
10575 {
10577
10578 }
10579
10580 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10581 {
10584
10585
10586 }
10587
10588 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10589 {
10592 }
10593
10594 else if (action_id ==
EActions.MAKE_SPECIAL)
10595 {
10596 auto debugParams = DebugSpawnParams.WithPlayer(player);
10597 OnDebugSpawnEx(debugParams);
10598 }
10599
10600 else if (action_id ==
EActions.DELETE)
10601 {
10602 Delete();
10603 }
10604
10605 }
10606
10607
10608 return false;
10609 }
10610
10611
10612
10613
10617
10620
10621
10622
10624 {
10625 return false;
10626 }
10627
10628
10630 {
10631 return true;
10632 }
10633
10634
10636 {
10637 return true;
10638 }
10639
10640
10641
10643 {
10644 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10646 }
10647
10650 {
10651 return null;
10652 }
10653
10655 {
10656 return false;
10657 }
10658
10660 {
10661 return false;
10662 }
10663
10667
10668
10670 {
10671 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10672 return module_repairing.CanRepair(this, item_repair_kit);
10673 }
10674
10675
10676 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10677 {
10678 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10679 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10680 }
10681
10682
10684 {
10685
10686
10687
10688
10689
10690
10691
10692
10693 return 1;
10694 }
10695
10696
10697
10699 {
10701 }
10702
10703
10704
10706 {
10708 }
10709
10710
10719 {
10720 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10721
10722 if (player)
10723 {
10724 player.MessageStatus(text);
10725 }
10726 }
10727
10728
10737 {
10738 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10739
10740 if (player)
10741 {
10742 player.MessageAction(text);
10743 }
10744 }
10745
10746
10755 {
10756 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10757
10758 if (player)
10759 {
10760 player.MessageFriendly(text);
10761 }
10762 }
10763
10764
10773 {
10774 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10775
10776 if (player)
10777 {
10778 player.MessageImportant(text);
10779 }
10780 }
10781
10783 {
10784 return true;
10785 }
10786
10787
10788 override bool KindOf(
string tag)
10789 {
10790 bool found = false;
10791 string item_name = this.
GetType();
10794
10795 int array_size = item_tag_array.Count();
10796 for (int i = 0; i < array_size; i++)
10797 {
10798 if (item_tag_array.Get(i) == tag)
10799 {
10800 found = true;
10801 break;
10802 }
10803 }
10804 return found;
10805 }
10806
10807
10809 {
10810
10811 super.OnRPC(sender, rpc_type,ctx);
10812
10813
10814 switch (rpc_type)
10815 {
10816 #ifndef SERVER
10817 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10818 Param2<bool, string> p = new Param2<bool, string>(false, "");
10819
10821 return;
10822
10823 bool play = p.param1;
10824 string soundSet = p.param2;
10825
10826 if (play)
10827 {
10829 {
10831 {
10833 }
10834 }
10835 else
10836 {
10838 }
10839 }
10840 else
10841 {
10843 }
10844
10845 break;
10846 #endif
10847
10848 }
10849
10851 {
10853 }
10854 }
10855
10856
10857
10858
10860 {
10861 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10862 return plugin.GetID(
name);
10863 }
10864
10866 {
10867 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10868 return plugin.GetName(id);
10869 }
10870
10873 {
10874
10875
10876 int varFlags;
10877 if (!ctx.
Read(varFlags))
10878 return;
10879
10880 if (varFlags & ItemVariableFlags.FLOAT)
10881 {
10883 }
10884 }
10885
10887 {
10888
10889 super.SerializeNumericalVars(floats_out);
10890
10891
10892
10894 {
10896 }
10897
10899 {
10901 }
10902
10904 {
10906 }
10907
10909 {
10914 }
10915
10917 {
10919 }
10920 }
10921
10923 {
10924
10925 super.DeSerializeNumericalVars(floats);
10926
10927
10928 int index = 0;
10929 int mask = Math.Round(floats.Get(index));
10930
10931 index++;
10932
10934 {
10936 {
10938 }
10939 else
10940 {
10941 float quantity = floats.Get(index);
10942 SetQuantity(quantity,
true,
false,
false,
false);
10943 }
10944 index++;
10945 }
10946
10948 {
10949 float wet = floats.Get(index);
10951 index++;
10952 }
10953
10955 {
10956 int liquidtype = Math.Round(floats.Get(index));
10958 index++;
10959 }
10960
10962 {
10964 index++;
10966 index++;
10968 index++;
10970 index++;
10971 }
10972
10974 {
10975 int cleanness = Math.Round(floats.Get(index));
10977 index++;
10978 }
10979 }
10980
10982 {
10983 super.WriteVarsToCTX(ctx);
10984
10985
10987 {
10989 }
10990
10992 {
10994 }
10995
10997 {
10999 }
11000
11002 {
11003 int r,g,b,a;
11009 }
11010
11012 {
11014 }
11015 }
11016
11018 {
11019 if (!super.ReadVarsFromCTX(ctx,version))
11020 return false;
11021
11022 int intValue;
11023 float value;
11024
11025 if (version < 140)
11026 {
11027 if (!ctx.
Read(intValue))
11028 return false;
11029
11030 m_VariablesMask = intValue;
11031 }
11032
11034 {
11035 if (!ctx.
Read(value))
11036 return false;
11037
11039 {
11041 }
11042 else
11043 {
11045 }
11046 }
11047
11048 if (version < 140)
11049 {
11051 {
11052 if (!ctx.
Read(value))
11053 return false;
11054 SetTemperatureDirect(value);
11055 }
11056 }
11057
11059 {
11060 if (!ctx.
Read(value))
11061 return false;
11063 }
11064
11066 {
11067 if (!ctx.
Read(intValue))
11068 return false;
11070 }
11071
11073 {
11074 int r,g,b,a;
11076 return false;
11078 return false;
11080 return false;
11082 return false;
11083
11085 }
11086
11088 {
11089 if (!ctx.
Read(intValue))
11090 return false;
11092 }
11093
11094 if (version >= 138 && version < 140)
11095 {
11097 {
11098 if (!ctx.
Read(intValue))
11099 return false;
11100 SetFrozen(intValue);
11101 }
11102 }
11103
11104 return true;
11105 }
11106
11107
11109 {
11112 {
11114 }
11115
11116 if (!super.OnStoreLoad(ctx, version))
11117 {
11119 return false;
11120 }
11121
11122 if (version >= 114)
11123 {
11124 bool hasQuickBarIndexSaved;
11125
11126 if (!ctx.
Read(hasQuickBarIndexSaved))
11127 {
11129 return false;
11130 }
11131
11132 if (hasQuickBarIndexSaved)
11133 {
11134 int itmQBIndex;
11135
11136
11137 if (!ctx.
Read(itmQBIndex))
11138 {
11140 return false;
11141 }
11142
11143 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11144 if (itmQBIndex != -1 && parentPlayer)
11145 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11146 }
11147 }
11148 else
11149 {
11150
11151 PlayerBase player;
11152 int itemQBIndex;
11153 if (version ==
int.
MAX)
11154 {
11155 if (!ctx.
Read(itemQBIndex))
11156 {
11158 return false;
11159 }
11160 }
11161 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11162 {
11163
11164 if (!ctx.
Read(itemQBIndex))
11165 {
11167 return false;
11168 }
11169 if (itemQBIndex != -1 && player)
11170 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11171 }
11172 }
11173
11174 if (version < 140)
11175 {
11176
11177 if (!LoadVariables(ctx, version))
11178 {
11180 return false;
11181 }
11182 }
11183
11184
11186 {
11188 return false;
11189 }
11190 if (version >= 132)
11191 {
11193 if (raib)
11194 {
11196 {
11198 return false;
11199 }
11200 }
11201 }
11202
11204 return true;
11205 }
11206
11207
11208
11210 {
11211 super.OnStoreSave(ctx);
11212
11213 PlayerBase player;
11214 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11215 {
11217
11218 int itemQBIndex = -1;
11219 itemQBIndex = player.FindQuickBarEntityIndex(this);
11220 ctx.
Write(itemQBIndex);
11221 }
11222 else
11223 {
11225 }
11226
11228
11230 if (raib)
11231 {
11233 }
11234 }
11235
11236
11238 {
11239 super.AfterStoreLoad();
11240
11242 {
11244 }
11245
11247 {
11250 }
11251 }
11252
11254 {
11255 super.EEOnAfterLoad();
11256
11258 {
11260 }
11261
11264 }
11265
11267 {
11268 return false;
11269 }
11270
11271
11272
11274 {
11276 {
11277 #ifdef PLATFORM_CONSOLE
11278
11280 {
11282 if (menu)
11283 {
11285 }
11286 }
11287 #endif
11288 }
11289
11291 {
11294 }
11295
11297 {
11298 SetWeightDirty();
11300 }
11302 {
11305 }
11306
11308 {
11311 }
11313 {
11316 }
11317
11318 super.OnVariablesSynchronized();
11319 }
11320
11321
11322
11324 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11325 {
11326 if (!IsServerCheck(allow_client))
11327 return false;
11328
11330 return false;
11331
11334
11335 if (value <= (min + 0.001))
11336 value = min;
11337
11338 if (value == min)
11339 {
11340 if (destroy_config)
11341 {
11342 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11343 if (dstr)
11344 {
11346 this.Delete();
11347 return true;
11348 }
11349 }
11350 else if (destroy_forced)
11351 {
11353 this.Delete();
11354 return true;
11355 }
11356
11358 }
11359
11362
11364 {
11366
11367 if (delta)
11369 }
11370
11372
11373 return false;
11374 }
11375
11376
11378 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11379 {
11381 }
11382
11384 {
11387 }
11388
11390 {
11393 }
11394
11397 {
11398 float value_clamped = Math.Clamp(value, 0, 1);
11400 SetQuantity(result, destroy_config, destroy_forced);
11401 }
11402
11403
11406 {
11408 }
11409
11411 {
11413 }
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11425 {
11426 int slot = -1;
11427 if (GetInventory())
11428 {
11429 InventoryLocation il = new InventoryLocation;
11430 GetInventory().GetCurrentInventoryLocation(il);
11432 }
11433
11435 }
11436
11438 {
11439 float quantity_max = 0;
11440
11442 {
11443 if (attSlotID != -1)
11444 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11445
11446 if (quantity_max <= 0)
11448 }
11449
11450 if (quantity_max <= 0)
11452
11453 return quantity_max;
11454 }
11455
11457 {
11459 }
11460
11462 {
11464 }
11465
11466
11468 {
11470 }
11471
11473 {
11475 }
11476
11478 {
11480 }
11481
11482
11484 {
11485
11486 float weightEx = GetWeightEx();
11487 float special = GetInventoryAndCargoWeight();
11488 return weightEx - special;
11489 }
11490
11491
11493 {
11495 }
11496
11498 {
11500 {
11501 #ifdef DEVELOPER
11502 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11503 {
11504 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11506 }
11507 #endif
11508
11509 return GetQuantity() * GetConfigWeightModified();
11510 }
11511 else if (HasEnergyManager())
11512 {
11513 #ifdef DEVELOPER
11514 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11515 {
11516 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11517 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11518 }
11519 #endif
11520 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11521 }
11522 else
11523 {
11524 #ifdef DEVELOPER
11525 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11526 {
11527 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11528 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11529 }
11530 #endif
11531 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11532 }
11533 }
11534
11537 {
11538 int item_count = 0;
11540
11541 if (GetInventory().GetCargo() != NULL)
11542 {
11543 item_count = GetInventory().GetCargo().GetItemCount();
11544 }
11545
11546 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11547 {
11548 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11549 if (item)
11550 item_count += item.GetNumberOfItems();
11551 }
11552 return item_count;
11553 }
11554
11557 {
11558 float weight = 0;
11559 float wetness = 1;
11560 if (include_wetness)
11563 {
11564 weight = wetness * m_ConfigWeight;
11565 }
11567 {
11568 weight = 1;
11569 }
11570 return weight;
11571 }
11572
11573
11574
11576 {
11577 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11578 {
11579 GameInventory inv = GetInventory();
11580 array<EntityAI> items = new array<EntityAI>;
11582 for (int i = 0; i < items.Count(); i++)
11583 {
11585 if (item)
11586 {
11588 }
11589 }
11590 }
11591 }
11592
11593
11594
11595
11597 {
11598 float energy = 0;
11599 if (HasEnergyManager())
11600 {
11601 energy = GetCompEM().GetEnergy();
11602 }
11603 return energy;
11604 }
11605
11606
11608 {
11609 super.OnEnergyConsumed();
11610
11612 }
11613
11615 {
11616 super.OnEnergyAdded();
11617
11619 }
11620
11621
11623 {
11624 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11625 {
11627 {
11628 float energy_0to1 = GetCompEM().GetEnergy0To1();
11630 }
11631 }
11632 }
11633
11634
11636 {
11637 return ConfigGetFloat("heatIsolation");
11638 }
11639
11641 {
11643 }
11644
11646 {
11647 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11648 if (
GetGame().ConfigIsExisting(paramPath))
11650
11651 return 0.0;
11652 }
11653
11655 {
11656 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11657 if (
GetGame().ConfigIsExisting(paramPath))
11659
11660 return 0.0;
11661 }
11662
11663 override void SetWet(
float value,
bool allow_client =
false)
11664 {
11665 if (!IsServerCheck(allow_client))
11666 return;
11667
11670
11672
11673 m_VarWet = Math.Clamp(value, min, max);
11674
11676 {
11679 }
11680 }
11681
11682 override void AddWet(
float value)
11683 {
11685 }
11686
11688 {
11690 }
11691
11693 {
11695 }
11696
11698 {
11700 }
11701
11703 {
11705 }
11706
11708 {
11710 }
11711
11712 override void OnWetChanged(
float newVal,
float oldVal)
11713 {
11716 if (newLevel != oldLevel)
11717 {
11719 }
11720 }
11721
11723 {
11724 SetWeightDirty();
11725 }
11726
11728 {
11729 return GetWetLevelInternal(
m_VarWet);
11730 }
11731
11732
11733
11735 {
11737 }
11738
11740 {
11742 }
11743
11745 {
11747 }
11748
11750 {
11752 }
11753
11754
11755
11757 {
11758 if (ConfigIsExisting("itemModelLength"))
11759 {
11760 return ConfigGetFloat("itemModelLength");
11761 }
11762 return 0;
11763 }
11764
11766 {
11767 if (ConfigIsExisting("itemAttachOffset"))
11768 {
11769 return ConfigGetFloat("itemAttachOffset");
11770 }
11771 return 0;
11772 }
11773
11774 override void SetCleanness(
int value,
bool allow_client =
false)
11775 {
11776 if (!IsServerCheck(allow_client))
11777 return;
11778
11780
11782
11785 }
11786
11788 {
11790 }
11791
11793 {
11794 return true;
11795 }
11796
11797
11798
11799
11801 {
11803 }
11804
11806 {
11808 }
11809
11810
11811
11812
11813 override void SetColor(
int r,
int g,
int b,
int a)
11814 {
11820 }
11822 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11823 {
11828 }
11829
11831 {
11833 }
11834
11837 {
11838 int r,g,b,a;
11840 r = r/255;
11841 g = g/255;
11842 b = b/255;
11843 a = a/255;
11844 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11845 }
11846
11847
11848
11849 override void SetLiquidType(
int value,
bool allow_client =
false)
11850 {
11851 if (!IsServerCheck(allow_client))
11852 return;
11853
11858 }
11859
11861 {
11862 return ConfigGetInt("varLiquidTypeInit");
11863 }
11864
11866 {
11868 }
11869
11871 {
11873 SetFrozen(false);
11874 }
11875
11878 {
11879 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11880 }
11881
11882
11885 {
11886 PlayerBase nplayer;
11887 if (PlayerBase.CastTo(nplayer, player))
11888 {
11890
11891 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11892 }
11893 }
11894
11895
11898 {
11899 PlayerBase nplayer;
11900 if (PlayerBase.CastTo(nplayer,player))
11901 {
11902
11903 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11904
11905 }
11906
11907
11908 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11909
11910
11911 if (HasEnergyManager())
11912 {
11913 GetCompEM().UpdatePlugState();
11914 }
11915 }
11916
11917
11919 {
11920 super.OnPlacementStarted(player);
11921
11923 }
11924
11925 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11926 {
11928 {
11929 m_AdminLog.OnPlacementComplete(player,
this);
11930 }
11931
11932 super.OnPlacementComplete(player, position, orientation);
11933 }
11934
11935
11936
11937
11938
11940 {
11942 {
11943 return true;
11944 }
11945 else
11946 {
11947 return false;
11948 }
11949 }
11950
11951
11953 {
11955 {
11957 }
11958 }
11959
11960
11962 {
11964 }
11965
11967 {
11969 }
11970
11971 override void InsertAgent(
int agent,
float count = 1)
11972 {
11973 if (count < 1)
11974 return;
11975
11977 }
11978
11981 {
11983 }
11984
11985
11987 {
11989 }
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12033 {
12035 return false;
12036 return true;
12037 }
12038
12040 {
12041
12043 }
12044
12045
12048 {
12049 super.CheckForRoofLimited(timeTresholdMS);
12050
12052 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12053 {
12054 m_PreviousRoofTestTime = time;
12055 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12056 }
12057 }
12058
12059
12061 {
12063 {
12064 return 0;
12065 }
12066
12067 if (GetInventory().GetAttachmentSlotsCount() != 0)
12068 {
12069 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12070 if (filter)
12071 return filter.GetProtectionLevel(type, false, system);
12072 else
12073 return 0;
12074 }
12075
12076 string subclassPath, entryName;
12077
12078 switch (type)
12079 {
12081 entryName = "biological";
12082 break;
12084 entryName = "chemical";
12085 break;
12086 default:
12087 entryName = "biological";
12088 break;
12089 }
12090
12091 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12092
12094 }
12095
12096
12097
12100 {
12101 if (!IsMagazine())
12103
12105 }
12106
12107
12108
12109
12110
12115 {
12116 return true;
12117 }
12118
12120 {
12122 }
12123
12124
12125
12126
12127
12129 {
12130 if (parent)
12131 {
12132 if (parent.IsInherited(DayZInfected))
12133 return true;
12134
12135 if (!parent.IsRuined())
12136 return true;
12137 }
12138
12139 return true;
12140 }
12141
12143 {
12144 if (!super.CanPutAsAttachment(parent))
12145 {
12146 return false;
12147 }
12148
12149 if (!IsRuined() && !parent.IsRuined())
12150 {
12151 return true;
12152 }
12153
12154 return false;
12155 }
12156
12158 {
12159
12160
12161
12162
12163 return super.CanReceiveItemIntoCargo(item);
12164 }
12165
12167 {
12168
12169
12170
12171
12172 GameInventory attachmentInv = attachment.GetInventory();
12174 {
12175 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12176 return false;
12177 }
12178
12179 InventoryLocation loc = new InventoryLocation();
12180 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12181 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12182 return false;
12183
12184 return super.CanReceiveAttachment(attachment, slotId);
12185 }
12186
12188 {
12189 if (!super.CanReleaseAttachment(attachment))
12190 return false;
12191
12192 return GetInventory().AreChildrenAccessible();
12193 }
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12216 {
12217 int id = muzzle_owner.GetMuzzleID();
12218 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12219
12220 if (WPOF_array)
12221 {
12222 for (int i = 0; i < WPOF_array.Count(); i++)
12223 {
12224 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12225
12226 if (WPOF)
12227 {
12228 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12229 }
12230 }
12231 }
12232 }
12233
12234
12236 {
12237 int id = muzzle_owner.GetMuzzleID();
12239
12240 if (WPOBE_array)
12241 {
12242 for (int i = 0; i < WPOBE_array.Count(); i++)
12243 {
12244 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12245
12246 if (WPOBE)
12247 {
12248 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12249 }
12250 }
12251 }
12252 }
12253
12254
12256 {
12257 int id = muzzle_owner.GetMuzzleID();
12258 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12259
12260 if (WPOOH_array)
12261 {
12262 for (int i = 0; i < WPOOH_array.Count(); i++)
12263 {
12264 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12265
12266 if (WPOOH)
12267 {
12268 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12269 }
12270 }
12271 }
12272 }
12273
12274
12276 {
12277 int id = muzzle_owner.GetMuzzleID();
12278 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12279
12280 if (WPOOH_array)
12281 {
12282 for (int i = 0; i < WPOOH_array.Count(); i++)
12283 {
12284 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12285
12286 if (WPOOH)
12287 {
12288 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12289 }
12290 }
12291 }
12292 }
12293
12294
12296 {
12297 int id = muzzle_owner.GetMuzzleID();
12298 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12299
12300 if (WPOOH_array)
12301 {
12302 for (int i = 0; i < WPOOH_array.Count(); i++)
12303 {
12304 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12305
12306 if (WPOOH)
12307 {
12308 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12309 }
12310 }
12311 }
12312 }
12313
12314
12315
12317 {
12319 {
12320 return true;
12321 }
12322
12323 return false;
12324 }
12325
12327 {
12329 {
12330 return true;
12331 }
12332
12333 return false;
12334 }
12335
12337 {
12339 {
12340 return true;
12341 }
12342
12343 return false;
12344 }
12345
12347 {
12348 return false;
12349 }
12350
12353 {
12354 return UATimeSpent.DEFAULT_DEPLOY;
12355 }
12356
12357
12358
12359
12361 {
12363 SetSynchDirty();
12364 }
12365
12367 {
12369 }
12370
12371
12373 {
12374 return false;
12375 }
12376
12379 {
12380 string att_type = "None";
12381
12382 if (ConfigIsExisting("soundAttType"))
12383 {
12384 att_type = ConfigGetString("soundAttType");
12385 }
12386
12388 }
12389
12391 {
12393 }
12394
12395
12396
12397
12398
12402
12404 {
12407
12409 }
12410
12411
12413 {
12415 return;
12416
12418
12421
12424
12425 SoundParameters params = new SoundParameters();
12429 }
12430
12431
12433 {
12435 return;
12436
12438 SetSynchDirty();
12439
12442 }
12443
12444
12446 {
12448 return;
12449
12451 SetSynchDirty();
12452
12455 }
12456
12458 {
12460 }
12461
12463 {
12465 }
12466
12469 {
12470 if (!
GetGame().IsDedicatedServer())
12471 {
12472 if (ConfigIsExisting("attachSoundSet"))
12473 {
12474 string cfg_path = "";
12475 string soundset = "";
12476 string type_name =
GetType();
12477
12480 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12481 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12482
12483 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12484 {
12485 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12486 {
12487 if (cfg_slot_array[i] == slot_type)
12488 {
12489 soundset = cfg_soundset_array[i];
12490 break;
12491 }
12492 }
12493 }
12494
12495 if (soundset != "")
12496 {
12497 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12499 }
12500 }
12501 }
12502 }
12503
12505 {
12506
12507 }
12508
12509 void OnApply(PlayerBase player);
12510
12512 {
12513 return 1.0;
12514 };
12515
12517 {
12519 }
12520
12522 {
12524 }
12525
12527
12529 {
12530 SetDynamicPhysicsLifeTime(0.01);
12532 }
12533
12535 {
12536 array<string> zone_names = new array<string>;
12537 GetDamageZones(zone_names);
12538 for (int i = 0; i < zone_names.Count(); i++)
12539 {
12540 SetHealthMax(zone_names.Get(i),"Health");
12541 }
12542 SetHealthMax("","Health");
12543 }
12544
12547 {
12548 float global_health = GetHealth01("","Health");
12549 array<string> zones = new array<string>;
12550 GetDamageZones(zones);
12551
12552 for (int i = 0; i < zones.Count(); i++)
12553 {
12554 SetHealth01(zones.Get(i),"Health",global_health);
12555 }
12556 }
12557
12560 {
12561 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12562 }
12563
12565 {
12566 if (!hasRootAsPlayer)
12567 {
12568 if (refParentIB)
12569 {
12570
12571 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12572 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12573
12574 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12575 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12576
12579 }
12580 else
12581 {
12582
12585 }
12586 }
12587 }
12588
12590 {
12592 {
12593 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12594 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12595 {
12596 float heatPermCoef = 1.0;
12598 while (ent)
12599 {
12600 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12601 ent = ent.GetHierarchyParent();
12602 }
12603
12604 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12605 }
12606 }
12607 }
12608
12610 {
12611
12612 EntityAI parent = GetHierarchyParent();
12613 if (!parent)
12614 {
12615 hasParent = false;
12616 hasRootAsPlayer = false;
12617 }
12618 else
12619 {
12620 hasParent = true;
12621 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12622 refParentIB =
ItemBase.Cast(parent);
12623 }
12624 }
12625
12626 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12627 {
12628
12629 }
12630
12632 {
12633
12634 return false;
12635 }
12636
12638 {
12639
12640
12641 return false;
12642 }
12643
12645 {
12646
12647 return false;
12648 }
12649
12652 {
12653 return !GetIsFrozen() &&
IsOpen();
12654 }
12655
12657 {
12658 bool hasParent = false, hasRootAsPlayer = false;
12660
12661 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12662 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12663
12664 if (wwtu || foodDecay)
12665 {
12669
12670 if (processWetness || processTemperature || processDecay)
12671 {
12673
12674 if (processWetness)
12675 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12676
12677 if (processTemperature)
12679
12680 if (processDecay)
12681 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12682 }
12683 }
12684 }
12685
12688 {
12690 }
12691
12693 {
12696
12697 return super.GetTemperatureFreezeThreshold();
12698 }
12699
12701 {
12704
12705 return super.GetTemperatureThawThreshold();
12706 }
12707
12709 {
12712
12713 return super.GetItemOverheatThreshold();
12714 }
12715
12717 {
12719 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12720
12721 return super.GetTemperatureFreezeTime();
12722 }
12723
12725 {
12727 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12728
12729 return super.GetTemperatureThawTime();
12730 }
12731
12736
12738 {
12739 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12740 }
12741
12743 {
12744 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12745 }
12746
12749 {
12751 }
12752
12754 {
12756 }
12757
12759 {
12761 }
12762
12765 {
12766 return null;
12767 }
12768
12771 {
12772 return false;
12773 }
12774
12776 {
12778 {
12781 if (!trg)
12782 {
12784 explosive = this;
12785 }
12786
12787 explosive.PairRemote(trg);
12789
12790 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12791 trg.SetPersistentPairID(persistentID);
12792 explosive.SetPersistentPairID(persistentID);
12793
12794 return true;
12795 }
12796 return false;
12797 }
12798
12801 {
12802 float ret = 1.0;
12805 ret *= GetHealth01();
12806
12807 return ret;
12808 }
12809
12810 #ifdef DEVELOPER
12811 override void SetDebugItem()
12812 {
12813 super.SetDebugItem();
12814 _itemBase = this;
12815 }
12816
12818 {
12819 string text = super.GetDebugText();
12820
12822 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12823
12824 return text;
12825 }
12826 #endif
12827
12829 {
12830 return true;
12831 }
12832
12834
12836
12838 {
12841 }
12842
12843
12851
12867}
12868
12870{
12872 if (entity)
12873 {
12874 bool is_item = entity.IsInherited(
ItemBase);
12875 if (is_item && full_quantity)
12876 {
12879 }
12880 }
12881 else
12882 {
12884 return NULL;
12885 }
12886 return entity;
12887}
12888
12890{
12891 if (item)
12892 {
12893 if (health > 0)
12894 item.SetHealth("", "", health);
12895
12896 if (item.CanHaveTemperature())
12897 {
12899 if (item.CanFreeze())
12900 item.SetFrozen(false);
12901 }
12902
12903 if (item.HasEnergyManager())
12904 {
12905 if (quantity >= 0)
12906 {
12907 item.GetCompEM().SetEnergy0To1(quantity);
12908 }
12909 else
12910 {
12912 }
12913 }
12914 else if (item.IsMagazine())
12915 {
12916 Magazine mag = Magazine.Cast(item);
12917 if (quantity >= 0)
12918 {
12919 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12920 }
12921 else
12922 {
12924 }
12925
12926 }
12927 else
12928 {
12929 if (quantity >= 0)
12930 {
12931 item.SetQuantityNormalized(quantity, false);
12932 }
12933 else
12934 {
12936 }
12937
12938 }
12939 }
12940}
12941
12942#ifdef DEVELOPER
12944#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.