8158{
8160 {
8161 return true;
8162 }
8163};
8164
8165
8166
8168{
8172
8174
8177
8178
8179
8180
8181
8190
8196
8201
8206
8227 protected bool m_IsResultOfSplit
8228
8230
8235
8236
8237
8239
8243
8244
8245
8247
8250
8251
8252
8258
8259
8267
8270
8271
8273
8274
8276
8277
8282
8283
8288
8289
8291
8292
8294 {
8299
8300 if (!
GetGame().IsDedicatedServer())
8301 {
8303 {
8305
8307 {
8309 }
8310 }
8311
8314 }
8315
8316 m_OldLocation = null;
8317
8319 {
8321 }
8322
8323 if (ConfigIsExisting("headSelectionsToHide"))
8324 {
8327 }
8328
8330 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8331 {
8333 }
8334
8336
8337 m_IsResultOfSplit = false;
8338
8340 }
8341
8343 {
8344 super.InitItemVariables();
8345
8351 m_Count = ConfigGetInt(
"count");
8352
8355
8360
8363
8368
8380
8384
8385
8388 if (ConfigIsExisting("canBeSplit"))
8389 {
8392 }
8393
8395 if (ConfigIsExisting("itemBehaviour"))
8397
8398
8401 RegisterNetSyncVariableInt("m_VarLiquidType");
8402 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8403
8404 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8405 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8406 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8407
8408 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8409 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8410 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8411 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8412
8413 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8414 RegisterNetSyncVariableBool("m_IsTakeable");
8415 RegisterNetSyncVariableBool("m_IsHologram");
8416
8419 {
8422 }
8423
8425
8427 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8429
8430 }
8431
8433 {
8435 }
8436
8438 {
8441 {
8446 }
8447 }
8448
8449 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8450 {
8452 {
8455 }
8456
8458 }
8459
8461 {
8467 }
8468
8470
8472 {
8474
8475 if (!action)
8476 {
8477 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8478 return;
8479 }
8480
8482 if (!ai)
8483 {
8485 return;
8486 }
8487
8489 if (!action_array)
8490 {
8491 action_array = new array<ActionBase_Basic>;
8493 }
8494 if (LogManager.IsActionLogEnable())
8495 {
8496 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8497 }
8498
8499 if (action_array.Find(action) != -1)
8500 {
8501 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8502 }
8503 else
8504 {
8505 action_array.Insert(action);
8506 }
8507 }
8508
8510 {
8512 ActionBase action = player.GetActionManager().GetAction(actionName);
8515
8516 if (action_array)
8517 {
8518 action_array.RemoveItem(action);
8519 }
8520 }
8521
8522
8523
8525 {
8526 ActionOverrideData overrideData = new ActionOverrideData();
8530
8532 if (!actionMap)
8533 {
8536 }
8537
8538 actionMap.Insert(this.
Type(), overrideData);
8539
8540 }
8541
8543
8545
8546
8548 {
8551
8554
8555 string config_to_search = "CfgVehicles";
8556 string muzzle_owner_config;
8557
8559 {
8560 if (IsInherited(Weapon))
8561 config_to_search = "CfgWeapons";
8562
8563 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8564
8565 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8566
8568
8569 if (config_OnFire_subclass_count > 0)
8570 {
8571 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8572
8573 for (int i = 0; i < config_OnFire_subclass_count; i++)
8574 {
8575 string particle_class = "";
8577 string config_OnFire_entry = config_OnFire_class + particle_class;
8578 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8579 WPOF_array.Insert(WPOF);
8580 }
8581
8582
8584 }
8585 }
8586
8588 {
8589 config_to_search = "CfgWeapons";
8590 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8591
8592 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8593
8595
8596 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8597 {
8598 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8599
8600 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8601 {
8602 string particle_class2 = "";
8604 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8605 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8606 WPOBE_array.Insert(WPOBE);
8607 }
8608
8609
8611 }
8612 }
8613 }
8614
8615
8617 {
8620
8622 {
8623 string config_to_search = "CfgVehicles";
8624
8625 if (IsInherited(Weapon))
8626 config_to_search = "CfgWeapons";
8627
8628 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8629 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8630
8631 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8632 {
8633
8635
8637 {
8639 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8641 return;
8642 }
8643
8646
8647
8648
8650 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8651
8652 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8653 {
8654 string particle_class = "";
8656 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8658
8659 if (entry_type == CT_CLASS)
8660 {
8661 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8662 WPOOH_array.Insert(WPOF);
8663 }
8664 }
8665
8666
8668 }
8669 }
8670 }
8671
8673 {
8675 }
8676
8678 {
8680 {
8682
8685
8688
8689 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8690 }
8691 }
8692
8694 {
8696 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8697
8699 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8700
8702 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8703
8705 {
8707 }
8708 }
8709
8711 {
8713 }
8714
8716 {
8719 else
8721
8723 {
8726 }
8727 else
8728 {
8731
8734 }
8735
8737 }
8738
8740 {
8742 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8743 }
8744
8746 {
8748 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8750 }
8751
8753 {
8755 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8756 }
8757
8759 {
8762
8763 OverheatingParticle OP = new OverheatingParticle();
8768
8770 }
8771
8773 {
8776
8777 return -1;
8778 }
8779
8781 {
8783 {
8786
8787 for (int i = count; i > 0; --i)
8788 {
8789 int id = i - 1;
8792
8795
8796 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8797 {
8798 if (p)
8799 {
8802 }
8803 }
8804 }
8805 }
8806 }
8807
8809 {
8811 {
8813 {
8814 int id = i - 1;
8816
8817 if (OP)
8818 {
8820
8821 if (p)
8822 {
8824 }
8825
8826 delete OP;
8827 }
8828 }
8829
8832 }
8833 }
8834
8837 {
8838 return 0.0;
8839 }
8840
8841
8843 {
8844 return 250;
8845 }
8846
8848 {
8849 return 0;
8850 }
8851
8854 {
8856 return true;
8857
8858 return false;
8859 }
8860
8863 {
8866
8868 {
8870 }
8871 else
8872 {
8873
8875 }
8876
8878 }
8879
8886 {
8887 return -1;
8888 }
8889
8890
8891
8892
8894 {
8896 {
8898 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8899
8900 if (r_index >= 0)
8901 {
8902 InventoryLocation r_il = new InventoryLocation;
8903 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8904
8905 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8908 {
8909 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8910 }
8912 {
8913 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8914 }
8915
8916 }
8917
8918 player.GetHumanInventory().ClearUserReservedLocation(this);
8919 }
8920
8923 }
8924
8925
8926
8927
8929 {
8930 return ItemBase.m_DebugActionsMask;
8931 }
8932
8934 {
8935 return ItemBase.m_DebugActionsMask & mask;
8936 }
8937
8939 {
8940 ItemBase.m_DebugActionsMask = mask;
8941 }
8942
8944 {
8945 ItemBase.m_DebugActionsMask |= mask;
8946 }
8947
8949 {
8950 ItemBase.m_DebugActionsMask &= ~mask;
8951 }
8952
8954 {
8956 {
8958 }
8959 else
8960 {
8962 }
8963 }
8964
8965
8967 {
8968 if (GetEconomyProfile())
8969 {
8970 float q_max = GetEconomyProfile().GetQuantityMax();
8971 if (q_max > 0)
8972 {
8973 float q_min = GetEconomyProfile().GetQuantityMin();
8974 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8975
8977 {
8978 ComponentEnergyManager comp = GetCompEM();
8980 {
8982 }
8983 }
8985 {
8987
8988 }
8989
8990 }
8991 }
8992 }
8993
8996 {
8997 EntityAI parent = GetHierarchyParent();
8998
8999 if (parent)
9000 {
9001 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9002 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9003 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9004 }
9005 }
9006
9009 {
9010 EntityAI parent = GetHierarchyParent();
9011
9012 if (parent)
9013 {
9014 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9015 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9016 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9017 }
9018 }
9019
9021 {
9022
9023
9024
9025
9027
9029 {
9030 if (ScriptInputUserData.CanStoreInputUserData())
9031 {
9032 ScriptInputUserData ctx = new ScriptInputUserData;
9038 ctx.
Write(use_stack_max);
9041
9043 {
9044 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9045 }
9046 }
9047 }
9048 else if (!
GetGame().IsMultiplayer())
9049 {
9051 }
9052 }
9053
9055 {
9057 }
9058
9060 {
9062 }
9063
9065 {
9067 }
9068
9070 {
9071
9072 return false;
9073 }
9074
9076 {
9077 return false;
9078 }
9079
9083 {
9084 return false;
9085 }
9086
9088 {
9089 return "";
9090 }
9091
9093
9095 {
9096 return false;
9097 }
9098
9100 {
9101 return true;
9102 }
9103
9104
9105
9107 {
9108 return true;
9109 }
9110
9112 {
9113 return true;
9114 }
9115
9117 {
9118 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9120 }
9121
9123 {
9125 }
9126
9128 {
9130 if (!is_being_placed)
9132 SetSynchDirty();
9133 }
9134
9135
9137
9139 {
9141 }
9142
9144 {
9146 }
9147
9149 {
9150 return 1;
9151 }
9152
9154 {
9155 return false;
9156 }
9157
9159 {
9161 SetSynchDirty();
9162 }
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9199 {
9200 super.OnMovedInsideCargo(container);
9201
9202 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9203 }
9204
9205 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9206 {
9207 super.EEItemLocationChanged(oldLoc,newLoc);
9208
9209 PlayerBase new_player = null;
9210 PlayerBase old_player = null;
9211
9212 if (newLoc.GetParent())
9213 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9214
9215 if (oldLoc.GetParent())
9216 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9217
9219 {
9220 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9221
9222 if (r_index >= 0)
9223 {
9224 InventoryLocation r_il = new InventoryLocation;
9225 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9226
9227 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9230 {
9231 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9232 }
9234 {
9235 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9236 }
9237
9238 }
9239 }
9240
9242 {
9243 if (new_player)
9244 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9245
9246 if (new_player == old_player)
9247 {
9248
9249 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9250 {
9252 {
9253 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9254 {
9255 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9256 }
9257 }
9258 else
9259 {
9260 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9261 }
9262 }
9263
9264 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9265 {
9266 int type = oldLoc.GetType();
9268 {
9269 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9270 }
9272 {
9273 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9274 }
9275 }
9276 if (!m_OldLocation)
9277 {
9278 m_OldLocation = new InventoryLocation;
9279 }
9280 m_OldLocation.Copy(oldLoc);
9281 }
9282 else
9283 {
9284 if (m_OldLocation)
9285 {
9286 m_OldLocation.Reset();
9287 }
9288 }
9289
9291 }
9292 else
9293 {
9294 if (new_player)
9295 {
9296 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9297 if (res_index >= 0)
9298 {
9299 InventoryLocation il = new InventoryLocation;
9300 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9302 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9305 {
9306 il.
GetParent().GetOnReleaseLock().Invoke(it);
9307 }
9309 {
9311 }
9312
9313 }
9314 }
9316 {
9317
9319 }
9320
9321 if (m_OldLocation)
9322 {
9323 m_OldLocation.Reset();
9324 }
9325 }
9326 }
9327
9328 override void EOnContact(IEntity other, Contact extra)
9329 {
9331 {
9332 int liquidType = -1;
9334 if (impactSpeed > 0.0)
9335 {
9337 #ifndef SERVER
9339 #else
9341 SetSynchDirty();
9342 #endif
9344 }
9345 }
9346
9347 #ifdef SERVER
9348 if (GetCompEM() && GetCompEM().IsPlugged())
9349 {
9350 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9351 GetCompEM().UnplugThis();
9352 }
9353 #endif
9354 }
9355
9357
9359 {
9361 }
9362
9364 {
9365
9366 }
9367
9369 {
9370 super.OnItemLocationChanged(old_owner, new_owner);
9371
9372 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9373 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9374
9375 if (!relatedPlayer && playerNew)
9376 relatedPlayer = playerNew;
9377
9378 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9379 {
9381 if (actionMgr)
9382 {
9383 ActionBase currentAction = actionMgr.GetRunningAction();
9384 if (currentAction)
9386 }
9387 }
9388
9389 Man ownerPlayerOld = null;
9390 Man ownerPlayerNew = null;
9391
9392 if (old_owner)
9393 {
9394 if (old_owner.
IsMan())
9395 {
9396 ownerPlayerOld = Man.Cast(old_owner);
9397 }
9398 else
9399 {
9400 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9401 }
9402 }
9403 else
9404 {
9406 {
9408
9409 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9410 {
9411 GetCompEM().UnplugThis();
9412 }
9413 }
9414 }
9415
9416 if (new_owner)
9417 {
9418 if (new_owner.
IsMan())
9419 {
9420 ownerPlayerNew = Man.Cast(new_owner);
9421 }
9422 else
9423 {
9424 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9425 }
9426 }
9427
9428 if (ownerPlayerOld != ownerPlayerNew)
9429 {
9430 if (ownerPlayerOld)
9431 {
9432 array<EntityAI> subItemsExit = new array<EntityAI>;
9434 for (int i = 0; i < subItemsExit.Count(); i++)
9435 {
9438 }
9439 }
9440
9441 if (ownerPlayerNew)
9442 {
9443 array<EntityAI> subItemsEnter = new array<EntityAI>;
9445 for (int j = 0; j < subItemsEnter.Count(); j++)
9446 {
9449 }
9450 }
9451 }
9452 else if (ownerPlayerNew != null)
9453 {
9454 PlayerBase nplayer;
9455 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9456 {
9457 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9459 for (int k = 0; k < subItemsUpdate.Count(); k++)
9460 {
9462 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9463 }
9464 }
9465 }
9466
9467 if (old_owner)
9468 old_owner.OnChildItemRemoved(this);
9469 if (new_owner)
9470 new_owner.OnChildItemReceived(this);
9471 }
9472
9473
9475 {
9476 super.EEDelete(parent);
9477 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9478 if (player)
9479 {
9481
9482 if (player.IsAlive())
9483 {
9484 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9485 if (r_index >= 0)
9486 {
9487 InventoryLocation r_il = new InventoryLocation;
9488 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9489
9490 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9493 {
9494 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9495 }
9497 {
9498 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9499 }
9500
9501 }
9502
9503 player.RemoveQuickBarEntityShortcut(this);
9504 }
9505 }
9506 }
9507
9509 {
9510 super.EEKilled(killer);
9511
9514 {
9515 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9516 {
9517 if (IsMagazine())
9518 {
9519 if (Magazine.Cast(this).GetAmmoCount() > 0)
9520 {
9522 }
9523 }
9524 else
9525 {
9527 }
9528 }
9529 }
9530 }
9531
9533 {
9534 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9535
9536 super.OnWasAttached(parent, slot_id);
9537
9540
9542 }
9543
9545 {
9546 super.OnWasDetached(parent, slot_id);
9547
9550 }
9551
9553 {
9554 int idx;
9557
9558 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9559 if (inventory_slots.Count() < 1)
9560 {
9561 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9562 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9563 }
9564 else
9565 {
9566 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9567 }
9568
9569 idx = inventory_slots.Find(slot);
9570 if (idx < 0)
9571 return "";
9572
9573 return attach_types.Get(idx);
9574 }
9575
9577 {
9578 int idx = -1;
9579 string slot;
9580
9583
9584 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9585 if (inventory_slots.Count() < 1)
9586 {
9587 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9588 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9589 }
9590 else
9591 {
9592 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9593 if (detach_types.Count() < 1)
9594 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9595 }
9596
9597 for (int i = 0; i < inventory_slots.Count(); i++)
9598 {
9599 slot = inventory_slots.Get(i);
9600 }
9601
9602 if (slot != "")
9603 {
9604 if (detach_types.Count() == 1)
9605 idx = 0;
9606 else
9607 idx = inventory_slots.Find(slot);
9608 }
9609 if (idx < 0)
9610 return "";
9611
9612 return detach_types.Get(idx);
9613 }
9614
9616 {
9617
9619
9620
9621 float min_time = 1;
9622 float max_time = 3;
9623 float delay = Math.RandomFloat(min_time, max_time);
9624
9625 explode_timer.Run(delay, this, "DoAmmoExplosion");
9626 }
9627
9629 {
9630 Magazine magazine = Magazine.Cast(this);
9631 int pop_sounds_count = 6;
9632 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9633
9634
9635 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9636 string sound_name = pop_sounds[ sound_idx ];
9638
9639
9640 magazine.ServerAddAmmoCount(-1);
9641
9642
9643 float min_temp_to_explode = 100;
9644
9645 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9646 {
9648 }
9649 }
9650
9651
9652 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9653 {
9654 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9655
9656 const int CHANCE_DAMAGE_CARGO = 4;
9657 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9658 const int CHANCE_DAMAGE_NOTHING = 2;
9659
9661 {
9662 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9663 int chances;
9664 int rnd;
9665
9666 if (GetInventory().GetCargo())
9667 {
9668 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9669 rnd = Math.RandomInt(0,chances);
9670
9671 if (rnd < CHANCE_DAMAGE_CARGO)
9672 {
9674 }
9675 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9676 {
9678 }
9679 }
9680 else
9681 {
9682 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9683 rnd = Math.RandomInt(0,chances);
9684
9685 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9686 {
9688 }
9689 }
9690 }
9691 }
9692
9694 {
9695 if (GetInventory().GetCargo())
9696 {
9697 int item_count = GetInventory().GetCargo().GetItemCount();
9698 if (item_count > 0)
9699 {
9700 int random_pick = Math.RandomInt(0, item_count);
9702 if (!item.IsExplosive())
9703 {
9704 item.AddHealth("","",damage);
9705 return true;
9706 }
9707 }
9708 }
9709 return false;
9710 }
9711
9713 {
9714 int attachment_count = GetInventory().AttachmentCount();
9715 if (attachment_count > 0)
9716 {
9717 int random_pick = Math.RandomInt(0, attachment_count);
9718 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9719 if (!attachment.IsExplosive())
9720 {
9721 attachment.AddHealth("","",damage);
9722 return true;
9723 }
9724 }
9725 return false;
9726 }
9727
9729 {
9731 }
9732
9734 {
9736 return GetInventory().CanRemoveEntity();
9737
9738 return false;
9739 }
9740
9742 {
9744 return;
9745
9747 {
9748 if (ScriptInputUserData.CanStoreInputUserData())
9749 {
9750 ScriptInputUserData ctx = new ScriptInputUserData;
9755 ctx.
Write(destination_entity);
9759 }
9760 }
9761 else if (!
GetGame().IsMultiplayer())
9762 {
9764 }
9765 }
9766
9768 {
9770 return;
9771
9772 float split_quantity_new;
9776 InventoryLocation loc = new InventoryLocation;
9777
9778 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9779 {
9781 split_quantity_new = stack_max;
9782 else
9784
9785 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9786 if (new_item)
9787 {
9788 new_item.SetResultOfSplit(true);
9789 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9791 new_item.SetQuantity(split_quantity_new);
9792 }
9793 }
9794 else if (destination_entity && slot_id == -1)
9795 {
9796 if (quantity > stack_max)
9797 split_quantity_new = stack_max;
9798 else
9799 split_quantity_new = quantity;
9800
9802 {
9805 }
9806
9807 if (new_item)
9808 {
9809 new_item.SetResultOfSplit(true);
9810 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9812 new_item.SetQuantity(split_quantity_new);
9813 }
9814 }
9815 else
9816 {
9817 if (stack_max != 0)
9818 {
9820 {
9822 }
9823
9824 if (split_quantity_new == 0)
9825 {
9826 if (!
GetGame().IsMultiplayer())
9827 player.PhysicalPredictiveDropItem(this);
9828 else
9829 player.ServerDropEntity(this);
9830 return;
9831 }
9832
9834
9835 if (new_item)
9836 {
9837 new_item.SetResultOfSplit(true);
9838 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9840 new_item.SetQuantity(stack_max);
9841 new_item.PlaceOnSurface();
9842 }
9843 }
9844 }
9845 }
9846
9848 {
9850 return;
9851
9852 float split_quantity_new;
9856 InventoryLocation loc = new InventoryLocation;
9857
9858 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9859 {
9861 split_quantity_new = stack_max;
9862 else
9864
9865 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9866 if (new_item)
9867 {
9868 new_item.SetResultOfSplit(true);
9869 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9871 new_item.SetQuantity(split_quantity_new);
9872 }
9873 }
9874 else if (destination_entity && slot_id == -1)
9875 {
9876 if (quantity > stack_max)
9877 split_quantity_new = stack_max;
9878 else
9879 split_quantity_new = quantity;
9880
9882 {
9885 }
9886
9887 if (new_item)
9888 {
9889 new_item.SetResultOfSplit(true);
9890 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9892 new_item.SetQuantity(split_quantity_new);
9893 }
9894 }
9895 else
9896 {
9897 if (stack_max != 0)
9898 {
9900 {
9902 }
9903
9905
9906 if (new_item)
9907 {
9908 new_item.SetResultOfSplit(true);
9909 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9911 new_item.SetQuantity(stack_max);
9912 new_item.PlaceOnSurface();
9913 }
9914 }
9915 }
9916 }
9917
9919 {
9921 return;
9922
9924 {
9925 if (ScriptInputUserData.CanStoreInputUserData())
9926 {
9927 ScriptInputUserData ctx = new ScriptInputUserData;
9932 dst.WriteToContext(ctx);
9934 }
9935 }
9936 else if (!
GetGame().IsMultiplayer())
9937 {
9939 }
9940 }
9941
9943 {
9945 return;
9946
9948 {
9949 if (ScriptInputUserData.CanStoreInputUserData())
9950 {
9951 ScriptInputUserData ctx = new ScriptInputUserData;
9956 ctx.
Write(destination_entity);
9962 }
9963 }
9964 else if (!
GetGame().IsMultiplayer())
9965 {
9967 }
9968 }
9969
9971 {
9973 }
9974
9976 {
9978 return this;
9979
9981 float split_quantity_new;
9983 if (dst.IsValid())
9984 {
9985 int slot_id = dst.GetSlot();
9987
9988 if (quantity > stack_max)
9989 split_quantity_new = stack_max;
9990 else
9991 split_quantity_new = quantity;
9992
9994
9995 if (new_item)
9996 {
9997 new_item.SetResultOfSplit(true);
9998 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10001 }
10002
10003 return new_item;
10004 }
10005
10006 return null;
10007 }
10008
10010 {
10012 return;
10013
10015 float split_quantity_new;
10017 if (destination_entity)
10018 {
10020 if (quantity > stackable)
10021 split_quantity_new = stackable;
10022 else
10023 split_quantity_new = quantity;
10024
10025 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10026 if (new_item)
10027 {
10028 new_item.SetResultOfSplit(true);
10029 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10031 new_item.SetQuantity(split_quantity_new);
10032 }
10033 }
10034 }
10035
10037 {
10039 return;
10040
10042 {
10043 if (ScriptInputUserData.CanStoreInputUserData())
10044 {
10045 ScriptInputUserData ctx = new ScriptInputUserData;
10050 ItemBase destination_entity =
this;
10051 ctx.
Write(destination_entity);
10055 }
10056 }
10057 else if (!
GetGame().IsMultiplayer())
10058 {
10060 }
10061 }
10062
10064 {
10066 return;
10067
10069 float split_quantity_new;
10071 if (player)
10072 {
10074 if (quantity > stackable)
10075 split_quantity_new = stackable;
10076 else
10077 split_quantity_new = quantity;
10078
10079 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10080 new_item =
ItemBase.Cast(in_hands);
10081 if (new_item)
10082 {
10083 new_item.SetResultOfSplit(true);
10084 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10086 new_item.SetQuantity(split_quantity_new);
10087 }
10088 }
10089 }
10090
10092 {
10094 return;
10095
10097 float split_quantity_new = Math.Floor(quantity * 0.5);
10098
10100
10101 if (new_item)
10102 {
10103 if (new_item.GetQuantityMax() < split_quantity_new)
10104 {
10105 split_quantity_new = new_item.GetQuantityMax();
10106 }
10107
10108 new_item.SetResultOfSplit(true);
10109 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10110
10112 {
10115 }
10116 else
10117 {
10120 }
10121 }
10122 }
10123
10125 {
10127 return;
10128
10130 float split_quantity_new = Math.Floor(quantity / 2);
10131
10132 InventoryLocation invloc = new InventoryLocation;
10134
10136 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10137
10138 if (new_item)
10139 {
10140 if (new_item.GetQuantityMax() < split_quantity_new)
10141 {
10142 split_quantity_new = new_item.GetQuantityMax();
10143 }
10145 {
10148 }
10149 else
10150 {
10153 }
10154 }
10155 }
10156
10159 {
10160 SetWeightDirty();
10162
10163 if (parent)
10164 parent.OnAttachmentQuantityChangedEx(this, delta);
10165
10167 {
10169 {
10171 }
10173 {
10174 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10176 }
10177 }
10178
10179 }
10180
10183 {
10184
10185 }
10186
10189 {
10191 }
10192
10194 {
10195 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10196
10198 {
10199 if (newLevel == GameConstants.STATE_RUINED)
10200 {
10202 EntityAI parent = GetHierarchyParent();
10203 if (parent && parent.IsFireplace())
10204 {
10205 CargoBase cargo = GetInventory().GetCargo();
10206 if (cargo)
10207 {
10209 {
10211 }
10212 }
10213 }
10214 }
10215
10217 {
10218
10220 return;
10221 }
10222
10223 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10224 {
10226 }
10227 }
10228 }
10229
10230
10232 {
10233 super.OnRightClick();
10234
10236 {
10238 {
10239 if (ScriptInputUserData.CanStoreInputUserData())
10240 {
10241 vector m4[4];
10243
10244 EntityAI root = GetHierarchyRoot();
10245
10246 InventoryLocation dst = new InventoryLocation;
10248 {
10249 if (root)
10250 {
10251 root.GetTransform(m4);
10253 }
10254 else
10255 GetInventory().GetCurrentInventoryLocation(dst);
10256 }
10257 else
10258 {
10260
10261
10262 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10263 {
10264 if (root)
10265 {
10266 root.GetTransform(m4);
10268 }
10269 else
10270 GetInventory().GetCurrentInventoryLocation(dst);
10271 }
10272 else
10273 {
10274 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10275 }
10276 }
10277
10278 ScriptInputUserData ctx = new ScriptInputUserData;
10286 }
10287 }
10288 else if (!
GetGame().IsMultiplayer())
10289 {
10291 }
10292 }
10293 }
10294
10295 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10296 {
10297
10298 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10299 return false;
10300
10301 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10302 return false;
10303
10304
10306 return false;
10307
10308
10309 Magazine mag = Magazine.Cast(this);
10310 if (mag)
10311 {
10312 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10313 return false;
10314
10315 if (stack_max_limit)
10316 {
10317 Magazine other_mag = Magazine.Cast(other_item);
10318 if (other_item)
10319 {
10320 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10321 return false;
10322 }
10323
10324 }
10325 }
10326 else
10327 {
10328
10330 return false;
10331
10333 return false;
10334 }
10335
10336 PlayerBase player = null;
10337 if (CastTo(player, GetHierarchyRootPlayer()))
10338 {
10339 if (player.GetInventory().HasAttachment(this))
10340 return false;
10341
10342 if (player.IsItemsToDelete())
10343 return false;
10344 }
10345
10346 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10347 return false;
10348
10349 int slotID;
10351 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10352 return false;
10353
10354 return true;
10355 }
10356
10358 {
10360 }
10361
10363 {
10364 return m_IsResultOfSplit;
10365 }
10366
10368 {
10369 m_IsResultOfSplit = value;
10370 }
10371
10373 {
10375 }
10376
10378 {
10379 float other_item_quantity = other_item.GetQuantity();
10380 float this_free_space;
10381
10383
10385
10386 if (other_item_quantity > this_free_space)
10387 {
10388 return this_free_space;
10389 }
10390 else
10391 {
10392 return other_item_quantity;
10393 }
10394 }
10395
10397 {
10399 }
10400
10402 {
10404 return;
10405
10406 if (!IsMagazine() && other_item)
10407 {
10409 if (quantity_used != 0)
10410 {
10411 float hp1 = GetHealth01("","");
10412 float hp2 = other_item.GetHealth01("","");
10413 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10414 hpResult = hpResult / (
GetQuantity() + quantity_used);
10415
10416 hpResult *= GetMaxHealth();
10417 Math.Round(hpResult);
10418 SetHealth("", "Health", hpResult);
10419
10421 other_item.AddQuantity(-quantity_used);
10422 }
10423 }
10425 }
10426
10428 {
10429 #ifdef SERVER
10430 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10431 GetHierarchyParent().IncreaseLifetimeUp();
10432 #endif
10433 };
10434
10436 {
10437 PlayerBase p = PlayerBase.Cast(player);
10438
10439 array<int> recipesIds = p.m_Recipes;
10440 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10441 if (moduleRecipesManager)
10442 {
10443 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10444 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10445 }
10446
10447 for (int i = 0;i < recipesIds.Count(); i++)
10448 {
10449 int key = recipesIds.Get(i);
10450 string recipeName = moduleRecipesManager.GetRecipeName(key);
10452 }
10453 }
10454
10455
10456 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10457 {
10458 super.GetDebugActions(outputList);
10459
10460
10465
10466
10470
10474
10475
10478
10479
10481 {
10484 }
10485
10487
10490
10494 }
10495
10496
10497
10498
10500 {
10501 super.OnAction(action_id, player, ctx);
10502 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10503 {
10504 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10505 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10506 PlayerBase p = PlayerBase.Cast(player);
10507 if (
EActions.RECIPES_RANGE_START < 1000)
10508 {
10509 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10510 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10511 }
10512 }
10513 #ifndef SERVER
10514 else if (action_id ==
EActions.WATCH_PLAYER)
10515 {
10516 PluginDeveloper.SetDeveloperItemClientEx(player);
10517 }
10518 #endif
10520 {
10521 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10522 {
10523 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10524 OnDebugButtonPressServer(id + 1);
10525 }
10526
10527 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10528 {
10529 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10531 }
10532
10533 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10534 {
10535 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10537 }
10538
10539 else if (action_id ==
EActions.ADD_QUANTITY)
10540 {
10541 if (IsMagazine())
10542 {
10543 Magazine mag = Magazine.Cast(this);
10544 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10545 }
10546 else
10547 {
10549 }
10550
10551 if (m_EM)
10552 {
10553 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10554 }
10555
10556 }
10557
10558 else if (action_id ==
EActions.REMOVE_QUANTITY)
10559 {
10560 if (IsMagazine())
10561 {
10562 Magazine mag2 = Magazine.Cast(this);
10563 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10564 }
10565 else
10566 {
10568 }
10569 if (m_EM)
10570 {
10571 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10572 }
10573
10574 }
10575
10576 else if (action_id ==
EActions.SET_QUANTITY_0)
10577 {
10579
10580 if (m_EM)
10581 {
10582 m_EM.SetEnergy(0);
10583 }
10584 }
10585
10586 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10587 {
10589
10590 if (m_EM)
10591 {
10592 m_EM.SetEnergy(m_EM.GetEnergyMax());
10593 }
10594 }
10595
10596 else if (action_id ==
EActions.ADD_HEALTH)
10597 {
10598 AddHealth("","",GetMaxHealth("","Health")/5);
10599 }
10600 else if (action_id ==
EActions.REMOVE_HEALTH)
10601 {
10602 AddHealth("","",-GetMaxHealth("","Health")/5);
10603 }
10604 else if (action_id ==
EActions.DESTROY_HEALTH)
10605 {
10606 SetHealth01("","",0);
10607 }
10608 else if (action_id ==
EActions.WATCH_ITEM)
10609 {
10611 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10612 #ifdef DEVELOPER
10613 SetDebugDeveloper_item(this);
10614 #endif
10615 }
10616
10617 else if (action_id ==
EActions.ADD_TEMPERATURE)
10618 {
10619 AddTemperature(20);
10620
10621 }
10622
10623 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10624 {
10625 AddTemperature(-20);
10626
10627 }
10628
10629 else if (action_id ==
EActions.FLIP_FROZEN)
10630 {
10631 SetFrozen(!GetIsFrozen());
10632
10633 }
10634
10635 else if (action_id ==
EActions.ADD_WETNESS)
10636 {
10638
10639 }
10640
10641 else if (action_id ==
EActions.REMOVE_WETNESS)
10642 {
10644
10645 }
10646
10647 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10648 {
10651
10652
10653 }
10654
10655 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10656 {
10659 }
10660
10661 else if (action_id ==
EActions.MAKE_SPECIAL)
10662 {
10663 auto debugParams = DebugSpawnParams.WithPlayer(player);
10664 OnDebugSpawnEx(debugParams);
10665 }
10666
10667 else if (action_id ==
EActions.DELETE)
10668 {
10669 Delete();
10670 }
10671
10672 }
10673
10674
10675 return false;
10676 }
10677
10678
10679
10680
10684
10687
10688
10689
10691 {
10692 return false;
10693 }
10694
10695
10697 {
10698 return true;
10699 }
10700
10701
10703 {
10704 return true;
10705 }
10706
10707
10708
10710 {
10711 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10713 }
10714
10717 {
10718 return null;
10719 }
10720
10722 {
10723 return false;
10724 }
10725
10727 {
10728 return false;
10729 }
10730
10734
10735
10737 {
10738 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10739 return module_repairing.CanRepair(this, item_repair_kit);
10740 }
10741
10742
10743 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10744 {
10745 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10746 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10747 }
10748
10749
10751 {
10752
10753
10754
10755
10756
10757
10758
10759
10760 return 1;
10761 }
10762
10763
10764
10766 {
10768 }
10769
10770
10771
10773 {
10775 }
10776
10777
10786 {
10787 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10788
10789 if (player)
10790 {
10791 player.MessageStatus(text);
10792 }
10793 }
10794
10795
10804 {
10805 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10806
10807 if (player)
10808 {
10809 player.MessageAction(text);
10810 }
10811 }
10812
10813
10822 {
10823 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10824
10825 if (player)
10826 {
10827 player.MessageFriendly(text);
10828 }
10829 }
10830
10831
10840 {
10841 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10842
10843 if (player)
10844 {
10845 player.MessageImportant(text);
10846 }
10847 }
10848
10850 {
10851 return true;
10852 }
10853
10854
10855 override bool KindOf(
string tag)
10856 {
10857 bool found = false;
10858 string item_name = this.
GetType();
10861
10862 int array_size = item_tag_array.Count();
10863 for (int i = 0; i < array_size; i++)
10864 {
10865 if (item_tag_array.Get(i) == tag)
10866 {
10867 found = true;
10868 break;
10869 }
10870 }
10871 return found;
10872 }
10873
10874
10876 {
10877
10878 super.OnRPC(sender, rpc_type,ctx);
10879
10880
10881 switch (rpc_type)
10882 {
10883 #ifndef SERVER
10884 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10885 Param2<bool, string> p = new Param2<bool, string>(false, "");
10886
10888 return;
10889
10890 bool play = p.param1;
10891 string soundSet = p.param2;
10892
10893 if (play)
10894 {
10896 {
10898 {
10900 }
10901 }
10902 else
10903 {
10905 }
10906 }
10907 else
10908 {
10910 }
10911
10912 break;
10913 #endif
10914
10915 }
10916
10918 {
10920 }
10921 }
10922
10923
10924
10925
10927 {
10928 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10929 return plugin.GetID(
name);
10930 }
10931
10933 {
10934 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10935 return plugin.GetName(id);
10936 }
10937
10940 {
10941
10942
10943 int varFlags;
10944 if (!ctx.
Read(varFlags))
10945 return;
10946
10947 if (varFlags & ItemVariableFlags.FLOAT)
10948 {
10950 }
10951 }
10952
10954 {
10955
10956 super.SerializeNumericalVars(floats_out);
10957
10958
10959
10961 {
10963 }
10964
10966 {
10968 }
10969
10971 {
10973 }
10974
10976 {
10981 }
10982
10984 {
10986 }
10987 }
10988
10990 {
10991
10992 super.DeSerializeNumericalVars(floats);
10993
10994
10995 int index = 0;
10996 int mask = Math.Round(floats.Get(index));
10997
10998 index++;
10999
11001 {
11003 {
11005 }
11006 else
11007 {
11008 float quantity = floats.Get(index);
11009 SetQuantity(quantity,
true,
false,
false,
false);
11010 }
11011 index++;
11012 }
11013
11015 {
11016 float wet = floats.Get(index);
11018 index++;
11019 }
11020
11022 {
11023 int liquidtype = Math.Round(floats.Get(index));
11025 index++;
11026 }
11027
11029 {
11031 index++;
11033 index++;
11035 index++;
11037 index++;
11038 }
11039
11041 {
11042 int cleanness = Math.Round(floats.Get(index));
11044 index++;
11045 }
11046 }
11047
11049 {
11050 super.WriteVarsToCTX(ctx);
11051
11052
11054 {
11056 }
11057
11059 {
11061 }
11062
11064 {
11066 }
11067
11069 {
11070 int r,g,b,a;
11076 }
11077
11079 {
11081 }
11082 }
11083
11085 {
11086 if (!super.ReadVarsFromCTX(ctx,version))
11087 return false;
11088
11089 int intValue;
11090 float value;
11091
11092 if (version < 140)
11093 {
11094 if (!ctx.
Read(intValue))
11095 return false;
11096
11097 m_VariablesMask = intValue;
11098 }
11099
11101 {
11102 if (!ctx.
Read(value))
11103 return false;
11104
11106 {
11108 }
11109 else
11110 {
11112 }
11113 }
11114
11115 if (version < 140)
11116 {
11118 {
11119 if (!ctx.
Read(value))
11120 return false;
11121 SetTemperatureDirect(value);
11122 }
11123 }
11124
11126 {
11127 if (!ctx.
Read(value))
11128 return false;
11130 }
11131
11133 {
11134 if (!ctx.
Read(intValue))
11135 return false;
11137 }
11138
11140 {
11141 int r,g,b,a;
11143 return false;
11145 return false;
11147 return false;
11149 return false;
11150
11152 }
11153
11155 {
11156 if (!ctx.
Read(intValue))
11157 return false;
11159 }
11160
11161 if (version >= 138 && version < 140)
11162 {
11164 {
11165 if (!ctx.
Read(intValue))
11166 return false;
11167 SetFrozen(intValue);
11168 }
11169 }
11170
11171 return true;
11172 }
11173
11174
11176 {
11179 {
11181 }
11182
11183 if (!super.OnStoreLoad(ctx, version))
11184 {
11186 return false;
11187 }
11188
11189 if (version >= 114)
11190 {
11191 bool hasQuickBarIndexSaved;
11192
11193 if (!ctx.
Read(hasQuickBarIndexSaved))
11194 {
11196 return false;
11197 }
11198
11199 if (hasQuickBarIndexSaved)
11200 {
11201 int itmQBIndex;
11202
11203
11204 if (!ctx.
Read(itmQBIndex))
11205 {
11207 return false;
11208 }
11209
11210 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11211 if (itmQBIndex != -1 && parentPlayer)
11212 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11213 }
11214 }
11215 else
11216 {
11217
11218 PlayerBase player;
11219 int itemQBIndex;
11220 if (version ==
int.
MAX)
11221 {
11222 if (!ctx.
Read(itemQBIndex))
11223 {
11225 return false;
11226 }
11227 }
11228 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11229 {
11230
11231 if (!ctx.
Read(itemQBIndex))
11232 {
11234 return false;
11235 }
11236 if (itemQBIndex != -1 && player)
11237 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11238 }
11239 }
11240
11241 if (version < 140)
11242 {
11243
11244 if (!LoadVariables(ctx, version))
11245 {
11247 return false;
11248 }
11249 }
11250
11251
11253 {
11255 return false;
11256 }
11257 if (version >= 132)
11258 {
11260 if (raib)
11261 {
11263 {
11265 return false;
11266 }
11267 }
11268 }
11269
11271 return true;
11272 }
11273
11274
11275
11277 {
11278 super.OnStoreSave(ctx);
11279
11280 PlayerBase player;
11281 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11282 {
11284
11285 int itemQBIndex = -1;
11286 itemQBIndex = player.FindQuickBarEntityIndex(this);
11287 ctx.
Write(itemQBIndex);
11288 }
11289 else
11290 {
11292 }
11293
11295
11297 if (raib)
11298 {
11300 }
11301 }
11302
11303
11305 {
11306 super.AfterStoreLoad();
11307
11309 {
11311 }
11312
11314 {
11317 }
11318 }
11319
11321 {
11322 super.EEOnAfterLoad();
11323
11325 {
11327 }
11328
11331 }
11332
11334 {
11335 return false;
11336 }
11337
11338
11339
11341 {
11343 {
11344 #ifdef PLATFORM_CONSOLE
11345
11347 {
11349 if (menu)
11350 {
11352 }
11353 }
11354 #endif
11355 }
11356
11358 {
11361 }
11362
11364 {
11365 SetWeightDirty();
11367 }
11369 {
11372 }
11373
11375 {
11378 }
11380 {
11383 }
11384
11385 super.OnVariablesSynchronized();
11386 }
11387
11388
11389
11391 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11392 {
11393 if (!IsServerCheck(allow_client))
11394 return false;
11395
11397 return false;
11398
11401
11402 if (value <= (min + 0.001))
11403 value = min;
11404
11405 if (value == min)
11406 {
11407 if (destroy_config)
11408 {
11409 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11410 if (dstr)
11411 {
11413 this.Delete();
11414 return true;
11415 }
11416 }
11417 else if (destroy_forced)
11418 {
11420 this.Delete();
11421 return true;
11422 }
11423
11425 }
11426
11429
11431 {
11433
11434 if (delta)
11436 }
11437
11439
11440 return false;
11441 }
11442
11443
11445 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11446 {
11448 }
11449
11451 {
11454 }
11455
11457 {
11460 }
11461
11464 {
11465 float value_clamped = Math.Clamp(value, 0, 1);
11467 SetQuantity(result, destroy_config, destroy_forced);
11468 }
11469
11470
11473 {
11475 }
11476
11478 {
11480 }
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11492 {
11493 int slot = -1;
11494 if (GetInventory())
11495 {
11496 InventoryLocation il = new InventoryLocation;
11497 GetInventory().GetCurrentInventoryLocation(il);
11499 }
11500
11502 }
11503
11505 {
11506 float quantity_max = 0;
11507
11509 {
11510 if (attSlotID != -1)
11511 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11512
11513 if (quantity_max <= 0)
11515 }
11516
11517 if (quantity_max <= 0)
11519
11520 return quantity_max;
11521 }
11522
11524 {
11526 }
11527
11529 {
11531 }
11532
11533
11535 {
11537 }
11538
11540 {
11542 }
11543
11545 {
11547 }
11548
11549
11551 {
11552
11553 float weightEx = GetWeightEx();
11554 float special = GetInventoryAndCargoWeight();
11555 return weightEx - special;
11556 }
11557
11558
11560 {
11562 }
11563
11565 {
11567 {
11568 #ifdef DEVELOPER
11569 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11570 {
11571 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11573 }
11574 #endif
11575
11576 return GetQuantity() * GetConfigWeightModified();
11577 }
11578 else if (HasEnergyManager())
11579 {
11580 #ifdef DEVELOPER
11581 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11582 {
11583 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11584 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11585 }
11586 #endif
11587 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11588 }
11589 else
11590 {
11591 #ifdef DEVELOPER
11592 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11593 {
11594 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11595 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11596 }
11597 #endif
11598 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11599 }
11600 }
11601
11604 {
11605 int item_count = 0;
11607
11608 if (GetInventory().GetCargo() != NULL)
11609 {
11610 item_count = GetInventory().GetCargo().GetItemCount();
11611 }
11612
11613 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11614 {
11615 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11616 if (item)
11617 item_count += item.GetNumberOfItems();
11618 }
11619 return item_count;
11620 }
11621
11624 {
11625 float weight = 0;
11626 float wetness = 1;
11627 if (include_wetness)
11630 {
11631 weight = wetness * m_ConfigWeight;
11632 }
11634 {
11635 weight = 1;
11636 }
11637 return weight;
11638 }
11639
11640
11641
11643 {
11644 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11645 {
11646 GameInventory inv = GetInventory();
11647 array<EntityAI> items = new array<EntityAI>;
11649 for (int i = 0; i < items.Count(); i++)
11650 {
11652 if (item)
11653 {
11655 }
11656 }
11657 }
11658 }
11659
11660
11661
11662
11664 {
11665 float energy = 0;
11666 if (HasEnergyManager())
11667 {
11668 energy = GetCompEM().GetEnergy();
11669 }
11670 return energy;
11671 }
11672
11673
11675 {
11676 super.OnEnergyConsumed();
11677
11679 }
11680
11682 {
11683 super.OnEnergyAdded();
11684
11686 }
11687
11688
11690 {
11691 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11692 {
11694 {
11695 float energy_0to1 = GetCompEM().GetEnergy0To1();
11697 }
11698 }
11699 }
11700
11701
11703 {
11704 return ConfigGetFloat("heatIsolation");
11705 }
11706
11708 {
11710 }
11711
11713 {
11714 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11715 if (
GetGame().ConfigIsExisting(paramPath))
11717
11718 return 0.0;
11719 }
11720
11722 {
11723 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11724 if (
GetGame().ConfigIsExisting(paramPath))
11726
11727 return 0.0;
11728 }
11729
11730 override void SetWet(
float value,
bool allow_client =
false)
11731 {
11732 if (!IsServerCheck(allow_client))
11733 return;
11734
11737
11739
11740 m_VarWet = Math.Clamp(value, min, max);
11741
11743 {
11746 }
11747 }
11748
11749 override void AddWet(
float value)
11750 {
11752 }
11753
11755 {
11757 }
11758
11760 {
11762 }
11763
11765 {
11767 }
11768
11770 {
11772 }
11773
11775 {
11777 }
11778
11779 override void OnWetChanged(
float newVal,
float oldVal)
11780 {
11783 if (newLevel != oldLevel)
11784 {
11786 }
11787 }
11788
11790 {
11791 SetWeightDirty();
11792 }
11793
11795 {
11796 return GetWetLevelInternal(
m_VarWet);
11797 }
11798
11799
11800
11802 {
11804 }
11805
11807 {
11809 }
11810
11812 {
11814 }
11815
11817 {
11819 }
11820
11821
11822
11824 {
11825 if (ConfigIsExisting("itemModelLength"))
11826 {
11827 return ConfigGetFloat("itemModelLength");
11828 }
11829 return 0;
11830 }
11831
11833 {
11834 if (ConfigIsExisting("itemAttachOffset"))
11835 {
11836 return ConfigGetFloat("itemAttachOffset");
11837 }
11838 return 0;
11839 }
11840
11841 override void SetCleanness(
int value,
bool allow_client =
false)
11842 {
11843 if (!IsServerCheck(allow_client))
11844 return;
11845
11847
11849
11852 }
11853
11855 {
11857 }
11858
11860 {
11861 return true;
11862 }
11863
11864
11865
11866
11868 {
11870 }
11871
11873 {
11875 }
11876
11877
11878
11879
11880 override void SetColor(
int r,
int g,
int b,
int a)
11881 {
11887 }
11889 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11890 {
11895 }
11896
11898 {
11900 }
11901
11904 {
11905 int r,g,b,a;
11907 r = r/255;
11908 g = g/255;
11909 b = b/255;
11910 a = a/255;
11911 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11912 }
11913
11914
11915
11916 override void SetLiquidType(
int value,
bool allow_client =
false)
11917 {
11918 if (!IsServerCheck(allow_client))
11919 return;
11920
11925 }
11926
11928 {
11929 return ConfigGetInt("varLiquidTypeInit");
11930 }
11931
11933 {
11935 }
11936
11938 {
11940 SetFrozen(false);
11941 }
11942
11945 {
11946 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11947 }
11948
11949
11952 {
11953 PlayerBase nplayer;
11954 if (PlayerBase.CastTo(nplayer, player))
11955 {
11957
11958 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11959 }
11960 }
11961
11962
11965 {
11966 PlayerBase nplayer;
11967 if (PlayerBase.CastTo(nplayer,player))
11968 {
11969
11970 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11971
11972 }
11973
11974
11975 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11976
11977
11978 if (HasEnergyManager())
11979 {
11980 GetCompEM().UpdatePlugState();
11981 }
11982 }
11983
11984
11986 {
11987 super.OnPlacementStarted(player);
11988
11990 }
11991
11992 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11993 {
11995 {
11996 m_AdminLog.OnPlacementComplete(player,
this);
11997 }
11998
11999 super.OnPlacementComplete(player, position, orientation);
12000 }
12001
12002
12003
12004
12005
12007 {
12009 {
12010 return true;
12011 }
12012 else
12013 {
12014 return false;
12015 }
12016 }
12017
12018
12020 {
12022 {
12024 }
12025 }
12026
12027
12029 {
12031 }
12032
12034 {
12036 }
12037
12038 override void InsertAgent(
int agent,
float count = 1)
12039 {
12040 if (count < 1)
12041 return;
12042
12044 }
12045
12048 {
12050 }
12051
12052
12054 {
12056 }
12057
12058
12059
12060
12061
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
12100 {
12102 return false;
12103 return true;
12104 }
12105
12107 {
12108
12110 }
12111
12112
12115 {
12116 super.CheckForRoofLimited(timeTresholdMS);
12117
12119 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12120 {
12121 m_PreviousRoofTestTime = time;
12122 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12123 }
12124 }
12125
12126
12128 {
12130 {
12131 return 0;
12132 }
12133
12134 if (GetInventory().GetAttachmentSlotsCount() != 0)
12135 {
12136 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12137 if (filter)
12138 return filter.GetProtectionLevel(type, false, system);
12139 else
12140 return 0;
12141 }
12142
12143 string subclassPath, entryName;
12144
12145 switch (type)
12146 {
12148 entryName = "biological";
12149 break;
12151 entryName = "chemical";
12152 break;
12153 default:
12154 entryName = "biological";
12155 break;
12156 }
12157
12158 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12159
12161 }
12162
12163
12164
12167 {
12168 if (!IsMagazine())
12170
12172 }
12173
12174
12175
12176
12177
12182 {
12183 return true;
12184 }
12185
12187 {
12189 }
12190
12191
12192
12193
12194
12196 {
12197 if (parent)
12198 {
12199 if (parent.IsInherited(DayZInfected))
12200 return true;
12201
12202 if (!parent.IsRuined())
12203 return true;
12204 }
12205
12206 return true;
12207 }
12208
12210 {
12211 if (!super.CanPutAsAttachment(parent))
12212 {
12213 return false;
12214 }
12215
12216 if (!IsRuined() && !parent.IsRuined())
12217 {
12218 return true;
12219 }
12220
12221 return false;
12222 }
12223
12225 {
12226
12227
12228
12229
12230 return super.CanReceiveItemIntoCargo(item);
12231 }
12232
12234 {
12235
12236
12237
12238
12239 GameInventory attachmentInv = attachment.GetInventory();
12241 {
12242 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12243 return false;
12244 }
12245
12246 InventoryLocation loc = new InventoryLocation();
12247 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12248 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12249 return false;
12250
12251 return super.CanReceiveAttachment(attachment, slotId);
12252 }
12253
12255 {
12256 if (!super.CanReleaseAttachment(attachment))
12257 return false;
12258
12259 return GetInventory().AreChildrenAccessible();
12260 }
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12283 {
12284 int id = muzzle_owner.GetMuzzleID();
12285 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12286
12287 if (WPOF_array)
12288 {
12289 for (int i = 0; i < WPOF_array.Count(); i++)
12290 {
12291 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12292
12293 if (WPOF)
12294 {
12295 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12296 }
12297 }
12298 }
12299 }
12300
12301
12303 {
12304 int id = muzzle_owner.GetMuzzleID();
12306
12307 if (WPOBE_array)
12308 {
12309 for (int i = 0; i < WPOBE_array.Count(); i++)
12310 {
12311 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12312
12313 if (WPOBE)
12314 {
12315 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12316 }
12317 }
12318 }
12319 }
12320
12321
12323 {
12324 int id = muzzle_owner.GetMuzzleID();
12325 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12326
12327 if (WPOOH_array)
12328 {
12329 for (int i = 0; i < WPOOH_array.Count(); i++)
12330 {
12331 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12332
12333 if (WPOOH)
12334 {
12335 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12336 }
12337 }
12338 }
12339 }
12340
12341
12343 {
12344 int id = muzzle_owner.GetMuzzleID();
12345 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12346
12347 if (WPOOH_array)
12348 {
12349 for (int i = 0; i < WPOOH_array.Count(); i++)
12350 {
12351 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12352
12353 if (WPOOH)
12354 {
12355 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12356 }
12357 }
12358 }
12359 }
12360
12361
12363 {
12364 int id = muzzle_owner.GetMuzzleID();
12365 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12366
12367 if (WPOOH_array)
12368 {
12369 for (int i = 0; i < WPOOH_array.Count(); i++)
12370 {
12371 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12372
12373 if (WPOOH)
12374 {
12375 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12376 }
12377 }
12378 }
12379 }
12380
12381
12382
12384 {
12386 {
12387 return true;
12388 }
12389
12390 return false;
12391 }
12392
12394 {
12396 {
12397 return true;
12398 }
12399
12400 return false;
12401 }
12402
12404 {
12406 {
12407 return true;
12408 }
12409
12410 return false;
12411 }
12412
12414 {
12415 return false;
12416 }
12417
12420 {
12421 return UATimeSpent.DEFAULT_DEPLOY;
12422 }
12423
12424
12425
12426
12428 {
12430 SetSynchDirty();
12431 }
12432
12434 {
12436 }
12437
12438
12440 {
12441 return false;
12442 }
12443
12446 {
12447 string att_type = "None";
12448
12449 if (ConfigIsExisting("soundAttType"))
12450 {
12451 att_type = ConfigGetString("soundAttType");
12452 }
12453
12455 }
12456
12458 {
12460 }
12461
12462
12463
12464
12465
12469
12471 {
12474
12476 }
12477
12478
12480 {
12482 return;
12483
12485
12488
12491
12492 SoundParameters params = new SoundParameters();
12496 }
12497
12498
12500 {
12502 return;
12503
12505 SetSynchDirty();
12506
12509 }
12510
12511
12513 {
12515 return;
12516
12518 SetSynchDirty();
12519
12522 }
12523
12525 {
12527 }
12528
12530 {
12532 }
12533
12536 {
12537 if (!
GetGame().IsDedicatedServer())
12538 {
12539 if (ConfigIsExisting("attachSoundSet"))
12540 {
12541 string cfg_path = "";
12542 string soundset = "";
12543 string type_name =
GetType();
12544
12547 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12548 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12549
12550 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12551 {
12552 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12553 {
12554 if (cfg_slot_array[i] == slot_type)
12555 {
12556 soundset = cfg_soundset_array[i];
12557 break;
12558 }
12559 }
12560 }
12561
12562 if (soundset != "")
12563 {
12564 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12566 }
12567 }
12568 }
12569 }
12570
12572 {
12573
12574 }
12575
12576 void OnApply(PlayerBase player);
12577
12579 {
12580 return 1.0;
12581 };
12582
12584 {
12586 }
12587
12589 {
12591 }
12592
12594
12596 {
12597 SetDynamicPhysicsLifeTime(0.01);
12599 }
12600
12602 {
12603 array<string> zone_names = new array<string>;
12604 GetDamageZones(zone_names);
12605 for (int i = 0; i < zone_names.Count(); i++)
12606 {
12607 SetHealthMax(zone_names.Get(i),"Health");
12608 }
12609 SetHealthMax("","Health");
12610 }
12611
12614 {
12615 float global_health = GetHealth01("","Health");
12616 array<string> zones = new array<string>;
12617 GetDamageZones(zones);
12618
12619 for (int i = 0; i < zones.Count(); i++)
12620 {
12621 SetHealth01(zones.Get(i),"Health",global_health);
12622 }
12623 }
12624
12627 {
12628 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12629 }
12630
12632 {
12633 if (!hasRootAsPlayer)
12634 {
12635 if (refParentIB)
12636 {
12637
12638 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12639 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12640
12641 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12642 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12643
12646 }
12647 else
12648 {
12649
12652 }
12653 }
12654 }
12655
12657 {
12659 {
12660 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12661 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12662 {
12663 float heatPermCoef = 1.0;
12665 while (ent)
12666 {
12667 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12668 ent = ent.GetHierarchyParent();
12669 }
12670
12671 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12672 }
12673 }
12674 }
12675
12677 {
12678
12679 EntityAI parent = GetHierarchyParent();
12680 if (!parent)
12681 {
12682 hasParent = false;
12683 hasRootAsPlayer = false;
12684 }
12685 else
12686 {
12687 hasParent = true;
12688 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12689 refParentIB =
ItemBase.Cast(parent);
12690 }
12691 }
12692
12693 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12694 {
12695
12696 }
12697
12699 {
12700
12701 return false;
12702 }
12703
12705 {
12706
12707
12708 return false;
12709 }
12710
12712 {
12713
12714 return false;
12715 }
12716
12719 {
12720 return !GetIsFrozen() &&
IsOpen();
12721 }
12722
12724 {
12725 bool hasParent = false, hasRootAsPlayer = false;
12727
12728 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12729 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12730
12731 if (wwtu || foodDecay)
12732 {
12736
12737 if (processWetness || processTemperature || processDecay)
12738 {
12740
12741 if (processWetness)
12742 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12743
12744 if (processTemperature)
12746
12747 if (processDecay)
12748 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12749 }
12750 }
12751 }
12752
12755 {
12757 }
12758
12760 {
12763
12764 return super.GetTemperatureFreezeThreshold();
12765 }
12766
12768 {
12771
12772 return super.GetTemperatureThawThreshold();
12773 }
12774
12776 {
12779
12780 return super.GetItemOverheatThreshold();
12781 }
12782
12784 {
12786 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12787
12788 return super.GetTemperatureFreezeTime();
12789 }
12790
12792 {
12794 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12795
12796 return super.GetTemperatureThawTime();
12797 }
12798
12803
12805 {
12806 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12807 }
12808
12810 {
12811 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12812 }
12813
12816 {
12818 }
12819
12821 {
12823 }
12824
12826 {
12828 }
12829
12832 {
12833 return null;
12834 }
12835
12838 {
12839 return false;
12840 }
12841
12843 {
12845 {
12848 if (!trg)
12849 {
12851 explosive = this;
12852 }
12853
12854 explosive.PairRemote(trg);
12856
12857 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12858 trg.SetPersistentPairID(persistentID);
12859 explosive.SetPersistentPairID(persistentID);
12860
12861 return true;
12862 }
12863 return false;
12864 }
12865
12868 {
12869 float ret = 1.0;
12872 ret *= GetHealth01();
12873
12874 return ret;
12875 }
12876
12877 #ifdef DEVELOPER
12878 override void SetDebugItem()
12879 {
12880 super.SetDebugItem();
12881 _itemBase = this;
12882 }
12883
12885 {
12886 string text = super.GetDebugText();
12887
12889 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12890
12891 return text;
12892 }
12893 #endif
12894
12896 {
12897 return true;
12898 }
12899
12901
12903
12905 {
12908 }
12909
12910
12918
12934}
12935
12937{
12939 if (entity)
12940 {
12941 bool is_item = entity.IsInherited(
ItemBase);
12942 if (is_item && full_quantity)
12943 {
12946 }
12947 }
12948 else
12949 {
12951 return NULL;
12952 }
12953 return entity;
12954}
12955
12957{
12958 if (item)
12959 {
12960 if (health > 0)
12961 item.SetHealth("", "", health);
12962
12963 if (item.CanHaveTemperature())
12964 {
12966 if (item.CanFreeze())
12967 item.SetFrozen(false);
12968 }
12969
12970 if (item.HasEnergyManager())
12971 {
12972 if (quantity >= 0)
12973 {
12974 item.GetCompEM().SetEnergy0To1(quantity);
12975 }
12976 else
12977 {
12979 }
12980 }
12981 else if (item.IsMagazine())
12982 {
12983 Magazine mag = Magazine.Cast(item);
12984 if (quantity >= 0)
12985 {
12986 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12987 }
12988 else
12989 {
12991 }
12992
12993 }
12994 else
12995 {
12996 if (quantity >= 0)
12997 {
12998 item.SetQuantityNormalized(quantity, false);
12999 }
13000 else
13001 {
13003 }
13004
13005 }
13006 }
13007}
13008
13009#ifdef DEVELOPER
13011#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.