8094{
8096 {
8097 return true;
8098 }
8099};
8100
8101
8102
8104{
8108
8110
8113
8114
8115
8116
8117
8126
8132
8137
8142
8163 protected bool m_IsResultOfSplit
8164
8166
8171
8172
8173
8175
8179
8180
8181
8183
8186
8187
8188
8194
8195
8203
8206
8207
8209
8210
8212
8213
8218
8219
8224
8225
8227
8228
8230 {
8235
8236 if (!
GetGame().IsDedicatedServer())
8237 {
8239 {
8241
8243 {
8245 }
8246 }
8247
8250 }
8251
8252 m_OldLocation = null;
8253
8255 {
8257 }
8258
8259 if (ConfigIsExisting("headSelectionsToHide"))
8260 {
8263 }
8264
8266 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8267 {
8269 }
8270
8272
8273 m_IsResultOfSplit = false;
8274
8276 }
8277
8279 {
8280 super.InitItemVariables();
8281
8287 m_Count = ConfigGetInt(
"count");
8288
8291
8296
8299
8304
8316
8320
8321
8324 if (ConfigIsExisting("canBeSplit"))
8325 {
8328 }
8329
8331 if (ConfigIsExisting("itemBehaviour"))
8333
8334
8337 RegisterNetSyncVariableInt("m_VarLiquidType");
8338 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8339
8340 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8341 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8342 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8343
8344 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8345 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8346 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8347 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8348
8349 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8350 RegisterNetSyncVariableBool("m_IsTakeable");
8351 RegisterNetSyncVariableBool("m_IsHologram");
8352
8355 {
8358 }
8359
8361
8363 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8365
8366 }
8367
8369 {
8371 }
8372
8374 {
8377 {
8382 }
8383 }
8384
8385 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8386 {
8388 {
8391 }
8392
8394 }
8395
8397 {
8403 }
8404
8406
8408 {
8410
8411 if (!action)
8412 {
8413 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8414 return;
8415 }
8416
8418 if (!ai)
8419 {
8421 return;
8422 }
8423
8425 if (!action_array)
8426 {
8427 action_array = new array<ActionBase_Basic>;
8429 }
8430 if (LogManager.IsActionLogEnable())
8431 {
8432 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8433 }
8434
8435 if (action_array.Find(action) != -1)
8436 {
8437 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8438 }
8439 else
8440 {
8441 action_array.Insert(action);
8442 }
8443 }
8444
8446 {
8448 ActionBase action = player.GetActionManager().GetAction(actionName);
8451
8452 if (action_array)
8453 {
8454 action_array.RemoveItem(action);
8455 }
8456 }
8457
8458
8459
8461 {
8462 ActionOverrideData overrideData = new ActionOverrideData();
8466
8468 if (!actionMap)
8469 {
8472 }
8473
8474 actionMap.Insert(this.
Type(), overrideData);
8475
8476 }
8477
8479
8481
8482
8484 {
8487
8490
8491 string config_to_search = "CfgVehicles";
8492 string muzzle_owner_config;
8493
8495 {
8496 if (IsInherited(Weapon))
8497 config_to_search = "CfgWeapons";
8498
8499 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8500
8501 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8502
8504
8505 if (config_OnFire_subclass_count > 0)
8506 {
8507 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8508
8509 for (int i = 0; i < config_OnFire_subclass_count; i++)
8510 {
8511 string particle_class = "";
8513 string config_OnFire_entry = config_OnFire_class + particle_class;
8514 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8515 WPOF_array.Insert(WPOF);
8516 }
8517
8518
8520 }
8521 }
8522
8524 {
8525 config_to_search = "CfgWeapons";
8526 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8527
8528 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8529
8531
8532 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8533 {
8534 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8535
8536 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8537 {
8538 string particle_class2 = "";
8540 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8541 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8542 WPOBE_array.Insert(WPOBE);
8543 }
8544
8545
8547 }
8548 }
8549 }
8550
8551
8553 {
8556
8558 {
8559 string config_to_search = "CfgVehicles";
8560
8561 if (IsInherited(Weapon))
8562 config_to_search = "CfgWeapons";
8563
8564 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8565 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8566
8567 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8568 {
8569
8571
8573 {
8575 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8577 return;
8578 }
8579
8582
8583
8584
8586 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8587
8588 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8589 {
8590 string particle_class = "";
8592 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8594
8595 if (entry_type == CT_CLASS)
8596 {
8597 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8598 WPOOH_array.Insert(WPOF);
8599 }
8600 }
8601
8602
8604 }
8605 }
8606 }
8607
8609 {
8611 }
8612
8614 {
8616 {
8618
8621
8624
8625 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8626 }
8627 }
8628
8630 {
8632 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8633
8635 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8636
8638 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8639
8641 {
8643 }
8644 }
8645
8647 {
8649 }
8650
8652 {
8655 else
8657
8659 {
8662 }
8663 else
8664 {
8667
8670 }
8671
8673 }
8674
8676 {
8678 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8679 }
8680
8682 {
8684 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8686 }
8687
8689 {
8691 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8692 }
8693
8695 {
8698
8699 OverheatingParticle OP = new OverheatingParticle();
8704
8706 }
8707
8709 {
8712
8713 return -1;
8714 }
8715
8717 {
8719 {
8722
8723 for (int i = count; i > 0; --i)
8724 {
8725 int id = i - 1;
8728
8731
8732 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8733 {
8734 if (p)
8735 {
8738 }
8739 }
8740 }
8741 }
8742 }
8743
8745 {
8747 {
8749 {
8750 int id = i - 1;
8752
8753 if (OP)
8754 {
8756
8757 if (p)
8758 {
8760 }
8761
8762 delete OP;
8763 }
8764 }
8765
8768 }
8769 }
8770
8773 {
8774 return 0.0;
8775 }
8776
8777
8779 {
8780 return 250;
8781 }
8782
8784 {
8785 return 0;
8786 }
8787
8790 {
8792 return true;
8793
8794 return false;
8795 }
8796
8799 {
8802
8804 {
8806 }
8807 else
8808 {
8809
8811 }
8812
8814 }
8815
8822 {
8823 return -1;
8824 }
8825
8826
8827
8828
8830 {
8832 {
8834 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8835
8836 if (r_index >= 0)
8837 {
8838 InventoryLocation r_il = new InventoryLocation;
8839 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8840
8841 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8844 {
8845 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8846 }
8848 {
8849 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8850 }
8851
8852 }
8853
8854 player.GetHumanInventory().ClearUserReservedLocation(this);
8855 }
8856
8859 }
8860
8861
8862
8863
8865 {
8866 return ItemBase.m_DebugActionsMask;
8867 }
8868
8870 {
8871 return ItemBase.m_DebugActionsMask & mask;
8872 }
8873
8875 {
8876 ItemBase.m_DebugActionsMask = mask;
8877 }
8878
8880 {
8881 ItemBase.m_DebugActionsMask |= mask;
8882 }
8883
8885 {
8886 ItemBase.m_DebugActionsMask &= ~mask;
8887 }
8888
8890 {
8892 {
8894 }
8895 else
8896 {
8898 }
8899 }
8900
8901
8903 {
8904 if (GetEconomyProfile())
8905 {
8906 float q_max = GetEconomyProfile().GetQuantityMax();
8907 if (q_max > 0)
8908 {
8909 float q_min = GetEconomyProfile().GetQuantityMin();
8910 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8911
8913 {
8914 ComponentEnergyManager comp = GetCompEM();
8916 {
8918 }
8919 }
8921 {
8923
8924 }
8925
8926 }
8927 }
8928 }
8929
8932 {
8933 EntityAI parent = GetHierarchyParent();
8934
8935 if (parent)
8936 {
8937 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8938 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8939 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8940 }
8941 }
8942
8945 {
8946 EntityAI parent = GetHierarchyParent();
8947
8948 if (parent)
8949 {
8950 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8951 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8952 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8953 }
8954 }
8955
8957 {
8958
8959
8960
8961
8963
8965 {
8966 if (ScriptInputUserData.CanStoreInputUserData())
8967 {
8968 ScriptInputUserData ctx = new ScriptInputUserData;
8974 ctx.
Write(use_stack_max);
8977
8979 {
8980 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8981 }
8982 }
8983 }
8984 else if (!
GetGame().IsMultiplayer())
8985 {
8987 }
8988 }
8989
8991 {
8993 }
8994
8996 {
8998 }
8999
9001 {
9003 }
9004
9006 {
9007
9008 return false;
9009 }
9010
9012 {
9013 return false;
9014 }
9015
9019 {
9020 return false;
9021 }
9022
9024 {
9025 return "";
9026 }
9027
9029
9031 {
9032 return false;
9033 }
9034
9036 {
9037 return true;
9038 }
9039
9040
9041
9043 {
9044 return true;
9045 }
9046
9048 {
9049 return true;
9050 }
9051
9053 {
9054 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9056 }
9057
9059 {
9061 }
9062
9064 {
9066 if (!is_being_placed)
9068 SetSynchDirty();
9069 }
9070
9071
9073
9075 {
9077 }
9078
9080 {
9082 }
9083
9085 {
9086 return 1;
9087 }
9088
9090 {
9091 return false;
9092 }
9093
9095 {
9097 SetSynchDirty();
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
9131
9132
9133
9135 {
9136 super.OnMovedInsideCargo(container);
9137
9138 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9139 }
9140
9141 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9142 {
9143 super.EEItemLocationChanged(oldLoc,newLoc);
9144
9145 PlayerBase new_player = null;
9146 PlayerBase old_player = null;
9147
9148 if (newLoc.GetParent())
9149 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9150
9151 if (oldLoc.GetParent())
9152 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9153
9155 {
9156 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9157
9158 if (r_index >= 0)
9159 {
9160 InventoryLocation r_il = new InventoryLocation;
9161 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9162
9163 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9166 {
9167 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9168 }
9170 {
9171 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9172 }
9173
9174 }
9175 }
9176
9178 {
9179 if (new_player)
9180 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9181
9182 if (new_player == old_player)
9183 {
9184
9185 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9186 {
9188 {
9189 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9190 {
9191 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9192 }
9193 }
9194 else
9195 {
9196 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9197 }
9198 }
9199
9200 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9201 {
9202 int type = oldLoc.GetType();
9204 {
9205 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9206 }
9208 {
9209 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9210 }
9211 }
9212 if (!m_OldLocation)
9213 {
9214 m_OldLocation = new InventoryLocation;
9215 }
9216 m_OldLocation.Copy(oldLoc);
9217 }
9218 else
9219 {
9220 if (m_OldLocation)
9221 {
9222 m_OldLocation.Reset();
9223 }
9224 }
9225
9227 }
9228 else
9229 {
9230 if (new_player)
9231 {
9232 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9233 if (res_index >= 0)
9234 {
9235 InventoryLocation il = new InventoryLocation;
9236 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9238 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9241 {
9242 il.
GetParent().GetOnReleaseLock().Invoke(it);
9243 }
9245 {
9247 }
9248
9249 }
9250 }
9252 {
9253
9255 }
9256
9257 if (m_OldLocation)
9258 {
9259 m_OldLocation.Reset();
9260 }
9261 }
9262 }
9263
9264 override void EOnContact(IEntity other, Contact extra)
9265 {
9267 {
9268 int liquidType = -1;
9270 if (impactSpeed > 0.0)
9271 {
9273 #ifndef SERVER
9275 #else
9277 SetSynchDirty();
9278 #endif
9280 }
9281 }
9282
9283 #ifdef SERVER
9284 if (GetCompEM() && GetCompEM().IsPlugged())
9285 {
9286 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9287 GetCompEM().UnplugThis();
9288 }
9289 #endif
9290 }
9291
9293
9295 {
9297 }
9298
9300 {
9301
9302 }
9303
9305 {
9306 super.OnItemLocationChanged(old_owner, new_owner);
9307
9308 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9309 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9310
9311 if (!relatedPlayer && playerNew)
9312 relatedPlayer = playerNew;
9313
9314 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9315 {
9317 if (actionMgr)
9318 {
9319 ActionBase currentAction = actionMgr.GetRunningAction();
9320 if (currentAction)
9322 }
9323 }
9324
9325 Man ownerPlayerOld = null;
9326 Man ownerPlayerNew = null;
9327
9328 if (old_owner)
9329 {
9330 if (old_owner.
IsMan())
9331 {
9332 ownerPlayerOld = Man.Cast(old_owner);
9333 }
9334 else
9335 {
9336 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9337 }
9338 }
9339 else
9340 {
9342 {
9344
9345 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9346 {
9347 GetCompEM().UnplugThis();
9348 }
9349 }
9350 }
9351
9352 if (new_owner)
9353 {
9354 if (new_owner.
IsMan())
9355 {
9356 ownerPlayerNew = Man.Cast(new_owner);
9357 }
9358 else
9359 {
9360 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9361 }
9362 }
9363
9364 if (ownerPlayerOld != ownerPlayerNew)
9365 {
9366 if (ownerPlayerOld)
9367 {
9368 array<EntityAI> subItemsExit = new array<EntityAI>;
9370 for (int i = 0; i < subItemsExit.Count(); i++)
9371 {
9374 }
9375 }
9376
9377 if (ownerPlayerNew)
9378 {
9379 array<EntityAI> subItemsEnter = new array<EntityAI>;
9381 for (int j = 0; j < subItemsEnter.Count(); j++)
9382 {
9385 }
9386 }
9387 }
9388 else if (ownerPlayerNew != null)
9389 {
9390 PlayerBase nplayer;
9391 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9392 {
9393 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9395 for (int k = 0; k < subItemsUpdate.Count(); k++)
9396 {
9398 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9399 }
9400 }
9401 }
9402
9403 if (old_owner)
9404 old_owner.OnChildItemRemoved(this);
9405 if (new_owner)
9406 new_owner.OnChildItemReceived(this);
9407 }
9408
9409
9411 {
9412 super.EEDelete(parent);
9413 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9414 if (player)
9415 {
9417
9418 if (player.IsAlive())
9419 {
9420 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9421 if (r_index >= 0)
9422 {
9423 InventoryLocation r_il = new InventoryLocation;
9424 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9425
9426 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9429 {
9430 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9431 }
9433 {
9434 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9435 }
9436
9437 }
9438
9439 player.RemoveQuickBarEntityShortcut(this);
9440 }
9441 }
9442 }
9443
9445 {
9446 super.EEKilled(killer);
9447
9450 {
9451 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9452 {
9453 if (IsMagazine())
9454 {
9455 if (Magazine.Cast(this).GetAmmoCount() > 0)
9456 {
9458 }
9459 }
9460 else
9461 {
9463 }
9464 }
9465 }
9466 }
9467
9469 {
9470 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9471
9472 super.OnWasAttached(parent, slot_id);
9473
9476
9478 }
9479
9481 {
9482 super.OnWasDetached(parent, slot_id);
9483
9486 }
9487
9489 {
9490 int idx;
9493
9494 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9495 if (inventory_slots.Count() < 1)
9496 {
9497 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9498 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9499 }
9500 else
9501 {
9502 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9503 }
9504
9505 idx = inventory_slots.Find(slot);
9506 if (idx < 0)
9507 return "";
9508
9509 return attach_types.Get(idx);
9510 }
9511
9513 {
9514 int idx = -1;
9515 string slot;
9516
9519
9520 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9521 if (inventory_slots.Count() < 1)
9522 {
9523 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9524 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9525 }
9526 else
9527 {
9528 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9529 if (detach_types.Count() < 1)
9530 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9531 }
9532
9533 for (int i = 0; i < inventory_slots.Count(); i++)
9534 {
9535 slot = inventory_slots.Get(i);
9536 }
9537
9538 if (slot != "")
9539 {
9540 if (detach_types.Count() == 1)
9541 idx = 0;
9542 else
9543 idx = inventory_slots.Find(slot);
9544 }
9545 if (idx < 0)
9546 return "";
9547
9548 return detach_types.Get(idx);
9549 }
9550
9552 {
9553
9555
9556
9557 float min_time = 1;
9558 float max_time = 3;
9559 float delay = Math.RandomFloat(min_time, max_time);
9560
9561 explode_timer.Run(delay, this, "DoAmmoExplosion");
9562 }
9563
9565 {
9566 Magazine magazine = Magazine.Cast(this);
9567 int pop_sounds_count = 6;
9568 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9569
9570
9571 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9572 string sound_name = pop_sounds[ sound_idx ];
9574
9575
9576 magazine.ServerAddAmmoCount(-1);
9577
9578
9579 float min_temp_to_explode = 100;
9580
9581 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9582 {
9584 }
9585 }
9586
9587
9588 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9589 {
9590 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9591
9592 const int CHANCE_DAMAGE_CARGO = 4;
9593 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9594 const int CHANCE_DAMAGE_NOTHING = 2;
9595
9597 {
9598 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9599 int chances;
9600 int rnd;
9601
9602 if (GetInventory().GetCargo())
9603 {
9604 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9605 rnd = Math.RandomInt(0,chances);
9606
9607 if (rnd < CHANCE_DAMAGE_CARGO)
9608 {
9610 }
9611 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9612 {
9614 }
9615 }
9616 else
9617 {
9618 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9619 rnd = Math.RandomInt(0,chances);
9620
9621 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9622 {
9624 }
9625 }
9626 }
9627 }
9628
9630 {
9631 if (GetInventory().GetCargo())
9632 {
9633 int item_count = GetInventory().GetCargo().GetItemCount();
9634 if (item_count > 0)
9635 {
9636 int random_pick = Math.RandomInt(0, item_count);
9638 if (!item.IsExplosive())
9639 {
9640 item.AddHealth("","",damage);
9641 return true;
9642 }
9643 }
9644 }
9645 return false;
9646 }
9647
9649 {
9650 int attachment_count = GetInventory().AttachmentCount();
9651 if (attachment_count > 0)
9652 {
9653 int random_pick = Math.RandomInt(0, attachment_count);
9654 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9655 if (!attachment.IsExplosive())
9656 {
9657 attachment.AddHealth("","",damage);
9658 return true;
9659 }
9660 }
9661 return false;
9662 }
9663
9665 {
9667 }
9668
9670 {
9672 return GetInventory().CanRemoveEntity();
9673
9674 return false;
9675 }
9676
9678 {
9679
9681 return false;
9682
9683
9685 return false;
9686
9687
9688
9690 if (delta == 0)
9691 return false;
9692
9693
9694 return true;
9695 }
9696
9698 {
9700 {
9701 if (ScriptInputUserData.CanStoreInputUserData())
9702 {
9703 ScriptInputUserData ctx = new ScriptInputUserData;
9708 ctx.
Write(destination_entity);
9712 }
9713 }
9714 else if (!
GetGame().IsMultiplayer())
9715 {
9717 }
9718 }
9719
9721 {
9722 float split_quantity_new;
9726 InventoryLocation loc = new InventoryLocation;
9727
9728 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9729 {
9731 split_quantity_new = stack_max;
9732 else
9734
9736 {
9737 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9738 if (new_item)
9739 {
9740 new_item.SetResultOfSplit(true);
9741 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9743 new_item.
SetQuantity(split_quantity_new,
false,
true);
9744 }
9745 }
9746 }
9747 else if (destination_entity && slot_id == -1)
9748 {
9749 if (quantity > stack_max)
9750 split_quantity_new = stack_max;
9751 else
9752 split_quantity_new = quantity;
9753
9755 {
9757 {
9760 }
9761
9762 if (new_item)
9763 {
9764 new_item.SetResultOfSplit(true);
9765 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9767 new_item.
SetQuantity(split_quantity_new,
false,
true);
9768 }
9769 }
9770 }
9771 else
9772 {
9773 if (stack_max != 0)
9774 {
9776 {
9778 }
9779
9780 if (split_quantity_new == 0)
9781 {
9782 if (!
GetGame().IsMultiplayer())
9783 player.PhysicalPredictiveDropItem(this);
9784 else
9785 player.ServerDropEntity(this);
9786 return;
9787 }
9788
9790 {
9792
9793 if (new_item)
9794 {
9795 new_item.SetResultOfSplit(true);
9796 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9799 new_item.PlaceOnSurface();
9800 }
9801 }
9802 }
9803 }
9804 }
9805
9807 {
9808 float split_quantity_new;
9812 InventoryLocation loc = new InventoryLocation;
9813
9814 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9815 {
9817 split_quantity_new = stack_max;
9818 else
9820
9822 {
9823 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9824 if (new_item)
9825 {
9826 new_item.SetResultOfSplit(true);
9827 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9829 new_item.
SetQuantity(split_quantity_new,
false,
true);
9830 }
9831 }
9832 }
9833 else if (destination_entity && slot_id == -1)
9834 {
9835 if (quantity > stack_max)
9836 split_quantity_new = stack_max;
9837 else
9838 split_quantity_new = quantity;
9839
9841 {
9843 {
9846 }
9847
9848 if (new_item)
9849 {
9850 new_item.SetResultOfSplit(true);
9851 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9853 new_item.
SetQuantity(split_quantity_new,
false,
true);
9854 }
9855 }
9856 }
9857 else
9858 {
9859 if (stack_max != 0)
9860 {
9862 {
9864 }
9865
9867 {
9869
9870 if (new_item)
9871 {
9872 new_item.SetResultOfSplit(true);
9873 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9876 new_item.PlaceOnSurface();
9877 }
9878 }
9879 }
9880 }
9881 }
9882
9884 {
9886 {
9887 if (ScriptInputUserData.CanStoreInputUserData())
9888 {
9889 ScriptInputUserData ctx = new ScriptInputUserData;
9894 dst.WriteToContext(ctx);
9896 }
9897 }
9898 else if (!
GetGame().IsMultiplayer())
9899 {
9901 }
9902 }
9903
9905 {
9907 {
9908 if (ScriptInputUserData.CanStoreInputUserData())
9909 {
9910 ScriptInputUserData ctx = new ScriptInputUserData;
9915 ctx.
Write(destination_entity);
9921 }
9922 }
9923 else if (!
GetGame().IsMultiplayer())
9924 {
9926 }
9927 }
9928
9930 {
9932 }
9933
9935 {
9937 float split_quantity_new;
9939 if (dst.IsValid())
9940 {
9941 int slot_id = dst.GetSlot();
9943
9944 if (quantity > stack_max)
9945 split_quantity_new = stack_max;
9946 else
9947 split_quantity_new = quantity;
9948
9950 {
9952
9953 if (new_item)
9954 {
9955 new_item.SetResultOfSplit(true);
9956 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9958 new_item.
SetQuantity(split_quantity_new,
false,
true);
9959 }
9960
9961 return new_item;
9962 }
9963 }
9964
9965 return null;
9966 }
9967
9969 {
9971 float split_quantity_new;
9973 if (destination_entity)
9974 {
9976 if (quantity > stackable)
9977 split_quantity_new = stackable;
9978 else
9979 split_quantity_new = quantity;
9980
9982 {
9983 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9984 if (new_item)
9985 {
9986 new_item.SetResultOfSplit(true);
9987 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9989 new_item.
SetQuantity(split_quantity_new,
false,
true);
9990 }
9991 }
9992 }
9993 }
9994
9996 {
9998 {
9999 if (ScriptInputUserData.CanStoreInputUserData())
10000 {
10001 ScriptInputUserData ctx = new ScriptInputUserData;
10006 ItemBase destination_entity =
this;
10007 ctx.
Write(destination_entity);
10011 }
10012 }
10013 else if (!
GetGame().IsMultiplayer())
10014 {
10016 }
10017 }
10018
10020 {
10022 float split_quantity_new;
10024 if (player)
10025 {
10027 if (quantity > stackable)
10028 split_quantity_new = stackable;
10029 else
10030 split_quantity_new = quantity;
10031
10033 {
10034 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10035 new_item =
ItemBase.Cast(in_hands);
10036 if (new_item)
10037 {
10038 new_item.SetResultOfSplit(true);
10039 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10041 new_item.SetQuantity(split_quantity_new, false, true);
10042 }
10043 }
10044 }
10045 }
10046
10048 {
10050 float split_quantity_new = Math.Floor(quantity * 0.5);
10051
10053 return;
10054
10056
10057 if (new_item)
10058 {
10059 if (new_item.GetQuantityMax() < split_quantity_new)
10060 {
10061 split_quantity_new = new_item.GetQuantityMax();
10062 }
10063
10064 new_item.SetResultOfSplit(true);
10065 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10066
10068 {
10071 }
10072 else
10073 {
10075 new_item.
SetQuantity(split_quantity_new,
false,
true);
10076 }
10077 }
10078 }
10079
10081 {
10083 float split_quantity_new = Math.Floor(quantity / 2);
10084
10086 return;
10087
10088 InventoryLocation invloc = new InventoryLocation;
10090
10092 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10093
10094 if (new_item)
10095 {
10096 if (new_item.GetQuantityMax() < split_quantity_new)
10097 {
10098 split_quantity_new = new_item.GetQuantityMax();
10099 }
10101 {
10104 }
10105 else if (split_quantity_new > 1)
10106 {
10108 new_item.
SetQuantity(split_quantity_new,
false,
true);
10109 }
10110 }
10111 }
10112
10115 {
10116 SetWeightDirty();
10118
10119 if (parent)
10120 parent.OnAttachmentQuantityChangedEx(this, delta);
10121
10123 {
10125 {
10127 }
10129 {
10130 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10132 }
10133 }
10134
10135 }
10136
10139 {
10140
10141 }
10142
10145 {
10147 }
10148
10150 {
10151 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10152
10154 {
10155 if (newLevel == GameConstants.STATE_RUINED)
10156 {
10158 EntityAI parent = GetHierarchyParent();
10159 if (parent && parent.IsFireplace())
10160 {
10161 CargoBase cargo = GetInventory().GetCargo();
10162 if (cargo)
10163 {
10165 {
10167 }
10168 }
10169 }
10170 }
10171
10173 {
10174
10176 return;
10177 }
10178
10179 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10180 {
10182 }
10183 }
10184 }
10185
10186
10188 {
10189 super.OnRightClick();
10190
10192 {
10194 {
10195 if (ScriptInputUserData.CanStoreInputUserData())
10196 {
10197 EntityAI root = GetHierarchyRoot();
10198 Man playerOwner = GetHierarchyRootPlayer();
10199 InventoryLocation dst = new InventoryLocation;
10200
10201
10202 if (!playerOwner && root && root == this)
10203 {
10205 }
10206 else
10207 {
10208
10209 GetInventory().GetCurrentInventoryLocation(dst);
10211 {
10214 {
10216 }
10217 else
10218 {
10220
10221
10222 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10223 {
10225 }
10226 else
10227 {
10228 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10229 }
10230 }
10231 }
10232 }
10233
10234 ScriptInputUserData ctx = new ScriptInputUserData;
10242 }
10243 }
10244 else if (!
GetGame().IsMultiplayer())
10245 {
10247 }
10248 }
10249 }
10250
10252 {
10253 if (root)
10254 {
10255 vector m4[4];
10256 root.GetTransform(m4);
10257 dst.SetGround(this, m4);
10258 }
10259 else
10260 {
10261 GetInventory().GetCurrentInventoryLocation(dst);
10262 }
10263 }
10264
10265 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10266 {
10267
10268 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10269 return false;
10270
10271 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10272 return false;
10273
10274
10276 return false;
10277
10278
10279 Magazine mag = Magazine.Cast(this);
10280 if (mag)
10281 {
10282 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10283 return false;
10284
10285 if (stack_max_limit)
10286 {
10287 Magazine other_mag = Magazine.Cast(other_item);
10288 if (other_item)
10289 {
10290 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10291 return false;
10292 }
10293
10294 }
10295 }
10296 else
10297 {
10298
10300 return false;
10301
10303 return false;
10304 }
10305
10306 PlayerBase player = null;
10307 if (CastTo(player, GetHierarchyRootPlayer()))
10308 {
10309 if (player.GetInventory().HasAttachment(this))
10310 return false;
10311
10312 if (player.IsItemsToDelete())
10313 return false;
10314 }
10315
10316 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10317 return false;
10318
10319 int slotID;
10321 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10322 return false;
10323
10324 return true;
10325 }
10326
10328 {
10330 }
10331
10333 {
10334 return m_IsResultOfSplit;
10335 }
10336
10338 {
10339 m_IsResultOfSplit = value;
10340 }
10341
10343 {
10345 }
10346
10348 {
10349 float other_item_quantity = other_item.GetQuantity();
10350 float this_free_space;
10351
10353
10355
10356 if (other_item_quantity > this_free_space)
10357 {
10358 return this_free_space;
10359 }
10360 else
10361 {
10362 return other_item_quantity;
10363 }
10364 }
10365
10367 {
10369 }
10370
10372 {
10374 return;
10375
10376 if (!IsMagazine() && other_item)
10377 {
10379 if (quantity_used != 0)
10380 {
10381 float hp1 = GetHealth01("","");
10382 float hp2 = other_item.GetHealth01("","");
10383 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10384 hpResult = hpResult / (
GetQuantity() + quantity_used);
10385
10386 hpResult *= GetMaxHealth();
10387 Math.Round(hpResult);
10388 SetHealth("", "Health", hpResult);
10389
10391 other_item.AddQuantity(-quantity_used);
10392 }
10393 }
10395 }
10396
10398 {
10399 #ifdef SERVER
10400 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10401 GetHierarchyParent().IncreaseLifetimeUp();
10402 #endif
10403 };
10404
10406 {
10407 PlayerBase p = PlayerBase.Cast(player);
10408
10409 array<int> recipesIds = p.m_Recipes;
10410 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10411 if (moduleRecipesManager)
10412 {
10413 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10414 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10415 }
10416
10417 for (int i = 0;i < recipesIds.Count(); i++)
10418 {
10419 int key = recipesIds.Get(i);
10420 string recipeName = moduleRecipesManager.GetRecipeName(key);
10422 }
10423 }
10424
10425
10426 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10427 {
10428 super.GetDebugActions(outputList);
10429
10430
10436
10437
10442
10447
10448
10452
10453
10455 {
10459 }
10460
10463
10464
10468
10470
10471 InventoryLocation loc = new InventoryLocation();
10472 GetInventory().GetCurrentInventoryLocation(loc);
10474 {
10475 if (Gizmo_IsSupported())
10478 }
10479
10481 }
10482
10483
10484
10485
10487 {
10488 super.OnAction(action_id, player, ctx);
10489
10491 {
10492 switch (action_id)
10493 {
10496 return true;
10499 return true;
10500 }
10501 }
10502
10504 {
10505 switch (action_id)
10506 {
10508 Delete();
10509 return true;
10510 }
10511 }
10512
10513 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10514 {
10515 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10516 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10517 PlayerBase p = PlayerBase.Cast(player);
10518 if (
EActions.RECIPES_RANGE_START < 1000)
10519 {
10520 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10521 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10522 }
10523 }
10524 #ifndef SERVER
10525 else if (action_id ==
EActions.WATCH_PLAYER)
10526 {
10527 PluginDeveloper.SetDeveloperItemClientEx(player);
10528 }
10529 #endif
10531 {
10532 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10533 {
10534 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10535 OnDebugButtonPressServer(id + 1);
10536 }
10537
10538 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10539 {
10540 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10542 }
10543
10544 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10545 {
10546 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10548 }
10549
10550 else if (action_id ==
EActions.ADD_QUANTITY)
10551 {
10552 if (IsMagazine())
10553 {
10554 Magazine mag = Magazine.Cast(this);
10555 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10556 }
10557 else
10558 {
10560 }
10561
10562 if (m_EM)
10563 {
10564 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10565 }
10566
10567 }
10568
10569 else if (action_id ==
EActions.REMOVE_QUANTITY)
10570 {
10571 if (IsMagazine())
10572 {
10573 Magazine mag2 = Magazine.Cast(this);
10574 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10575 }
10576 else
10577 {
10579 }
10580 if (m_EM)
10581 {
10582 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10583 }
10584
10585 }
10586
10587 else if (action_id ==
EActions.SET_QUANTITY_0)
10588 {
10590
10591 if (m_EM)
10592 {
10593 m_EM.SetEnergy(0);
10594 }
10595 }
10596
10597 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10598 {
10600
10601 if (m_EM)
10602 {
10603 m_EM.SetEnergy(m_EM.GetEnergyMax());
10604 }
10605 }
10606
10607 else if (action_id ==
EActions.ADD_HEALTH)
10608 {
10609 AddHealth("","",GetMaxHealth("","Health")/5);
10610 }
10611 else if (action_id ==
EActions.REMOVE_HEALTH)
10612 {
10613 AddHealth("","",-GetMaxHealth("","Health")/5);
10614 }
10615 else if (action_id ==
EActions.DESTROY_HEALTH)
10616 {
10617 SetHealth01("","",0);
10618 }
10619 else if (action_id ==
EActions.WATCH_ITEM)
10620 {
10622 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10623 #ifdef DEVELOPER
10624 SetDebugDeveloper_item(this);
10625 #endif
10626 }
10627
10628 else if (action_id ==
EActions.ADD_TEMPERATURE)
10629 {
10630 AddTemperature(20);
10631
10632 }
10633
10634 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10635 {
10636 AddTemperature(-20);
10637
10638 }
10639
10640 else if (action_id ==
EActions.FLIP_FROZEN)
10641 {
10642 SetFrozen(!GetIsFrozen());
10643
10644 }
10645
10646 else if (action_id ==
EActions.ADD_WETNESS)
10647 {
10649
10650 }
10651
10652 else if (action_id ==
EActions.REMOVE_WETNESS)
10653 {
10655
10656 }
10657
10658 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10659 {
10662
10663
10664 }
10665
10666 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10667 {
10670 }
10671
10672 else if (action_id ==
EActions.MAKE_SPECIAL)
10673 {
10674 auto debugParams = DebugSpawnParams.WithPlayer(player);
10675 OnDebugSpawnEx(debugParams);
10676 }
10677
10678 }
10679
10680
10681 return false;
10682 }
10683
10684
10685
10686
10690
10693
10694
10695
10697 {
10698 return false;
10699 }
10700
10701
10703 {
10704 return true;
10705 }
10706
10707
10709 {
10710 return true;
10711 }
10712
10713
10714
10716 {
10717 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10719 }
10720
10723 {
10724 return null;
10725 }
10726
10728 {
10729 return false;
10730 }
10731
10733 {
10734 return false;
10735 }
10736
10740
10741
10743 {
10744 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10745 return module_repairing.CanRepair(this, item_repair_kit);
10746 }
10747
10748
10749 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10750 {
10751 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10752 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10753 }
10754
10755
10757 {
10758
10759
10760
10761
10762
10763
10764
10765
10766 return 1;
10767 }
10768
10769
10770
10772 {
10774 }
10775
10776
10777
10779 {
10781 }
10782
10783
10792 {
10793 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10794
10795 if (player)
10796 {
10797 player.MessageStatus(text);
10798 }
10799 }
10800
10801
10810 {
10811 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10812
10813 if (player)
10814 {
10815 player.MessageAction(text);
10816 }
10817 }
10818
10819
10828 {
10829 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10830
10831 if (player)
10832 {
10833 player.MessageFriendly(text);
10834 }
10835 }
10836
10837
10846 {
10847 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10848
10849 if (player)
10850 {
10851 player.MessageImportant(text);
10852 }
10853 }
10854
10856 {
10857 return true;
10858 }
10859
10860
10861 override bool KindOf(
string tag)
10862 {
10863 bool found = false;
10864 string item_name = this.
GetType();
10867
10868 int array_size = item_tag_array.Count();
10869 for (int i = 0; i < array_size; i++)
10870 {
10871 if (item_tag_array.Get(i) == tag)
10872 {
10873 found = true;
10874 break;
10875 }
10876 }
10877 return found;
10878 }
10879
10880
10882 {
10883
10884 super.OnRPC(sender, rpc_type,ctx);
10885
10886
10887 switch (rpc_type)
10888 {
10889 #ifndef SERVER
10890 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10891 Param2<bool, string> p = new Param2<bool, string>(false, "");
10892
10894 return;
10895
10896 bool play = p.param1;
10897 string soundSet = p.param2;
10898
10899 if (play)
10900 {
10902 {
10904 {
10906 }
10907 }
10908 else
10909 {
10911 }
10912 }
10913 else
10914 {
10916 }
10917
10918 break;
10919 #endif
10920
10921 }
10922
10924 {
10926 }
10927 }
10928
10929
10930
10931
10933 {
10934 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10935 return plugin.GetID(
name);
10936 }
10937
10939 {
10940 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10941 return plugin.GetName(id);
10942 }
10943
10946 {
10947
10948
10949 int varFlags;
10950 if (!ctx.
Read(varFlags))
10951 return;
10952
10953 if (varFlags & ItemVariableFlags.FLOAT)
10954 {
10956 }
10957 }
10958
10960 {
10961
10962 super.SerializeNumericalVars(floats_out);
10963
10964
10965
10967 {
10969 }
10970
10972 {
10974 }
10975
10977 {
10979 }
10980
10982 {
10987 }
10988
10990 {
10992 }
10993 }
10994
10996 {
10997
10998 super.DeSerializeNumericalVars(floats);
10999
11000
11001 int index = 0;
11002 int mask = Math.Round(floats.Get(index));
11003
11004 index++;
11005
11007 {
11009 {
11011 }
11012 else
11013 {
11014 float quantity = floats.Get(index);
11015 SetQuantity(quantity,
true,
false,
false,
false);
11016 }
11017 index++;
11018 }
11019
11021 {
11022 float wet = floats.Get(index);
11024 index++;
11025 }
11026
11028 {
11029 int liquidtype = Math.Round(floats.Get(index));
11031 index++;
11032 }
11033
11035 {
11037 index++;
11039 index++;
11041 index++;
11043 index++;
11044 }
11045
11047 {
11048 int cleanness = Math.Round(floats.Get(index));
11050 index++;
11051 }
11052 }
11053
11055 {
11056 super.WriteVarsToCTX(ctx);
11057
11058
11060 {
11062 }
11063
11065 {
11067 }
11068
11070 {
11072 }
11073
11075 {
11076 int r,g,b,a;
11082 }
11083
11085 {
11087 }
11088 }
11089
11091 {
11092 if (!super.ReadVarsFromCTX(ctx,version))
11093 return false;
11094
11095 int intValue;
11096 float value;
11097
11098 if (version < 140)
11099 {
11100 if (!ctx.
Read(intValue))
11101 return false;
11102
11103 m_VariablesMask = intValue;
11104 }
11105
11107 {
11108 if (!ctx.
Read(value))
11109 return false;
11110
11112 {
11114 }
11115 else
11116 {
11118 }
11119 }
11120
11121 if (version < 140)
11122 {
11124 {
11125 if (!ctx.
Read(value))
11126 return false;
11127 SetTemperatureDirect(value);
11128 }
11129 }
11130
11132 {
11133 if (!ctx.
Read(value))
11134 return false;
11136 }
11137
11139 {
11140 if (!ctx.
Read(intValue))
11141 return false;
11143 }
11144
11146 {
11147 int r,g,b,a;
11149 return false;
11151 return false;
11153 return false;
11155 return false;
11156
11158 }
11159
11161 {
11162 if (!ctx.
Read(intValue))
11163 return false;
11165 }
11166
11167 if (version >= 138 && version < 140)
11168 {
11170 {
11171 if (!ctx.
Read(intValue))
11172 return false;
11173 SetFrozen(intValue);
11174 }
11175 }
11176
11177 return true;
11178 }
11179
11180
11182 {
11185 {
11187 }
11188
11189 if (!super.OnStoreLoad(ctx, version))
11190 {
11192 return false;
11193 }
11194
11195 if (version >= 114)
11196 {
11197 bool hasQuickBarIndexSaved;
11198
11199 if (!ctx.
Read(hasQuickBarIndexSaved))
11200 {
11202 return false;
11203 }
11204
11205 if (hasQuickBarIndexSaved)
11206 {
11207 int itmQBIndex;
11208
11209
11210 if (!ctx.
Read(itmQBIndex))
11211 {
11213 return false;
11214 }
11215
11216 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11217 if (itmQBIndex != -1 && parentPlayer)
11218 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11219 }
11220 }
11221 else
11222 {
11223
11224 PlayerBase player;
11225 int itemQBIndex;
11226 if (version ==
int.
MAX)
11227 {
11228 if (!ctx.
Read(itemQBIndex))
11229 {
11231 return false;
11232 }
11233 }
11234 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11235 {
11236
11237 if (!ctx.
Read(itemQBIndex))
11238 {
11240 return false;
11241 }
11242 if (itemQBIndex != -1 && player)
11243 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11244 }
11245 }
11246
11247 if (version < 140)
11248 {
11249
11250 if (!LoadVariables(ctx, version))
11251 {
11253 return false;
11254 }
11255 }
11256
11257
11259 {
11261 return false;
11262 }
11263 if (version >= 132)
11264 {
11266 if (raib)
11267 {
11269 {
11271 return false;
11272 }
11273 }
11274 }
11275
11277 return true;
11278 }
11279
11280
11281
11283 {
11284 super.OnStoreSave(ctx);
11285
11286 PlayerBase player;
11287 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11288 {
11290
11291 int itemQBIndex = -1;
11292 itemQBIndex = player.FindQuickBarEntityIndex(this);
11293 ctx.
Write(itemQBIndex);
11294 }
11295 else
11296 {
11298 }
11299
11301
11303 if (raib)
11304 {
11306 }
11307 }
11308
11309
11311 {
11312 super.AfterStoreLoad();
11313
11315 {
11317 }
11318
11320 {
11323 }
11324 }
11325
11327 {
11328 super.EEOnAfterLoad();
11329
11331 {
11333 }
11334
11337 }
11338
11340 {
11341 return false;
11342 }
11343
11344
11345
11347 {
11349 {
11350 #ifdef PLATFORM_CONSOLE
11351
11353 {
11355 if (menu)
11356 {
11358 }
11359 }
11360 #endif
11361 }
11362
11364 {
11367 }
11368
11370 {
11371 SetWeightDirty();
11373 }
11375 {
11378 }
11379
11381 {
11384 }
11386 {
11389 }
11390
11391 super.OnVariablesSynchronized();
11392 }
11393
11394
11395
11397 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11398 {
11399 if (!IsServerCheck(allow_client))
11400 return false;
11401
11403 return false;
11404
11407
11408 if (value <= (min + 0.001))
11409 value = min;
11410
11411 if (value == min)
11412 {
11413 if (destroy_config)
11414 {
11415 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11416 if (dstr)
11417 {
11419 this.Delete();
11420 return true;
11421 }
11422 }
11423 else if (destroy_forced)
11424 {
11426 this.Delete();
11427 return true;
11428 }
11429
11431 }
11432
11435
11437 {
11439
11440 if (delta)
11442 }
11443
11445
11446 return false;
11447 }
11448
11449
11451 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11452 {
11454 }
11455
11457 {
11460 }
11461
11463 {
11466 }
11467
11469 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11470 {
11471 float value_clamped = Math.Clamp(value, 0, 1);
11473 SetQuantity(result, destroy_config, destroy_forced);
11474 }
11475
11476
11479 {
11481 }
11482
11484 {
11486 }
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11498 {
11499 int slot = -1;
11500 if (GetInventory())
11501 {
11502 InventoryLocation il = new InventoryLocation;
11503 GetInventory().GetCurrentInventoryLocation(il);
11505 }
11506
11508 }
11509
11511 {
11512 float quantity_max = 0;
11513
11515 {
11516 if (attSlotID != -1)
11517 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11518
11519 if (quantity_max <= 0)
11521 }
11522
11523 if (quantity_max <= 0)
11525
11526 return quantity_max;
11527 }
11528
11530 {
11532 }
11533
11535 {
11537 }
11538
11539
11541 {
11543 }
11544
11546 {
11548 }
11549
11551 {
11553 }
11554
11555
11557 {
11558
11559 float weightEx = GetWeightEx();
11560 float special = GetInventoryAndCargoWeight();
11561 return weightEx - special;
11562 }
11563
11564
11566 {
11568 }
11569
11571 {
11573 {
11574 #ifdef DEVELOPER
11575 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11576 {
11577 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11579 }
11580 #endif
11581
11582 return GetQuantity() * GetConfigWeightModified();
11583 }
11584 else if (HasEnergyManager())
11585 {
11586 #ifdef DEVELOPER
11587 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11588 {
11589 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11590 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11591 }
11592 #endif
11593 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11594 }
11595 else
11596 {
11597 #ifdef DEVELOPER
11598 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11599 {
11600 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11601 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11602 }
11603 #endif
11604 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11605 }
11606 }
11607
11610 {
11611 int item_count = 0;
11613
11614 if (GetInventory().GetCargo() != NULL)
11615 {
11616 item_count = GetInventory().GetCargo().GetItemCount();
11617 }
11618
11619 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11620 {
11621 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11622 if (item)
11623 item_count += item.GetNumberOfItems();
11624 }
11625 return item_count;
11626 }
11627
11630 {
11631 float weight = 0;
11632 float wetness = 1;
11633 if (include_wetness)
11636 {
11637 weight = wetness * m_ConfigWeight;
11638 }
11640 {
11641 weight = 1;
11642 }
11643 return weight;
11644 }
11645
11646
11647
11649 {
11650 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11651 {
11652 GameInventory inv = GetInventory();
11653 array<EntityAI> items = new array<EntityAI>;
11655 for (int i = 0; i < items.Count(); i++)
11656 {
11658 if (item)
11659 {
11661 }
11662 }
11663 }
11664 }
11665
11666
11667
11668
11670 {
11671 float energy = 0;
11672 if (HasEnergyManager())
11673 {
11674 energy = GetCompEM().GetEnergy();
11675 }
11676 return energy;
11677 }
11678
11679
11681 {
11682 super.OnEnergyConsumed();
11683
11685 }
11686
11688 {
11689 super.OnEnergyAdded();
11690
11692 }
11693
11694
11696 {
11697 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11698 {
11700 {
11701 float energy_0to1 = GetCompEM().GetEnergy0To1();
11703 }
11704 }
11705 }
11706
11707
11709 {
11710 return ConfigGetFloat("heatIsolation");
11711 }
11712
11714 {
11716 }
11717
11719 {
11720 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11721 if (
GetGame().ConfigIsExisting(paramPath))
11723
11724 return 0.0;
11725 }
11726
11728 {
11729 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11730 if (
GetGame().ConfigIsExisting(paramPath))
11732
11733 return 0.0;
11734 }
11735
11736 override void SetWet(
float value,
bool allow_client =
false)
11737 {
11738 if (!IsServerCheck(allow_client))
11739 return;
11740
11743
11745
11746 m_VarWet = Math.Clamp(value, min, max);
11747
11749 {
11752 }
11753 }
11754
11755 override void AddWet(
float value)
11756 {
11758 }
11759
11761 {
11763 }
11764
11766 {
11768 }
11769
11771 {
11773 }
11774
11776 {
11778 }
11779
11781 {
11783 }
11784
11785 override void OnWetChanged(
float newVal,
float oldVal)
11786 {
11789 if (newLevel != oldLevel)
11790 {
11792 }
11793 }
11794
11796 {
11797 SetWeightDirty();
11798 }
11799
11801 {
11802 return GetWetLevelInternal(
m_VarWet);
11803 }
11804
11805
11806
11808 {
11810 }
11811
11813 {
11815 }
11816
11818 {
11820 }
11821
11823 {
11825 }
11826
11827
11828
11830 {
11831 if (ConfigIsExisting("itemModelLength"))
11832 {
11833 return ConfigGetFloat("itemModelLength");
11834 }
11835 return 0;
11836 }
11837
11839 {
11840 if (ConfigIsExisting("itemAttachOffset"))
11841 {
11842 return ConfigGetFloat("itemAttachOffset");
11843 }
11844 return 0;
11845 }
11846
11847 override void SetCleanness(
int value,
bool allow_client =
false)
11848 {
11849 if (!IsServerCheck(allow_client))
11850 return;
11851
11853
11855
11858 }
11859
11861 {
11863 }
11864
11866 {
11867 return true;
11868 }
11869
11870
11871
11872
11874 {
11876 }
11877
11879 {
11881 }
11882
11883
11884
11885
11886 override void SetColor(
int r,
int g,
int b,
int a)
11887 {
11893 }
11895 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11896 {
11901 }
11902
11904 {
11906 }
11907
11910 {
11911 int r,g,b,a;
11913 r = r/255;
11914 g = g/255;
11915 b = b/255;
11916 a = a/255;
11917 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11918 }
11919
11920
11921
11922 override void SetLiquidType(
int value,
bool allow_client =
false)
11923 {
11924 if (!IsServerCheck(allow_client))
11925 return;
11926
11931 }
11932
11934 {
11935 return ConfigGetInt("varLiquidTypeInit");
11936 }
11937
11939 {
11941 }
11942
11944 {
11946 SetFrozen(false);
11947 }
11948
11951 {
11952 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11953 }
11954
11955
11958 {
11959 PlayerBase nplayer;
11960 if (PlayerBase.CastTo(nplayer, player))
11961 {
11963
11964 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11965 }
11966 }
11967
11968
11971 {
11972 PlayerBase nplayer;
11973 if (PlayerBase.CastTo(nplayer,player))
11974 {
11975
11976 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11977
11978 }
11979
11980
11981 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11982
11983
11984 if (HasEnergyManager())
11985 {
11986 GetCompEM().UpdatePlugState();
11987 }
11988 }
11989
11990
11992 {
11993 super.OnPlacementStarted(player);
11994
11996 }
11997
11998 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11999 {
12001 {
12002 m_AdminLog.OnPlacementComplete(player,
this);
12003 }
12004
12005 super.OnPlacementComplete(player, position, orientation);
12006 }
12007
12008
12009
12010
12011
12013 {
12015 {
12016 return true;
12017 }
12018 else
12019 {
12020 return false;
12021 }
12022 }
12023
12024
12026 {
12028 {
12030 }
12031 }
12032
12033
12035 {
12037 }
12038
12040 {
12042 }
12043
12044 override void InsertAgent(
int agent,
float count = 1)
12045 {
12046 if (count < 1)
12047 return;
12048
12050 }
12051
12054 {
12056 }
12057
12058
12060 {
12062 }
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12106 {
12108 return false;
12109 return true;
12110 }
12111
12113 {
12114
12116 }
12117
12118
12121 {
12122 super.CheckForRoofLimited(timeTresholdMS);
12123
12125 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12126 {
12127 m_PreviousRoofTestTime = time;
12128 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12129 }
12130 }
12131
12132
12134 {
12136 {
12137 return 0;
12138 }
12139
12140 if (GetInventory().GetAttachmentSlotsCount() != 0)
12141 {
12142 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12143 if (filter)
12144 return filter.GetProtectionLevel(type, false, system);
12145 else
12146 return 0;
12147 }
12148
12149 string subclassPath, entryName;
12150
12151 switch (type)
12152 {
12154 entryName = "biological";
12155 break;
12157 entryName = "chemical";
12158 break;
12159 default:
12160 entryName = "biological";
12161 break;
12162 }
12163
12164 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12165
12167 }
12168
12169
12170
12173 {
12174 if (!IsMagazine())
12176
12178 }
12179
12180
12181
12182
12183
12188 {
12189 return true;
12190 }
12191
12193 {
12195 }
12196
12197
12198
12199
12200
12202 {
12203 if (parent)
12204 {
12205 if (parent.IsInherited(DayZInfected))
12206 return true;
12207
12208 if (!parent.IsRuined())
12209 return true;
12210 }
12211
12212 return true;
12213 }
12214
12216 {
12217 if (!super.CanPutAsAttachment(parent))
12218 {
12219 return false;
12220 }
12221
12222 if (!IsRuined() && !parent.IsRuined())
12223 {
12224 return true;
12225 }
12226
12227 return false;
12228 }
12229
12231 {
12232
12233
12234
12235
12236 return super.CanReceiveItemIntoCargo(item);
12237 }
12238
12240 {
12241
12242
12243
12244
12245 GameInventory attachmentInv = attachment.GetInventory();
12247 {
12248 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12249 return false;
12250 }
12251
12252 InventoryLocation loc = new InventoryLocation();
12253 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12254 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12255 return false;
12256
12257 return super.CanReceiveAttachment(attachment, slotId);
12258 }
12259
12261 {
12262 if (!super.CanReleaseAttachment(attachment))
12263 return false;
12264
12265 return GetInventory().AreChildrenAccessible();
12266 }
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12289 {
12290 int id = muzzle_owner.GetMuzzleID();
12291 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12292
12293 if (WPOF_array)
12294 {
12295 for (int i = 0; i < WPOF_array.Count(); i++)
12296 {
12297 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12298
12299 if (WPOF)
12300 {
12301 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12302 }
12303 }
12304 }
12305 }
12306
12307
12309 {
12310 int id = muzzle_owner.GetMuzzleID();
12312
12313 if (WPOBE_array)
12314 {
12315 for (int i = 0; i < WPOBE_array.Count(); i++)
12316 {
12317 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12318
12319 if (WPOBE)
12320 {
12321 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12322 }
12323 }
12324 }
12325 }
12326
12327
12329 {
12330 int id = muzzle_owner.GetMuzzleID();
12331 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12332
12333 if (WPOOH_array)
12334 {
12335 for (int i = 0; i < WPOOH_array.Count(); i++)
12336 {
12337 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12338
12339 if (WPOOH)
12340 {
12341 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12342 }
12343 }
12344 }
12345 }
12346
12347
12349 {
12350 int id = muzzle_owner.GetMuzzleID();
12351 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12352
12353 if (WPOOH_array)
12354 {
12355 for (int i = 0; i < WPOOH_array.Count(); i++)
12356 {
12357 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12358
12359 if (WPOOH)
12360 {
12361 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12362 }
12363 }
12364 }
12365 }
12366
12367
12369 {
12370 int id = muzzle_owner.GetMuzzleID();
12371 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12372
12373 if (WPOOH_array)
12374 {
12375 for (int i = 0; i < WPOOH_array.Count(); i++)
12376 {
12377 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12378
12379 if (WPOOH)
12380 {
12381 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12382 }
12383 }
12384 }
12385 }
12386
12387
12388
12390 {
12392 {
12393 return true;
12394 }
12395
12396 return false;
12397 }
12398
12400 {
12402 {
12403 return true;
12404 }
12405
12406 return false;
12407 }
12408
12410 {
12412 {
12413 return true;
12414 }
12415
12416 return false;
12417 }
12418
12420 {
12421 return false;
12422 }
12423
12426 {
12427 return UATimeSpent.DEFAULT_DEPLOY;
12428 }
12429
12430
12431
12432
12434 {
12436 SetSynchDirty();
12437 }
12438
12440 {
12442 }
12443
12444
12446 {
12447 return false;
12448 }
12449
12452 {
12453 string att_type = "None";
12454
12455 if (ConfigIsExisting("soundAttType"))
12456 {
12457 att_type = ConfigGetString("soundAttType");
12458 }
12459
12461 }
12462
12464 {
12466 }
12467
12468
12469
12470
12471
12477
12479 {
12482
12484 }
12485
12486
12488 {
12490 return;
12491
12493
12496
12499
12500 SoundParameters params = new SoundParameters();
12504 }
12505
12506
12508 {
12510 return;
12511
12513 SetSynchDirty();
12514
12517 }
12518
12519
12521 {
12523 return;
12524
12526 SetSynchDirty();
12527
12530 }
12531
12533 {
12535 }
12536
12538 {
12540 }
12541
12544 {
12545 if (!
GetGame().IsDedicatedServer())
12546 {
12547 if (ConfigIsExisting("attachSoundSet"))
12548 {
12549 string cfg_path = "";
12550 string soundset = "";
12551 string type_name =
GetType();
12552
12555 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12556 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12557
12558 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12559 {
12560 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12561 {
12562 if (cfg_slot_array[i] == slot_type)
12563 {
12564 soundset = cfg_soundset_array[i];
12565 break;
12566 }
12567 }
12568 }
12569
12570 if (soundset != "")
12571 {
12572 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12574 }
12575 }
12576 }
12577 }
12578
12580 {
12581
12582 }
12583
12584 void OnApply(PlayerBase player);
12585
12587 {
12588 return 1.0;
12589 };
12590
12592 {
12594 }
12595
12597 {
12599 }
12600
12602
12604 {
12605 SetDynamicPhysicsLifeTime(0.01);
12607 }
12608
12610 {
12611 array<string> zone_names = new array<string>;
12612 GetDamageZones(zone_names);
12613 for (int i = 0; i < zone_names.Count(); i++)
12614 {
12615 SetHealthMax(zone_names.Get(i),"Health");
12616 }
12617 SetHealthMax("","Health");
12618 }
12619
12622 {
12623 float global_health = GetHealth01("","Health");
12624 array<string> zones = new array<string>;
12625 GetDamageZones(zones);
12626
12627 for (int i = 0; i < zones.Count(); i++)
12628 {
12629 SetHealth01(zones.Get(i),"Health",global_health);
12630 }
12631 }
12632
12635 {
12636 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12637 }
12638
12640 {
12641 if (!hasRootAsPlayer)
12642 {
12643 if (refParentIB)
12644 {
12645
12646 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12647 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12648
12649 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12650 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12651
12654 }
12655 else
12656 {
12657
12660 }
12661 }
12662 }
12663
12665 {
12667 {
12668 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12669 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12670 {
12671 float heatPermCoef = 1.0;
12673 while (ent)
12674 {
12675 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12676 ent = ent.GetHierarchyParent();
12677 }
12678
12679 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12680 }
12681 }
12682 }
12683
12685 {
12686
12687 EntityAI parent = GetHierarchyParent();
12688 if (!parent)
12689 {
12690 hasParent = false;
12691 hasRootAsPlayer = false;
12692 }
12693 else
12694 {
12695 hasParent = true;
12696 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12697 refParentIB =
ItemBase.Cast(parent);
12698 }
12699 }
12700
12701 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12702 {
12703
12704 }
12705
12707 {
12708
12709 return false;
12710 }
12711
12713 {
12714
12715
12716 return false;
12717 }
12718
12720 {
12721
12722 return false;
12723 }
12724
12727 {
12728 return !GetIsFrozen() &&
IsOpen();
12729 }
12730
12732 {
12733 bool hasParent = false, hasRootAsPlayer = false;
12735
12736 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12737 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12738
12739 if (wwtu || foodDecay)
12740 {
12744
12745 if (processWetness || processTemperature || processDecay)
12746 {
12748
12749 if (processWetness)
12750 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12751
12752 if (processTemperature)
12754
12755 if (processDecay)
12756 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12757 }
12758 }
12759 }
12760
12763 {
12765 }
12766
12768 {
12771
12772 return super.GetTemperatureFreezeThreshold();
12773 }
12774
12776 {
12779
12780 return super.GetTemperatureThawThreshold();
12781 }
12782
12784 {
12787
12788 return super.GetItemOverheatThreshold();
12789 }
12790
12792 {
12794 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12795
12796 return super.GetTemperatureFreezeTime();
12797 }
12798
12800 {
12802 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12803
12804 return super.GetTemperatureThawTime();
12805 }
12806
12811
12813 {
12814 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12815 }
12816
12818 {
12819 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12820 }
12821
12824 {
12826 }
12827
12829 {
12831 }
12832
12834 {
12836 }
12837
12840 {
12841 return null;
12842 }
12843
12846 {
12847 return false;
12848 }
12849
12851 {
12853 {
12856 if (!trg)
12857 {
12859 explosive = this;
12860 }
12861
12862 explosive.PairRemote(trg);
12864
12865 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12866 trg.SetPersistentPairID(persistentID);
12867 explosive.SetPersistentPairID(persistentID);
12868
12869 return true;
12870 }
12871 return false;
12872 }
12873
12876 {
12877 float ret = 1.0;
12880 ret *= GetHealth01();
12881
12882 return ret;
12883 }
12884
12885 #ifdef DEVELOPER
12886 override void SetDebugItem()
12887 {
12888 super.SetDebugItem();
12889 _itemBase = this;
12890 }
12891
12893 {
12894 string text = super.GetDebugText();
12895
12897 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12898
12899 return text;
12900 }
12901 #endif
12902
12904 {
12905 return true;
12906 }
12907
12909
12911
12913 {
12916 }
12917
12918
12926
12942}
12943
12945{
12947 if (entity)
12948 {
12949 bool is_item = entity.IsInherited(
ItemBase);
12950 if (is_item && full_quantity)
12951 {
12954 }
12955 }
12956 else
12957 {
12959 return NULL;
12960 }
12961 return entity;
12962}
12963
12965{
12966 if (item)
12967 {
12968 if (health > 0)
12969 item.SetHealth("", "", health);
12970
12971 if (item.CanHaveTemperature())
12972 {
12974 if (item.CanFreeze())
12975 item.SetFrozen(false);
12976 }
12977
12978 if (item.HasEnergyManager())
12979 {
12980 if (quantity >= 0)
12981 {
12982 item.GetCompEM().SetEnergy0To1(quantity);
12983 }
12984 else
12985 {
12987 }
12988 }
12989 else if (item.IsMagazine())
12990 {
12991 Magazine mag = Magazine.Cast(item);
12992 if (quantity >= 0)
12993 {
12994 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12995 }
12996 else
12997 {
12999 }
13000
13001 }
13002 else
13003 {
13004 if (quantity >= 0)
13005 {
13006 item.SetQuantityNormalized(quantity, false);
13007 }
13008 else
13009 {
13011 }
13012
13013 }
13014 }
13015}
13016
13017#ifdef DEVELOPER
13019#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.