8096{
8098 {
8099 return true;
8100 }
8101};
8102
8103
8104
8106{
8110
8112
8115
8116
8117
8118
8119
8128
8134
8139
8144
8165 protected bool m_IsResultOfSplit
8166
8168
8173
8174
8175
8177
8181
8182
8183
8185
8188
8189
8190
8196
8197
8205
8208
8209
8211
8212
8214
8215
8220
8221
8226
8227
8229
8230
8232 {
8237
8238 if (!
GetGame().IsDedicatedServer())
8239 {
8241 {
8243
8245 {
8247 }
8248 }
8249
8252 }
8253
8254 m_OldLocation = null;
8255
8257 {
8259 }
8260
8261 if (ConfigIsExisting("headSelectionsToHide"))
8262 {
8265 }
8266
8268 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8269 {
8271 }
8272
8274
8275 m_IsResultOfSplit = false;
8276
8278 }
8279
8281 {
8282 super.InitItemVariables();
8283
8289 m_Count = ConfigGetInt(
"count");
8290
8293
8298
8301
8306
8318
8322
8323
8326 if (ConfigIsExisting("canBeSplit"))
8327 {
8330 }
8331
8333 if (ConfigIsExisting("itemBehaviour"))
8335
8336
8339 RegisterNetSyncVariableInt("m_VarLiquidType");
8340 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8341
8342 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8343 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8344 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8345
8346 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8347 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8348 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8349 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8350
8351 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8352 RegisterNetSyncVariableBool("m_IsTakeable");
8353 RegisterNetSyncVariableBool("m_IsHologram");
8354
8357 {
8360 }
8361
8363
8365 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8367
8368 }
8369
8371 {
8373 }
8374
8376 {
8379 {
8384 }
8385 }
8386
8387 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8388 {
8390 {
8393 }
8394
8396 }
8397
8399 {
8405 }
8406
8408
8410 {
8412
8413 if (!action)
8414 {
8415 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8416 return;
8417 }
8418
8420 if (!ai)
8421 {
8423 return;
8424 }
8425
8427 if (!action_array)
8428 {
8429 action_array = new array<ActionBase_Basic>;
8431 }
8432 if (LogManager.IsActionLogEnable())
8433 {
8434 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8435 }
8436
8437 if (action_array.Find(action) != -1)
8438 {
8439 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8440 }
8441 else
8442 {
8443 action_array.Insert(action);
8444 }
8445 }
8446
8448 {
8450 ActionBase action = player.GetActionManager().GetAction(actionName);
8453
8454 if (action_array)
8455 {
8456 action_array.RemoveItem(action);
8457 }
8458 }
8459
8460
8461
8463 {
8464 ActionOverrideData overrideData = new ActionOverrideData();
8468
8470 if (!actionMap)
8471 {
8474 }
8475
8476 actionMap.Insert(this.
Type(), overrideData);
8477
8478 }
8479
8481
8483
8484
8486 {
8489
8492
8493 string config_to_search = "CfgVehicles";
8494 string muzzle_owner_config;
8495
8497 {
8498 if (IsInherited(Weapon))
8499 config_to_search = "CfgWeapons";
8500
8501 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8502
8503 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8504
8506
8507 if (config_OnFire_subclass_count > 0)
8508 {
8509 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8510
8511 for (int i = 0; i < config_OnFire_subclass_count; i++)
8512 {
8513 string particle_class = "";
8515 string config_OnFire_entry = config_OnFire_class + particle_class;
8516 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8517 WPOF_array.Insert(WPOF);
8518 }
8519
8520
8522 }
8523 }
8524
8526 {
8527 config_to_search = "CfgWeapons";
8528 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8529
8530 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8531
8533
8534 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8535 {
8536 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8537
8538 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8539 {
8540 string particle_class2 = "";
8542 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8543 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8544 WPOBE_array.Insert(WPOBE);
8545 }
8546
8547
8549 }
8550 }
8551 }
8552
8553
8555 {
8558
8560 {
8561 string config_to_search = "CfgVehicles";
8562
8563 if (IsInherited(Weapon))
8564 config_to_search = "CfgWeapons";
8565
8566 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8567 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8568
8569 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8570 {
8571
8573
8575 {
8577 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8579 return;
8580 }
8581
8584
8585
8586
8588 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8589
8590 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8591 {
8592 string particle_class = "";
8594 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8596
8597 if (entry_type == CT_CLASS)
8598 {
8599 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8600 WPOOH_array.Insert(WPOF);
8601 }
8602 }
8603
8604
8606 }
8607 }
8608 }
8609
8611 {
8613 }
8614
8616 {
8618 {
8620
8623
8626
8627 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8628 }
8629 }
8630
8632 {
8634 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8635
8637 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8638
8640 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8641
8643 {
8645 }
8646 }
8647
8649 {
8651 }
8652
8654 {
8657 else
8659
8661 {
8664 }
8665 else
8666 {
8669
8672 }
8673
8675 }
8676
8678 {
8680 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8681 }
8682
8684 {
8686 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8688 }
8689
8691 {
8693 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8694 }
8695
8697 {
8700
8701 OverheatingParticle OP = new OverheatingParticle();
8706
8708 }
8709
8711 {
8714
8715 return -1;
8716 }
8717
8719 {
8721 {
8724
8725 for (int i = count; i > 0; --i)
8726 {
8727 int id = i - 1;
8730
8733
8734 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8735 {
8736 if (p)
8737 {
8740 }
8741 }
8742 }
8743 }
8744 }
8745
8747 {
8749 {
8751 {
8752 int id = i - 1;
8754
8755 if (OP)
8756 {
8758
8759 if (p)
8760 {
8762 }
8763
8764 delete OP;
8765 }
8766 }
8767
8770 }
8771 }
8772
8775 {
8776 return 0.0;
8777 }
8778
8779
8781 {
8782 return 250;
8783 }
8784
8786 {
8787 return 0;
8788 }
8789
8792 {
8794 return true;
8795
8796 return false;
8797 }
8798
8801 {
8804
8806 {
8808 }
8809 else
8810 {
8811
8813 }
8814
8816 }
8817
8824 {
8825 return -1;
8826 }
8827
8828
8829
8830
8832 {
8834 {
8836 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8837
8838 if (r_index >= 0)
8839 {
8840 InventoryLocation r_il = new InventoryLocation;
8841 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8842
8843 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8846 {
8847 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8848 }
8850 {
8851 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8852 }
8853
8854 }
8855
8856 player.GetHumanInventory().ClearUserReservedLocation(this);
8857 }
8858
8861 }
8862
8863
8864
8865
8867 {
8868 return ItemBase.m_DebugActionsMask;
8869 }
8870
8872 {
8873 return ItemBase.m_DebugActionsMask & mask;
8874 }
8875
8877 {
8878 ItemBase.m_DebugActionsMask = mask;
8879 }
8880
8882 {
8883 ItemBase.m_DebugActionsMask |= mask;
8884 }
8885
8887 {
8888 ItemBase.m_DebugActionsMask &= ~mask;
8889 }
8890
8892 {
8894 {
8896 }
8897 else
8898 {
8900 }
8901 }
8902
8903
8905 {
8906 if (GetEconomyProfile())
8907 {
8908 float q_max = GetEconomyProfile().GetQuantityMax();
8909 if (q_max > 0)
8910 {
8911 float q_min = GetEconomyProfile().GetQuantityMin();
8912 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8913
8915 {
8916 ComponentEnergyManager comp = GetCompEM();
8918 {
8920 }
8921 }
8923 {
8925
8926 }
8927
8928 }
8929 }
8930 }
8931
8934 {
8935 EntityAI parent = GetHierarchyParent();
8936
8937 if (parent)
8938 {
8939 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8940 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8941 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8942 }
8943 }
8944
8947 {
8948 EntityAI parent = GetHierarchyParent();
8949
8950 if (parent)
8951 {
8952 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8953 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8954 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8955 }
8956 }
8957
8959 {
8960
8961
8962
8963
8965
8967 {
8968 if (ScriptInputUserData.CanStoreInputUserData())
8969 {
8970 ScriptInputUserData ctx = new ScriptInputUserData;
8976 ctx.
Write(use_stack_max);
8979
8981 {
8982 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8983 }
8984 }
8985 }
8986 else if (!
GetGame().IsMultiplayer())
8987 {
8989 }
8990 }
8991
8993 {
8995 }
8996
8998 {
9000 }
9001
9003 {
9005 }
9006
9008 {
9009
9010 return false;
9011 }
9012
9014 {
9015 return false;
9016 }
9017
9021 {
9022 return false;
9023 }
9024
9026 {
9027 return "";
9028 }
9029
9031
9033 {
9034 return false;
9035 }
9036
9038 {
9039 return true;
9040 }
9041
9042
9043
9045 {
9046 return true;
9047 }
9048
9050 {
9051 return true;
9052 }
9053
9055 {
9056 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9058 }
9059
9061 {
9063 }
9064
9066 {
9068 if (!is_being_placed)
9070 SetSynchDirty();
9071 }
9072
9073
9075
9077 {
9079 }
9080
9082 {
9084 }
9085
9087 {
9088 return 1;
9089 }
9090
9092 {
9093 return false;
9094 }
9095
9097 {
9099 SetSynchDirty();
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
9131
9132
9133
9134
9135
9137 {
9138 super.OnMovedInsideCargo(container);
9139
9140 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9141 }
9142
9143 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9144 {
9145 super.EEItemLocationChanged(oldLoc,newLoc);
9146
9147 PlayerBase new_player = null;
9148 PlayerBase old_player = null;
9149
9150 if (newLoc.GetParent())
9151 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9152
9153 if (oldLoc.GetParent())
9154 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9155
9157 {
9158 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9159
9160 if (r_index >= 0)
9161 {
9162 InventoryLocation r_il = new InventoryLocation;
9163 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9164
9165 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9168 {
9169 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9170 }
9172 {
9173 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9174 }
9175
9176 }
9177 }
9178
9180 {
9181 if (new_player)
9182 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9183
9184 if (new_player == old_player)
9185 {
9186
9187 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9188 {
9190 {
9191 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9192 {
9193 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9194 }
9195 }
9196 else
9197 {
9198 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9199 }
9200 }
9201
9202 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9203 {
9204 int type = oldLoc.GetType();
9206 {
9207 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9208 }
9210 {
9211 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9212 }
9213 }
9214 if (!m_OldLocation)
9215 {
9216 m_OldLocation = new InventoryLocation;
9217 }
9218 m_OldLocation.Copy(oldLoc);
9219 }
9220 else
9221 {
9222 if (m_OldLocation)
9223 {
9224 m_OldLocation.Reset();
9225 }
9226 }
9227
9229 }
9230 else
9231 {
9232 if (new_player)
9233 {
9234 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9235 if (res_index >= 0)
9236 {
9237 InventoryLocation il = new InventoryLocation;
9238 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9240 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9243 {
9244 il.
GetParent().GetOnReleaseLock().Invoke(it);
9245 }
9247 {
9249 }
9250
9251 }
9252 }
9254 {
9255
9257 }
9258
9259 if (m_OldLocation)
9260 {
9261 m_OldLocation.Reset();
9262 }
9263 }
9264 }
9265
9266 override void EOnContact(IEntity other, Contact extra)
9267 {
9269 {
9270 int liquidType = -1;
9272 if (impactSpeed > 0.0)
9273 {
9275 #ifndef SERVER
9277 #else
9279 SetSynchDirty();
9280 #endif
9282 }
9283 }
9284
9285 #ifdef SERVER
9286 if (GetCompEM() && GetCompEM().IsPlugged())
9287 {
9288 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9289 GetCompEM().UnplugThis();
9290 }
9291 #endif
9292 }
9293
9295
9297 {
9299 }
9300
9302 {
9303
9304 }
9305
9307 {
9308 super.OnItemLocationChanged(old_owner, new_owner);
9309
9310 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9311 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9312
9313 if (!relatedPlayer && playerNew)
9314 relatedPlayer = playerNew;
9315
9316 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9317 {
9319 if (actionMgr)
9320 {
9321 ActionBase currentAction = actionMgr.GetRunningAction();
9322 if (currentAction)
9324 }
9325 }
9326
9327 Man ownerPlayerOld = null;
9328 Man ownerPlayerNew = null;
9329
9330 if (old_owner)
9331 {
9332 if (old_owner.
IsMan())
9333 {
9334 ownerPlayerOld = Man.Cast(old_owner);
9335 }
9336 else
9337 {
9338 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9339 }
9340 }
9341 else
9342 {
9344 {
9346
9347 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9348 {
9349 GetCompEM().UnplugThis();
9350 }
9351 }
9352 }
9353
9354 if (new_owner)
9355 {
9356 if (new_owner.
IsMan())
9357 {
9358 ownerPlayerNew = Man.Cast(new_owner);
9359 }
9360 else
9361 {
9362 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9363 }
9364 }
9365
9366 if (ownerPlayerOld != ownerPlayerNew)
9367 {
9368 if (ownerPlayerOld)
9369 {
9370 array<EntityAI> subItemsExit = new array<EntityAI>;
9372 for (int i = 0; i < subItemsExit.Count(); i++)
9373 {
9376 }
9377 }
9378
9379 if (ownerPlayerNew)
9380 {
9381 array<EntityAI> subItemsEnter = new array<EntityAI>;
9383 for (int j = 0; j < subItemsEnter.Count(); j++)
9384 {
9387 }
9388 }
9389 }
9390 else if (ownerPlayerNew != null)
9391 {
9392 PlayerBase nplayer;
9393 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9394 {
9395 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9397 for (int k = 0; k < subItemsUpdate.Count(); k++)
9398 {
9400 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9401 }
9402 }
9403 }
9404
9405 if (old_owner)
9406 old_owner.OnChildItemRemoved(this);
9407 if (new_owner)
9408 new_owner.OnChildItemReceived(this);
9409 }
9410
9411
9413 {
9414 super.EEDelete(parent);
9415 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9416 if (player)
9417 {
9419
9420 if (player.IsAlive())
9421 {
9422 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9423 if (r_index >= 0)
9424 {
9425 InventoryLocation r_il = new InventoryLocation;
9426 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9427
9428 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9431 {
9432 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9433 }
9435 {
9436 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9437 }
9438
9439 }
9440
9441 player.RemoveQuickBarEntityShortcut(this);
9442 }
9443 }
9444 }
9445
9447 {
9448 super.EEKilled(killer);
9449
9452 {
9453 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9454 {
9455 if (IsMagazine())
9456 {
9457 if (Magazine.Cast(this).GetAmmoCount() > 0)
9458 {
9460 }
9461 }
9462 else
9463 {
9465 }
9466 }
9467 }
9468 }
9469
9471 {
9472 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9473
9474 super.OnWasAttached(parent, slot_id);
9475
9478
9480 }
9481
9483 {
9484 super.OnWasDetached(parent, slot_id);
9485
9488 }
9489
9491 {
9492 int idx;
9495
9496 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9497 if (inventory_slots.Count() < 1)
9498 {
9499 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9500 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9501 }
9502 else
9503 {
9504 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9505 }
9506
9507 idx = inventory_slots.Find(slot);
9508 if (idx < 0)
9509 return "";
9510
9511 return attach_types.Get(idx);
9512 }
9513
9515 {
9516 int idx = -1;
9517 string slot;
9518
9521
9522 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9523 if (inventory_slots.Count() < 1)
9524 {
9525 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9526 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9527 }
9528 else
9529 {
9530 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9531 if (detach_types.Count() < 1)
9532 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9533 }
9534
9535 for (int i = 0; i < inventory_slots.Count(); i++)
9536 {
9537 slot = inventory_slots.Get(i);
9538 }
9539
9540 if (slot != "")
9541 {
9542 if (detach_types.Count() == 1)
9543 idx = 0;
9544 else
9545 idx = inventory_slots.Find(slot);
9546 }
9547 if (idx < 0)
9548 return "";
9549
9550 return detach_types.Get(idx);
9551 }
9552
9554 {
9555
9557
9558
9559 float min_time = 1;
9560 float max_time = 3;
9561 float delay = Math.RandomFloat(min_time, max_time);
9562
9563 explode_timer.Run(delay, this, "DoAmmoExplosion");
9564 }
9565
9567 {
9568 Magazine magazine = Magazine.Cast(this);
9569 int pop_sounds_count = 6;
9570 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9571
9572
9573 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9574 string sound_name = pop_sounds[ sound_idx ];
9576
9577
9578 magazine.ServerAddAmmoCount(-1);
9579
9580
9581 float min_temp_to_explode = 100;
9582
9583 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9584 {
9586 }
9587 }
9588
9589
9590 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9591 {
9592 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9593
9594 const int CHANCE_DAMAGE_CARGO = 4;
9595 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9596 const int CHANCE_DAMAGE_NOTHING = 2;
9597
9599 {
9600 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9601 int chances;
9602 int rnd;
9603
9604 if (GetInventory().GetCargo())
9605 {
9606 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9607 rnd = Math.RandomInt(0,chances);
9608
9609 if (rnd < CHANCE_DAMAGE_CARGO)
9610 {
9612 }
9613 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9614 {
9616 }
9617 }
9618 else
9619 {
9620 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9621 rnd = Math.RandomInt(0,chances);
9622
9623 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9624 {
9626 }
9627 }
9628 }
9629 }
9630
9632 {
9633 if (GetInventory().GetCargo())
9634 {
9635 int item_count = GetInventory().GetCargo().GetItemCount();
9636 if (item_count > 0)
9637 {
9638 int random_pick = Math.RandomInt(0, item_count);
9640 if (!item.IsExplosive())
9641 {
9642 item.AddHealth("","",damage);
9643 return true;
9644 }
9645 }
9646 }
9647 return false;
9648 }
9649
9651 {
9652 int attachment_count = GetInventory().AttachmentCount();
9653 if (attachment_count > 0)
9654 {
9655 int random_pick = Math.RandomInt(0, attachment_count);
9656 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9657 if (!attachment.IsExplosive())
9658 {
9659 attachment.AddHealth("","",damage);
9660 return true;
9661 }
9662 }
9663 return false;
9664 }
9665
9667 {
9669 }
9670
9672 {
9674 return GetInventory().CanRemoveEntity();
9675
9676 return false;
9677 }
9678
9680 {
9682 return;
9683
9685 {
9686 if (ScriptInputUserData.CanStoreInputUserData())
9687 {
9688 ScriptInputUserData ctx = new ScriptInputUserData;
9693 ctx.
Write(destination_entity);
9697 }
9698 }
9699 else if (!
GetGame().IsMultiplayer())
9700 {
9702 }
9703 }
9704
9706 {
9708 return;
9709
9710 float split_quantity_new;
9714 InventoryLocation loc = new InventoryLocation;
9715
9716 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9717 {
9719 split_quantity_new = stack_max;
9720 else
9722
9723 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9724 if (new_item)
9725 {
9726 new_item.SetResultOfSplit(true);
9727 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9729 new_item.SetQuantity(split_quantity_new);
9730 }
9731 }
9732 else if (destination_entity && slot_id == -1)
9733 {
9734 if (quantity > stack_max)
9735 split_quantity_new = stack_max;
9736 else
9737 split_quantity_new = quantity;
9738
9740 {
9743 }
9744
9745 if (new_item)
9746 {
9747 new_item.SetResultOfSplit(true);
9748 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9750 new_item.SetQuantity(split_quantity_new);
9751 }
9752 }
9753 else
9754 {
9755 if (stack_max != 0)
9756 {
9758 {
9760 }
9761
9762 if (split_quantity_new == 0)
9763 {
9764 if (!
GetGame().IsMultiplayer())
9765 player.PhysicalPredictiveDropItem(this);
9766 else
9767 player.ServerDropEntity(this);
9768 return;
9769 }
9770
9772
9773 if (new_item)
9774 {
9775 new_item.SetResultOfSplit(true);
9776 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9778 new_item.SetQuantity(stack_max);
9779 new_item.PlaceOnSurface();
9780 }
9781 }
9782 }
9783 }
9784
9786 {
9788 return;
9789
9790 float split_quantity_new;
9794 InventoryLocation loc = new InventoryLocation;
9795
9796 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9797 {
9799 split_quantity_new = stack_max;
9800 else
9802
9803 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9804 if (new_item)
9805 {
9806 new_item.SetResultOfSplit(true);
9807 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9809 new_item.SetQuantity(split_quantity_new);
9810 }
9811 }
9812 else if (destination_entity && slot_id == -1)
9813 {
9814 if (quantity > stack_max)
9815 split_quantity_new = stack_max;
9816 else
9817 split_quantity_new = quantity;
9818
9820 {
9823 }
9824
9825 if (new_item)
9826 {
9827 new_item.SetResultOfSplit(true);
9828 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9830 new_item.SetQuantity(split_quantity_new);
9831 }
9832 }
9833 else
9834 {
9835 if (stack_max != 0)
9836 {
9838 {
9840 }
9841
9843
9844 if (new_item)
9845 {
9846 new_item.SetResultOfSplit(true);
9847 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9849 new_item.SetQuantity(stack_max);
9850 new_item.PlaceOnSurface();
9851 }
9852 }
9853 }
9854 }
9855
9857 {
9859 return;
9860
9862 {
9863 if (ScriptInputUserData.CanStoreInputUserData())
9864 {
9865 ScriptInputUserData ctx = new ScriptInputUserData;
9870 dst.WriteToContext(ctx);
9872 }
9873 }
9874 else if (!
GetGame().IsMultiplayer())
9875 {
9877 }
9878 }
9879
9881 {
9883 return;
9884
9886 {
9887 if (ScriptInputUserData.CanStoreInputUserData())
9888 {
9889 ScriptInputUserData ctx = new ScriptInputUserData;
9894 ctx.
Write(destination_entity);
9900 }
9901 }
9902 else if (!
GetGame().IsMultiplayer())
9903 {
9905 }
9906 }
9907
9909 {
9911 }
9912
9914 {
9916 return this;
9917
9919 float split_quantity_new;
9921 if (dst.IsValid())
9922 {
9923 int slot_id = dst.GetSlot();
9925
9926 if (quantity > stack_max)
9927 split_quantity_new = stack_max;
9928 else
9929 split_quantity_new = quantity;
9930
9932
9933 if (new_item)
9934 {
9935 new_item.SetResultOfSplit(true);
9936 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9939 }
9940
9941 return new_item;
9942 }
9943
9944 return null;
9945 }
9946
9948 {
9950 return;
9951
9953 float split_quantity_new;
9955 if (destination_entity)
9956 {
9958 if (quantity > stackable)
9959 split_quantity_new = stackable;
9960 else
9961 split_quantity_new = quantity;
9962
9963 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9964 if (new_item)
9965 {
9966 new_item.SetResultOfSplit(true);
9967 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9969 new_item.SetQuantity(split_quantity_new);
9970 }
9971 }
9972 }
9973
9975 {
9977 return;
9978
9980 {
9981 if (ScriptInputUserData.CanStoreInputUserData())
9982 {
9983 ScriptInputUserData ctx = new ScriptInputUserData;
9988 ItemBase destination_entity =
this;
9989 ctx.
Write(destination_entity);
9993 }
9994 }
9995 else if (!
GetGame().IsMultiplayer())
9996 {
9998 }
9999 }
10000
10002 {
10004 return;
10005
10007 float split_quantity_new;
10009 if (player)
10010 {
10012 if (quantity > stackable)
10013 split_quantity_new = stackable;
10014 else
10015 split_quantity_new = quantity;
10016
10017 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10018 new_item =
ItemBase.Cast(in_hands);
10019 if (new_item)
10020 {
10021 new_item.SetResultOfSplit(true);
10022 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10024 new_item.SetQuantity(split_quantity_new);
10025 }
10026 }
10027 }
10028
10030 {
10032 return;
10033
10035 float split_quantity_new = Math.Floor(quantity * 0.5);
10036
10038
10039 if (new_item)
10040 {
10041 if (new_item.GetQuantityMax() < split_quantity_new)
10042 {
10043 split_quantity_new = new_item.GetQuantityMax();
10044 }
10045
10046 new_item.SetResultOfSplit(true);
10047 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10048
10050 {
10053 }
10054 else
10055 {
10058 }
10059 }
10060 }
10061
10063 {
10065 return;
10066
10068 float split_quantity_new = Math.Floor(quantity / 2);
10069
10070 InventoryLocation invloc = new InventoryLocation;
10072
10074 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10075
10076 if (new_item)
10077 {
10078 if (new_item.GetQuantityMax() < split_quantity_new)
10079 {
10080 split_quantity_new = new_item.GetQuantityMax();
10081 }
10083 {
10086 }
10087 else
10088 {
10091 }
10092 }
10093 }
10094
10097 {
10098 SetWeightDirty();
10100
10101 if (parent)
10102 parent.OnAttachmentQuantityChangedEx(this, delta);
10103
10105 {
10107 {
10109 }
10111 {
10112 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10114 }
10115 }
10116
10117 }
10118
10121 {
10122
10123 }
10124
10127 {
10129 }
10130
10132 {
10133 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10134
10136 {
10137 if (newLevel == GameConstants.STATE_RUINED)
10138 {
10140 EntityAI parent = GetHierarchyParent();
10141 if (parent && parent.IsFireplace())
10142 {
10143 CargoBase cargo = GetInventory().GetCargo();
10144 if (cargo)
10145 {
10147 {
10149 }
10150 }
10151 }
10152 }
10153
10155 {
10156
10158 return;
10159 }
10160
10161 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10162 {
10164 }
10165 }
10166 }
10167
10168
10170 {
10171 super.OnRightClick();
10172
10174 {
10176 {
10177 if (ScriptInputUserData.CanStoreInputUserData())
10178 {
10179 vector m4[4];
10181
10182 EntityAI root = GetHierarchyRoot();
10183
10184 InventoryLocation dst = new InventoryLocation;
10186 {
10187 if (root)
10188 {
10189 root.GetTransform(m4);
10191 }
10192 else
10193 GetInventory().GetCurrentInventoryLocation(dst);
10194 }
10195 else
10196 {
10198
10199
10200 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10201 {
10202 if (root)
10203 {
10204 root.GetTransform(m4);
10206 }
10207 else
10208 GetInventory().GetCurrentInventoryLocation(dst);
10209 }
10210 else
10211 {
10212 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10213 }
10214 }
10215
10216 ScriptInputUserData ctx = new ScriptInputUserData;
10224 }
10225 }
10226 else if (!
GetGame().IsMultiplayer())
10227 {
10229 }
10230 }
10231 }
10232
10233 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10234 {
10235
10236 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10237 return false;
10238
10239 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10240 return false;
10241
10242
10244 return false;
10245
10246
10247 Magazine mag = Magazine.Cast(this);
10248 if (mag)
10249 {
10250 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10251 return false;
10252
10253 if (stack_max_limit)
10254 {
10255 Magazine other_mag = Magazine.Cast(other_item);
10256 if (other_item)
10257 {
10258 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10259 return false;
10260 }
10261
10262 }
10263 }
10264 else
10265 {
10266
10268 return false;
10269
10271 return false;
10272 }
10273
10274 PlayerBase player = null;
10275 if (CastTo(player, GetHierarchyRootPlayer()))
10276 {
10277 if (player.GetInventory().HasAttachment(this))
10278 return false;
10279
10280 if (player.IsItemsToDelete())
10281 return false;
10282 }
10283
10284 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10285 return false;
10286
10287 int slotID;
10289 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10290 return false;
10291
10292 return true;
10293 }
10294
10296 {
10298 }
10299
10301 {
10302 return m_IsResultOfSplit;
10303 }
10304
10306 {
10307 m_IsResultOfSplit = value;
10308 }
10309
10311 {
10313 }
10314
10316 {
10317 float other_item_quantity = other_item.GetQuantity();
10318 float this_free_space;
10319
10321
10323
10324 if (other_item_quantity > this_free_space)
10325 {
10326 return this_free_space;
10327 }
10328 else
10329 {
10330 return other_item_quantity;
10331 }
10332 }
10333
10335 {
10337 }
10338
10340 {
10342 return;
10343
10344 if (!IsMagazine() && other_item)
10345 {
10347 if (quantity_used != 0)
10348 {
10349 float hp1 = GetHealth01("","");
10350 float hp2 = other_item.GetHealth01("","");
10351 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10352 hpResult = hpResult / (
GetQuantity() + quantity_used);
10353
10354 hpResult *= GetMaxHealth();
10355 Math.Round(hpResult);
10356 SetHealth("", "Health", hpResult);
10357
10359 other_item.AddQuantity(-quantity_used);
10360 }
10361 }
10363 }
10364
10366 {
10367 #ifdef SERVER
10368 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10369 GetHierarchyParent().IncreaseLifetimeUp();
10370 #endif
10371 };
10372
10374 {
10375 PlayerBase p = PlayerBase.Cast(player);
10376
10377 array<int> recipesIds = p.m_Recipes;
10378 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10379 if (moduleRecipesManager)
10380 {
10381 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10382 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10383 }
10384
10385 for (int i = 0;i < recipesIds.Count(); i++)
10386 {
10387 int key = recipesIds.Get(i);
10388 string recipeName = moduleRecipesManager.GetRecipeName(key);
10390 }
10391 }
10392
10393
10394 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10395 {
10396 super.GetDebugActions(outputList);
10397
10398
10403
10404
10408
10412
10413
10416
10417
10419 {
10422 }
10423
10425
10428
10432 }
10433
10434
10435
10436
10438 {
10439 super.OnAction(action_id, player, ctx);
10440 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10441 {
10442 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10443 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10444 PlayerBase p = PlayerBase.Cast(player);
10445 if (
EActions.RECIPES_RANGE_START < 1000)
10446 {
10447 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10448 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10449 }
10450 }
10451 #ifndef SERVER
10452 else if (action_id ==
EActions.WATCH_PLAYER)
10453 {
10454 PluginDeveloper.SetDeveloperItemClientEx(player);
10455 }
10456 #endif
10458 {
10459 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10460 {
10461 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10462 OnDebugButtonPressServer(id + 1);
10463 }
10464
10465 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10466 {
10467 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10469 }
10470
10471 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10472 {
10473 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10475 }
10476
10477 else if (action_id ==
EActions.ADD_QUANTITY)
10478 {
10479 if (IsMagazine())
10480 {
10481 Magazine mag = Magazine.Cast(this);
10482 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10483 }
10484 else
10485 {
10487 }
10488
10489 if (m_EM)
10490 {
10491 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10492 }
10493
10494 }
10495
10496 else if (action_id ==
EActions.REMOVE_QUANTITY)
10497 {
10498 if (IsMagazine())
10499 {
10500 Magazine mag2 = Magazine.Cast(this);
10501 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10502 }
10503 else
10504 {
10506 }
10507 if (m_EM)
10508 {
10509 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10510 }
10511
10512 }
10513
10514 else if (action_id ==
EActions.SET_QUANTITY_0)
10515 {
10517
10518 if (m_EM)
10519 {
10520 m_EM.SetEnergy(0);
10521 }
10522 }
10523
10524 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10525 {
10527
10528 if (m_EM)
10529 {
10530 m_EM.SetEnergy(m_EM.GetEnergyMax());
10531 }
10532 }
10533
10534 else if (action_id ==
EActions.ADD_HEALTH)
10535 {
10536 AddHealth("","",GetMaxHealth("","Health")/5);
10537 }
10538 else if (action_id ==
EActions.REMOVE_HEALTH)
10539 {
10540 AddHealth("","",-GetMaxHealth("","Health")/5);
10541 }
10542 else if (action_id ==
EActions.DESTROY_HEALTH)
10543 {
10544 SetHealth01("","",0);
10545 }
10546 else if (action_id ==
EActions.WATCH_ITEM)
10547 {
10549 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10550 #ifdef DEVELOPER
10551 SetDebugDeveloper_item(this);
10552 #endif
10553 }
10554
10555 else if (action_id ==
EActions.ADD_TEMPERATURE)
10556 {
10557 AddTemperature(20);
10558
10559 }
10560
10561 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10562 {
10563 AddTemperature(-20);
10564
10565 }
10566
10567 else if (action_id ==
EActions.FLIP_FROZEN)
10568 {
10569 SetFrozen(!GetIsFrozen());
10570
10571 }
10572
10573 else if (action_id ==
EActions.ADD_WETNESS)
10574 {
10576
10577 }
10578
10579 else if (action_id ==
EActions.REMOVE_WETNESS)
10580 {
10582
10583 }
10584
10585 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10586 {
10589
10590
10591 }
10592
10593 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10594 {
10597 }
10598
10599 else if (action_id ==
EActions.MAKE_SPECIAL)
10600 {
10601 auto debugParams = DebugSpawnParams.WithPlayer(player);
10602 OnDebugSpawnEx(debugParams);
10603 }
10604
10605 else if (action_id ==
EActions.DELETE)
10606 {
10607 Delete();
10608 }
10609
10610 }
10611
10612
10613 return false;
10614 }
10615
10616
10617
10618
10622
10625
10626
10627
10629 {
10630 return false;
10631 }
10632
10633
10635 {
10636 return true;
10637 }
10638
10639
10641 {
10642 return true;
10643 }
10644
10645
10646
10648 {
10649 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10651 }
10652
10655 {
10656 return null;
10657 }
10658
10660 {
10661 return false;
10662 }
10663
10665 {
10666 return false;
10667 }
10668
10672
10673
10675 {
10676 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10677 return module_repairing.CanRepair(this, item_repair_kit);
10678 }
10679
10680
10681 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10682 {
10683 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10684 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10685 }
10686
10687
10689 {
10690
10691
10692
10693
10694
10695
10696
10697
10698 return 1;
10699 }
10700
10701
10702
10704 {
10706 }
10707
10708
10709
10711 {
10713 }
10714
10715
10724 {
10725 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10726
10727 if (player)
10728 {
10729 player.MessageStatus(text);
10730 }
10731 }
10732
10733
10742 {
10743 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10744
10745 if (player)
10746 {
10747 player.MessageAction(text);
10748 }
10749 }
10750
10751
10760 {
10761 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10762
10763 if (player)
10764 {
10765 player.MessageFriendly(text);
10766 }
10767 }
10768
10769
10778 {
10779 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10780
10781 if (player)
10782 {
10783 player.MessageImportant(text);
10784 }
10785 }
10786
10788 {
10789 return true;
10790 }
10791
10792
10793 override bool KindOf(
string tag)
10794 {
10795 bool found = false;
10796 string item_name = this.
GetType();
10799
10800 int array_size = item_tag_array.Count();
10801 for (int i = 0; i < array_size; i++)
10802 {
10803 if (item_tag_array.Get(i) == tag)
10804 {
10805 found = true;
10806 break;
10807 }
10808 }
10809 return found;
10810 }
10811
10812
10814 {
10815
10816 super.OnRPC(sender, rpc_type,ctx);
10817
10818
10819 switch (rpc_type)
10820 {
10821 #ifndef SERVER
10822 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10823 Param2<bool, string> p = new Param2<bool, string>(false, "");
10824
10826 return;
10827
10828 bool play = p.param1;
10829 string soundSet = p.param2;
10830
10831 if (play)
10832 {
10834 {
10836 {
10838 }
10839 }
10840 else
10841 {
10843 }
10844 }
10845 else
10846 {
10848 }
10849
10850 break;
10851 #endif
10852
10853 }
10854
10856 {
10858 }
10859 }
10860
10861
10862
10863
10865 {
10866 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10867 return plugin.GetID(
name);
10868 }
10869
10871 {
10872 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10873 return plugin.GetName(id);
10874 }
10875
10878 {
10879
10880
10881 int varFlags;
10882 if (!ctx.
Read(varFlags))
10883 return;
10884
10885 if (varFlags & ItemVariableFlags.FLOAT)
10886 {
10888 }
10889 }
10890
10892 {
10893
10894 super.SerializeNumericalVars(floats_out);
10895
10896
10897
10899 {
10901 }
10902
10904 {
10906 }
10907
10909 {
10911 }
10912
10914 {
10919 }
10920
10922 {
10924 }
10925 }
10926
10928 {
10929
10930 super.DeSerializeNumericalVars(floats);
10931
10932
10933 int index = 0;
10934 int mask = Math.Round(floats.Get(index));
10935
10936 index++;
10937
10939 {
10941 {
10943 }
10944 else
10945 {
10946 float quantity = floats.Get(index);
10947 SetQuantity(quantity,
true,
false,
false,
false);
10948 }
10949 index++;
10950 }
10951
10953 {
10954 float wet = floats.Get(index);
10956 index++;
10957 }
10958
10960 {
10961 int liquidtype = Math.Round(floats.Get(index));
10963 index++;
10964 }
10965
10967 {
10969 index++;
10971 index++;
10973 index++;
10975 index++;
10976 }
10977
10979 {
10980 int cleanness = Math.Round(floats.Get(index));
10982 index++;
10983 }
10984 }
10985
10987 {
10988 super.WriteVarsToCTX(ctx);
10989
10990
10992 {
10994 }
10995
10997 {
10999 }
11000
11002 {
11004 }
11005
11007 {
11008 int r,g,b,a;
11014 }
11015
11017 {
11019 }
11020 }
11021
11023 {
11024 if (!super.ReadVarsFromCTX(ctx,version))
11025 return false;
11026
11027 int intValue;
11028 float value;
11029
11030 if (version < 140)
11031 {
11032 if (!ctx.
Read(intValue))
11033 return false;
11034
11035 m_VariablesMask = intValue;
11036 }
11037
11039 {
11040 if (!ctx.
Read(value))
11041 return false;
11042
11044 {
11046 }
11047 else
11048 {
11050 }
11051 }
11052
11053 if (version < 140)
11054 {
11056 {
11057 if (!ctx.
Read(value))
11058 return false;
11059 SetTemperatureDirect(value);
11060 }
11061 }
11062
11064 {
11065 if (!ctx.
Read(value))
11066 return false;
11068 }
11069
11071 {
11072 if (!ctx.
Read(intValue))
11073 return false;
11075 }
11076
11078 {
11079 int r,g,b,a;
11081 return false;
11083 return false;
11085 return false;
11087 return false;
11088
11090 }
11091
11093 {
11094 if (!ctx.
Read(intValue))
11095 return false;
11097 }
11098
11099 if (version >= 138 && version < 140)
11100 {
11102 {
11103 if (!ctx.
Read(intValue))
11104 return false;
11105 SetFrozen(intValue);
11106 }
11107 }
11108
11109 return true;
11110 }
11111
11112
11114 {
11117 {
11119 }
11120
11121 if (!super.OnStoreLoad(ctx, version))
11122 {
11124 return false;
11125 }
11126
11127 if (version >= 114)
11128 {
11129 bool hasQuickBarIndexSaved;
11130
11131 if (!ctx.
Read(hasQuickBarIndexSaved))
11132 {
11134 return false;
11135 }
11136
11137 if (hasQuickBarIndexSaved)
11138 {
11139 int itmQBIndex;
11140
11141
11142 if (!ctx.
Read(itmQBIndex))
11143 {
11145 return false;
11146 }
11147
11148 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11149 if (itmQBIndex != -1 && parentPlayer)
11150 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11151 }
11152 }
11153 else
11154 {
11155
11156 PlayerBase player;
11157 int itemQBIndex;
11158 if (version ==
int.
MAX)
11159 {
11160 if (!ctx.
Read(itemQBIndex))
11161 {
11163 return false;
11164 }
11165 }
11166 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11167 {
11168
11169 if (!ctx.
Read(itemQBIndex))
11170 {
11172 return false;
11173 }
11174 if (itemQBIndex != -1 && player)
11175 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11176 }
11177 }
11178
11179 if (version < 140)
11180 {
11181
11182 if (!LoadVariables(ctx, version))
11183 {
11185 return false;
11186 }
11187 }
11188
11189
11191 {
11193 return false;
11194 }
11195 if (version >= 132)
11196 {
11198 if (raib)
11199 {
11201 {
11203 return false;
11204 }
11205 }
11206 }
11207
11209 return true;
11210 }
11211
11212
11213
11215 {
11216 super.OnStoreSave(ctx);
11217
11218 PlayerBase player;
11219 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11220 {
11222
11223 int itemQBIndex = -1;
11224 itemQBIndex = player.FindQuickBarEntityIndex(this);
11225 ctx.
Write(itemQBIndex);
11226 }
11227 else
11228 {
11230 }
11231
11233
11235 if (raib)
11236 {
11238 }
11239 }
11240
11241
11243 {
11244 super.AfterStoreLoad();
11245
11247 {
11249 }
11250
11252 {
11255 }
11256 }
11257
11259 {
11260 super.EEOnAfterLoad();
11261
11263 {
11265 }
11266
11269 }
11270
11272 {
11273 return false;
11274 }
11275
11276
11277
11279 {
11281 {
11282 #ifdef PLATFORM_CONSOLE
11283
11285 {
11287 if (menu)
11288 {
11290 }
11291 }
11292 #endif
11293 }
11294
11296 {
11299 }
11300
11302 {
11303 SetWeightDirty();
11305 }
11307 {
11310 }
11311
11313 {
11316 }
11318 {
11321 }
11322
11323 super.OnVariablesSynchronized();
11324 }
11325
11326
11327
11329 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11330 {
11331 if (!IsServerCheck(allow_client))
11332 return false;
11333
11335 return false;
11336
11339
11340 if (value <= (min + 0.001))
11341 value = min;
11342
11343 if (value == min)
11344 {
11345 if (destroy_config)
11346 {
11347 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11348 if (dstr)
11349 {
11351 this.Delete();
11352 return true;
11353 }
11354 }
11355 else if (destroy_forced)
11356 {
11358 this.Delete();
11359 return true;
11360 }
11361
11363 }
11364
11367
11369 {
11371
11372 if (delta)
11374 }
11375
11377
11378 return false;
11379 }
11380
11381
11383 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11384 {
11386 }
11387
11389 {
11392 }
11393
11395 {
11398 }
11399
11402 {
11403 float value_clamped = Math.Clamp(value, 0, 1);
11405 SetQuantity(result, destroy_config, destroy_forced);
11406 }
11407
11408
11411 {
11413 }
11414
11416 {
11418 }
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11430 {
11431 int slot = -1;
11432 if (GetInventory())
11433 {
11434 InventoryLocation il = new InventoryLocation;
11435 GetInventory().GetCurrentInventoryLocation(il);
11437 }
11438
11440 }
11441
11443 {
11444 float quantity_max = 0;
11445
11447 {
11448 if (attSlotID != -1)
11449 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11450
11451 if (quantity_max <= 0)
11453 }
11454
11455 if (quantity_max <= 0)
11457
11458 return quantity_max;
11459 }
11460
11462 {
11464 }
11465
11467 {
11469 }
11470
11471
11473 {
11475 }
11476
11478 {
11480 }
11481
11483 {
11485 }
11486
11487
11489 {
11490
11491 float weightEx = GetWeightEx();
11492 float special = GetInventoryAndCargoWeight();
11493 return weightEx - special;
11494 }
11495
11496
11498 {
11500 }
11501
11503 {
11505 {
11506 #ifdef DEVELOPER
11507 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11508 {
11509 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11511 }
11512 #endif
11513
11514 return GetQuantity() * GetConfigWeightModified();
11515 }
11516 else if (HasEnergyManager())
11517 {
11518 #ifdef DEVELOPER
11519 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11520 {
11521 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11522 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11523 }
11524 #endif
11525 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11526 }
11527 else
11528 {
11529 #ifdef DEVELOPER
11530 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11531 {
11532 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11533 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11534 }
11535 #endif
11536 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11537 }
11538 }
11539
11542 {
11543 int item_count = 0;
11545
11546 if (GetInventory().GetCargo() != NULL)
11547 {
11548 item_count = GetInventory().GetCargo().GetItemCount();
11549 }
11550
11551 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11552 {
11553 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11554 if (item)
11555 item_count += item.GetNumberOfItems();
11556 }
11557 return item_count;
11558 }
11559
11562 {
11563 float weight = 0;
11564 float wetness = 1;
11565 if (include_wetness)
11568 {
11569 weight = wetness * m_ConfigWeight;
11570 }
11572 {
11573 weight = 1;
11574 }
11575 return weight;
11576 }
11577
11578
11579
11581 {
11582 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11583 {
11584 GameInventory inv = GetInventory();
11585 array<EntityAI> items = new array<EntityAI>;
11587 for (int i = 0; i < items.Count(); i++)
11588 {
11590 if (item)
11591 {
11593 }
11594 }
11595 }
11596 }
11597
11598
11599
11600
11602 {
11603 float energy = 0;
11604 if (HasEnergyManager())
11605 {
11606 energy = GetCompEM().GetEnergy();
11607 }
11608 return energy;
11609 }
11610
11611
11613 {
11614 super.OnEnergyConsumed();
11615
11617 }
11618
11620 {
11621 super.OnEnergyAdded();
11622
11624 }
11625
11626
11628 {
11629 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11630 {
11632 {
11633 float energy_0to1 = GetCompEM().GetEnergy0To1();
11635 }
11636 }
11637 }
11638
11639
11641 {
11642 return ConfigGetFloat("heatIsolation");
11643 }
11644
11646 {
11648 }
11649
11651 {
11652 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11653 if (
GetGame().ConfigIsExisting(paramPath))
11655
11656 return 0.0;
11657 }
11658
11660 {
11661 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11662 if (
GetGame().ConfigIsExisting(paramPath))
11664
11665 return 0.0;
11666 }
11667
11668 override void SetWet(
float value,
bool allow_client =
false)
11669 {
11670 if (!IsServerCheck(allow_client))
11671 return;
11672
11675
11677
11678 m_VarWet = Math.Clamp(value, min, max);
11679
11681 {
11684 }
11685 }
11686
11687 override void AddWet(
float value)
11688 {
11690 }
11691
11693 {
11695 }
11696
11698 {
11700 }
11701
11703 {
11705 }
11706
11708 {
11710 }
11711
11713 {
11715 }
11716
11717 override void OnWetChanged(
float newVal,
float oldVal)
11718 {
11721 if (newLevel != oldLevel)
11722 {
11724 }
11725 }
11726
11728 {
11729 SetWeightDirty();
11730 }
11731
11733 {
11734 return GetWetLevelInternal(
m_VarWet);
11735 }
11736
11737
11738
11740 {
11742 }
11743
11745 {
11747 }
11748
11750 {
11752 }
11753
11755 {
11757 }
11758
11759
11760
11762 {
11763 if (ConfigIsExisting("itemModelLength"))
11764 {
11765 return ConfigGetFloat("itemModelLength");
11766 }
11767 return 0;
11768 }
11769
11771 {
11772 if (ConfigIsExisting("itemAttachOffset"))
11773 {
11774 return ConfigGetFloat("itemAttachOffset");
11775 }
11776 return 0;
11777 }
11778
11779 override void SetCleanness(
int value,
bool allow_client =
false)
11780 {
11781 if (!IsServerCheck(allow_client))
11782 return;
11783
11785
11787
11790 }
11791
11793 {
11795 }
11796
11798 {
11799 return true;
11800 }
11801
11802
11803
11804
11806 {
11808 }
11809
11811 {
11813 }
11814
11815
11816
11817
11818 override void SetColor(
int r,
int g,
int b,
int a)
11819 {
11825 }
11827 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11828 {
11833 }
11834
11836 {
11838 }
11839
11842 {
11843 int r,g,b,a;
11845 r = r/255;
11846 g = g/255;
11847 b = b/255;
11848 a = a/255;
11849 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11850 }
11851
11852
11853
11854 override void SetLiquidType(
int value,
bool allow_client =
false)
11855 {
11856 if (!IsServerCheck(allow_client))
11857 return;
11858
11863 }
11864
11866 {
11867 return ConfigGetInt("varLiquidTypeInit");
11868 }
11869
11871 {
11873 }
11874
11876 {
11878 SetFrozen(false);
11879 }
11880
11883 {
11884 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11885 }
11886
11887
11890 {
11891 PlayerBase nplayer;
11892 if (PlayerBase.CastTo(nplayer, player))
11893 {
11895
11896 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11897 }
11898 }
11899
11900
11903 {
11904 PlayerBase nplayer;
11905 if (PlayerBase.CastTo(nplayer,player))
11906 {
11907
11908 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11909
11910 }
11911
11912
11913 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11914
11915
11916 if (HasEnergyManager())
11917 {
11918 GetCompEM().UpdatePlugState();
11919 }
11920 }
11921
11922
11924 {
11925 super.OnPlacementStarted(player);
11926
11928 }
11929
11930 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11931 {
11933 {
11934 m_AdminLog.OnPlacementComplete(player,
this);
11935 }
11936
11937 super.OnPlacementComplete(player, position, orientation);
11938 }
11939
11940
11941
11942
11943
11945 {
11947 {
11948 return true;
11949 }
11950 else
11951 {
11952 return false;
11953 }
11954 }
11955
11956
11958 {
11960 {
11962 }
11963 }
11964
11965
11967 {
11969 }
11970
11972 {
11974 }
11975
11976 override void InsertAgent(
int agent,
float count = 1)
11977 {
11978 if (count < 1)
11979 return;
11980
11982 }
11983
11986 {
11988 }
11989
11990
11992 {
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
12032
12033
12034
12035
12036
12038 {
12040 return false;
12041 return true;
12042 }
12043
12045 {
12046
12048 }
12049
12050
12053 {
12054 super.CheckForRoofLimited(timeTresholdMS);
12055
12057 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12058 {
12059 m_PreviousRoofTestTime = time;
12060 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12061 }
12062 }
12063
12064
12066 {
12068 {
12069 return 0;
12070 }
12071
12072 if (GetInventory().GetAttachmentSlotsCount() != 0)
12073 {
12074 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12075 if (filter)
12076 return filter.GetProtectionLevel(type, false, system);
12077 else
12078 return 0;
12079 }
12080
12081 string subclassPath, entryName;
12082
12083 switch (type)
12084 {
12086 entryName = "biological";
12087 break;
12089 entryName = "chemical";
12090 break;
12091 default:
12092 entryName = "biological";
12093 break;
12094 }
12095
12096 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12097
12099 }
12100
12101
12102
12105 {
12106 if (!IsMagazine())
12108
12110 }
12111
12112
12113
12114
12115
12120 {
12121 return true;
12122 }
12123
12125 {
12127 }
12128
12129
12130
12131
12132
12134 {
12135 if (parent)
12136 {
12137 if (parent.IsInherited(DayZInfected))
12138 return true;
12139
12140 if (!parent.IsRuined())
12141 return true;
12142 }
12143
12144 return true;
12145 }
12146
12148 {
12149 if (!super.CanPutAsAttachment(parent))
12150 {
12151 return false;
12152 }
12153
12154 if (!IsRuined() && !parent.IsRuined())
12155 {
12156 return true;
12157 }
12158
12159 return false;
12160 }
12161
12163 {
12164
12165
12166
12167
12168 return super.CanReceiveItemIntoCargo(item);
12169 }
12170
12172 {
12173
12174
12175
12176
12177 GameInventory attachmentInv = attachment.GetInventory();
12179 {
12180 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12181 return false;
12182 }
12183
12184 InventoryLocation loc = new InventoryLocation();
12185 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12186 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12187 return false;
12188
12189 return super.CanReceiveAttachment(attachment, slotId);
12190 }
12191
12193 {
12194 if (!super.CanReleaseAttachment(attachment))
12195 return false;
12196
12197 return GetInventory().AreChildrenAccessible();
12198 }
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12221 {
12222 int id = muzzle_owner.GetMuzzleID();
12223 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12224
12225 if (WPOF_array)
12226 {
12227 for (int i = 0; i < WPOF_array.Count(); i++)
12228 {
12229 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12230
12231 if (WPOF)
12232 {
12233 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12234 }
12235 }
12236 }
12237 }
12238
12239
12241 {
12242 int id = muzzle_owner.GetMuzzleID();
12244
12245 if (WPOBE_array)
12246 {
12247 for (int i = 0; i < WPOBE_array.Count(); i++)
12248 {
12249 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12250
12251 if (WPOBE)
12252 {
12253 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12254 }
12255 }
12256 }
12257 }
12258
12259
12261 {
12262 int id = muzzle_owner.GetMuzzleID();
12263 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12264
12265 if (WPOOH_array)
12266 {
12267 for (int i = 0; i < WPOOH_array.Count(); i++)
12268 {
12269 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12270
12271 if (WPOOH)
12272 {
12273 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12274 }
12275 }
12276 }
12277 }
12278
12279
12281 {
12282 int id = muzzle_owner.GetMuzzleID();
12283 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12284
12285 if (WPOOH_array)
12286 {
12287 for (int i = 0; i < WPOOH_array.Count(); i++)
12288 {
12289 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12290
12291 if (WPOOH)
12292 {
12293 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12294 }
12295 }
12296 }
12297 }
12298
12299
12301 {
12302 int id = muzzle_owner.GetMuzzleID();
12303 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12304
12305 if (WPOOH_array)
12306 {
12307 for (int i = 0; i < WPOOH_array.Count(); i++)
12308 {
12309 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12310
12311 if (WPOOH)
12312 {
12313 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12314 }
12315 }
12316 }
12317 }
12318
12319
12320
12322 {
12324 {
12325 return true;
12326 }
12327
12328 return false;
12329 }
12330
12332 {
12334 {
12335 return true;
12336 }
12337
12338 return false;
12339 }
12340
12342 {
12344 {
12345 return true;
12346 }
12347
12348 return false;
12349 }
12350
12352 {
12353 return false;
12354 }
12355
12358 {
12359 return UATimeSpent.DEFAULT_DEPLOY;
12360 }
12361
12362
12363
12364
12366 {
12368 SetSynchDirty();
12369 }
12370
12372 {
12374 }
12375
12376
12378 {
12379 return false;
12380 }
12381
12384 {
12385 string att_type = "None";
12386
12387 if (ConfigIsExisting("soundAttType"))
12388 {
12389 att_type = ConfigGetString("soundAttType");
12390 }
12391
12393 }
12394
12396 {
12398 }
12399
12400
12401
12402
12403
12407
12409 {
12412
12414 }
12415
12416
12418 {
12420 return;
12421
12423
12426
12429
12430 SoundParameters params = new SoundParameters();
12434 }
12435
12436
12438 {
12440 return;
12441
12443 SetSynchDirty();
12444
12447 }
12448
12449
12451 {
12453 return;
12454
12456 SetSynchDirty();
12457
12460 }
12461
12463 {
12465 }
12466
12468 {
12470 }
12471
12474 {
12475 if (!
GetGame().IsDedicatedServer())
12476 {
12477 if (ConfigIsExisting("attachSoundSet"))
12478 {
12479 string cfg_path = "";
12480 string soundset = "";
12481 string type_name =
GetType();
12482
12485 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12486 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12487
12488 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12489 {
12490 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12491 {
12492 if (cfg_slot_array[i] == slot_type)
12493 {
12494 soundset = cfg_soundset_array[i];
12495 break;
12496 }
12497 }
12498 }
12499
12500 if (soundset != "")
12501 {
12502 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12504 }
12505 }
12506 }
12507 }
12508
12510 {
12511
12512 }
12513
12514 void OnApply(PlayerBase player);
12515
12517 {
12518 return 1.0;
12519 };
12520
12522 {
12524 }
12525
12527 {
12529 }
12530
12532
12534 {
12535 SetDynamicPhysicsLifeTime(0.01);
12537 }
12538
12540 {
12541 array<string> zone_names = new array<string>;
12542 GetDamageZones(zone_names);
12543 for (int i = 0; i < zone_names.Count(); i++)
12544 {
12545 SetHealthMax(zone_names.Get(i),"Health");
12546 }
12547 SetHealthMax("","Health");
12548 }
12549
12552 {
12553 float global_health = GetHealth01("","Health");
12554 array<string> zones = new array<string>;
12555 GetDamageZones(zones);
12556
12557 for (int i = 0; i < zones.Count(); i++)
12558 {
12559 SetHealth01(zones.Get(i),"Health",global_health);
12560 }
12561 }
12562
12565 {
12566 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12567 }
12568
12570 {
12571 if (!hasRootAsPlayer)
12572 {
12573 if (refParentIB)
12574 {
12575
12576 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12577 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12578
12579 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12580 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12581
12584 }
12585 else
12586 {
12587
12590 }
12591 }
12592 }
12593
12595 {
12597 {
12598 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12599 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12600 {
12601 float heatPermCoef = 1.0;
12603 while (ent)
12604 {
12605 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12606 ent = ent.GetHierarchyParent();
12607 }
12608
12609 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12610 }
12611 }
12612 }
12613
12615 {
12616
12617 EntityAI parent = GetHierarchyParent();
12618 if (!parent)
12619 {
12620 hasParent = false;
12621 hasRootAsPlayer = false;
12622 }
12623 else
12624 {
12625 hasParent = true;
12626 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12627 refParentIB =
ItemBase.Cast(parent);
12628 }
12629 }
12630
12631 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12632 {
12633
12634 }
12635
12637 {
12638
12639 return false;
12640 }
12641
12643 {
12644
12645
12646 return false;
12647 }
12648
12650 {
12651
12652 return false;
12653 }
12654
12657 {
12658 return !GetIsFrozen() &&
IsOpen();
12659 }
12660
12662 {
12663 bool hasParent = false, hasRootAsPlayer = false;
12665
12666 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12667 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12668
12669 if (wwtu || foodDecay)
12670 {
12674
12675 if (processWetness || processTemperature || processDecay)
12676 {
12678
12679 if (processWetness)
12680 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12681
12682 if (processTemperature)
12684
12685 if (processDecay)
12686 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12687 }
12688 }
12689 }
12690
12693 {
12695 }
12696
12698 {
12701
12702 return super.GetTemperatureFreezeThreshold();
12703 }
12704
12706 {
12709
12710 return super.GetTemperatureThawThreshold();
12711 }
12712
12714 {
12717
12718 return super.GetItemOverheatThreshold();
12719 }
12720
12722 {
12724 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12725
12726 return super.GetTemperatureFreezeTime();
12727 }
12728
12730 {
12732 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12733
12734 return super.GetTemperatureThawTime();
12735 }
12736
12741
12743 {
12744 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12745 }
12746
12748 {
12749 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12750 }
12751
12754 {
12756 }
12757
12759 {
12761 }
12762
12764 {
12766 }
12767
12770 {
12771 return null;
12772 }
12773
12776 {
12777 return false;
12778 }
12779
12781 {
12783 {
12786 if (!trg)
12787 {
12789 explosive = this;
12790 }
12791
12792 explosive.PairRemote(trg);
12794
12795 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12796 trg.SetPersistentPairID(persistentID);
12797 explosive.SetPersistentPairID(persistentID);
12798
12799 return true;
12800 }
12801 return false;
12802 }
12803
12806 {
12807 float ret = 1.0;
12810 ret *= GetHealth01();
12811
12812 return ret;
12813 }
12814
12815 #ifdef DEVELOPER
12816 override void SetDebugItem()
12817 {
12818 super.SetDebugItem();
12819 _itemBase = this;
12820 }
12821
12823 {
12824 string text = super.GetDebugText();
12825
12827 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12828
12829 return text;
12830 }
12831 #endif
12832
12834 {
12835 return true;
12836 }
12837
12839
12841
12843 {
12846 }
12847
12848
12856
12872}
12873
12875{
12877 if (entity)
12878 {
12879 bool is_item = entity.IsInherited(
ItemBase);
12880 if (is_item && full_quantity)
12881 {
12884 }
12885 }
12886 else
12887 {
12889 return NULL;
12890 }
12891 return entity;
12892}
12893
12895{
12896 if (item)
12897 {
12898 if (health > 0)
12899 item.SetHealth("", "", health);
12900
12901 if (item.CanHaveTemperature())
12902 {
12904 if (item.CanFreeze())
12905 item.SetFrozen(false);
12906 }
12907
12908 if (item.HasEnergyManager())
12909 {
12910 if (quantity >= 0)
12911 {
12912 item.GetCompEM().SetEnergy0To1(quantity);
12913 }
12914 else
12915 {
12917 }
12918 }
12919 else if (item.IsMagazine())
12920 {
12921 Magazine mag = Magazine.Cast(item);
12922 if (quantity >= 0)
12923 {
12924 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12925 }
12926 else
12927 {
12929 }
12930
12931 }
12932 else
12933 {
12934 if (quantity >= 0)
12935 {
12936 item.SetQuantityNormalized(quantity, false);
12937 }
12938 else
12939 {
12941 }
12942
12943 }
12944 }
12945}
12946
12947#ifdef DEVELOPER
12949#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.