Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config(for Min 0 and Max 5000, setting 0.5 will result in value 2500)
8224{
8226 {
8227 return true;
8228 }
8229};
8230
8231
8232
8234{
8238
8240
8243
8244
8245
8246
8247
8256
8262
8267
8272
8293 protected bool m_IsResultOfSplit
8294
8296
8301
8302
8303
8305
8309
8310
8311
8313
8316
8317
8318
8324
8325
8333
8336
8337
8339
8340
8342
8343
8348
8349
8354
8355
8357
8358
8360 {
8365
8366 if (!
GetGame().IsDedicatedServer())
8367 {
8369 {
8371
8373 {
8375 }
8376 }
8377
8380 }
8381
8382 m_OldLocation = null;
8383
8385 {
8387 }
8388
8389 if (ConfigIsExisting("headSelectionsToHide"))
8390 {
8393 }
8394
8396 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8397 {
8399 }
8400
8402
8403 m_IsResultOfSplit = false;
8404
8406 }
8407
8409 {
8410 super.InitItemVariables();
8411
8417 m_Count = ConfigGetInt(
"count");
8418
8421
8426
8429
8434
8446
8450
8451
8454 if (ConfigIsExisting("canBeSplit"))
8455 {
8458 }
8459
8461 if (ConfigIsExisting("itemBehaviour"))
8463
8464
8467 RegisterNetSyncVariableInt("m_VarLiquidType");
8468 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8469
8470 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8471 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8472 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8473
8474 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8475 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8476 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8477 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8478
8479 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8480 RegisterNetSyncVariableBool("m_IsTakeable");
8481 RegisterNetSyncVariableBool("m_IsHologram");
8482
8485 {
8488 }
8489
8491
8493 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8495
8496 }
8497
8499 {
8501 }
8502
8504 {
8507 {
8512 }
8513 }
8514
8515 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8516 {
8518 {
8521 }
8522
8524 }
8525
8527 {
8533 }
8534
8536
8538 {
8540
8541 if (!action)
8542 {
8543 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8544 return;
8545 }
8546
8548 if (!ai)
8549 {
8551 return;
8552 }
8553
8555 if (!action_array)
8556 {
8557 action_array = new array<ActionBase_Basic>;
8559 }
8560 if (LogManager.IsActionLogEnable())
8561 {
8562 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8563 }
8564
8565 if (action_array.Find(action) != -1)
8566 {
8567 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8568 }
8569 else
8570 {
8571 action_array.Insert(action);
8572 }
8573 }
8574
8576 {
8578 ActionBase action = player.GetActionManager().GetAction(actionName);
8581
8582 if (action_array)
8583 {
8584 action_array.RemoveItem(action);
8585 }
8586 }
8587
8588
8589
8591 {
8592 ActionOverrideData overrideData = new ActionOverrideData();
8596
8598 if (!actionMap)
8599 {
8602 }
8603
8604 actionMap.Insert(this.
Type(), overrideData);
8605
8606 }
8607
8609
8611
8612
8614 {
8617
8620
8621 string config_to_search = "CfgVehicles";
8622 string muzzle_owner_config;
8623
8625 {
8626 if (IsInherited(Weapon))
8627 config_to_search = "CfgWeapons";
8628
8629 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8630
8631 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8632
8634
8635 if (config_OnFire_subclass_count > 0)
8636 {
8637 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8638
8639 for (int i = 0; i < config_OnFire_subclass_count; i++)
8640 {
8641 string particle_class = "";
8643 string config_OnFire_entry = config_OnFire_class + particle_class;
8644 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8645 WPOF_array.Insert(WPOF);
8646 }
8647
8648
8650 }
8651 }
8652
8654 {
8655 config_to_search = "CfgWeapons";
8656 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8657
8658 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8659
8661
8662 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8663 {
8664 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8665
8666 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8667 {
8668 string particle_class2 = "";
8670 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8671 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8672 WPOBE_array.Insert(WPOBE);
8673 }
8674
8675
8677 }
8678 }
8679 }
8680
8681
8683 {
8686
8688 {
8689 string config_to_search = "CfgVehicles";
8690
8691 if (IsInherited(Weapon))
8692 config_to_search = "CfgWeapons";
8693
8694 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8695 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8696
8697 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8698 {
8699
8701
8703 {
8705 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8707 return;
8708 }
8709
8712
8713
8714
8716 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8717
8718 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8719 {
8720 string particle_class = "";
8722 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8724
8725 if (entry_type == CT_CLASS)
8726 {
8727 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8728 WPOOH_array.Insert(WPOF);
8729 }
8730 }
8731
8732
8734 }
8735 }
8736 }
8737
8739 {
8741 }
8742
8744 {
8746 {
8748
8751
8754
8755 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8756 }
8757 }
8758
8760 {
8762 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8763
8765 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8766
8768 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8769
8771 {
8773 }
8774 }
8775
8777 {
8779 }
8780
8782 {
8785 else
8787
8789 {
8792 }
8793 else
8794 {
8797
8800 }
8801
8803 }
8804
8806 {
8808 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8809 }
8810
8812 {
8814 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8816 }
8817
8819 {
8821 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8822 }
8823
8825 {
8828
8829 OverheatingParticle OP = new OverheatingParticle();
8834
8836 }
8837
8839 {
8842
8843 return -1;
8844 }
8845
8847 {
8849 {
8852
8853 for (int i = count; i > 0; --i)
8854 {
8855 int id = i - 1;
8858
8861
8862 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8863 {
8864 if (p)
8865 {
8868 }
8869 }
8870 }
8871 }
8872 }
8873
8875 {
8877 {
8879 {
8880 int id = i - 1;
8882
8883 if (OP)
8884 {
8886
8887 if (p)
8888 {
8890 }
8891
8892 delete OP;
8893 }
8894 }
8895
8898 }
8899 }
8900
8903 {
8904 return 0.0;
8905 }
8906
8907
8909 {
8910 return 250;
8911 }
8912
8914 {
8915 return 0;
8916 }
8917
8920 {
8922 return true;
8923
8924 return false;
8925 }
8926
8929 {
8932
8934 {
8936 }
8937 else
8938 {
8939
8941 }
8942
8944 }
8945
8952 {
8953 return -1;
8954 }
8955
8956
8957
8958
8960 {
8962 {
8964 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8965
8966 if (r_index >= 0)
8967 {
8968 InventoryLocation r_il = new InventoryLocation;
8969 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8970
8971 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8974 {
8975 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8976 }
8978 {
8979 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8980 }
8981
8982 }
8983
8984 player.GetHumanInventory().ClearUserReservedLocation(this);
8985 }
8986
8989 }
8990
8991
8992
8993
8995 {
8996 return ItemBase.m_DebugActionsMask;
8997 }
8998
9000 {
9001 return ItemBase.m_DebugActionsMask & mask;
9002 }
9003
9005 {
9006 ItemBase.m_DebugActionsMask = mask;
9007 }
9008
9010 {
9011 ItemBase.m_DebugActionsMask |= mask;
9012 }
9013
9015 {
9016 ItemBase.m_DebugActionsMask &= ~mask;
9017 }
9018
9020 {
9022 {
9024 }
9025 else
9026 {
9028 }
9029 }
9030
9031
9033 {
9034 if (GetEconomyProfile())
9035 {
9036 float q_max = GetEconomyProfile().GetQuantityMax();
9037 if (q_max > 0)
9038 {
9039 float q_min = GetEconomyProfile().GetQuantityMin();
9040 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9041
9043 {
9044 ComponentEnergyManager comp = GetCompEM();
9046 {
9048 }
9049 }
9051 {
9053
9054 }
9055
9056 }
9057 }
9058 }
9059
9062 {
9063 EntityAI parent = GetHierarchyParent();
9064
9065 if (parent)
9066 {
9067 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9068 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9069 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9070 }
9071 }
9072
9075 {
9076 EntityAI parent = GetHierarchyParent();
9077
9078 if (parent)
9079 {
9080 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9081 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9082 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9083 }
9084 }
9085
9087 {
9088
9089
9090
9091
9093
9095 {
9096 if (ScriptInputUserData.CanStoreInputUserData())
9097 {
9098 ScriptInputUserData ctx = new ScriptInputUserData;
9104 ctx.
Write(use_stack_max);
9107
9109 {
9110 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9111 }
9112 }
9113 }
9114 else if (!
GetGame().IsMultiplayer())
9115 {
9117 }
9118 }
9119
9121 {
9123 }
9124
9126 {
9128 }
9129
9131 {
9133 }
9134
9136 {
9137
9138 return false;
9139 }
9140
9142 {
9143 return false;
9144 }
9145
9149 {
9150 return false;
9151 }
9152
9154 {
9155 return "";
9156 }
9157
9159
9161 {
9162 return false;
9163 }
9164
9166 {
9167 return true;
9168 }
9169
9170
9171
9173 {
9174 return true;
9175 }
9176
9178 {
9179 return true;
9180 }
9181
9183 {
9184 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9186 }
9187
9189 {
9191 }
9192
9194 {
9196 if (!is_being_placed)
9198 SetSynchDirty();
9199 }
9200
9201
9203
9205 {
9207 }
9208
9210 {
9212 }
9213
9215 {
9216 return 1;
9217 }
9218
9220 {
9221 return false;
9222 }
9223
9225 {
9227 SetSynchDirty();
9228 }
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9265 {
9266 super.OnMovedInsideCargo(container);
9267
9268 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9269 }
9270
9271 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9272 {
9273 super.EEItemLocationChanged(oldLoc,newLoc);
9274
9275 PlayerBase new_player = null;
9276 PlayerBase old_player = null;
9277
9278 if (newLoc.GetParent())
9279 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9280
9281 if (oldLoc.GetParent())
9282 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9283
9285 {
9286 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9287
9288 if (r_index >= 0)
9289 {
9290 InventoryLocation r_il = new InventoryLocation;
9291 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9292
9293 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9296 {
9297 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9298 }
9300 {
9301 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9302 }
9303
9304 }
9305 }
9306
9308 {
9309 if (new_player)
9310 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9311
9312 if (new_player == old_player)
9313 {
9314
9315 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9316 {
9318 {
9319 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9320 {
9321 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9322 }
9323 }
9324 else
9325 {
9326 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9327 }
9328 }
9329
9330 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9331 {
9332 int type = oldLoc.GetType();
9334 {
9335 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9336 }
9338 {
9339 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9340 }
9341 }
9342 if (!m_OldLocation)
9343 {
9344 m_OldLocation = new InventoryLocation;
9345 }
9346 m_OldLocation.Copy(oldLoc);
9347 }
9348 else
9349 {
9350 if (m_OldLocation)
9351 {
9352 m_OldLocation.Reset();
9353 }
9354 }
9355
9357 }
9358 else
9359 {
9360 if (new_player)
9361 {
9362 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9363 if (res_index >= 0)
9364 {
9365 InventoryLocation il = new InventoryLocation;
9366 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9368 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9371 {
9372 il.
GetParent().GetOnReleaseLock().Invoke(it);
9373 }
9375 {
9377 }
9378
9379 }
9380 }
9382 {
9383
9385 }
9386
9387 if (m_OldLocation)
9388 {
9389 m_OldLocation.Reset();
9390 }
9391 }
9392 }
9393
9394 override void EOnContact(IEntity other, Contact extra)
9395 {
9397 {
9398 int liquidType = -1;
9400 if (impactSpeed > 0.0)
9401 {
9403 #ifndef SERVER
9405 #else
9407 SetSynchDirty();
9408 #endif
9410 }
9411 }
9412
9413 #ifdef SERVER
9414 if (GetCompEM() && GetCompEM().IsPlugged())
9415 {
9416 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9417 GetCompEM().UnplugThis();
9418 }
9419 #endif
9420 }
9421
9423
9425 {
9427 }
9428
9430 {
9431
9432 }
9433
9435 {
9436 super.OnItemLocationChanged(old_owner, new_owner);
9437
9438 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9439 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9440
9441 if (!relatedPlayer && playerNew)
9442 relatedPlayer = playerNew;
9443
9444 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9445 {
9447 if (actionMgr)
9448 {
9449 ActionBase currentAction = actionMgr.GetRunningAction();
9450 if (currentAction)
9452 }
9453 }
9454
9455 Man ownerPlayerOld = null;
9456 Man ownerPlayerNew = null;
9457
9458 if (old_owner)
9459 {
9460 if (old_owner.
IsMan())
9461 {
9462 ownerPlayerOld = Man.Cast(old_owner);
9463 }
9464 else
9465 {
9466 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9467 }
9468 }
9469 else
9470 {
9472 {
9474
9475 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9476 {
9477 GetCompEM().UnplugThis();
9478 }
9479 }
9480 }
9481
9482 if (new_owner)
9483 {
9484 if (new_owner.
IsMan())
9485 {
9486 ownerPlayerNew = Man.Cast(new_owner);
9487 }
9488 else
9489 {
9490 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9491 }
9492 }
9493
9494 if (ownerPlayerOld != ownerPlayerNew)
9495 {
9496 if (ownerPlayerOld)
9497 {
9498 array<EntityAI> subItemsExit = new array<EntityAI>;
9500 for (int i = 0; i < subItemsExit.Count(); i++)
9501 {
9504 }
9505 }
9506
9507 if (ownerPlayerNew)
9508 {
9509 array<EntityAI> subItemsEnter = new array<EntityAI>;
9511 for (int j = 0; j < subItemsEnter.Count(); j++)
9512 {
9515 }
9516 }
9517 }
9518 else if (ownerPlayerNew != null)
9519 {
9520 PlayerBase nplayer;
9521 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9522 {
9523 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9525 for (int k = 0; k < subItemsUpdate.Count(); k++)
9526 {
9528 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9529 }
9530 }
9531 }
9532
9533 if (old_owner)
9534 old_owner.OnChildItemRemoved(this);
9535 if (new_owner)
9536 new_owner.OnChildItemReceived(this);
9537 }
9538
9539
9541 {
9542 super.EEDelete(parent);
9543 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9544 if (player)
9545 {
9547
9548 if (player.IsAlive())
9549 {
9550 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9551 if (r_index >= 0)
9552 {
9553 InventoryLocation r_il = new InventoryLocation;
9554 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9555
9556 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9559 {
9560 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9561 }
9563 {
9564 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9565 }
9566
9567 }
9568
9569 player.RemoveQuickBarEntityShortcut(this);
9570 }
9571 }
9572 }
9573
9575 {
9576 super.EEKilled(killer);
9577
9580 {
9581 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9582 {
9583 if (IsMagazine())
9584 {
9585 if (Magazine.Cast(this).GetAmmoCount() > 0)
9586 {
9588 }
9589 }
9590 else
9591 {
9593 }
9594 }
9595 }
9596 }
9597
9599 {
9600 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9601
9602 super.OnWasAttached(parent, slot_id);
9603
9606
9608 }
9609
9611 {
9612 super.OnWasDetached(parent, slot_id);
9613
9616 }
9617
9619 {
9620 int idx;
9623
9624 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9625 if (inventory_slots.Count() < 1)
9626 {
9627 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9628 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9629 }
9630 else
9631 {
9632 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9633 }
9634
9635 idx = inventory_slots.Find(slot);
9636 if (idx < 0)
9637 return "";
9638
9639 return attach_types.Get(idx);
9640 }
9641
9643 {
9644 int idx = -1;
9645 string slot;
9646
9649
9650 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9651 if (inventory_slots.Count() < 1)
9652 {
9653 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9654 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9655 }
9656 else
9657 {
9658 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9659 if (detach_types.Count() < 1)
9660 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9661 }
9662
9663 for (int i = 0; i < inventory_slots.Count(); i++)
9664 {
9665 slot = inventory_slots.Get(i);
9666 }
9667
9668 if (slot != "")
9669 {
9670 if (detach_types.Count() == 1)
9671 idx = 0;
9672 else
9673 idx = inventory_slots.Find(slot);
9674 }
9675 if (idx < 0)
9676 return "";
9677
9678 return detach_types.Get(idx);
9679 }
9680
9682 {
9683
9685
9686
9687 float min_time = 1;
9688 float max_time = 3;
9689 float delay = Math.RandomFloat(min_time, max_time);
9690
9691 explode_timer.Run(delay, this, "DoAmmoExplosion");
9692 }
9693
9695 {
9696 Magazine magazine = Magazine.Cast(this);
9697 int pop_sounds_count = 6;
9698 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9699
9700
9701 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9702 string sound_name = pop_sounds[ sound_idx ];
9704
9705
9706 magazine.ServerAddAmmoCount(-1);
9707
9708
9709 float min_temp_to_explode = 100;
9710
9711 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9712 {
9714 }
9715 }
9716
9717
9718 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9719 {
9720 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9721
9722 const int CHANCE_DAMAGE_CARGO = 4;
9723 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9724 const int CHANCE_DAMAGE_NOTHING = 2;
9725
9727 {
9728 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9729 int chances;
9730 int rnd;
9731
9732 if (GetInventory().GetCargo())
9733 {
9734 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9735 rnd = Math.RandomInt(0,chances);
9736
9737 if (rnd < CHANCE_DAMAGE_CARGO)
9738 {
9740 }
9741 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9742 {
9744 }
9745 }
9746 else
9747 {
9748 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9749 rnd = Math.RandomInt(0,chances);
9750
9751 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9752 {
9754 }
9755 }
9756 }
9757 }
9758
9760 {
9761 if (GetInventory().GetCargo())
9762 {
9763 int item_count = GetInventory().GetCargo().GetItemCount();
9764 if (item_count > 0)
9765 {
9766 int random_pick = Math.RandomInt(0, item_count);
9768 if (!item.IsExplosive())
9769 {
9770 item.AddHealth("","",damage);
9771 return true;
9772 }
9773 }
9774 }
9775 return false;
9776 }
9777
9779 {
9780 int attachment_count = GetInventory().AttachmentCount();
9781 if (attachment_count > 0)
9782 {
9783 int random_pick = Math.RandomInt(0, attachment_count);
9784 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9785 if (!attachment.IsExplosive())
9786 {
9787 attachment.AddHealth("","",damage);
9788 return true;
9789 }
9790 }
9791 return false;
9792 }
9793
9795 {
9797 }
9798
9800 {
9802 return GetInventory().CanRemoveEntity();
9803
9804 return false;
9805 }
9806
9808 {
9809
9811 return false;
9812
9813
9815 return false;
9816
9817
9818
9820 if (delta == 0)
9821 return false;
9822
9823
9824 return true;
9825 }
9826
9828 {
9830 {
9831 if (ScriptInputUserData.CanStoreInputUserData())
9832 {
9833 ScriptInputUserData ctx = new ScriptInputUserData;
9838 ctx.
Write(destination_entity);
9842 }
9843 }
9844 else if (!
GetGame().IsMultiplayer())
9845 {
9847 }
9848 }
9849
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
9866 {
9867 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9868 if (new_item)
9869 {
9870 new_item.SetResultOfSplit(true);
9871 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9873 new_item.
SetQuantity(split_quantity_new,
false,
true);
9874 }
9875 }
9876 }
9877 else if (destination_entity && slot_id == -1)
9878 {
9879 if (quantity > stack_max)
9880 split_quantity_new = stack_max;
9881 else
9882 split_quantity_new = quantity;
9883
9885 {
9887 {
9890 }
9891
9892 if (new_item)
9893 {
9894 new_item.SetResultOfSplit(true);
9895 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9897 new_item.
SetQuantity(split_quantity_new,
false,
true);
9898 }
9899 }
9900 }
9901 else
9902 {
9903 if (stack_max != 0)
9904 {
9906 {
9908 }
9909
9910 if (split_quantity_new == 0)
9911 {
9912 if (!
GetGame().IsMultiplayer())
9913 player.PhysicalPredictiveDropItem(this);
9914 else
9915 player.ServerDropEntity(this);
9916 return;
9917 }
9918
9920 {
9922
9923 if (new_item)
9924 {
9925 new_item.SetResultOfSplit(true);
9926 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9929 new_item.PlaceOnSurface();
9930 }
9931 }
9932 }
9933 }
9934 }
9935
9937 {
9938 float split_quantity_new;
9942 InventoryLocation loc = new InventoryLocation;
9943
9944 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9945 {
9947 split_quantity_new = stack_max;
9948 else
9950
9952 {
9953 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9954 if (new_item)
9955 {
9956 new_item.SetResultOfSplit(true);
9957 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9959 new_item.
SetQuantity(split_quantity_new,
false,
true);
9960 }
9961 }
9962 }
9963 else if (destination_entity && slot_id == -1)
9964 {
9965 if (quantity > stack_max)
9966 split_quantity_new = stack_max;
9967 else
9968 split_quantity_new = quantity;
9969
9971 {
9973 {
9976 }
9977
9978 if (new_item)
9979 {
9980 new_item.SetResultOfSplit(true);
9981 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9983 new_item.
SetQuantity(split_quantity_new,
false,
true);
9984 }
9985 }
9986 }
9987 else
9988 {
9989 if (stack_max != 0)
9990 {
9992 {
9994 }
9995
9997 {
9999
10000 if (new_item)
10001 {
10002 new_item.SetResultOfSplit(true);
10003 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10006 new_item.PlaceOnSurface();
10007 }
10008 }
10009 }
10010 }
10011 }
10012
10014 {
10016 {
10017 if (ScriptInputUserData.CanStoreInputUserData())
10018 {
10019 ScriptInputUserData ctx = new ScriptInputUserData;
10024 dst.WriteToContext(ctx);
10026 }
10027 }
10028 else if (!
GetGame().IsMultiplayer())
10029 {
10031 }
10032 }
10033
10035 {
10037 {
10038 if (ScriptInputUserData.CanStoreInputUserData())
10039 {
10040 ScriptInputUserData ctx = new ScriptInputUserData;
10045 ctx.
Write(destination_entity);
10051 }
10052 }
10053 else if (!
GetGame().IsMultiplayer())
10054 {
10056 }
10057 }
10058
10060 {
10062 }
10063
10065 {
10067 float split_quantity_new;
10069 if (dst.IsValid())
10070 {
10071 int slot_id = dst.GetSlot();
10073
10074 if (quantity > stack_max)
10075 split_quantity_new = stack_max;
10076 else
10077 split_quantity_new = quantity;
10078
10080 {
10082
10083 if (new_item)
10084 {
10085 new_item.SetResultOfSplit(true);
10086 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10088 new_item.
SetQuantity(split_quantity_new,
false,
true);
10089 }
10090
10091 return new_item;
10092 }
10093 }
10094
10095 return null;
10096 }
10097
10099 {
10101 float split_quantity_new;
10103 if (destination_entity)
10104 {
10106 if (quantity > stackable)
10107 split_quantity_new = stackable;
10108 else
10109 split_quantity_new = quantity;
10110
10112 {
10113 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10114 if (new_item)
10115 {
10116 new_item.SetResultOfSplit(true);
10117 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10119 new_item.
SetQuantity(split_quantity_new,
false,
true);
10120 }
10121 }
10122 }
10123 }
10124
10126 {
10128 {
10129 if (ScriptInputUserData.CanStoreInputUserData())
10130 {
10131 ScriptInputUserData ctx = new ScriptInputUserData;
10136 ItemBase destination_entity =
this;
10137 ctx.
Write(destination_entity);
10141 }
10142 }
10143 else if (!
GetGame().IsMultiplayer())
10144 {
10146 }
10147 }
10148
10150 {
10152 float split_quantity_new;
10154 if (player)
10155 {
10157 if (quantity > stackable)
10158 split_quantity_new = stackable;
10159 else
10160 split_quantity_new = quantity;
10161
10163 {
10164 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10165 new_item =
ItemBase.Cast(in_hands);
10166 if (new_item)
10167 {
10168 new_item.SetResultOfSplit(true);
10169 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10171 new_item.SetQuantity(split_quantity_new, false, true);
10172 }
10173 }
10174 }
10175 }
10176
10178 {
10180 float split_quantity_new = Math.Floor(quantity * 0.5);
10181
10183 return;
10184
10186
10187 if (new_item)
10188 {
10189 if (new_item.GetQuantityMax() < split_quantity_new)
10190 {
10191 split_quantity_new = new_item.GetQuantityMax();
10192 }
10193
10194 new_item.SetResultOfSplit(true);
10195 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10196
10198 {
10201 }
10202 else
10203 {
10205 new_item.
SetQuantity(split_quantity_new,
false,
true);
10206 }
10207 }
10208 }
10209
10211 {
10213 float split_quantity_new = Math.Floor(quantity / 2);
10214
10216 return;
10217
10218 InventoryLocation invloc = new InventoryLocation;
10220
10222 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10223
10224 if (new_item)
10225 {
10226 if (new_item.GetQuantityMax() < split_quantity_new)
10227 {
10228 split_quantity_new = new_item.GetQuantityMax();
10229 }
10231 {
10234 }
10235 else if (split_quantity_new > 1)
10236 {
10238 new_item.
SetQuantity(split_quantity_new,
false,
true);
10239 }
10240 }
10241 }
10242
10245 {
10246 SetWeightDirty();
10248
10249 if (parent)
10250 parent.OnAttachmentQuantityChangedEx(this, delta);
10251
10253 {
10255 {
10257 }
10259 {
10260 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10262 }
10263 }
10264
10265 }
10266
10269 {
10270
10271 }
10272
10275 {
10277 }
10278
10280 {
10281 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10282
10284 {
10285 if (newLevel == GameConstants.STATE_RUINED)
10286 {
10288 EntityAI parent = GetHierarchyParent();
10289 if (parent && parent.IsFireplace())
10290 {
10291 CargoBase cargo = GetInventory().GetCargo();
10292 if (cargo)
10293 {
10295 {
10297 }
10298 }
10299 }
10300 }
10301
10303 {
10304
10306 return;
10307 }
10308
10309 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10310 {
10312 }
10313 }
10314 }
10315
10316
10318 {
10319 super.OnRightClick();
10320
10322 {
10324 {
10325 if (ScriptInputUserData.CanStoreInputUserData())
10326 {
10327 EntityAI root = GetHierarchyRoot();
10328 Man playerOwner = GetHierarchyRootPlayer();
10329 InventoryLocation dst = new InventoryLocation;
10330
10331
10332 if (!playerOwner && root && root == this)
10333 {
10335 }
10336 else
10337 {
10338
10339 GetInventory().GetCurrentInventoryLocation(dst);
10341 {
10344 {
10346 }
10347 else
10348 {
10350
10351
10352 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10353 {
10355 }
10356 else
10357 {
10358 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10359 }
10360 }
10361 }
10362 }
10363
10364 ScriptInputUserData ctx = new ScriptInputUserData;
10372 }
10373 }
10374 else if (!
GetGame().IsMultiplayer())
10375 {
10377 }
10378 }
10379 }
10380
10382 {
10383 if (root)
10384 {
10385 vector m4[4];
10386 root.GetTransform(m4);
10387 dst.SetGround(this, m4);
10388 }
10389 else
10390 {
10391 GetInventory().GetCurrentInventoryLocation(dst);
10392 }
10393 }
10394
10395 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10396 {
10397
10398 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10399 return false;
10400
10401 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10402 return false;
10403
10404
10406 return false;
10407
10408
10409 Magazine mag = Magazine.Cast(this);
10410 if (mag)
10411 {
10412 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10413 return false;
10414
10415 if (stack_max_limit)
10416 {
10417 Magazine other_mag = Magazine.Cast(other_item);
10418 if (other_item)
10419 {
10420 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10421 return false;
10422 }
10423
10424 }
10425 }
10426 else
10427 {
10428
10430 return false;
10431
10433 return false;
10434 }
10435
10436 PlayerBase player = null;
10437 if (CastTo(player, GetHierarchyRootPlayer()))
10438 {
10439 if (player.GetInventory().HasAttachment(this))
10440 return false;
10441
10442 if (player.IsItemsToDelete())
10443 return false;
10444 }
10445
10446 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10447 return false;
10448
10449 int slotID;
10451 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10452 return false;
10453
10454 return true;
10455 }
10456
10458 {
10460 }
10461
10463 {
10464 return m_IsResultOfSplit;
10465 }
10466
10468 {
10469 m_IsResultOfSplit = value;
10470 }
10471
10473 {
10475 }
10476
10478 {
10479 float other_item_quantity = other_item.GetQuantity();
10480 float this_free_space;
10481
10483
10485
10486 if (other_item_quantity > this_free_space)
10487 {
10488 return this_free_space;
10489 }
10490 else
10491 {
10492 return other_item_quantity;
10493 }
10494 }
10495
10497 {
10499 }
10500
10502 {
10504 return;
10505
10506 if (!IsMagazine() && other_item)
10507 {
10509 if (quantity_used != 0)
10510 {
10511 float hp1 = GetHealth01("","");
10512 float hp2 = other_item.GetHealth01("","");
10513 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10514 hpResult = hpResult / (
GetQuantity() + quantity_used);
10515
10516 hpResult *= GetMaxHealth();
10517 Math.Round(hpResult);
10518 SetHealth("", "Health", hpResult);
10519
10521 other_item.AddQuantity(-quantity_used);
10522 }
10523 }
10525 }
10526
10528 {
10529 #ifdef SERVER
10530 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10531 GetHierarchyParent().IncreaseLifetimeUp();
10532 #endif
10533 };
10534
10536 {
10537 PlayerBase p = PlayerBase.Cast(player);
10538
10539 array<int> recipesIds = p.m_Recipes;
10540 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10541 if (moduleRecipesManager)
10542 {
10543 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10544 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10545 }
10546
10547 for (int i = 0;i < recipesIds.Count(); i++)
10548 {
10549 int key = recipesIds.Get(i);
10550 string recipeName = moduleRecipesManager.GetRecipeName(key);
10552 }
10553 }
10554
10555
10556 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10557 {
10558 super.GetDebugActions(outputList);
10559
10560
10566
10567
10572
10577
10578
10582
10583
10585 {
10589 }
10590
10593
10594
10598
10600
10601 InventoryLocation loc = new InventoryLocation();
10602 GetInventory().GetCurrentInventoryLocation(loc);
10604 {
10605 if (Gizmo_IsSupported())
10608 }
10609
10611 }
10612
10613
10614
10615
10617 {
10618 super.OnAction(action_id, player, ctx);
10619
10621 {
10622 switch (action_id)
10623 {
10626 return true;
10629 return true;
10630 }
10631 }
10632
10634 {
10635 switch (action_id)
10636 {
10638 Delete();
10639 return true;
10640 }
10641 }
10642
10643 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10644 {
10645 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10646 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10647 PlayerBase p = PlayerBase.Cast(player);
10648 if (
EActions.RECIPES_RANGE_START < 1000)
10649 {
10650 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10651 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10652 }
10653 }
10654 #ifndef SERVER
10655 else if (action_id ==
EActions.WATCH_PLAYER)
10656 {
10657 PluginDeveloper.SetDeveloperItemClientEx(player);
10658 }
10659 #endif
10661 {
10662 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10663 {
10664 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10665 OnDebugButtonPressServer(id + 1);
10666 }
10667
10668 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10669 {
10670 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10672 }
10673
10674 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10675 {
10676 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10678 }
10679
10680 else if (action_id ==
EActions.ADD_QUANTITY)
10681 {
10682 if (IsMagazine())
10683 {
10684 Magazine mag = Magazine.Cast(this);
10685 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10686 }
10687 else
10688 {
10690 }
10691
10692 if (m_EM)
10693 {
10694 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10695 }
10696
10697 }
10698
10699 else if (action_id ==
EActions.REMOVE_QUANTITY)
10700 {
10701 if (IsMagazine())
10702 {
10703 Magazine mag2 = Magazine.Cast(this);
10704 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10705 }
10706 else
10707 {
10709 }
10710 if (m_EM)
10711 {
10712 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10713 }
10714
10715 }
10716
10717 else if (action_id ==
EActions.SET_QUANTITY_0)
10718 {
10720
10721 if (m_EM)
10722 {
10723 m_EM.SetEnergy(0);
10724 }
10725 }
10726
10727 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10728 {
10730
10731 if (m_EM)
10732 {
10733 m_EM.SetEnergy(m_EM.GetEnergyMax());
10734 }
10735 }
10736
10737 else if (action_id ==
EActions.ADD_HEALTH)
10738 {
10739 AddHealth("","",GetMaxHealth("","Health")/5);
10740 }
10741 else if (action_id ==
EActions.REMOVE_HEALTH)
10742 {
10743 AddHealth("","",-GetMaxHealth("","Health")/5);
10744 }
10745 else if (action_id ==
EActions.DESTROY_HEALTH)
10746 {
10747 SetHealth01("","",0);
10748 }
10749 else if (action_id ==
EActions.WATCH_ITEM)
10750 {
10752 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10753 #ifdef DEVELOPER
10754 SetDebugDeveloper_item(this);
10755 #endif
10756 }
10757
10758 else if (action_id ==
EActions.ADD_TEMPERATURE)
10759 {
10760 AddTemperature(20);
10761
10762 }
10763
10764 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10765 {
10766 AddTemperature(-20);
10767
10768 }
10769
10770 else if (action_id ==
EActions.FLIP_FROZEN)
10771 {
10772 SetFrozen(!GetIsFrozen());
10773
10774 }
10775
10776 else if (action_id ==
EActions.ADD_WETNESS)
10777 {
10779
10780 }
10781
10782 else if (action_id ==
EActions.REMOVE_WETNESS)
10783 {
10785
10786 }
10787
10788 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10789 {
10792
10793
10794 }
10795
10796 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10797 {
10800 }
10801
10802 else if (action_id ==
EActions.MAKE_SPECIAL)
10803 {
10804 auto debugParams = DebugSpawnParams.WithPlayer(player);
10805 OnDebugSpawnEx(debugParams);
10806 }
10807
10808 }
10809
10810
10811 return false;
10812 }
10813
10814
10815
10816
10820
10823
10824
10825
10827 {
10828 return false;
10829 }
10830
10831
10833 {
10834 return true;
10835 }
10836
10837
10839 {
10840 return true;
10841 }
10842
10843
10844
10846 {
10847 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10849 }
10850
10853 {
10854 return null;
10855 }
10856
10858 {
10859 return false;
10860 }
10861
10863 {
10864 return false;
10865 }
10866
10870
10871
10873 {
10874 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10875 return module_repairing.CanRepair(this, item_repair_kit);
10876 }
10877
10878
10879 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10880 {
10881 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10882 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10883 }
10884
10885
10887 {
10888
10889
10890
10891
10892
10893
10894
10895
10896 return 1;
10897 }
10898
10899
10900
10902 {
10904 }
10905
10906
10907
10909 {
10911 }
10912
10913
10922 {
10923 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10924
10925 if (player)
10926 {
10927 player.MessageStatus(text);
10928 }
10929 }
10930
10931
10940 {
10941 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10942
10943 if (player)
10944 {
10945 player.MessageAction(text);
10946 }
10947 }
10948
10949
10958 {
10959 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10960
10961 if (player)
10962 {
10963 player.MessageFriendly(text);
10964 }
10965 }
10966
10967
10976 {
10977 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10978
10979 if (player)
10980 {
10981 player.MessageImportant(text);
10982 }
10983 }
10984
10986 {
10987 return true;
10988 }
10989
10990
10991 override bool KindOf(
string tag)
10992 {
10993 bool found = false;
10994 string item_name = this.
GetType();
10997
10998 int array_size = item_tag_array.Count();
10999 for (int i = 0; i < array_size; i++)
11000 {
11001 if (item_tag_array.Get(i) == tag)
11002 {
11003 found = true;
11004 break;
11005 }
11006 }
11007 return found;
11008 }
11009
11010
11012 {
11013
11014 super.OnRPC(sender, rpc_type,ctx);
11015
11016
11017 switch (rpc_type)
11018 {
11019 #ifndef SERVER
11020 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11021 Param2<bool, string> p = new Param2<bool, string>(false, "");
11022
11024 return;
11025
11026 bool play = p.param1;
11027 string soundSet = p.param2;
11028
11029 if (play)
11030 {
11032 {
11034 {
11036 }
11037 }
11038 else
11039 {
11041 }
11042 }
11043 else
11044 {
11046 }
11047
11048 break;
11049 #endif
11050
11051 }
11052
11054 {
11056 }
11057 }
11058
11059
11060
11061
11063 {
11064 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11065 return plugin.GetID(
name);
11066 }
11067
11069 {
11070 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11071 return plugin.GetName(id);
11072 }
11073
11076 {
11077
11078
11079 int varFlags;
11080 if (!ctx.
Read(varFlags))
11081 return;
11082
11083 if (varFlags & ItemVariableFlags.FLOAT)
11084 {
11086 }
11087 }
11088
11090 {
11091
11092 super.SerializeNumericalVars(floats_out);
11093
11094
11095
11097 {
11099 }
11100
11102 {
11104 }
11105
11107 {
11109 }
11110
11112 {
11117 }
11118
11120 {
11122 }
11123 }
11124
11126 {
11127
11128 super.DeSerializeNumericalVars(floats);
11129
11130
11131 int index = 0;
11132 int mask = Math.Round(floats.Get(index));
11133
11134 index++;
11135
11137 {
11139 {
11141 }
11142 else
11143 {
11144 float quantity = floats.Get(index);
11145 SetQuantity(quantity,
true,
false,
false,
false);
11146 }
11147 index++;
11148 }
11149
11151 {
11152 float wet = floats.Get(index);
11154 index++;
11155 }
11156
11158 {
11159 int liquidtype = Math.Round(floats.Get(index));
11161 index++;
11162 }
11163
11165 {
11167 index++;
11169 index++;
11171 index++;
11173 index++;
11174 }
11175
11177 {
11178 int cleanness = Math.Round(floats.Get(index));
11180 index++;
11181 }
11182 }
11183
11185 {
11186 super.WriteVarsToCTX(ctx);
11187
11188
11190 {
11192 }
11193
11195 {
11197 }
11198
11200 {
11202 }
11203
11205 {
11206 int r,g,b,a;
11212 }
11213
11215 {
11217 }
11218 }
11219
11221 {
11222 if (!super.ReadVarsFromCTX(ctx,version))
11223 return false;
11224
11225 int intValue;
11226 float value;
11227
11228 if (version < 140)
11229 {
11230 if (!ctx.
Read(intValue))
11231 return false;
11232
11233 m_VariablesMask = intValue;
11234 }
11235
11237 {
11238 if (!ctx.
Read(value))
11239 return false;
11240
11242 {
11244 }
11245 else
11246 {
11248 }
11249 }
11250
11251 if (version < 140)
11252 {
11254 {
11255 if (!ctx.
Read(value))
11256 return false;
11257 SetTemperatureDirect(value);
11258 }
11259 }
11260
11262 {
11263 if (!ctx.
Read(value))
11264 return false;
11266 }
11267
11269 {
11270 if (!ctx.
Read(intValue))
11271 return false;
11273 }
11274
11276 {
11277 int r,g,b,a;
11279 return false;
11281 return false;
11283 return false;
11285 return false;
11286
11288 }
11289
11291 {
11292 if (!ctx.
Read(intValue))
11293 return false;
11295 }
11296
11297 if (version >= 138 && version < 140)
11298 {
11300 {
11301 if (!ctx.
Read(intValue))
11302 return false;
11303 SetFrozen(intValue);
11304 }
11305 }
11306
11307 return true;
11308 }
11309
11310
11312 {
11315 {
11317 }
11318
11319 if (!super.OnStoreLoad(ctx, version))
11320 {
11322 return false;
11323 }
11324
11325 if (version >= 114)
11326 {
11327 bool hasQuickBarIndexSaved;
11328
11329 if (!ctx.
Read(hasQuickBarIndexSaved))
11330 {
11332 return false;
11333 }
11334
11335 if (hasQuickBarIndexSaved)
11336 {
11337 int itmQBIndex;
11338
11339
11340 if (!ctx.
Read(itmQBIndex))
11341 {
11343 return false;
11344 }
11345
11346 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11347 if (itmQBIndex != -1 && parentPlayer)
11348 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11349 }
11350 }
11351 else
11352 {
11353
11354 PlayerBase player;
11355 int itemQBIndex;
11356 if (version ==
int.
MAX)
11357 {
11358 if (!ctx.
Read(itemQBIndex))
11359 {
11361 return false;
11362 }
11363 }
11364 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11365 {
11366
11367 if (!ctx.
Read(itemQBIndex))
11368 {
11370 return false;
11371 }
11372 if (itemQBIndex != -1 && player)
11373 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11374 }
11375 }
11376
11377 if (version < 140)
11378 {
11379
11380 if (!LoadVariables(ctx, version))
11381 {
11383 return false;
11384 }
11385 }
11386
11387
11389 {
11391 return false;
11392 }
11393 if (version >= 132)
11394 {
11396 if (raib)
11397 {
11399 {
11401 return false;
11402 }
11403 }
11404 }
11405
11407 return true;
11408 }
11409
11410
11411
11413 {
11414 super.OnStoreSave(ctx);
11415
11416 PlayerBase player;
11417 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11418 {
11420
11421 int itemQBIndex = -1;
11422 itemQBIndex = player.FindQuickBarEntityIndex(this);
11423 ctx.
Write(itemQBIndex);
11424 }
11425 else
11426 {
11428 }
11429
11431
11433 if (raib)
11434 {
11436 }
11437 }
11438
11439
11441 {
11442 super.AfterStoreLoad();
11443
11445 {
11447 }
11448
11450 {
11453 }
11454 }
11455
11457 {
11458 super.EEOnAfterLoad();
11459
11461 {
11463 }
11464
11467 }
11468
11470 {
11471 return false;
11472 }
11473
11474
11475
11477 {
11479 {
11480 #ifdef PLATFORM_CONSOLE
11481
11483 {
11485 if (menu)
11486 {
11488 }
11489 }
11490 #endif
11491 }
11492
11494 {
11497 }
11498
11500 {
11501 SetWeightDirty();
11503 }
11505 {
11508 }
11509
11511 {
11514 }
11516 {
11519 }
11520
11521 super.OnVariablesSynchronized();
11522 }
11523
11524
11525
11527 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11528 {
11529 if (!IsServerCheck(allow_client))
11530 return false;
11531
11533 return false;
11534
11537
11538 if (value <= (min + 0.001))
11539 value = min;
11540
11541 if (value == min)
11542 {
11543 if (destroy_config)
11544 {
11545 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11546 if (dstr)
11547 {
11549 this.Delete();
11550 return true;
11551 }
11552 }
11553 else if (destroy_forced)
11554 {
11556 this.Delete();
11557 return true;
11558 }
11559
11561 }
11562
11565
11567 {
11569
11570 if (delta)
11572 }
11573
11575
11576 return false;
11577 }
11578
11579
11581 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11582 {
11584 }
11585
11587 {
11590 }
11591
11593 {
11596 }
11597
11599 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11600 {
11601 float value_clamped = Math.Clamp(value, 0, 1);
11603 SetQuantity(result, destroy_config, destroy_forced);
11604 }
11605
11606
11609 {
11611 }
11612
11614 {
11616 }
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11628 {
11629 int slot = -1;
11630 if (GetInventory())
11631 {
11632 InventoryLocation il = new InventoryLocation;
11633 GetInventory().GetCurrentInventoryLocation(il);
11635 }
11636
11638 }
11639
11641 {
11642 float quantity_max = 0;
11643
11645 {
11646 if (attSlotID != -1)
11647 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11648
11649 if (quantity_max <= 0)
11651 }
11652
11653 if (quantity_max <= 0)
11655
11656 return quantity_max;
11657 }
11658
11660 {
11662 }
11663
11665 {
11667 }
11668
11669
11671 {
11673 }
11674
11676 {
11678 }
11679
11681 {
11683 }
11684
11685
11687 {
11688
11689 float weightEx = GetWeightEx();
11690 float special = GetInventoryAndCargoWeight();
11691 return weightEx - special;
11692 }
11693
11694
11696 {
11698 }
11699
11701 {
11703 {
11704 #ifdef DEVELOPER
11705 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11706 {
11707 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11709 }
11710 #endif
11711
11712 return GetQuantity() * GetConfigWeightModified();
11713 }
11714 else if (HasEnergyManager())
11715 {
11716 #ifdef DEVELOPER
11717 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11718 {
11719 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11720 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11721 }
11722 #endif
11723 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11724 }
11725 else
11726 {
11727 #ifdef DEVELOPER
11728 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11729 {
11730 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11731 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11732 }
11733 #endif
11734 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11735 }
11736 }
11737
11740 {
11741 int item_count = 0;
11743
11744 if (GetInventory().GetCargo() != NULL)
11745 {
11746 item_count = GetInventory().GetCargo().GetItemCount();
11747 }
11748
11749 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11750 {
11751 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11752 if (item)
11753 item_count += item.GetNumberOfItems();
11754 }
11755 return item_count;
11756 }
11757
11760 {
11761 float weight = 0;
11762 float wetness = 1;
11763 if (include_wetness)
11766 {
11767 weight = wetness * m_ConfigWeight;
11768 }
11770 {
11771 weight = 1;
11772 }
11773 return weight;
11774 }
11775
11776
11777
11779 {
11780 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11781 {
11782 GameInventory inv = GetInventory();
11783 array<EntityAI> items = new array<EntityAI>;
11785 for (int i = 0; i < items.Count(); i++)
11786 {
11788 if (item)
11789 {
11791 }
11792 }
11793 }
11794 }
11795
11796
11797
11798
11800 {
11801 float energy = 0;
11802 if (HasEnergyManager())
11803 {
11804 energy = GetCompEM().GetEnergy();
11805 }
11806 return energy;
11807 }
11808
11809
11811 {
11812 super.OnEnergyConsumed();
11813
11815 }
11816
11818 {
11819 super.OnEnergyAdded();
11820
11822 }
11823
11824
11826 {
11827 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11828 {
11830 {
11831 float energy_0to1 = GetCompEM().GetEnergy0To1();
11833 }
11834 }
11835 }
11836
11837
11839 {
11840 return ConfigGetFloat("heatIsolation");
11841 }
11842
11844 {
11846 }
11847
11849 {
11850 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11851 if (
GetGame().ConfigIsExisting(paramPath))
11853
11854 return 0.0;
11855 }
11856
11858 {
11859 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11860 if (
GetGame().ConfigIsExisting(paramPath))
11862
11863 return 0.0;
11864 }
11865
11866 override void SetWet(
float value,
bool allow_client =
false)
11867 {
11868 if (!IsServerCheck(allow_client))
11869 return;
11870
11873
11875
11876 m_VarWet = Math.Clamp(value, min, max);
11877
11879 {
11882 }
11883 }
11884
11885 override void AddWet(
float value)
11886 {
11888 }
11889
11891 {
11893 }
11894
11896 {
11898 }
11899
11901 {
11903 }
11904
11906 {
11908 }
11909
11911 {
11913 }
11914
11915 override void OnWetChanged(
float newVal,
float oldVal)
11916 {
11919 if (newLevel != oldLevel)
11920 {
11922 }
11923 }
11924
11926 {
11927 SetWeightDirty();
11928 }
11929
11931 {
11932 return GetWetLevelInternal(
m_VarWet);
11933 }
11934
11935
11936
11938 {
11940 }
11941
11943 {
11945 }
11946
11948 {
11950 }
11951
11953 {
11955 }
11956
11957
11958
11960 {
11961 if (ConfigIsExisting("itemModelLength"))
11962 {
11963 return ConfigGetFloat("itemModelLength");
11964 }
11965 return 0;
11966 }
11967
11969 {
11970 if (ConfigIsExisting("itemAttachOffset"))
11971 {
11972 return ConfigGetFloat("itemAttachOffset");
11973 }
11974 return 0;
11975 }
11976
11977 override void SetCleanness(
int value,
bool allow_client =
false)
11978 {
11979 if (!IsServerCheck(allow_client))
11980 return;
11981
11983
11985
11988 }
11989
11991 {
11993 }
11994
11996 {
11997 return true;
11998 }
11999
12000
12001
12002
12004 {
12006 }
12007
12009 {
12011 }
12012
12013
12014
12015
12016 override void SetColor(
int r,
int g,
int b,
int a)
12017 {
12023 }
12025 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12026 {
12031 }
12032
12034 {
12036 }
12037
12040 {
12041 int r,g,b,a;
12043 r = r/255;
12044 g = g/255;
12045 b = b/255;
12046 a = a/255;
12047 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12048 }
12049
12050
12051
12052 override void SetLiquidType(
int value,
bool allow_client =
false)
12053 {
12054 if (!IsServerCheck(allow_client))
12055 return;
12056
12061 }
12062
12064 {
12065 return ConfigGetInt("varLiquidTypeInit");
12066 }
12067
12069 {
12071 }
12072
12074 {
12076 SetFrozen(false);
12077 }
12078
12081 {
12082 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12083 }
12084
12085
12088 {
12089 PlayerBase nplayer;
12090 if (PlayerBase.CastTo(nplayer, player))
12091 {
12093
12094 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12095 }
12096 }
12097
12098
12101 {
12102 PlayerBase nplayer;
12103 if (PlayerBase.CastTo(nplayer,player))
12104 {
12105
12106 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12107
12108 }
12109
12110
12111 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12112
12113
12114 if (HasEnergyManager())
12115 {
12116 GetCompEM().UpdatePlugState();
12117 }
12118 }
12119
12120
12122 {
12123 super.OnPlacementStarted(player);
12124
12126 }
12127
12128 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12129 {
12131 {
12132 m_AdminLog.OnPlacementComplete(player,
this);
12133 }
12134
12135 super.OnPlacementComplete(player, position, orientation);
12136 }
12137
12138
12139
12140
12141
12143 {
12145 {
12146 return true;
12147 }
12148 else
12149 {
12150 return false;
12151 }
12152 }
12153
12154
12156 {
12158 {
12160 }
12161 }
12162
12163
12165 {
12167 }
12168
12170 {
12172 }
12173
12174 override void InsertAgent(
int agent,
float count = 1)
12175 {
12176 if (count < 1)
12177 return;
12178
12180 }
12181
12184 {
12186 }
12187
12188
12190 {
12192 }
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12236 {
12238 return false;
12239 return true;
12240 }
12241
12243 {
12244
12246 }
12247
12248
12251 {
12252 super.CheckForRoofLimited(timeTresholdMS);
12253
12255 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12256 {
12257 m_PreviousRoofTestTime = time;
12258 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12259 }
12260 }
12261
12262
12264 {
12266 {
12267 return 0;
12268 }
12269
12270 if (GetInventory().GetAttachmentSlotsCount() != 0)
12271 {
12272 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12273 if (filter)
12274 return filter.GetProtectionLevel(type, false, system);
12275 else
12276 return 0;
12277 }
12278
12279 string subclassPath, entryName;
12280
12281 switch (type)
12282 {
12284 entryName = "biological";
12285 break;
12287 entryName = "chemical";
12288 break;
12289 default:
12290 entryName = "biological";
12291 break;
12292 }
12293
12294 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12295
12297 }
12298
12299
12300
12303 {
12304 if (!IsMagazine())
12306
12308 }
12309
12310
12311
12312
12313
12318 {
12319 return true;
12320 }
12321
12323 {
12325 }
12326
12327
12328
12329
12330
12332 {
12333 if (parent)
12334 {
12335 if (parent.IsInherited(DayZInfected))
12336 return true;
12337
12338 if (!parent.IsRuined())
12339 return true;
12340 }
12341
12342 return true;
12343 }
12344
12346 {
12347 if (!super.CanPutAsAttachment(parent))
12348 {
12349 return false;
12350 }
12351
12352 if (!IsRuined() && !parent.IsRuined())
12353 {
12354 return true;
12355 }
12356
12357 return false;
12358 }
12359
12361 {
12362
12363
12364
12365
12366 return super.CanReceiveItemIntoCargo(item);
12367 }
12368
12370 {
12371
12372
12373
12374
12375 GameInventory attachmentInv = attachment.GetInventory();
12377 {
12378 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12379 return false;
12380 }
12381
12382 InventoryLocation loc = new InventoryLocation();
12383 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12384 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12385 return false;
12386
12387 return super.CanReceiveAttachment(attachment, slotId);
12388 }
12389
12391 {
12392 if (!super.CanReleaseAttachment(attachment))
12393 return false;
12394
12395 return GetInventory().AreChildrenAccessible();
12396 }
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12419 {
12420 int id = muzzle_owner.GetMuzzleID();
12421 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12422
12423 if (WPOF_array)
12424 {
12425 for (int i = 0; i < WPOF_array.Count(); i++)
12426 {
12427 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12428
12429 if (WPOF)
12430 {
12431 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12432 }
12433 }
12434 }
12435 }
12436
12437
12439 {
12440 int id = muzzle_owner.GetMuzzleID();
12442
12443 if (WPOBE_array)
12444 {
12445 for (int i = 0; i < WPOBE_array.Count(); i++)
12446 {
12447 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12448
12449 if (WPOBE)
12450 {
12451 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12452 }
12453 }
12454 }
12455 }
12456
12457
12459 {
12460 int id = muzzle_owner.GetMuzzleID();
12461 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12462
12463 if (WPOOH_array)
12464 {
12465 for (int i = 0; i < WPOOH_array.Count(); i++)
12466 {
12467 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12468
12469 if (WPOOH)
12470 {
12471 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12472 }
12473 }
12474 }
12475 }
12476
12477
12479 {
12480 int id = muzzle_owner.GetMuzzleID();
12481 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12482
12483 if (WPOOH_array)
12484 {
12485 for (int i = 0; i < WPOOH_array.Count(); i++)
12486 {
12487 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12488
12489 if (WPOOH)
12490 {
12491 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12492 }
12493 }
12494 }
12495 }
12496
12497
12499 {
12500 int id = muzzle_owner.GetMuzzleID();
12501 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12502
12503 if (WPOOH_array)
12504 {
12505 for (int i = 0; i < WPOOH_array.Count(); i++)
12506 {
12507 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12508
12509 if (WPOOH)
12510 {
12511 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12512 }
12513 }
12514 }
12515 }
12516
12517
12518
12520 {
12522 {
12523 return true;
12524 }
12525
12526 return false;
12527 }
12528
12530 {
12532 {
12533 return true;
12534 }
12535
12536 return false;
12537 }
12538
12540 {
12542 {
12543 return true;
12544 }
12545
12546 return false;
12547 }
12548
12550 {
12551 return false;
12552 }
12553
12556 {
12557 return UATimeSpent.DEFAULT_DEPLOY;
12558 }
12559
12560
12561
12562
12564 {
12566 SetSynchDirty();
12567 }
12568
12570 {
12572 }
12573
12574
12576 {
12577 return false;
12578 }
12579
12582 {
12583 string att_type = "None";
12584
12585 if (ConfigIsExisting("soundAttType"))
12586 {
12587 att_type = ConfigGetString("soundAttType");
12588 }
12589
12591 }
12592
12594 {
12596 }
12597
12598
12599
12600
12601
12607
12609 {
12612
12614 }
12615
12616
12618 {
12620 return;
12621
12623
12626
12629
12630 SoundParameters params = new SoundParameters();
12634 }
12635
12636
12638 {
12640 return;
12641
12643 SetSynchDirty();
12644
12647 }
12648
12649
12651 {
12653 return;
12654
12656 SetSynchDirty();
12657
12660 }
12661
12663 {
12665 }
12666
12668 {
12670 }
12671
12674 {
12675 if (!
GetGame().IsDedicatedServer())
12676 {
12677 if (ConfigIsExisting("attachSoundSet"))
12678 {
12679 string cfg_path = "";
12680 string soundset = "";
12681 string type_name =
GetType();
12682
12685 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12686 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12687
12688 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12689 {
12690 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12691 {
12692 if (cfg_slot_array[i] == slot_type)
12693 {
12694 soundset = cfg_soundset_array[i];
12695 break;
12696 }
12697 }
12698 }
12699
12700 if (soundset != "")
12701 {
12702 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12704 }
12705 }
12706 }
12707 }
12708
12710 {
12711
12712 }
12713
12714 void OnApply(PlayerBase player);
12715
12717 {
12718 return 1.0;
12719 };
12720
12722 {
12724 }
12725
12727 {
12729 }
12730
12732
12734 {
12735 SetDynamicPhysicsLifeTime(0.01);
12737 }
12738
12740 {
12741 array<string> zone_names = new array<string>;
12742 GetDamageZones(zone_names);
12743 for (int i = 0; i < zone_names.Count(); i++)
12744 {
12745 SetHealthMax(zone_names.Get(i),"Health");
12746 }
12747 SetHealthMax("","Health");
12748 }
12749
12752 {
12753 float global_health = GetHealth01("","Health");
12754 array<string> zones = new array<string>;
12755 GetDamageZones(zones);
12756
12757 for (int i = 0; i < zones.Count(); i++)
12758 {
12759 SetHealth01(zones.Get(i),"Health",global_health);
12760 }
12761 }
12762
12765 {
12766 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12767 }
12768
12770 {
12771 if (!hasRootAsPlayer)
12772 {
12773 if (refParentIB)
12774 {
12775
12776 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12777 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12778
12779 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12780 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12781
12784 }
12785 else
12786 {
12787
12790 }
12791 }
12792 }
12793
12795 {
12797 {
12798 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12799 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12800 {
12801 float heatPermCoef = 1.0;
12803 while (ent)
12804 {
12805 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12806 ent = ent.GetHierarchyParent();
12807 }
12808
12809 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12810 }
12811 }
12812 }
12813
12815 {
12816
12817 EntityAI parent = GetHierarchyParent();
12818 if (!parent)
12819 {
12820 hasParent = false;
12821 hasRootAsPlayer = false;
12822 }
12823 else
12824 {
12825 hasParent = true;
12826 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12827 refParentIB =
ItemBase.Cast(parent);
12828 }
12829 }
12830
12831 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12832 {
12833
12834 }
12835
12837 {
12838
12839 return false;
12840 }
12841
12843 {
12844
12845
12846 return false;
12847 }
12848
12850 {
12851
12852 return false;
12853 }
12854
12857 {
12858 return !GetIsFrozen() &&
IsOpen();
12859 }
12860
12862 {
12863 bool hasParent = false, hasRootAsPlayer = false;
12865
12866 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12867 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12868
12869 if (wwtu || foodDecay)
12870 {
12874
12875 if (processWetness || processTemperature || processDecay)
12876 {
12878
12879 if (processWetness)
12880 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12881
12882 if (processTemperature)
12884
12885 if (processDecay)
12886 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12887 }
12888 }
12889 }
12890
12893 {
12895 }
12896
12898 {
12901
12902 return super.GetTemperatureFreezeThreshold();
12903 }
12904
12906 {
12909
12910 return super.GetTemperatureThawThreshold();
12911 }
12912
12914 {
12917
12918 return super.GetItemOverheatThreshold();
12919 }
12920
12922 {
12924 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12925
12926 return super.GetTemperatureFreezeTime();
12927 }
12928
12930 {
12932 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12933
12934 return super.GetTemperatureThawTime();
12935 }
12936
12941
12943 {
12944 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12945 }
12946
12948 {
12949 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12950 }
12951
12954 {
12956 }
12957
12959 {
12961 }
12962
12964 {
12966 }
12967
12970 {
12971 return null;
12972 }
12973
12976 {
12977 return false;
12978 }
12979
12981 {
12983 {
12986 if (!trg)
12987 {
12989 explosive = this;
12990 }
12991
12992 explosive.PairRemote(trg);
12994
12995 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12996 trg.SetPersistentPairID(persistentID);
12997 explosive.SetPersistentPairID(persistentID);
12998
12999 return true;
13000 }
13001 return false;
13002 }
13003
13006 {
13007 float ret = 1.0;
13010 ret *= GetHealth01();
13011
13012 return ret;
13013 }
13014
13015 #ifdef DEVELOPER
13016 override void SetDebugItem()
13017 {
13018 super.SetDebugItem();
13019 _itemBase = this;
13020 }
13021
13023 {
13024 string text = super.GetDebugText();
13025
13027 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13028
13029 return text;
13030 }
13031 #endif
13032
13034 {
13035 return true;
13036 }
13037
13039
13041
13043 {
13046 }
13047
13048
13056
13072}
13073
13075{
13077 if (entity)
13078 {
13079 bool is_item = entity.IsInherited(
ItemBase);
13080 if (is_item && full_quantity)
13081 {
13084 }
13085 }
13086 else
13087 {
13089 return NULL;
13090 }
13091 return entity;
13092}
13093
13095{
13096 if (item)
13097 {
13098 if (health > 0)
13099 item.SetHealth("", "", health);
13100
13101 if (item.CanHaveTemperature())
13102 {
13104 if (item.CanFreeze())
13105 item.SetFrozen(false);
13106 }
13107
13108 if (item.HasEnergyManager())
13109 {
13110 if (quantity >= 0)
13111 {
13112 item.GetCompEM().SetEnergy0To1(quantity);
13113 }
13114 else
13115 {
13117 }
13118 }
13119 else if (item.IsMagazine())
13120 {
13121 Magazine mag = Magazine.Cast(item);
13122 if (quantity >= 0)
13123 {
13124 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13125 }
13126 else
13127 {
13129 }
13130
13131 }
13132 else
13133 {
13134 if (quantity >= 0)
13135 {
13136 item.SetQuantityNormalized(quantity, false);
13137 }
13138 else
13139 {
13141 }
13142
13143 }
13144 }
13145}
13146
13147#ifdef DEVELOPER
13149#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.