8265{
8267 {
8268 return true;
8269 }
8270};
8271
8272
8273
8275{
8279
8281
8284
8285
8286
8287
8288
8297
8303
8308
8313
8334 protected bool m_IsResultOfSplit
8335
8337
8342
8343
8344
8346
8350
8351
8352
8354
8357
8358
8359
8365
8366
8374
8377
8378
8380
8381
8383
8384
8389
8390
8395
8396
8398
8399
8401 {
8406
8407 if (!
GetGame().IsDedicatedServer())
8408 {
8410 {
8412
8414 {
8416 }
8417 }
8418
8421 }
8422
8423 m_OldLocation = null;
8424
8426 {
8428 }
8429
8430 if (ConfigIsExisting("headSelectionsToHide"))
8431 {
8434 }
8435
8437 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8438 {
8440 }
8441
8443
8444 m_IsResultOfSplit = false;
8445
8447 }
8448
8450 {
8451 super.InitItemVariables();
8452
8458 m_Count = ConfigGetInt(
"count");
8459
8462
8467
8470
8475
8487
8491
8492
8495 if (ConfigIsExisting("canBeSplit"))
8496 {
8499 }
8500
8502 if (ConfigIsExisting("itemBehaviour"))
8504
8505
8508 RegisterNetSyncVariableInt("m_VarLiquidType");
8509 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8510
8511 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8512 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8513 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8514
8515 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8516 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8517 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8518 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8519
8520 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8521 RegisterNetSyncVariableBool("m_IsTakeable");
8522 RegisterNetSyncVariableBool("m_IsHologram");
8523
8526 {
8529 }
8530
8532
8534 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8536
8537 }
8538
8540 {
8542 }
8543
8545 {
8548 {
8553 }
8554 }
8555
8556 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8557 {
8559 {
8562 }
8563
8565 }
8566
8568 {
8574 }
8575
8577
8579 {
8581
8582 if (!action)
8583 {
8584 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8585 return;
8586 }
8587
8589 if (!ai)
8590 {
8592 return;
8593 }
8594
8596 if (!action_array)
8597 {
8598 action_array = new array<ActionBase_Basic>;
8600 }
8601 if (LogManager.IsActionLogEnable())
8602 {
8603 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8604 }
8605
8606 if (action_array.Find(action) != -1)
8607 {
8608 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8609 }
8610 else
8611 {
8612 action_array.Insert(action);
8613 }
8614 }
8615
8617 {
8619 ActionBase action = player.GetActionManager().GetAction(actionName);
8622
8623 if (action_array)
8624 {
8625 action_array.RemoveItem(action);
8626 }
8627 }
8628
8629
8630
8632 {
8633 ActionOverrideData overrideData = new ActionOverrideData();
8637
8639 if (!actionMap)
8640 {
8643 }
8644
8645 actionMap.Insert(this.
Type(), overrideData);
8646
8647 }
8648
8650
8652
8653
8655 {
8658
8661
8662 string config_to_search = "CfgVehicles";
8663 string muzzle_owner_config;
8664
8666 {
8667 if (IsInherited(Weapon))
8668 config_to_search = "CfgWeapons";
8669
8670 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8671
8672 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8673
8675
8676 if (config_OnFire_subclass_count > 0)
8677 {
8678 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8679
8680 for (int i = 0; i < config_OnFire_subclass_count; i++)
8681 {
8682 string particle_class = "";
8684 string config_OnFire_entry = config_OnFire_class + particle_class;
8685 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8686 WPOF_array.Insert(WPOF);
8687 }
8688
8689
8691 }
8692 }
8693
8695 {
8696 config_to_search = "CfgWeapons";
8697 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8698
8699 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8700
8702
8703 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8704 {
8705 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8706
8707 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8708 {
8709 string particle_class2 = "";
8711 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8712 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8713 WPOBE_array.Insert(WPOBE);
8714 }
8715
8716
8718 }
8719 }
8720 }
8721
8722
8724 {
8727
8729 {
8730 string config_to_search = "CfgVehicles";
8731
8732 if (IsInherited(Weapon))
8733 config_to_search = "CfgWeapons";
8734
8735 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8736 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8737
8738 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8739 {
8740
8742
8744 {
8746 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8748 return;
8749 }
8750
8753
8754
8755
8757 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8758
8759 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8760 {
8761 string particle_class = "";
8763 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8765
8766 if (entry_type == CT_CLASS)
8767 {
8768 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8769 WPOOH_array.Insert(WPOF);
8770 }
8771 }
8772
8773
8775 }
8776 }
8777 }
8778
8780 {
8782 }
8783
8785 {
8787 {
8789
8792
8795
8796 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8797 }
8798 }
8799
8801 {
8803 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8804
8806 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8807
8809 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8810
8812 {
8814 }
8815 }
8816
8818 {
8820 }
8821
8823 {
8826 else
8828
8830 {
8833 }
8834 else
8835 {
8838
8841 }
8842
8844 }
8845
8847 {
8849 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8850 }
8851
8853 {
8855 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8857 }
8858
8860 {
8862 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8863 }
8864
8866 {
8869
8870 OverheatingParticle OP = new OverheatingParticle();
8875
8877 }
8878
8880 {
8883
8884 return -1;
8885 }
8886
8888 {
8890 {
8893
8894 for (int i = count; i > 0; --i)
8895 {
8896 int id = i - 1;
8899
8902
8903 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8904 {
8905 if (p)
8906 {
8909 }
8910 }
8911 }
8912 }
8913 }
8914
8916 {
8918 {
8920 {
8921 int id = i - 1;
8923
8924 if (OP)
8925 {
8927
8928 if (p)
8929 {
8931 }
8932
8933 delete OP;
8934 }
8935 }
8936
8939 }
8940 }
8941
8944 {
8945 return 0.0;
8946 }
8947
8948
8950 {
8951 return 250;
8952 }
8953
8955 {
8956 return 0;
8957 }
8958
8961 {
8963 return true;
8964
8965 return false;
8966 }
8967
8970 {
8973
8975 {
8977 }
8978 else
8979 {
8980
8982 }
8983
8985 }
8986
8993 {
8994 return -1;
8995 }
8996
8997
8998
8999
9001 {
9003 {
9005 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9006
9007 if (r_index >= 0)
9008 {
9009 InventoryLocation r_il = new InventoryLocation;
9010 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9011
9012 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9015 {
9016 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9017 }
9019 {
9020 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9021 }
9022
9023 }
9024
9025 player.GetHumanInventory().ClearUserReservedLocation(this);
9026 }
9027
9030 }
9031
9032
9033
9034
9036 {
9037 return ItemBase.m_DebugActionsMask;
9038 }
9039
9041 {
9042 return ItemBase.m_DebugActionsMask & mask;
9043 }
9044
9046 {
9047 ItemBase.m_DebugActionsMask = mask;
9048 }
9049
9051 {
9052 ItemBase.m_DebugActionsMask |= mask;
9053 }
9054
9056 {
9057 ItemBase.m_DebugActionsMask &= ~mask;
9058 }
9059
9061 {
9063 {
9065 }
9066 else
9067 {
9069 }
9070 }
9071
9072
9074 {
9075 if (GetEconomyProfile())
9076 {
9077 float q_max = GetEconomyProfile().GetQuantityMax();
9078 if (q_max > 0)
9079 {
9080 float q_min = GetEconomyProfile().GetQuantityMin();
9081 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9082
9084 {
9085 ComponentEnergyManager comp = GetCompEM();
9087 {
9089 }
9090 }
9092 {
9094
9095 }
9096
9097 }
9098 }
9099 }
9100
9103 {
9104 EntityAI parent = GetHierarchyParent();
9105
9106 if (parent)
9107 {
9108 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9109 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9110 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9111 }
9112 }
9113
9116 {
9117 EntityAI parent = GetHierarchyParent();
9118
9119 if (parent)
9120 {
9121 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9122 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9123 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9124 }
9125 }
9126
9128 {
9129
9130
9131
9132
9134
9136 {
9137 if (ScriptInputUserData.CanStoreInputUserData())
9138 {
9139 ScriptInputUserData ctx = new ScriptInputUserData;
9145 ctx.
Write(use_stack_max);
9148
9150 {
9151 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9152 }
9153 }
9154 }
9155 else if (!
GetGame().IsMultiplayer())
9156 {
9158 }
9159 }
9160
9162 {
9164 }
9165
9167 {
9169 }
9170
9172 {
9174 }
9175
9177 {
9178
9179 return false;
9180 }
9181
9183 {
9184 return false;
9185 }
9186
9190 {
9191 return false;
9192 }
9193
9195 {
9196 return "";
9197 }
9198
9200
9202 {
9203 return false;
9204 }
9205
9207 {
9208 return true;
9209 }
9210
9211
9212
9214 {
9215 return true;
9216 }
9217
9219 {
9220 return true;
9221 }
9222
9224 {
9225 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9227 }
9228
9230 {
9232 }
9233
9235 {
9237 if (!is_being_placed)
9239 SetSynchDirty();
9240 }
9241
9242
9244
9246 {
9248 }
9249
9251 {
9253 }
9254
9256 {
9257 return 1;
9258 }
9259
9261 {
9262 return false;
9263 }
9264
9266 {
9268 SetSynchDirty();
9269 }
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9306 {
9307 super.OnMovedInsideCargo(container);
9308
9309 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9310 }
9311
9312 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9313 {
9314 super.EEItemLocationChanged(oldLoc,newLoc);
9315
9316 PlayerBase new_player = null;
9317 PlayerBase old_player = null;
9318
9319 if (newLoc.GetParent())
9320 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9321
9322 if (oldLoc.GetParent())
9323 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9324
9326 {
9327 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9328
9329 if (r_index >= 0)
9330 {
9331 InventoryLocation r_il = new InventoryLocation;
9332 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9333
9334 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9337 {
9338 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9339 }
9341 {
9342 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9343 }
9344
9345 }
9346 }
9347
9349 {
9350 if (new_player)
9351 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9352
9353 if (new_player == old_player)
9354 {
9355
9356 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9357 {
9359 {
9360 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9361 {
9362 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9363 }
9364 }
9365 else
9366 {
9367 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9368 }
9369 }
9370
9371 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9372 {
9373 int type = oldLoc.GetType();
9375 {
9376 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9377 }
9379 {
9380 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9381 }
9382 }
9383 if (!m_OldLocation)
9384 {
9385 m_OldLocation = new InventoryLocation;
9386 }
9387 m_OldLocation.Copy(oldLoc);
9388 }
9389 else
9390 {
9391 if (m_OldLocation)
9392 {
9393 m_OldLocation.Reset();
9394 }
9395 }
9396
9398 }
9399 else
9400 {
9401 if (new_player)
9402 {
9403 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9404 if (res_index >= 0)
9405 {
9406 InventoryLocation il = new InventoryLocation;
9407 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9409 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9412 {
9413 il.
GetParent().GetOnReleaseLock().Invoke(it);
9414 }
9416 {
9418 }
9419
9420 }
9421 }
9423 {
9424
9426 }
9427
9428 if (m_OldLocation)
9429 {
9430 m_OldLocation.Reset();
9431 }
9432 }
9433 }
9434
9435 override void EOnContact(IEntity other, Contact extra)
9436 {
9438 {
9439 int liquidType = -1;
9441 if (impactSpeed > 0.0)
9442 {
9444 #ifndef SERVER
9446 #else
9448 SetSynchDirty();
9449 #endif
9451 }
9452 }
9453
9454 #ifdef SERVER
9455 if (GetCompEM() && GetCompEM().IsPlugged())
9456 {
9457 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9458 GetCompEM().UnplugThis();
9459 }
9460 #endif
9461 }
9462
9464
9466 {
9468 }
9469
9471 {
9472
9473 }
9474
9476 {
9477 super.OnItemLocationChanged(old_owner, new_owner);
9478
9479 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9480 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9481
9482 if (!relatedPlayer && playerNew)
9483 relatedPlayer = playerNew;
9484
9485 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9486 {
9488 if (actionMgr)
9489 {
9490 ActionBase currentAction = actionMgr.GetRunningAction();
9491 if (currentAction)
9493 }
9494 }
9495
9496 Man ownerPlayerOld = null;
9497 Man ownerPlayerNew = null;
9498
9499 if (old_owner)
9500 {
9501 if (old_owner.
IsMan())
9502 {
9503 ownerPlayerOld = Man.Cast(old_owner);
9504 }
9505 else
9506 {
9507 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9508 }
9509 }
9510 else
9511 {
9513 {
9515
9516 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9517 {
9518 GetCompEM().UnplugThis();
9519 }
9520 }
9521 }
9522
9523 if (new_owner)
9524 {
9525 if (new_owner.
IsMan())
9526 {
9527 ownerPlayerNew = Man.Cast(new_owner);
9528 }
9529 else
9530 {
9531 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9532 }
9533 }
9534
9535 if (ownerPlayerOld != ownerPlayerNew)
9536 {
9537 if (ownerPlayerOld)
9538 {
9539 array<EntityAI> subItemsExit = new array<EntityAI>;
9541 for (int i = 0; i < subItemsExit.Count(); i++)
9542 {
9545 }
9546 }
9547
9548 if (ownerPlayerNew)
9549 {
9550 array<EntityAI> subItemsEnter = new array<EntityAI>;
9552 for (int j = 0; j < subItemsEnter.Count(); j++)
9553 {
9556 }
9557 }
9558 }
9559 else if (ownerPlayerNew != null)
9560 {
9561 PlayerBase nplayer;
9562 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9563 {
9564 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9566 for (int k = 0; k < subItemsUpdate.Count(); k++)
9567 {
9569 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9570 }
9571 }
9572 }
9573
9574 if (old_owner)
9575 old_owner.OnChildItemRemoved(this);
9576 if (new_owner)
9577 new_owner.OnChildItemReceived(this);
9578 }
9579
9580
9582 {
9583 super.EEDelete(parent);
9584 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9585 if (player)
9586 {
9588
9589 if (player.IsAlive())
9590 {
9591 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9592 if (r_index >= 0)
9593 {
9594 InventoryLocation r_il = new InventoryLocation;
9595 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9596
9597 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9600 {
9601 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9602 }
9604 {
9605 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9606 }
9607
9608 }
9609
9610 player.RemoveQuickBarEntityShortcut(this);
9611 }
9612 }
9613 }
9614
9616 {
9617 super.EEKilled(killer);
9618
9621 {
9622 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9623 {
9624 if (IsMagazine())
9625 {
9626 if (Magazine.Cast(this).GetAmmoCount() > 0)
9627 {
9629 }
9630 }
9631 else
9632 {
9634 }
9635 }
9636 }
9637 }
9638
9640 {
9641 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9642
9643 super.OnWasAttached(parent, slot_id);
9644
9647
9649 }
9650
9652 {
9653 super.OnWasDetached(parent, slot_id);
9654
9657 }
9658
9660 {
9661 int idx;
9664
9665 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9666 if (inventory_slots.Count() < 1)
9667 {
9668 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9669 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9670 }
9671 else
9672 {
9673 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9674 }
9675
9676 idx = inventory_slots.Find(slot);
9677 if (idx < 0)
9678 return "";
9679
9680 return attach_types.Get(idx);
9681 }
9682
9684 {
9685 int idx = -1;
9686 string slot;
9687
9690
9691 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9692 if (inventory_slots.Count() < 1)
9693 {
9694 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9695 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9696 }
9697 else
9698 {
9699 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9700 if (detach_types.Count() < 1)
9701 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9702 }
9703
9704 for (int i = 0; i < inventory_slots.Count(); i++)
9705 {
9706 slot = inventory_slots.Get(i);
9707 }
9708
9709 if (slot != "")
9710 {
9711 if (detach_types.Count() == 1)
9712 idx = 0;
9713 else
9714 idx = inventory_slots.Find(slot);
9715 }
9716 if (idx < 0)
9717 return "";
9718
9719 return detach_types.Get(idx);
9720 }
9721
9723 {
9724
9726
9727
9728 float min_time = 1;
9729 float max_time = 3;
9730 float delay = Math.RandomFloat(min_time, max_time);
9731
9732 explode_timer.Run(delay, this, "DoAmmoExplosion");
9733 }
9734
9736 {
9737 Magazine magazine = Magazine.Cast(this);
9738 int pop_sounds_count = 6;
9739 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9740
9741
9742 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9743 string sound_name = pop_sounds[ sound_idx ];
9745
9746
9747 magazine.ServerAddAmmoCount(-1);
9748
9749
9750 float min_temp_to_explode = 100;
9751
9752 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9753 {
9755 }
9756 }
9757
9758
9759 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9760 {
9761 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9762
9763 const int CHANCE_DAMAGE_CARGO = 4;
9764 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9765 const int CHANCE_DAMAGE_NOTHING = 2;
9766
9768 {
9769 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9770 int chances;
9771 int rnd;
9772
9773 if (GetInventory().GetCargo())
9774 {
9775 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9776 rnd = Math.RandomInt(0,chances);
9777
9778 if (rnd < CHANCE_DAMAGE_CARGO)
9779 {
9781 }
9782 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9783 {
9785 }
9786 }
9787 else
9788 {
9789 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9790 rnd = Math.RandomInt(0,chances);
9791
9792 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9793 {
9795 }
9796 }
9797 }
9798 }
9799
9801 {
9802 if (GetInventory().GetCargo())
9803 {
9804 int item_count = GetInventory().GetCargo().GetItemCount();
9805 if (item_count > 0)
9806 {
9807 int random_pick = Math.RandomInt(0, item_count);
9809 if (!item.IsExplosive())
9810 {
9811 item.AddHealth("","",damage);
9812 return true;
9813 }
9814 }
9815 }
9816 return false;
9817 }
9818
9820 {
9821 int attachment_count = GetInventory().AttachmentCount();
9822 if (attachment_count > 0)
9823 {
9824 int random_pick = Math.RandomInt(0, attachment_count);
9825 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9826 if (!attachment.IsExplosive())
9827 {
9828 attachment.AddHealth("","",damage);
9829 return true;
9830 }
9831 }
9832 return false;
9833 }
9834
9836 {
9838 }
9839
9841 {
9843 return GetInventory().CanRemoveEntity();
9844
9845 return false;
9846 }
9847
9849 {
9850
9852 return false;
9853
9854
9856 return false;
9857
9858
9859
9861 if (delta == 0)
9862 return false;
9863
9864
9865 return true;
9866 }
9867
9869 {
9871 {
9872 if (ScriptInputUserData.CanStoreInputUserData())
9873 {
9874 ScriptInputUserData ctx = new ScriptInputUserData;
9879 ctx.
Write(destination_entity);
9883 }
9884 }
9885 else if (!
GetGame().IsMultiplayer())
9886 {
9888 }
9889 }
9890
9892 {
9893 float split_quantity_new;
9897 InventoryLocation loc = new InventoryLocation;
9898
9899 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9900 {
9902 split_quantity_new = stack_max;
9903 else
9905
9907 {
9908 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9909 if (new_item)
9910 {
9911 new_item.SetResultOfSplit(true);
9912 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9914 new_item.
SetQuantity(split_quantity_new,
false,
true);
9915 }
9916 }
9917 }
9918 else if (destination_entity && slot_id == -1)
9919 {
9920 if (quantity > stack_max)
9921 split_quantity_new = stack_max;
9922 else
9923 split_quantity_new = quantity;
9924
9926 {
9928 {
9931 }
9932
9933 if (new_item)
9934 {
9935 new_item.SetResultOfSplit(true);
9936 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9938 new_item.
SetQuantity(split_quantity_new,
false,
true);
9939 }
9940 }
9941 }
9942 else
9943 {
9944 if (stack_max != 0)
9945 {
9947 {
9949 }
9950
9951 if (split_quantity_new == 0)
9952 {
9953 if (!
GetGame().IsMultiplayer())
9954 player.PhysicalPredictiveDropItem(this);
9955 else
9956 player.ServerDropEntity(this);
9957 return;
9958 }
9959
9961 {
9963
9964 if (new_item)
9965 {
9966 new_item.SetResultOfSplit(true);
9967 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9970 new_item.PlaceOnSurface();
9971 }
9972 }
9973 }
9974 }
9975 }
9976
9978 {
9979 float split_quantity_new;
9983 InventoryLocation loc = new InventoryLocation;
9984
9985 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9986 {
9988 split_quantity_new = stack_max;
9989 else
9991
9993 {
9994 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9995 if (new_item)
9996 {
9997 new_item.SetResultOfSplit(true);
9998 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10000 new_item.
SetQuantity(split_quantity_new,
false,
true);
10001 }
10002 }
10003 }
10004 else if (destination_entity && slot_id == -1)
10005 {
10006 if (quantity > stack_max)
10007 split_quantity_new = stack_max;
10008 else
10009 split_quantity_new = quantity;
10010
10012 {
10014 {
10017 }
10018
10019 if (new_item)
10020 {
10021 new_item.SetResultOfSplit(true);
10022 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10024 new_item.
SetQuantity(split_quantity_new,
false,
true);
10025 }
10026 }
10027 }
10028 else
10029 {
10030 if (stack_max != 0)
10031 {
10033 {
10035 }
10036
10038 {
10040
10041 if (new_item)
10042 {
10043 new_item.SetResultOfSplit(true);
10044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10047 new_item.PlaceOnSurface();
10048 }
10049 }
10050 }
10051 }
10052 }
10053
10055 {
10057 {
10058 if (ScriptInputUserData.CanStoreInputUserData())
10059 {
10060 ScriptInputUserData ctx = new ScriptInputUserData;
10065 dst.WriteToContext(ctx);
10067 }
10068 }
10069 else if (!
GetGame().IsMultiplayer())
10070 {
10072 }
10073 }
10074
10076 {
10078 {
10079 if (ScriptInputUserData.CanStoreInputUserData())
10080 {
10081 ScriptInputUserData ctx = new ScriptInputUserData;
10086 ctx.
Write(destination_entity);
10092 }
10093 }
10094 else if (!
GetGame().IsMultiplayer())
10095 {
10097 }
10098 }
10099
10101 {
10103 }
10104
10106 {
10108 float split_quantity_new;
10110 if (dst.IsValid())
10111 {
10112 int slot_id = dst.GetSlot();
10114
10115 if (quantity > stack_max)
10116 split_quantity_new = stack_max;
10117 else
10118 split_quantity_new = quantity;
10119
10121 {
10123
10124 if (new_item)
10125 {
10126 new_item.SetResultOfSplit(true);
10127 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10129 new_item.
SetQuantity(split_quantity_new,
false,
true);
10130 }
10131
10132 return new_item;
10133 }
10134 }
10135
10136 return null;
10137 }
10138
10140 {
10142 float split_quantity_new;
10144 if (destination_entity)
10145 {
10147 if (quantity > stackable)
10148 split_quantity_new = stackable;
10149 else
10150 split_quantity_new = quantity;
10151
10153 {
10154 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10155 if (new_item)
10156 {
10157 new_item.SetResultOfSplit(true);
10158 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10160 new_item.
SetQuantity(split_quantity_new,
false,
true);
10161 }
10162 }
10163 }
10164 }
10165
10167 {
10169 {
10170 if (ScriptInputUserData.CanStoreInputUserData())
10171 {
10172 ScriptInputUserData ctx = new ScriptInputUserData;
10177 ItemBase destination_entity =
this;
10178 ctx.
Write(destination_entity);
10182 }
10183 }
10184 else if (!
GetGame().IsMultiplayer())
10185 {
10187 }
10188 }
10189
10191 {
10193 float split_quantity_new;
10195 if (player)
10196 {
10198 if (quantity > stackable)
10199 split_quantity_new = stackable;
10200 else
10201 split_quantity_new = quantity;
10202
10204 {
10205 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10206 new_item =
ItemBase.Cast(in_hands);
10207 if (new_item)
10208 {
10209 new_item.SetResultOfSplit(true);
10210 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10212 new_item.SetQuantity(split_quantity_new, false, true);
10213 }
10214 }
10215 }
10216 }
10217
10219 {
10221 float split_quantity_new = Math.Floor(quantity * 0.5);
10222
10224 return;
10225
10227
10228 if (new_item)
10229 {
10230 if (new_item.GetQuantityMax() < split_quantity_new)
10231 {
10232 split_quantity_new = new_item.GetQuantityMax();
10233 }
10234
10235 new_item.SetResultOfSplit(true);
10236 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10237
10239 {
10242 }
10243 else
10244 {
10246 new_item.
SetQuantity(split_quantity_new,
false,
true);
10247 }
10248 }
10249 }
10250
10252 {
10254 float split_quantity_new = Math.Floor(quantity / 2);
10255
10257 return;
10258
10259 InventoryLocation invloc = new InventoryLocation;
10261
10263 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10264
10265 if (new_item)
10266 {
10267 if (new_item.GetQuantityMax() < split_quantity_new)
10268 {
10269 split_quantity_new = new_item.GetQuantityMax();
10270 }
10272 {
10275 }
10276 else if (split_quantity_new > 1)
10277 {
10279 new_item.
SetQuantity(split_quantity_new,
false,
true);
10280 }
10281 }
10282 }
10283
10286 {
10287 SetWeightDirty();
10289
10290 if (parent)
10291 parent.OnAttachmentQuantityChangedEx(this, delta);
10292
10294 {
10296 {
10298 }
10300 {
10301 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10303 }
10304 }
10305
10306 }
10307
10310 {
10311
10312 }
10313
10316 {
10318 }
10319
10321 {
10322 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10323
10325 {
10326 if (newLevel == GameConstants.STATE_RUINED)
10327 {
10329 EntityAI parent = GetHierarchyParent();
10330 if (parent && parent.IsFireplace())
10331 {
10332 CargoBase cargo = GetInventory().GetCargo();
10333 if (cargo)
10334 {
10336 {
10338 }
10339 }
10340 }
10341 }
10342
10344 {
10345
10347 return;
10348 }
10349
10350 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10351 {
10353 }
10354 }
10355 }
10356
10357
10359 {
10360 super.OnRightClick();
10361
10363 {
10365 {
10366 if (ScriptInputUserData.CanStoreInputUserData())
10367 {
10368 EntityAI root = GetHierarchyRoot();
10369 Man playerOwner = GetHierarchyRootPlayer();
10370 InventoryLocation dst = new InventoryLocation;
10371
10372
10373 if (!playerOwner && root && root == this)
10374 {
10376 }
10377 else
10378 {
10379
10380 GetInventory().GetCurrentInventoryLocation(dst);
10382 {
10385 {
10387 }
10388 else
10389 {
10391
10392
10393 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10394 {
10396 }
10397 else
10398 {
10399 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10400 }
10401 }
10402 }
10403 }
10404
10405 ScriptInputUserData ctx = new ScriptInputUserData;
10413 }
10414 }
10415 else if (!
GetGame().IsMultiplayer())
10416 {
10418 }
10419 }
10420 }
10421
10423 {
10424 if (root)
10425 {
10426 vector m4[4];
10427 root.GetTransform(m4);
10428 dst.SetGround(this, m4);
10429 }
10430 else
10431 {
10432 GetInventory().GetCurrentInventoryLocation(dst);
10433 }
10434 }
10435
10436 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10437 {
10438
10439 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10440 return false;
10441
10442 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10443 return false;
10444
10445
10447 return false;
10448
10449
10450 Magazine mag = Magazine.Cast(this);
10451 if (mag)
10452 {
10453 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10454 return false;
10455
10456 if (stack_max_limit)
10457 {
10458 Magazine other_mag = Magazine.Cast(other_item);
10459 if (other_item)
10460 {
10461 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10462 return false;
10463 }
10464
10465 }
10466 }
10467 else
10468 {
10469
10471 return false;
10472
10474 return false;
10475 }
10476
10477 PlayerBase player = null;
10478 if (CastTo(player, GetHierarchyRootPlayer()))
10479 {
10480 if (player.GetInventory().HasAttachment(this))
10481 return false;
10482
10483 if (player.IsItemsToDelete())
10484 return false;
10485 }
10486
10487 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10488 return false;
10489
10490 int slotID;
10492 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10493 return false;
10494
10495 return true;
10496 }
10497
10499 {
10501 }
10502
10504 {
10505 return m_IsResultOfSplit;
10506 }
10507
10509 {
10510 m_IsResultOfSplit = value;
10511 }
10512
10514 {
10516 }
10517
10519 {
10520 float other_item_quantity = other_item.GetQuantity();
10521 float this_free_space;
10522
10524
10526
10527 if (other_item_quantity > this_free_space)
10528 {
10529 return this_free_space;
10530 }
10531 else
10532 {
10533 return other_item_quantity;
10534 }
10535 }
10536
10538 {
10540 }
10541
10543 {
10545 return;
10546
10547 if (!IsMagazine() && other_item)
10548 {
10550 if (quantity_used != 0)
10551 {
10552 float hp1 = GetHealth01("","");
10553 float hp2 = other_item.GetHealth01("","");
10554 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10555 hpResult = hpResult / (
GetQuantity() + quantity_used);
10556
10557 hpResult *= GetMaxHealth();
10558 Math.Round(hpResult);
10559 SetHealth("", "Health", hpResult);
10560
10562 other_item.AddQuantity(-quantity_used);
10563 }
10564 }
10566 }
10567
10569 {
10570 #ifdef SERVER
10571 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10572 GetHierarchyParent().IncreaseLifetimeUp();
10573 #endif
10574 };
10575
10577 {
10578 PlayerBase p = PlayerBase.Cast(player);
10579
10580 array<int> recipesIds = p.m_Recipes;
10581 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10582 if (moduleRecipesManager)
10583 {
10584 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10585 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10586 }
10587
10588 for (int i = 0;i < recipesIds.Count(); i++)
10589 {
10590 int key = recipesIds.Get(i);
10591 string recipeName = moduleRecipesManager.GetRecipeName(key);
10593 }
10594 }
10595
10596
10597 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10598 {
10599 super.GetDebugActions(outputList);
10600
10601
10607
10608
10613
10618
10619
10623
10624
10626 {
10630 }
10631
10634
10635
10639
10641
10642 InventoryLocation loc = new InventoryLocation();
10643 GetInventory().GetCurrentInventoryLocation(loc);
10645 {
10646 if (Gizmo_IsSupported())
10649 }
10650
10652 }
10653
10654
10655
10656
10658 {
10659 super.OnAction(action_id, player, ctx);
10660
10662 {
10663 switch (action_id)
10664 {
10667 return true;
10670 return true;
10671 }
10672 }
10673
10675 {
10676 switch (action_id)
10677 {
10679 Delete();
10680 return true;
10681 }
10682 }
10683
10684 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10685 {
10686 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10687 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10688 PlayerBase p = PlayerBase.Cast(player);
10689 if (
EActions.RECIPES_RANGE_START < 1000)
10690 {
10691 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10692 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10693 }
10694 }
10695 #ifndef SERVER
10696 else if (action_id ==
EActions.WATCH_PLAYER)
10697 {
10698 PluginDeveloper.SetDeveloperItemClientEx(player);
10699 }
10700 #endif
10702 {
10703 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10704 {
10705 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10706 OnDebugButtonPressServer(id + 1);
10707 }
10708
10709 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10710 {
10711 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10713 }
10714
10715 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10716 {
10717 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10719 }
10720
10721 else if (action_id ==
EActions.ADD_QUANTITY)
10722 {
10723 if (IsMagazine())
10724 {
10725 Magazine mag = Magazine.Cast(this);
10726 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10727 }
10728 else
10729 {
10731 }
10732
10733 if (m_EM)
10734 {
10735 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10736 }
10737
10738 }
10739
10740 else if (action_id ==
EActions.REMOVE_QUANTITY)
10741 {
10742 if (IsMagazine())
10743 {
10744 Magazine mag2 = Magazine.Cast(this);
10745 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10746 }
10747 else
10748 {
10750 }
10751 if (m_EM)
10752 {
10753 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10754 }
10755
10756 }
10757
10758 else if (action_id ==
EActions.SET_QUANTITY_0)
10759 {
10761
10762 if (m_EM)
10763 {
10764 m_EM.SetEnergy(0);
10765 }
10766 }
10767
10768 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10769 {
10771
10772 if (m_EM)
10773 {
10774 m_EM.SetEnergy(m_EM.GetEnergyMax());
10775 }
10776 }
10777
10778 else if (action_id ==
EActions.ADD_HEALTH)
10779 {
10780 AddHealth("","",GetMaxHealth("","Health")/5);
10781 }
10782 else if (action_id ==
EActions.REMOVE_HEALTH)
10783 {
10784 AddHealth("","",-GetMaxHealth("","Health")/5);
10785 }
10786 else if (action_id ==
EActions.DESTROY_HEALTH)
10787 {
10788 SetHealth01("","",0);
10789 }
10790 else if (action_id ==
EActions.WATCH_ITEM)
10791 {
10793 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10794 #ifdef DEVELOPER
10795 SetDebugDeveloper_item(this);
10796 #endif
10797 }
10798
10799 else if (action_id ==
EActions.ADD_TEMPERATURE)
10800 {
10801 AddTemperature(20);
10802
10803 }
10804
10805 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10806 {
10807 AddTemperature(-20);
10808
10809 }
10810
10811 else if (action_id ==
EActions.FLIP_FROZEN)
10812 {
10813 SetFrozen(!GetIsFrozen());
10814
10815 }
10816
10817 else if (action_id ==
EActions.ADD_WETNESS)
10818 {
10820
10821 }
10822
10823 else if (action_id ==
EActions.REMOVE_WETNESS)
10824 {
10826
10827 }
10828
10829 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10830 {
10833
10834
10835 }
10836
10837 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10838 {
10841 }
10842
10843 else if (action_id ==
EActions.MAKE_SPECIAL)
10844 {
10845 auto debugParams = DebugSpawnParams.WithPlayer(player);
10846 OnDebugSpawnEx(debugParams);
10847 }
10848
10849 }
10850
10851
10852 return false;
10853 }
10854
10855
10856
10857
10861
10864
10865
10866
10868 {
10869 return false;
10870 }
10871
10872
10874 {
10875 return true;
10876 }
10877
10878
10880 {
10881 return true;
10882 }
10883
10884
10885
10887 {
10888 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10890 }
10891
10894 {
10895 return null;
10896 }
10897
10899 {
10900 return false;
10901 }
10902
10904 {
10905 return false;
10906 }
10907
10911
10912
10914 {
10915 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10916 return module_repairing.CanRepair(this, item_repair_kit);
10917 }
10918
10919
10920 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10921 {
10922 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10923 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10924 }
10925
10926
10928 {
10929
10930
10931
10932
10933
10934
10935
10936
10937 return 1;
10938 }
10939
10940
10941
10943 {
10945 }
10946
10947
10948
10950 {
10952 }
10953
10954
10963 {
10964 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10965
10966 if (player)
10967 {
10968 player.MessageStatus(text);
10969 }
10970 }
10971
10972
10981 {
10982 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10983
10984 if (player)
10985 {
10986 player.MessageAction(text);
10987 }
10988 }
10989
10990
10999 {
11000 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11001
11002 if (player)
11003 {
11004 player.MessageFriendly(text);
11005 }
11006 }
11007
11008
11017 {
11018 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11019
11020 if (player)
11021 {
11022 player.MessageImportant(text);
11023 }
11024 }
11025
11027 {
11028 return true;
11029 }
11030
11031
11032 override bool KindOf(
string tag)
11033 {
11034 bool found = false;
11035 string item_name = this.
GetType();
11038
11039 int array_size = item_tag_array.Count();
11040 for (int i = 0; i < array_size; i++)
11041 {
11042 if (item_tag_array.Get(i) == tag)
11043 {
11044 found = true;
11045 break;
11046 }
11047 }
11048 return found;
11049 }
11050
11051
11053 {
11054
11055 super.OnRPC(sender, rpc_type,ctx);
11056
11057
11058 switch (rpc_type)
11059 {
11060 #ifndef SERVER
11061 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11062 Param2<bool, string> p = new Param2<bool, string>(false, "");
11063
11065 return;
11066
11067 bool play = p.param1;
11068 string soundSet = p.param2;
11069
11070 if (play)
11071 {
11073 {
11075 {
11077 }
11078 }
11079 else
11080 {
11082 }
11083 }
11084 else
11085 {
11087 }
11088
11089 break;
11090 #endif
11091
11092 }
11093
11095 {
11097 }
11098 }
11099
11100
11101
11102
11104 {
11105 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11106 return plugin.GetID(
name);
11107 }
11108
11110 {
11111 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11112 return plugin.GetName(id);
11113 }
11114
11117 {
11118
11119
11120 int varFlags;
11121 if (!ctx.
Read(varFlags))
11122 return;
11123
11124 if (varFlags & ItemVariableFlags.FLOAT)
11125 {
11127 }
11128 }
11129
11131 {
11132
11133 super.SerializeNumericalVars(floats_out);
11134
11135
11136
11138 {
11140 }
11141
11143 {
11145 }
11146
11148 {
11150 }
11151
11153 {
11158 }
11159
11161 {
11163 }
11164 }
11165
11167 {
11168
11169 super.DeSerializeNumericalVars(floats);
11170
11171
11172 int index = 0;
11173 int mask = Math.Round(floats.Get(index));
11174
11175 index++;
11176
11178 {
11180 {
11182 }
11183 else
11184 {
11185 float quantity = floats.Get(index);
11186 SetQuantity(quantity,
true,
false,
false,
false);
11187 }
11188 index++;
11189 }
11190
11192 {
11193 float wet = floats.Get(index);
11195 index++;
11196 }
11197
11199 {
11200 int liquidtype = Math.Round(floats.Get(index));
11202 index++;
11203 }
11204
11206 {
11208 index++;
11210 index++;
11212 index++;
11214 index++;
11215 }
11216
11218 {
11219 int cleanness = Math.Round(floats.Get(index));
11221 index++;
11222 }
11223 }
11224
11226 {
11227 super.WriteVarsToCTX(ctx);
11228
11229
11231 {
11233 }
11234
11236 {
11238 }
11239
11241 {
11243 }
11244
11246 {
11247 int r,g,b,a;
11253 }
11254
11256 {
11258 }
11259 }
11260
11262 {
11263 if (!super.ReadVarsFromCTX(ctx,version))
11264 return false;
11265
11266 int intValue;
11267 float value;
11268
11269 if (version < 140)
11270 {
11271 if (!ctx.
Read(intValue))
11272 return false;
11273
11274 m_VariablesMask = intValue;
11275 }
11276
11278 {
11279 if (!ctx.
Read(value))
11280 return false;
11281
11283 {
11285 }
11286 else
11287 {
11289 }
11290 }
11291
11292 if (version < 140)
11293 {
11295 {
11296 if (!ctx.
Read(value))
11297 return false;
11298 SetTemperatureDirect(value);
11299 }
11300 }
11301
11303 {
11304 if (!ctx.
Read(value))
11305 return false;
11307 }
11308
11310 {
11311 if (!ctx.
Read(intValue))
11312 return false;
11314 }
11315
11317 {
11318 int r,g,b,a;
11320 return false;
11322 return false;
11324 return false;
11326 return false;
11327
11329 }
11330
11332 {
11333 if (!ctx.
Read(intValue))
11334 return false;
11336 }
11337
11338 if (version >= 138 && version < 140)
11339 {
11341 {
11342 if (!ctx.
Read(intValue))
11343 return false;
11344 SetFrozen(intValue);
11345 }
11346 }
11347
11348 return true;
11349 }
11350
11351
11353 {
11356 {
11358 }
11359
11360 if (!super.OnStoreLoad(ctx, version))
11361 {
11363 return false;
11364 }
11365
11366 if (version >= 114)
11367 {
11368 bool hasQuickBarIndexSaved;
11369
11370 if (!ctx.
Read(hasQuickBarIndexSaved))
11371 {
11373 return false;
11374 }
11375
11376 if (hasQuickBarIndexSaved)
11377 {
11378 int itmQBIndex;
11379
11380
11381 if (!ctx.
Read(itmQBIndex))
11382 {
11384 return false;
11385 }
11386
11387 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11388 if (itmQBIndex != -1 && parentPlayer)
11389 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11390 }
11391 }
11392 else
11393 {
11394
11395 PlayerBase player;
11396 int itemQBIndex;
11397 if (version ==
int.
MAX)
11398 {
11399 if (!ctx.
Read(itemQBIndex))
11400 {
11402 return false;
11403 }
11404 }
11405 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11406 {
11407
11408 if (!ctx.
Read(itemQBIndex))
11409 {
11411 return false;
11412 }
11413 if (itemQBIndex != -1 && player)
11414 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11415 }
11416 }
11417
11418 if (version < 140)
11419 {
11420
11421 if (!LoadVariables(ctx, version))
11422 {
11424 return false;
11425 }
11426 }
11427
11428
11430 {
11432 return false;
11433 }
11434 if (version >= 132)
11435 {
11437 if (raib)
11438 {
11440 {
11442 return false;
11443 }
11444 }
11445 }
11446
11448 return true;
11449 }
11450
11451
11452
11454 {
11455 super.OnStoreSave(ctx);
11456
11457 PlayerBase player;
11458 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11459 {
11461
11462 int itemQBIndex = -1;
11463 itemQBIndex = player.FindQuickBarEntityIndex(this);
11464 ctx.
Write(itemQBIndex);
11465 }
11466 else
11467 {
11469 }
11470
11472
11474 if (raib)
11475 {
11477 }
11478 }
11479
11480
11482 {
11483 super.AfterStoreLoad();
11484
11486 {
11488 }
11489
11491 {
11494 }
11495 }
11496
11498 {
11499 super.EEOnAfterLoad();
11500
11502 {
11504 }
11505
11508 }
11509
11511 {
11512 return false;
11513 }
11514
11515
11516
11518 {
11520 {
11521 #ifdef PLATFORM_CONSOLE
11522
11524 {
11526 if (menu)
11527 {
11529 }
11530 }
11531 #endif
11532 }
11533
11535 {
11538 }
11539
11541 {
11542 SetWeightDirty();
11544 }
11546 {
11549 }
11550
11552 {
11555 }
11557 {
11560 }
11561
11562 super.OnVariablesSynchronized();
11563 }
11564
11565
11566
11568 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11569 {
11570 if (!IsServerCheck(allow_client))
11571 return false;
11572
11574 return false;
11575
11578
11579 if (value <= (min + 0.001))
11580 value = min;
11581
11582 if (value == min)
11583 {
11584 if (destroy_config)
11585 {
11586 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11587 if (dstr)
11588 {
11590 this.Delete();
11591 return true;
11592 }
11593 }
11594 else if (destroy_forced)
11595 {
11597 this.Delete();
11598 return true;
11599 }
11600
11602 }
11603
11606
11608 {
11610
11611 if (delta)
11613 }
11614
11616
11617 return false;
11618 }
11619
11620
11622 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11623 {
11625 }
11626
11628 {
11631 }
11632
11634 {
11637 }
11638
11640 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11641 {
11642 float value_clamped = Math.Clamp(value, 0, 1);
11644 SetQuantity(result, destroy_config, destroy_forced);
11645 }
11646
11647
11650 {
11652 }
11653
11655 {
11657 }
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11669 {
11670 int slot = -1;
11671 if (GetInventory())
11672 {
11673 InventoryLocation il = new InventoryLocation;
11674 GetInventory().GetCurrentInventoryLocation(il);
11676 }
11677
11679 }
11680
11682 {
11683 float quantity_max = 0;
11684
11686 {
11687 if (attSlotID != -1)
11688 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11689
11690 if (quantity_max <= 0)
11692 }
11693
11694 if (quantity_max <= 0)
11696
11697 return quantity_max;
11698 }
11699
11701 {
11703 }
11704
11706 {
11708 }
11709
11710
11712 {
11714 }
11715
11717 {
11719 }
11720
11722 {
11724 }
11725
11726
11728 {
11729
11730 float weightEx = GetWeightEx();
11731 float special = GetInventoryAndCargoWeight();
11732 return weightEx - special;
11733 }
11734
11735
11737 {
11739 }
11740
11742 {
11744 {
11745 #ifdef DEVELOPER
11746 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11747 {
11748 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11750 }
11751 #endif
11752
11753 return GetQuantity() * GetConfigWeightModified();
11754 }
11755 else if (HasEnergyManager())
11756 {
11757 #ifdef DEVELOPER
11758 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11759 {
11760 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11761 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11762 }
11763 #endif
11764 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11765 }
11766 else
11767 {
11768 #ifdef DEVELOPER
11769 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11770 {
11771 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11772 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11773 }
11774 #endif
11775 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11776 }
11777 }
11778
11781 {
11782 int item_count = 0;
11784
11785 if (GetInventory().GetCargo() != NULL)
11786 {
11787 item_count = GetInventory().GetCargo().GetItemCount();
11788 }
11789
11790 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11791 {
11792 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11793 if (item)
11794 item_count += item.GetNumberOfItems();
11795 }
11796 return item_count;
11797 }
11798
11801 {
11802 float weight = 0;
11803 float wetness = 1;
11804 if (include_wetness)
11807 {
11808 weight = wetness * m_ConfigWeight;
11809 }
11811 {
11812 weight = 1;
11813 }
11814 return weight;
11815 }
11816
11817
11818
11820 {
11821 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11822 {
11823 GameInventory inv = GetInventory();
11824 array<EntityAI> items = new array<EntityAI>;
11826 for (int i = 0; i < items.Count(); i++)
11827 {
11829 if (item)
11830 {
11832 }
11833 }
11834 }
11835 }
11836
11837
11838
11839
11841 {
11842 float energy = 0;
11843 if (HasEnergyManager())
11844 {
11845 energy = GetCompEM().GetEnergy();
11846 }
11847 return energy;
11848 }
11849
11850
11852 {
11853 super.OnEnergyConsumed();
11854
11856 }
11857
11859 {
11860 super.OnEnergyAdded();
11861
11863 }
11864
11865
11867 {
11868 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11869 {
11871 {
11872 float energy_0to1 = GetCompEM().GetEnergy0To1();
11874 }
11875 }
11876 }
11877
11878
11880 {
11881 return ConfigGetFloat("heatIsolation");
11882 }
11883
11885 {
11887 }
11888
11890 {
11891 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11892 if (
GetGame().ConfigIsExisting(paramPath))
11894
11895 return 0.0;
11896 }
11897
11899 {
11900 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11901 if (
GetGame().ConfigIsExisting(paramPath))
11903
11904 return 0.0;
11905 }
11906
11907 override void SetWet(
float value,
bool allow_client =
false)
11908 {
11909 if (!IsServerCheck(allow_client))
11910 return;
11911
11914
11916
11917 m_VarWet = Math.Clamp(value, min, max);
11918
11920 {
11923 }
11924 }
11925
11926 override void AddWet(
float value)
11927 {
11929 }
11930
11932 {
11934 }
11935
11937 {
11939 }
11940
11942 {
11944 }
11945
11947 {
11949 }
11950
11952 {
11954 }
11955
11956 override void OnWetChanged(
float newVal,
float oldVal)
11957 {
11960 if (newLevel != oldLevel)
11961 {
11963 }
11964 }
11965
11967 {
11968 SetWeightDirty();
11969 }
11970
11972 {
11973 return GetWetLevelInternal(
m_VarWet);
11974 }
11975
11976
11977
11979 {
11981 }
11982
11984 {
11986 }
11987
11989 {
11991 }
11992
11994 {
11996 }
11997
11998
11999
12001 {
12002 if (ConfigIsExisting("itemModelLength"))
12003 {
12004 return ConfigGetFloat("itemModelLength");
12005 }
12006 return 0;
12007 }
12008
12010 {
12011 if (ConfigIsExisting("itemAttachOffset"))
12012 {
12013 return ConfigGetFloat("itemAttachOffset");
12014 }
12015 return 0;
12016 }
12017
12018 override void SetCleanness(
int value,
bool allow_client =
false)
12019 {
12020 if (!IsServerCheck(allow_client))
12021 return;
12022
12024
12026
12029 }
12030
12032 {
12034 }
12035
12037 {
12038 return true;
12039 }
12040
12041
12042
12043
12045 {
12047 }
12048
12050 {
12052 }
12053
12054
12055
12056
12057 override void SetColor(
int r,
int g,
int b,
int a)
12058 {
12064 }
12066 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12067 {
12072 }
12073
12075 {
12077 }
12078
12081 {
12082 int r,g,b,a;
12084 r = r/255;
12085 g = g/255;
12086 b = b/255;
12087 a = a/255;
12088 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12089 }
12090
12091
12092
12093 override void SetLiquidType(
int value,
bool allow_client =
false)
12094 {
12095 if (!IsServerCheck(allow_client))
12096 return;
12097
12102 }
12103
12105 {
12106 return ConfigGetInt("varLiquidTypeInit");
12107 }
12108
12110 {
12112 }
12113
12115 {
12117 SetFrozen(false);
12118 }
12119
12122 {
12123 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12124 }
12125
12126
12129 {
12130 PlayerBase nplayer;
12131 if (PlayerBase.CastTo(nplayer, player))
12132 {
12134
12135 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12136 }
12137 }
12138
12139
12142 {
12143 PlayerBase nplayer;
12144 if (PlayerBase.CastTo(nplayer,player))
12145 {
12146
12147 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12148
12149 }
12150
12151
12152 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12153
12154
12155 if (HasEnergyManager())
12156 {
12157 GetCompEM().UpdatePlugState();
12158 }
12159 }
12160
12161
12163 {
12164 super.OnPlacementStarted(player);
12165
12167 }
12168
12169 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12170 {
12172 {
12173 m_AdminLog.OnPlacementComplete(player,
this);
12174 }
12175
12176 super.OnPlacementComplete(player, position, orientation);
12177 }
12178
12179
12180
12181
12182
12184 {
12186 {
12187 return true;
12188 }
12189 else
12190 {
12191 return false;
12192 }
12193 }
12194
12195
12197 {
12199 {
12201 }
12202 }
12203
12204
12206 {
12208 }
12209
12211 {
12213 }
12214
12215 override void InsertAgent(
int agent,
float count = 1)
12216 {
12217 if (count < 1)
12218 return;
12219
12221 }
12222
12225 {
12227 }
12228
12229
12231 {
12233 }
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12277 {
12279 return false;
12280 return true;
12281 }
12282
12284 {
12285
12287 }
12288
12289
12292 {
12293 super.CheckForRoofLimited(timeTresholdMS);
12294
12296 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12297 {
12298 m_PreviousRoofTestTime = time;
12299 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12300 }
12301 }
12302
12303
12305 {
12307 {
12308 return 0;
12309 }
12310
12311 if (GetInventory().GetAttachmentSlotsCount() != 0)
12312 {
12313 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12314 if (filter)
12315 return filter.GetProtectionLevel(type, false, system);
12316 else
12317 return 0;
12318 }
12319
12320 string subclassPath, entryName;
12321
12322 switch (type)
12323 {
12325 entryName = "biological";
12326 break;
12328 entryName = "chemical";
12329 break;
12330 default:
12331 entryName = "biological";
12332 break;
12333 }
12334
12335 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12336
12338 }
12339
12340
12341
12344 {
12345 if (!IsMagazine())
12347
12349 }
12350
12351
12352
12353
12354
12359 {
12360 return true;
12361 }
12362
12364 {
12366 }
12367
12368
12369
12370
12371
12373 {
12374 if (parent)
12375 {
12376 if (parent.IsInherited(DayZInfected))
12377 return true;
12378
12379 if (!parent.IsRuined())
12380 return true;
12381 }
12382
12383 return true;
12384 }
12385
12387 {
12388 if (!super.CanPutAsAttachment(parent))
12389 {
12390 return false;
12391 }
12392
12393 if (!IsRuined() && !parent.IsRuined())
12394 {
12395 return true;
12396 }
12397
12398 return false;
12399 }
12400
12402 {
12403
12404
12405
12406
12407 return super.CanReceiveItemIntoCargo(item);
12408 }
12409
12411 {
12412
12413
12414
12415
12416 GameInventory attachmentInv = attachment.GetInventory();
12418 {
12419 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12420 return false;
12421 }
12422
12423 InventoryLocation loc = new InventoryLocation();
12424 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12425 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12426 return false;
12427
12428 return super.CanReceiveAttachment(attachment, slotId);
12429 }
12430
12432 {
12433 if (!super.CanReleaseAttachment(attachment))
12434 return false;
12435
12436 return GetInventory().AreChildrenAccessible();
12437 }
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12460 {
12461 int id = muzzle_owner.GetMuzzleID();
12462 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12463
12464 if (WPOF_array)
12465 {
12466 for (int i = 0; i < WPOF_array.Count(); i++)
12467 {
12468 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12469
12470 if (WPOF)
12471 {
12472 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12473 }
12474 }
12475 }
12476 }
12477
12478
12480 {
12481 int id = muzzle_owner.GetMuzzleID();
12483
12484 if (WPOBE_array)
12485 {
12486 for (int i = 0; i < WPOBE_array.Count(); i++)
12487 {
12488 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12489
12490 if (WPOBE)
12491 {
12492 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12493 }
12494 }
12495 }
12496 }
12497
12498
12500 {
12501 int id = muzzle_owner.GetMuzzleID();
12502 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12503
12504 if (WPOOH_array)
12505 {
12506 for (int i = 0; i < WPOOH_array.Count(); i++)
12507 {
12508 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12509
12510 if (WPOOH)
12511 {
12512 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12513 }
12514 }
12515 }
12516 }
12517
12518
12520 {
12521 int id = muzzle_owner.GetMuzzleID();
12522 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12523
12524 if (WPOOH_array)
12525 {
12526 for (int i = 0; i < WPOOH_array.Count(); i++)
12527 {
12528 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12529
12530 if (WPOOH)
12531 {
12532 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12533 }
12534 }
12535 }
12536 }
12537
12538
12540 {
12541 int id = muzzle_owner.GetMuzzleID();
12542 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12543
12544 if (WPOOH_array)
12545 {
12546 for (int i = 0; i < WPOOH_array.Count(); i++)
12547 {
12548 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12549
12550 if (WPOOH)
12551 {
12552 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12553 }
12554 }
12555 }
12556 }
12557
12558
12559
12561 {
12563 {
12564 return true;
12565 }
12566
12567 return false;
12568 }
12569
12571 {
12573 {
12574 return true;
12575 }
12576
12577 return false;
12578 }
12579
12581 {
12583 {
12584 return true;
12585 }
12586
12587 return false;
12588 }
12589
12591 {
12592 return false;
12593 }
12594
12597 {
12598 return UATimeSpent.DEFAULT_DEPLOY;
12599 }
12600
12601
12602
12603
12605 {
12607 SetSynchDirty();
12608 }
12609
12611 {
12613 }
12614
12615
12617 {
12618 return false;
12619 }
12620
12623 {
12624 string att_type = "None";
12625
12626 if (ConfigIsExisting("soundAttType"))
12627 {
12628 att_type = ConfigGetString("soundAttType");
12629 }
12630
12632 }
12633
12635 {
12637 }
12638
12639
12640
12641
12642
12648
12650 {
12653
12655 }
12656
12657
12659 {
12661 return;
12662
12664
12667
12670
12671 SoundParameters params = new SoundParameters();
12675 }
12676
12677
12679 {
12681 return;
12682
12684 SetSynchDirty();
12685
12688 }
12689
12690
12692 {
12694 return;
12695
12697 SetSynchDirty();
12698
12701 }
12702
12704 {
12706 }
12707
12709 {
12711 }
12712
12715 {
12716 if (!
GetGame().IsDedicatedServer())
12717 {
12718 if (ConfigIsExisting("attachSoundSet"))
12719 {
12720 string cfg_path = "";
12721 string soundset = "";
12722 string type_name =
GetType();
12723
12726 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12727 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12728
12729 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12730 {
12731 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12732 {
12733 if (cfg_slot_array[i] == slot_type)
12734 {
12735 soundset = cfg_soundset_array[i];
12736 break;
12737 }
12738 }
12739 }
12740
12741 if (soundset != "")
12742 {
12743 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12745 }
12746 }
12747 }
12748 }
12749
12751 {
12752
12753 }
12754
12755 void OnApply(PlayerBase player);
12756
12758 {
12759 return 1.0;
12760 };
12761
12763 {
12765 }
12766
12768 {
12770 }
12771
12773
12775 {
12776 SetDynamicPhysicsLifeTime(0.01);
12778 }
12779
12781 {
12782 array<string> zone_names = new array<string>;
12783 GetDamageZones(zone_names);
12784 for (int i = 0; i < zone_names.Count(); i++)
12785 {
12786 SetHealthMax(zone_names.Get(i),"Health");
12787 }
12788 SetHealthMax("","Health");
12789 }
12790
12793 {
12794 float global_health = GetHealth01("","Health");
12795 array<string> zones = new array<string>;
12796 GetDamageZones(zones);
12797
12798 for (int i = 0; i < zones.Count(); i++)
12799 {
12800 SetHealth01(zones.Get(i),"Health",global_health);
12801 }
12802 }
12803
12806 {
12807 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12808 }
12809
12811 {
12812 if (!hasRootAsPlayer)
12813 {
12814 if (refParentIB)
12815 {
12816
12817 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12818 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12819
12820 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12821 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12822
12825 }
12826 else
12827 {
12828
12831 }
12832 }
12833 }
12834
12836 {
12838 {
12839 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12840 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12841 {
12842 float heatPermCoef = 1.0;
12844 while (ent)
12845 {
12846 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12847 ent = ent.GetHierarchyParent();
12848 }
12849
12850 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12851 }
12852 }
12853 }
12854
12856 {
12857
12858 EntityAI parent = GetHierarchyParent();
12859 if (!parent)
12860 {
12861 hasParent = false;
12862 hasRootAsPlayer = false;
12863 }
12864 else
12865 {
12866 hasParent = true;
12867 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12868 refParentIB =
ItemBase.Cast(parent);
12869 }
12870 }
12871
12872 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12873 {
12874
12875 }
12876
12878 {
12879
12880 return false;
12881 }
12882
12884 {
12885
12886
12887 return false;
12888 }
12889
12891 {
12892
12893 return false;
12894 }
12895
12898 {
12899 return !GetIsFrozen() &&
IsOpen();
12900 }
12901
12903 {
12904 bool hasParent = false, hasRootAsPlayer = false;
12906
12907 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12908 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12909
12910 if (wwtu || foodDecay)
12911 {
12915
12916 if (processWetness || processTemperature || processDecay)
12917 {
12919
12920 if (processWetness)
12921 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12922
12923 if (processTemperature)
12925
12926 if (processDecay)
12927 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12928 }
12929 }
12930 }
12931
12934 {
12936 }
12937
12939 {
12942
12943 return super.GetTemperatureFreezeThreshold();
12944 }
12945
12947 {
12950
12951 return super.GetTemperatureThawThreshold();
12952 }
12953
12955 {
12958
12959 return super.GetItemOverheatThreshold();
12960 }
12961
12963 {
12965 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12966
12967 return super.GetTemperatureFreezeTime();
12968 }
12969
12971 {
12973 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12974
12975 return super.GetTemperatureThawTime();
12976 }
12977
12982
12984 {
12985 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12986 }
12987
12989 {
12990 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12991 }
12992
12995 {
12997 }
12998
13000 {
13002 }
13003
13005 {
13007 }
13008
13011 {
13012 return null;
13013 }
13014
13017 {
13018 return false;
13019 }
13020
13022 {
13024 {
13027 if (!trg)
13028 {
13030 explosive = this;
13031 }
13032
13033 explosive.PairRemote(trg);
13035
13036 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13037 trg.SetPersistentPairID(persistentID);
13038 explosive.SetPersistentPairID(persistentID);
13039
13040 return true;
13041 }
13042 return false;
13043 }
13044
13047 {
13048 float ret = 1.0;
13051 ret *= GetHealth01();
13052
13053 return ret;
13054 }
13055
13056 #ifdef DEVELOPER
13057 override void SetDebugItem()
13058 {
13059 super.SetDebugItem();
13060 _itemBase = this;
13061 }
13062
13064 {
13065 string text = super.GetDebugText();
13066
13068 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13069
13070 return text;
13071 }
13072 #endif
13073
13075 {
13076 return true;
13077 }
13078
13080
13082
13084 {
13087 }
13088
13089
13097
13113}
13114
13116{
13118 if (entity)
13119 {
13120 bool is_item = entity.IsInherited(
ItemBase);
13121 if (is_item && full_quantity)
13122 {
13125 }
13126 }
13127 else
13128 {
13130 return NULL;
13131 }
13132 return entity;
13133}
13134
13136{
13137 if (item)
13138 {
13139 if (health > 0)
13140 item.SetHealth("", "", health);
13141
13142 if (item.CanHaveTemperature())
13143 {
13145 if (item.CanFreeze())
13146 item.SetFrozen(false);
13147 }
13148
13149 if (item.HasEnergyManager())
13150 {
13151 if (quantity >= 0)
13152 {
13153 item.GetCompEM().SetEnergy0To1(quantity);
13154 }
13155 else
13156 {
13158 }
13159 }
13160 else if (item.IsMagazine())
13161 {
13162 Magazine mag = Magazine.Cast(item);
13163 if (quantity >= 0)
13164 {
13165 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13166 }
13167 else
13168 {
13170 }
13171
13172 }
13173 else
13174 {
13175 if (quantity >= 0)
13176 {
13177 item.SetQuantityNormalized(quantity, false);
13178 }
13179 else
13180 {
13182 }
13183
13184 }
13185 }
13186}
13187
13188#ifdef DEVELOPER
13190#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.