8311{
8313 {
8314 return true;
8315 }
8316};
8317
8318
8319
8321{
8325
8327
8330
8331
8332
8333
8334
8343
8349
8354
8359
8380 protected bool m_IsResultOfSplit
8381
8383
8388
8389
8390
8392
8396
8397
8398
8400
8403
8404
8405
8411
8412
8420
8423
8424
8426
8427
8429
8430
8435
8436
8441
8442
8444
8445
8447 {
8452
8453 if (!
GetGame().IsDedicatedServer())
8454 {
8456 {
8458
8460 {
8462 }
8463 }
8464
8467 }
8468
8469 m_OldLocation = null;
8470
8472 {
8474 }
8475
8476 if (ConfigIsExisting("headSelectionsToHide"))
8477 {
8480 }
8481
8483 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8484 {
8486 }
8487
8489
8490 m_IsResultOfSplit = false;
8491
8493 }
8494
8496 {
8497 super.InitItemVariables();
8498
8504 m_Count = ConfigGetInt(
"count");
8505
8508
8513
8516
8521
8533
8537
8538
8541 if (ConfigIsExisting("canBeSplit"))
8542 {
8545 }
8546
8548 if (ConfigIsExisting("itemBehaviour"))
8550
8551
8554 RegisterNetSyncVariableInt("m_VarLiquidType");
8555 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8556
8557 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8558 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8559 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8560
8561 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8562 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8563 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8564 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8565
8566 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8567 RegisterNetSyncVariableBool("m_IsTakeable");
8568 RegisterNetSyncVariableBool("m_IsHologram");
8569
8572 {
8575 }
8576
8578
8580 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8582
8583 }
8584
8586 {
8588 }
8589
8591 {
8594 {
8599 }
8600 }
8601
8602 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8603 {
8605 {
8608 }
8609
8611 }
8612
8614 {
8620 }
8621
8623
8625 {
8627
8628 if (!action)
8629 {
8630 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8631 return;
8632 }
8633
8635 if (!ai)
8636 {
8638 return;
8639 }
8640
8642 if (!action_array)
8643 {
8644 action_array = new array<ActionBase_Basic>;
8646 }
8647 if (LogManager.IsActionLogEnable())
8648 {
8649 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8650 }
8651
8652 if (action_array.Find(action) != -1)
8653 {
8654 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8655 }
8656 else
8657 {
8658 action_array.Insert(action);
8659 }
8660 }
8661
8663 {
8665 ActionBase action = player.GetActionManager().GetAction(actionName);
8668
8669 if (action_array)
8670 {
8671 action_array.RemoveItem(action);
8672 }
8673 }
8674
8675
8676
8678 {
8679 ActionOverrideData overrideData = new ActionOverrideData();
8683
8685 if (!actionMap)
8686 {
8689 }
8690
8691 actionMap.Insert(this.
Type(), overrideData);
8692
8693 }
8694
8696
8698
8699
8701 {
8704
8707
8708 string config_to_search = "CfgVehicles";
8709 string muzzle_owner_config;
8710
8712 {
8713 if (IsInherited(Weapon))
8714 config_to_search = "CfgWeapons";
8715
8716 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8717
8718 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8719
8721
8722 if (config_OnFire_subclass_count > 0)
8723 {
8724 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8725
8726 for (int i = 0; i < config_OnFire_subclass_count; i++)
8727 {
8728 string particle_class = "";
8730 string config_OnFire_entry = config_OnFire_class + particle_class;
8731 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8732 WPOF_array.Insert(WPOF);
8733 }
8734
8735
8737 }
8738 }
8739
8741 {
8742 config_to_search = "CfgWeapons";
8743 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8744
8745 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8746
8748
8749 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8750 {
8751 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8752
8753 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8754 {
8755 string particle_class2 = "";
8757 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8758 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8759 WPOBE_array.Insert(WPOBE);
8760 }
8761
8762
8764 }
8765 }
8766 }
8767
8768
8770 {
8773
8775 {
8776 string config_to_search = "CfgVehicles";
8777
8778 if (IsInherited(Weapon))
8779 config_to_search = "CfgWeapons";
8780
8781 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8782 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8783
8784 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8785 {
8786
8788
8790 {
8792 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8794 return;
8795 }
8796
8799
8800
8801
8803 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8804
8805 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8806 {
8807 string particle_class = "";
8809 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8811
8812 if (entry_type == CT_CLASS)
8813 {
8814 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8815 WPOOH_array.Insert(WPOF);
8816 }
8817 }
8818
8819
8821 }
8822 }
8823 }
8824
8826 {
8828 }
8829
8831 {
8833 {
8835
8838
8841
8842 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8843 }
8844 }
8845
8847 {
8849 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8850
8852 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8853
8855 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8856
8858 {
8860 }
8861 }
8862
8864 {
8866 }
8867
8869 {
8872 else
8874
8876 {
8879 }
8880 else
8881 {
8884
8887 }
8888
8890 }
8891
8893 {
8895 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8896 }
8897
8899 {
8901 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8903 }
8904
8906 {
8908 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8909 }
8910
8912 {
8915
8916 OverheatingParticle OP = new OverheatingParticle();
8921
8923 }
8924
8926 {
8929
8930 return -1;
8931 }
8932
8934 {
8936 {
8939
8940 for (int i = count; i > 0; --i)
8941 {
8942 int id = i - 1;
8945
8948
8949 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8950 {
8951 if (p)
8952 {
8955 }
8956 }
8957 }
8958 }
8959 }
8960
8962 {
8964 {
8966 {
8967 int id = i - 1;
8969
8970 if (OP)
8971 {
8973
8974 if (p)
8975 {
8977 }
8978
8979 delete OP;
8980 }
8981 }
8982
8985 }
8986 }
8987
8990 {
8991 return 0.0;
8992 }
8993
8994
8996 {
8997 return 250;
8998 }
8999
9001 {
9002 return 0;
9003 }
9004
9007 {
9009 return true;
9010
9011 return false;
9012 }
9013
9016 {
9019
9021 {
9023 }
9024 else
9025 {
9026
9028 }
9029
9031 }
9032
9039 {
9040 return -1;
9041 }
9042
9043
9044
9045
9047 {
9049 {
9051 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9052
9053 if (r_index >= 0)
9054 {
9055 InventoryLocation r_il = new InventoryLocation;
9056 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9057
9058 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9061 {
9062 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9063 }
9065 {
9066 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9067 }
9068
9069 }
9070
9071 player.GetHumanInventory().ClearUserReservedLocation(this);
9072 }
9073
9076 }
9077
9078
9079
9080
9082 {
9083 return ItemBase.m_DebugActionsMask;
9084 }
9085
9087 {
9088 return ItemBase.m_DebugActionsMask & mask;
9089 }
9090
9092 {
9093 ItemBase.m_DebugActionsMask = mask;
9094 }
9095
9097 {
9098 ItemBase.m_DebugActionsMask |= mask;
9099 }
9100
9102 {
9103 ItemBase.m_DebugActionsMask &= ~mask;
9104 }
9105
9107 {
9109 {
9111 }
9112 else
9113 {
9115 }
9116 }
9117
9118
9120 {
9121 if (GetEconomyProfile())
9122 {
9123 float q_max = GetEconomyProfile().GetQuantityMax();
9124 if (q_max > 0)
9125 {
9126 float q_min = GetEconomyProfile().GetQuantityMin();
9127 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9128
9130 {
9131 ComponentEnergyManager comp = GetCompEM();
9133 {
9135 }
9136 }
9138 {
9140
9141 }
9142
9143 }
9144 }
9145 }
9146
9149 {
9150 EntityAI parent = GetHierarchyParent();
9151
9152 if (parent)
9153 {
9154 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9155 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9156 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9157 }
9158 }
9159
9162 {
9163 EntityAI parent = GetHierarchyParent();
9164
9165 if (parent)
9166 {
9167 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9168 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9169 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9170 }
9171 }
9172
9174 {
9175
9176
9177
9178
9180
9182 {
9183 if (ScriptInputUserData.CanStoreInputUserData())
9184 {
9185 ScriptInputUserData ctx = new ScriptInputUserData;
9191 ctx.
Write(use_stack_max);
9194
9196 {
9197 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9198 }
9199 }
9200 }
9201 else if (!
GetGame().IsMultiplayer())
9202 {
9204 }
9205 }
9206
9208 {
9210 }
9211
9213 {
9215 }
9216
9218 {
9220 }
9221
9223 {
9224
9225 return false;
9226 }
9227
9229 {
9230 return false;
9231 }
9232
9236 {
9237 return false;
9238 }
9239
9241 {
9242 return "";
9243 }
9244
9246
9248 {
9249 return false;
9250 }
9251
9253 {
9254 return true;
9255 }
9256
9257
9258
9260 {
9261 return true;
9262 }
9263
9265 {
9266 return true;
9267 }
9268
9270 {
9271 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9273 }
9274
9276 {
9278 }
9279
9281 {
9283 if (!is_being_placed)
9285 SetSynchDirty();
9286 }
9287
9288
9290
9292 {
9294 }
9295
9297 {
9299 }
9300
9302 {
9303 return 1;
9304 }
9305
9307 {
9308 return false;
9309 }
9310
9312 {
9314 SetSynchDirty();
9315 }
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9352 {
9353 super.OnMovedInsideCargo(container);
9354
9355 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9356 }
9357
9358 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9359 {
9360 super.EEItemLocationChanged(oldLoc,newLoc);
9361
9362 PlayerBase new_player = null;
9363 PlayerBase old_player = null;
9364
9365 if (newLoc.GetParent())
9366 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9367
9368 if (oldLoc.GetParent())
9369 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9370
9372 {
9373 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9374
9375 if (r_index >= 0)
9376 {
9377 InventoryLocation r_il = new InventoryLocation;
9378 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9379
9380 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9383 {
9384 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9385 }
9387 {
9388 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9389 }
9390
9391 }
9392 }
9393
9395 {
9396 if (new_player)
9397 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9398
9399 if (new_player == old_player)
9400 {
9401
9402 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9403 {
9405 {
9406 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9407 {
9408 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9409 }
9410 }
9411 else
9412 {
9413 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9414 }
9415 }
9416
9417 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9418 {
9419 int type = oldLoc.GetType();
9421 {
9422 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9423 }
9425 {
9426 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9427 }
9428 }
9429 if (!m_OldLocation)
9430 {
9431 m_OldLocation = new InventoryLocation;
9432 }
9433 m_OldLocation.Copy(oldLoc);
9434 }
9435 else
9436 {
9437 if (m_OldLocation)
9438 {
9439 m_OldLocation.Reset();
9440 }
9441 }
9442
9444 }
9445 else
9446 {
9447 if (new_player)
9448 {
9449 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9450 if (res_index >= 0)
9451 {
9452 InventoryLocation il = new InventoryLocation;
9453 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9455 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9458 {
9459 il.
GetParent().GetOnReleaseLock().Invoke(it);
9460 }
9462 {
9464 }
9465
9466 }
9467 }
9469 {
9470
9472 }
9473
9474 if (m_OldLocation)
9475 {
9476 m_OldLocation.Reset();
9477 }
9478 }
9479 }
9480
9481 override void EOnContact(IEntity other, Contact extra)
9482 {
9484 {
9485 int liquidType = -1;
9487 if (impactSpeed > 0.0)
9488 {
9490 #ifndef SERVER
9492 #else
9494 SetSynchDirty();
9495 #endif
9497 }
9498 }
9499
9500 #ifdef SERVER
9501 if (GetCompEM() && GetCompEM().IsPlugged())
9502 {
9503 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9504 GetCompEM().UnplugThis();
9505 }
9506 #endif
9507 }
9508
9510
9512 {
9514 }
9515
9517 {
9518
9519 }
9520
9522 {
9523 super.OnItemLocationChanged(old_owner, new_owner);
9524
9525 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9526 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9527
9528 if (!relatedPlayer && playerNew)
9529 relatedPlayer = playerNew;
9530
9531 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9532 {
9534 if (actionMgr)
9535 {
9536 ActionBase currentAction = actionMgr.GetRunningAction();
9537 if (currentAction)
9539 }
9540 }
9541
9542 Man ownerPlayerOld = null;
9543 Man ownerPlayerNew = null;
9544
9545 if (old_owner)
9546 {
9547 if (old_owner.
IsMan())
9548 {
9549 ownerPlayerOld = Man.Cast(old_owner);
9550 }
9551 else
9552 {
9553 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9554 }
9555 }
9556 else
9557 {
9559 {
9561
9562 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9563 {
9564 GetCompEM().UnplugThis();
9565 }
9566 }
9567 }
9568
9569 if (new_owner)
9570 {
9571 if (new_owner.
IsMan())
9572 {
9573 ownerPlayerNew = Man.Cast(new_owner);
9574 }
9575 else
9576 {
9577 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9578 }
9579 }
9580
9581 if (ownerPlayerOld != ownerPlayerNew)
9582 {
9583 if (ownerPlayerOld)
9584 {
9585 array<EntityAI> subItemsExit = new array<EntityAI>;
9587 for (int i = 0; i < subItemsExit.Count(); i++)
9588 {
9591 }
9592 }
9593
9594 if (ownerPlayerNew)
9595 {
9596 array<EntityAI> subItemsEnter = new array<EntityAI>;
9598 for (int j = 0; j < subItemsEnter.Count(); j++)
9599 {
9602 }
9603 }
9604 }
9605 else if (ownerPlayerNew != null)
9606 {
9607 PlayerBase nplayer;
9608 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9609 {
9610 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9612 for (int k = 0; k < subItemsUpdate.Count(); k++)
9613 {
9615 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9616 }
9617 }
9618 }
9619
9620 if (old_owner)
9621 old_owner.OnChildItemRemoved(this);
9622 if (new_owner)
9623 new_owner.OnChildItemReceived(this);
9624 }
9625
9626
9628 {
9629 super.EEDelete(parent);
9630 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9631 if (player)
9632 {
9634
9635 if (player.IsAlive())
9636 {
9637 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9638 if (r_index >= 0)
9639 {
9640 InventoryLocation r_il = new InventoryLocation;
9641 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9642
9643 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9646 {
9647 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9648 }
9650 {
9651 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9652 }
9653
9654 }
9655
9656 player.RemoveQuickBarEntityShortcut(this);
9657 }
9658 }
9659 }
9660
9662 {
9663 super.EEKilled(killer);
9664
9667 {
9668 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9669 {
9670 if (IsMagazine())
9671 {
9672 if (Magazine.Cast(this).GetAmmoCount() > 0)
9673 {
9675 }
9676 }
9677 else
9678 {
9680 }
9681 }
9682 }
9683 }
9684
9686 {
9687 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9688
9689 super.OnWasAttached(parent, slot_id);
9690
9693
9695 }
9696
9698 {
9699 super.OnWasDetached(parent, slot_id);
9700
9703 }
9704
9706 {
9707 int idx;
9710
9711 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9712 if (inventory_slots.Count() < 1)
9713 {
9714 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9715 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9716 }
9717 else
9718 {
9719 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9720 }
9721
9722 idx = inventory_slots.Find(slot);
9723 if (idx < 0)
9724 return "";
9725
9726 return attach_types.Get(idx);
9727 }
9728
9730 {
9731 int idx = -1;
9732 string slot;
9733
9736
9737 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9738 if (inventory_slots.Count() < 1)
9739 {
9740 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9741 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9742 }
9743 else
9744 {
9745 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9746 if (detach_types.Count() < 1)
9747 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9748 }
9749
9750 for (int i = 0; i < inventory_slots.Count(); i++)
9751 {
9752 slot = inventory_slots.Get(i);
9753 }
9754
9755 if (slot != "")
9756 {
9757 if (detach_types.Count() == 1)
9758 idx = 0;
9759 else
9760 idx = inventory_slots.Find(slot);
9761 }
9762 if (idx < 0)
9763 return "";
9764
9765 return detach_types.Get(idx);
9766 }
9767
9769 {
9770
9772
9773
9774 float min_time = 1;
9775 float max_time = 3;
9776 float delay = Math.RandomFloat(min_time, max_time);
9777
9778 explode_timer.Run(delay, this, "DoAmmoExplosion");
9779 }
9780
9782 {
9783 Magazine magazine = Magazine.Cast(this);
9784 int pop_sounds_count = 6;
9785 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9786
9787
9788 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9789 string sound_name = pop_sounds[ sound_idx ];
9791
9792
9793 magazine.ServerAddAmmoCount(-1);
9794
9795
9796 float min_temp_to_explode = 100;
9797
9798 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9799 {
9801 }
9802 }
9803
9804
9805 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9806 {
9807 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9808
9809 const int CHANCE_DAMAGE_CARGO = 4;
9810 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9811 const int CHANCE_DAMAGE_NOTHING = 2;
9812
9814 {
9815 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9816 int chances;
9817 int rnd;
9818
9819 if (GetInventory().GetCargo())
9820 {
9821 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9822 rnd = Math.RandomInt(0,chances);
9823
9824 if (rnd < CHANCE_DAMAGE_CARGO)
9825 {
9827 }
9828 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9829 {
9831 }
9832 }
9833 else
9834 {
9835 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9836 rnd = Math.RandomInt(0,chances);
9837
9838 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9839 {
9841 }
9842 }
9843 }
9844 }
9845
9847 {
9848 if (GetInventory().GetCargo())
9849 {
9850 int item_count = GetInventory().GetCargo().GetItemCount();
9851 if (item_count > 0)
9852 {
9853 int random_pick = Math.RandomInt(0, item_count);
9855 if (!item.IsExplosive())
9856 {
9857 item.AddHealth("","",damage);
9858 return true;
9859 }
9860 }
9861 }
9862 return false;
9863 }
9864
9866 {
9867 int attachment_count = GetInventory().AttachmentCount();
9868 if (attachment_count > 0)
9869 {
9870 int random_pick = Math.RandomInt(0, attachment_count);
9871 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9872 if (!attachment.IsExplosive())
9873 {
9874 attachment.AddHealth("","",damage);
9875 return true;
9876 }
9877 }
9878 return false;
9879 }
9880
9882 {
9884 }
9885
9887 {
9889 return GetInventory().CanRemoveEntity();
9890
9891 return false;
9892 }
9893
9895 {
9896
9898 return false;
9899
9900
9902 return false;
9903
9904
9905
9907 if (delta == 0)
9908 return false;
9909
9910
9911 return true;
9912 }
9913
9915 {
9917 {
9918 if (ScriptInputUserData.CanStoreInputUserData())
9919 {
9920 ScriptInputUserData ctx = new ScriptInputUserData;
9925 ctx.
Write(destination_entity);
9929 }
9930 }
9931 else if (!
GetGame().IsMultiplayer())
9932 {
9934 }
9935 }
9936
9938 {
9939 float split_quantity_new;
9943 InventoryLocation loc = new InventoryLocation;
9944
9945 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9946 {
9948 split_quantity_new = stack_max;
9949 else
9951
9953 {
9954 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9955 if (new_item)
9956 {
9957 new_item.SetResultOfSplit(true);
9958 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9960 new_item.
SetQuantity(split_quantity_new,
false,
true);
9961 }
9962 }
9963 }
9964 else if (destination_entity && slot_id == -1)
9965 {
9966 if (quantity > stack_max)
9967 split_quantity_new = stack_max;
9968 else
9969 split_quantity_new = quantity;
9970
9972 {
9974 {
9977 }
9978
9979 if (new_item)
9980 {
9981 new_item.SetResultOfSplit(true);
9982 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9984 new_item.
SetQuantity(split_quantity_new,
false,
true);
9985 }
9986 }
9987 }
9988 else
9989 {
9990 if (stack_max != 0)
9991 {
9993 {
9995 }
9996
9997 if (split_quantity_new == 0)
9998 {
9999 if (!
GetGame().IsMultiplayer())
10000 player.PhysicalPredictiveDropItem(this);
10001 else
10002 player.ServerDropEntity(this);
10003 return;
10004 }
10005
10007 {
10009
10010 if (new_item)
10011 {
10012 new_item.SetResultOfSplit(true);
10013 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10016 new_item.PlaceOnSurface();
10017 }
10018 }
10019 }
10020 }
10021 }
10022
10024 {
10025 float split_quantity_new;
10029 InventoryLocation loc = new InventoryLocation;
10030
10031 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10032 {
10034 split_quantity_new = stack_max;
10035 else
10037
10039 {
10040 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10041 if (new_item)
10042 {
10043 new_item.SetResultOfSplit(true);
10044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10046 new_item.
SetQuantity(split_quantity_new,
false,
true);
10047 }
10048 }
10049 }
10050 else if (destination_entity && slot_id == -1)
10051 {
10052 if (quantity > stack_max)
10053 split_quantity_new = stack_max;
10054 else
10055 split_quantity_new = quantity;
10056
10058 {
10060 {
10063 }
10064
10065 if (new_item)
10066 {
10067 new_item.SetResultOfSplit(true);
10068 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10070 new_item.
SetQuantity(split_quantity_new,
false,
true);
10071 }
10072 }
10073 }
10074 else
10075 {
10076 if (stack_max != 0)
10077 {
10079 {
10081 }
10082
10084 {
10086
10087 if (new_item)
10088 {
10089 new_item.SetResultOfSplit(true);
10090 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10093 new_item.PlaceOnSurface();
10094 }
10095 }
10096 }
10097 }
10098 }
10099
10101 {
10103 {
10104 if (ScriptInputUserData.CanStoreInputUserData())
10105 {
10106 ScriptInputUserData ctx = new ScriptInputUserData;
10111 dst.WriteToContext(ctx);
10113 }
10114 }
10115 else if (!
GetGame().IsMultiplayer())
10116 {
10118 }
10119 }
10120
10122 {
10124 {
10125 if (ScriptInputUserData.CanStoreInputUserData())
10126 {
10127 ScriptInputUserData ctx = new ScriptInputUserData;
10132 ctx.
Write(destination_entity);
10138 }
10139 }
10140 else if (!
GetGame().IsMultiplayer())
10141 {
10143 }
10144 }
10145
10147 {
10149 }
10150
10152 {
10154 float split_quantity_new;
10156 if (dst.IsValid())
10157 {
10158 int slot_id = dst.GetSlot();
10160
10161 if (quantity > stack_max)
10162 split_quantity_new = stack_max;
10163 else
10164 split_quantity_new = quantity;
10165
10167 {
10169
10170 if (new_item)
10171 {
10172 new_item.SetResultOfSplit(true);
10173 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10175 new_item.
SetQuantity(split_quantity_new,
false,
true);
10176 }
10177
10178 return new_item;
10179 }
10180 }
10181
10182 return null;
10183 }
10184
10186 {
10188 float split_quantity_new;
10190 if (destination_entity)
10191 {
10193 if (quantity > stackable)
10194 split_quantity_new = stackable;
10195 else
10196 split_quantity_new = quantity;
10197
10199 {
10200 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10201 if (new_item)
10202 {
10203 new_item.SetResultOfSplit(true);
10204 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10206 new_item.
SetQuantity(split_quantity_new,
false,
true);
10207 }
10208 }
10209 }
10210 }
10211
10213 {
10215 {
10216 if (ScriptInputUserData.CanStoreInputUserData())
10217 {
10218 ScriptInputUserData ctx = new ScriptInputUserData;
10223 ItemBase destination_entity =
this;
10224 ctx.
Write(destination_entity);
10228 }
10229 }
10230 else if (!
GetGame().IsMultiplayer())
10231 {
10233 }
10234 }
10235
10237 {
10239 float split_quantity_new;
10241 if (player)
10242 {
10244 if (quantity > stackable)
10245 split_quantity_new = stackable;
10246 else
10247 split_quantity_new = quantity;
10248
10250 {
10251 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10252 new_item =
ItemBase.Cast(in_hands);
10253 if (new_item)
10254 {
10255 new_item.SetResultOfSplit(true);
10256 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10258 new_item.SetQuantity(split_quantity_new, false, true);
10259 }
10260 }
10261 }
10262 }
10263
10265 {
10267 float split_quantity_new = Math.Floor(quantity * 0.5);
10268
10270 return;
10271
10273
10274 if (new_item)
10275 {
10276 if (new_item.GetQuantityMax() < split_quantity_new)
10277 {
10278 split_quantity_new = new_item.GetQuantityMax();
10279 }
10280
10281 new_item.SetResultOfSplit(true);
10282 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10283
10285 {
10288 }
10289 else
10290 {
10292 new_item.
SetQuantity(split_quantity_new,
false,
true);
10293 }
10294 }
10295 }
10296
10298 {
10300 float split_quantity_new = Math.Floor(quantity / 2);
10301
10303 return;
10304
10305 InventoryLocation invloc = new InventoryLocation;
10307
10309 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10310
10311 if (new_item)
10312 {
10313 if (new_item.GetQuantityMax() < split_quantity_new)
10314 {
10315 split_quantity_new = new_item.GetQuantityMax();
10316 }
10318 {
10321 }
10322 else if (split_quantity_new > 1)
10323 {
10325 new_item.
SetQuantity(split_quantity_new,
false,
true);
10326 }
10327 }
10328 }
10329
10332 {
10333 SetWeightDirty();
10335
10336 if (parent)
10337 parent.OnAttachmentQuantityChangedEx(this, delta);
10338
10340 {
10342 {
10344 }
10346 {
10347 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10349 }
10350 }
10351
10352 }
10353
10356 {
10357
10358 }
10359
10362 {
10364 }
10365
10367 {
10368 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10369
10371 {
10372 if (newLevel == GameConstants.STATE_RUINED)
10373 {
10375 EntityAI parent = GetHierarchyParent();
10376 if (parent && parent.IsFireplace())
10377 {
10378 CargoBase cargo = GetInventory().GetCargo();
10379 if (cargo)
10380 {
10382 {
10384 }
10385 }
10386 }
10387 }
10388
10390 {
10391
10393 return;
10394 }
10395
10396 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10397 {
10399 }
10400 }
10401 }
10402
10403
10405 {
10406 super.OnRightClick();
10407
10409 {
10411 {
10412 if (ScriptInputUserData.CanStoreInputUserData())
10413 {
10414 EntityAI root = GetHierarchyRoot();
10415 Man playerOwner = GetHierarchyRootPlayer();
10416 InventoryLocation dst = new InventoryLocation;
10417
10418
10419 if (!playerOwner && root && root == this)
10420 {
10422 }
10423 else
10424 {
10425
10426 GetInventory().GetCurrentInventoryLocation(dst);
10428 {
10431 {
10433 }
10434 else
10435 {
10437
10438
10439 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10440 {
10442 }
10443 else
10444 {
10445 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10446 }
10447 }
10448 }
10449 }
10450
10451 ScriptInputUserData ctx = new ScriptInputUserData;
10459 }
10460 }
10461 else if (!
GetGame().IsMultiplayer())
10462 {
10464 }
10465 }
10466 }
10467
10469 {
10470 if (root)
10471 {
10472 vector m4[4];
10473 root.GetTransform(m4);
10474 dst.SetGround(this, m4);
10475 }
10476 else
10477 {
10478 GetInventory().GetCurrentInventoryLocation(dst);
10479 }
10480 }
10481
10482 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10483 {
10484
10485 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10486 return false;
10487
10488 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10489 return false;
10490
10491
10493 return false;
10494
10495
10496 Magazine mag = Magazine.Cast(this);
10497 if (mag)
10498 {
10499 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10500 return false;
10501
10502 if (stack_max_limit)
10503 {
10504 Magazine other_mag = Magazine.Cast(other_item);
10505 if (other_item)
10506 {
10507 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10508 return false;
10509 }
10510
10511 }
10512 }
10513 else
10514 {
10515
10517 return false;
10518
10520 return false;
10521 }
10522
10523 PlayerBase player = null;
10524 if (CastTo(player, GetHierarchyRootPlayer()))
10525 {
10526 if (player.GetInventory().HasAttachment(this))
10527 return false;
10528
10529 if (player.IsItemsToDelete())
10530 return false;
10531 }
10532
10533 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10534 return false;
10535
10536 int slotID;
10538 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10539 return false;
10540
10541 return true;
10542 }
10543
10545 {
10547 }
10548
10550 {
10551 return m_IsResultOfSplit;
10552 }
10553
10555 {
10556 m_IsResultOfSplit = value;
10557 }
10558
10560 {
10562 }
10563
10565 {
10566 float other_item_quantity = other_item.GetQuantity();
10567 float this_free_space;
10568
10570
10572
10573 if (other_item_quantity > this_free_space)
10574 {
10575 return this_free_space;
10576 }
10577 else
10578 {
10579 return other_item_quantity;
10580 }
10581 }
10582
10584 {
10586 }
10587
10589 {
10591 return;
10592
10593 if (!IsMagazine() && other_item)
10594 {
10596 if (quantity_used != 0)
10597 {
10598 float hp1 = GetHealth01("","");
10599 float hp2 = other_item.GetHealth01("","");
10600 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10601 hpResult = hpResult / (
GetQuantity() + quantity_used);
10602
10603 hpResult *= GetMaxHealth();
10604 Math.Round(hpResult);
10605 SetHealth("", "Health", hpResult);
10606
10608 other_item.AddQuantity(-quantity_used);
10609 }
10610 }
10612 }
10613
10615 {
10616 #ifdef SERVER
10617 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10618 GetHierarchyParent().IncreaseLifetimeUp();
10619 #endif
10620 };
10621
10623 {
10624 PlayerBase p = PlayerBase.Cast(player);
10625
10626 array<int> recipesIds = p.m_Recipes;
10627 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10628 if (moduleRecipesManager)
10629 {
10630 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10631 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10632 }
10633
10634 for (int i = 0;i < recipesIds.Count(); i++)
10635 {
10636 int key = recipesIds.Get(i);
10637 string recipeName = moduleRecipesManager.GetRecipeName(key);
10639 }
10640 }
10641
10642
10643 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10644 {
10645 super.GetDebugActions(outputList);
10646
10647
10653
10654
10659
10664
10665
10669
10670
10672 {
10676 }
10677
10680
10681
10685
10687
10688 InventoryLocation loc = new InventoryLocation();
10689 GetInventory().GetCurrentInventoryLocation(loc);
10691 {
10692 if (Gizmo_IsSupported())
10695 }
10696
10698 }
10699
10700
10701
10702
10704 {
10705 super.OnAction(action_id, player, ctx);
10706
10708 {
10709 switch (action_id)
10710 {
10713 return true;
10716 return true;
10717 }
10718 }
10719
10721 {
10722 switch (action_id)
10723 {
10725 Delete();
10726 return true;
10727 }
10728 }
10729
10730 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10731 {
10732 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10733 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10734 PlayerBase p = PlayerBase.Cast(player);
10735 if (
EActions.RECIPES_RANGE_START < 1000)
10736 {
10737 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10738 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10739 }
10740 }
10741 #ifndef SERVER
10742 else if (action_id ==
EActions.WATCH_PLAYER)
10743 {
10744 PluginDeveloper.SetDeveloperItemClientEx(player);
10745 }
10746 #endif
10748 {
10749 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10750 {
10751 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10752 OnDebugButtonPressServer(id + 1);
10753 }
10754
10755 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10756 {
10757 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10759 }
10760
10761 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10762 {
10763 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10765 }
10766
10767 else if (action_id ==
EActions.ADD_QUANTITY)
10768 {
10769 if (IsMagazine())
10770 {
10771 Magazine mag = Magazine.Cast(this);
10772 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10773 }
10774 else
10775 {
10777 }
10778
10779 if (m_EM)
10780 {
10781 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10782 }
10783
10784 }
10785
10786 else if (action_id ==
EActions.REMOVE_QUANTITY)
10787 {
10788 if (IsMagazine())
10789 {
10790 Magazine mag2 = Magazine.Cast(this);
10791 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10792 }
10793 else
10794 {
10796 }
10797 if (m_EM)
10798 {
10799 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10800 }
10801
10802 }
10803
10804 else if (action_id ==
EActions.SET_QUANTITY_0)
10805 {
10807
10808 if (m_EM)
10809 {
10810 m_EM.SetEnergy(0);
10811 }
10812 }
10813
10814 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10815 {
10817
10818 if (m_EM)
10819 {
10820 m_EM.SetEnergy(m_EM.GetEnergyMax());
10821 }
10822 }
10823
10824 else if (action_id ==
EActions.ADD_HEALTH)
10825 {
10826 AddHealth("","",GetMaxHealth("","Health")/5);
10827 }
10828 else if (action_id ==
EActions.REMOVE_HEALTH)
10829 {
10830 AddHealth("","",-GetMaxHealth("","Health")/5);
10831 }
10832 else if (action_id ==
EActions.DESTROY_HEALTH)
10833 {
10834 SetHealth01("","",0);
10835 }
10836 else if (action_id ==
EActions.WATCH_ITEM)
10837 {
10839 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10840 #ifdef DEVELOPER
10841 SetDebugDeveloper_item(this);
10842 #endif
10843 }
10844
10845 else if (action_id ==
EActions.ADD_TEMPERATURE)
10846 {
10847 AddTemperature(20);
10848
10849 }
10850
10851 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10852 {
10853 AddTemperature(-20);
10854
10855 }
10856
10857 else if (action_id ==
EActions.FLIP_FROZEN)
10858 {
10859 SetFrozen(!GetIsFrozen());
10860
10861 }
10862
10863 else if (action_id ==
EActions.ADD_WETNESS)
10864 {
10866
10867 }
10868
10869 else if (action_id ==
EActions.REMOVE_WETNESS)
10870 {
10872
10873 }
10874
10875 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10876 {
10879
10880
10881 }
10882
10883 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10884 {
10887 }
10888
10889 else if (action_id ==
EActions.MAKE_SPECIAL)
10890 {
10891 auto debugParams = DebugSpawnParams.WithPlayer(player);
10892 OnDebugSpawnEx(debugParams);
10893 }
10894
10895 }
10896
10897
10898 return false;
10899 }
10900
10901
10902
10903
10907
10910
10911
10912
10914 {
10915 return false;
10916 }
10917
10918
10920 {
10921 return true;
10922 }
10923
10924
10926 {
10927 return true;
10928 }
10929
10930
10931
10933 {
10934 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10936 }
10937
10940 {
10941 return null;
10942 }
10943
10945 {
10946 return false;
10947 }
10948
10950 {
10951 return false;
10952 }
10953
10957
10958
10960 {
10961 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10962 return module_repairing.CanRepair(this, item_repair_kit);
10963 }
10964
10965
10966 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10967 {
10968 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10969 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10970 }
10971
10972
10974 {
10975
10976
10977
10978
10979
10980
10981
10982
10983 return 1;
10984 }
10985
10986
10987
10989 {
10991 }
10992
10993
10994
10996 {
10998 }
10999
11000
11009 {
11010 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11011
11012 if (player)
11013 {
11014 player.MessageStatus(text);
11015 }
11016 }
11017
11018
11027 {
11028 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11029
11030 if (player)
11031 {
11032 player.MessageAction(text);
11033 }
11034 }
11035
11036
11045 {
11046 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11047
11048 if (player)
11049 {
11050 player.MessageFriendly(text);
11051 }
11052 }
11053
11054
11063 {
11064 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11065
11066 if (player)
11067 {
11068 player.MessageImportant(text);
11069 }
11070 }
11071
11073 {
11074 return true;
11075 }
11076
11077
11078 override bool KindOf(
string tag)
11079 {
11080 bool found = false;
11081 string item_name = this.
GetType();
11084
11085 int array_size = item_tag_array.Count();
11086 for (int i = 0; i < array_size; i++)
11087 {
11088 if (item_tag_array.Get(i) == tag)
11089 {
11090 found = true;
11091 break;
11092 }
11093 }
11094 return found;
11095 }
11096
11097
11099 {
11100
11101 super.OnRPC(sender, rpc_type,ctx);
11102
11103
11104 switch (rpc_type)
11105 {
11106 #ifndef SERVER
11107 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11108 Param2<bool, string> p = new Param2<bool, string>(false, "");
11109
11111 return;
11112
11113 bool play = p.param1;
11114 string soundSet = p.param2;
11115
11116 if (play)
11117 {
11119 {
11121 {
11123 }
11124 }
11125 else
11126 {
11128 }
11129 }
11130 else
11131 {
11133 }
11134
11135 break;
11136 #endif
11137
11138 }
11139
11141 {
11143 }
11144 }
11145
11146
11147
11148
11150 {
11151 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11152 return plugin.GetID(
name);
11153 }
11154
11156 {
11157 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11158 return plugin.GetName(id);
11159 }
11160
11163 {
11164
11165
11166 int varFlags;
11167 if (!ctx.
Read(varFlags))
11168 return;
11169
11170 if (varFlags & ItemVariableFlags.FLOAT)
11171 {
11173 }
11174 }
11175
11177 {
11178
11179 super.SerializeNumericalVars(floats_out);
11180
11181
11182
11184 {
11186 }
11187
11189 {
11191 }
11192
11194 {
11196 }
11197
11199 {
11204 }
11205
11207 {
11209 }
11210 }
11211
11213 {
11214
11215 super.DeSerializeNumericalVars(floats);
11216
11217
11218 int index = 0;
11219 int mask = Math.Round(floats.Get(index));
11220
11221 index++;
11222
11224 {
11226 {
11228 }
11229 else
11230 {
11231 float quantity = floats.Get(index);
11232 SetQuantity(quantity,
true,
false,
false,
false);
11233 }
11234 index++;
11235 }
11236
11238 {
11239 float wet = floats.Get(index);
11241 index++;
11242 }
11243
11245 {
11246 int liquidtype = Math.Round(floats.Get(index));
11248 index++;
11249 }
11250
11252 {
11254 index++;
11256 index++;
11258 index++;
11260 index++;
11261 }
11262
11264 {
11265 int cleanness = Math.Round(floats.Get(index));
11267 index++;
11268 }
11269 }
11270
11272 {
11273 super.WriteVarsToCTX(ctx);
11274
11275
11277 {
11279 }
11280
11282 {
11284 }
11285
11287 {
11289 }
11290
11292 {
11293 int r,g,b,a;
11299 }
11300
11302 {
11304 }
11305 }
11306
11308 {
11309 if (!super.ReadVarsFromCTX(ctx,version))
11310 return false;
11311
11312 int intValue;
11313 float value;
11314
11315 if (version < 140)
11316 {
11317 if (!ctx.
Read(intValue))
11318 return false;
11319
11320 m_VariablesMask = intValue;
11321 }
11322
11324 {
11325 if (!ctx.
Read(value))
11326 return false;
11327
11329 {
11331 }
11332 else
11333 {
11335 }
11336 }
11337
11338 if (version < 140)
11339 {
11341 {
11342 if (!ctx.
Read(value))
11343 return false;
11344 SetTemperatureDirect(value);
11345 }
11346 }
11347
11349 {
11350 if (!ctx.
Read(value))
11351 return false;
11353 }
11354
11356 {
11357 if (!ctx.
Read(intValue))
11358 return false;
11360 }
11361
11363 {
11364 int r,g,b,a;
11366 return false;
11368 return false;
11370 return false;
11372 return false;
11373
11375 }
11376
11378 {
11379 if (!ctx.
Read(intValue))
11380 return false;
11382 }
11383
11384 if (version >= 138 && version < 140)
11385 {
11387 {
11388 if (!ctx.
Read(intValue))
11389 return false;
11390 SetFrozen(intValue);
11391 }
11392 }
11393
11394 return true;
11395 }
11396
11397
11399 {
11402 {
11404 }
11405
11406 if (!super.OnStoreLoad(ctx, version))
11407 {
11409 return false;
11410 }
11411
11412 if (version >= 114)
11413 {
11414 bool hasQuickBarIndexSaved;
11415
11416 if (!ctx.
Read(hasQuickBarIndexSaved))
11417 {
11419 return false;
11420 }
11421
11422 if (hasQuickBarIndexSaved)
11423 {
11424 int itmQBIndex;
11425
11426
11427 if (!ctx.
Read(itmQBIndex))
11428 {
11430 return false;
11431 }
11432
11433 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11434 if (itmQBIndex != -1 && parentPlayer)
11435 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11436 }
11437 }
11438 else
11439 {
11440
11441 PlayerBase player;
11442 int itemQBIndex;
11443 if (version ==
int.
MAX)
11444 {
11445 if (!ctx.
Read(itemQBIndex))
11446 {
11448 return false;
11449 }
11450 }
11451 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11452 {
11453
11454 if (!ctx.
Read(itemQBIndex))
11455 {
11457 return false;
11458 }
11459 if (itemQBIndex != -1 && player)
11460 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11461 }
11462 }
11463
11464 if (version < 140)
11465 {
11466
11467 if (!LoadVariables(ctx, version))
11468 {
11470 return false;
11471 }
11472 }
11473
11474
11476 {
11478 return false;
11479 }
11480 if (version >= 132)
11481 {
11483 if (raib)
11484 {
11486 {
11488 return false;
11489 }
11490 }
11491 }
11492
11494 return true;
11495 }
11496
11497
11498
11500 {
11501 super.OnStoreSave(ctx);
11502
11503 PlayerBase player;
11504 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11505 {
11507
11508 int itemQBIndex = -1;
11509 itemQBIndex = player.FindQuickBarEntityIndex(this);
11510 ctx.
Write(itemQBIndex);
11511 }
11512 else
11513 {
11515 }
11516
11518
11520 if (raib)
11521 {
11523 }
11524 }
11525
11526
11528 {
11529 super.AfterStoreLoad();
11530
11532 {
11534 }
11535
11537 {
11540 }
11541 }
11542
11544 {
11545 super.EEOnAfterLoad();
11546
11548 {
11550 }
11551
11554 }
11555
11557 {
11558 return false;
11559 }
11560
11561
11562
11564 {
11566 {
11567 #ifdef PLATFORM_CONSOLE
11568
11570 {
11572 if (menu)
11573 {
11575 }
11576 }
11577 #endif
11578 }
11579
11581 {
11584 }
11585
11587 {
11588 SetWeightDirty();
11590 }
11592 {
11595 }
11596
11598 {
11601 }
11603 {
11606 }
11607
11608 super.OnVariablesSynchronized();
11609 }
11610
11611
11612
11614 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11615 {
11616 if (!IsServerCheck(allow_client))
11617 return false;
11618
11620 return false;
11621
11624
11625 if (value <= (min + 0.001))
11626 value = min;
11627
11628 if (value == min)
11629 {
11630 if (destroy_config)
11631 {
11632 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11633 if (dstr)
11634 {
11636 this.Delete();
11637 return true;
11638 }
11639 }
11640 else if (destroy_forced)
11641 {
11643 this.Delete();
11644 return true;
11645 }
11646
11648 }
11649
11652
11654 {
11656
11657 if (delta)
11659 }
11660
11662
11663 return false;
11664 }
11665
11666
11668 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11669 {
11671 }
11672
11674 {
11677 }
11678
11680 {
11683 }
11684
11686 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11687 {
11688 float value_clamped = Math.Clamp(value, 0, 1);
11690 SetQuantity(result, destroy_config, destroy_forced);
11691 }
11692
11693
11696 {
11698 }
11699
11701 {
11703 }
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11715 {
11716 int slot = -1;
11717 if (GetInventory())
11718 {
11719 InventoryLocation il = new InventoryLocation;
11720 GetInventory().GetCurrentInventoryLocation(il);
11722 }
11723
11725 }
11726
11728 {
11729 float quantity_max = 0;
11730
11732 {
11733 if (attSlotID != -1)
11734 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11735
11736 if (quantity_max <= 0)
11738 }
11739
11740 if (quantity_max <= 0)
11742
11743 return quantity_max;
11744 }
11745
11747 {
11749 }
11750
11752 {
11754 }
11755
11756
11758 {
11760 }
11761
11763 {
11765 }
11766
11768 {
11770 }
11771
11772
11774 {
11775
11776 float weightEx = GetWeightEx();
11777 float special = GetInventoryAndCargoWeight();
11778 return weightEx - special;
11779 }
11780
11781
11783 {
11785 }
11786
11788 {
11790 {
11791 #ifdef DEVELOPER
11792 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11793 {
11794 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11796 }
11797 #endif
11798
11799 return GetQuantity() * GetConfigWeightModified();
11800 }
11801 else if (HasEnergyManager())
11802 {
11803 #ifdef DEVELOPER
11804 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11805 {
11806 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11807 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11808 }
11809 #endif
11810 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11811 }
11812 else
11813 {
11814 #ifdef DEVELOPER
11815 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11816 {
11817 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11818 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11819 }
11820 #endif
11821 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11822 }
11823 }
11824
11827 {
11828 int item_count = 0;
11830
11831 if (GetInventory().GetCargo() != NULL)
11832 {
11833 item_count = GetInventory().GetCargo().GetItemCount();
11834 }
11835
11836 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11837 {
11838 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11839 if (item)
11840 item_count += item.GetNumberOfItems();
11841 }
11842 return item_count;
11843 }
11844
11847 {
11848 float weight = 0;
11849 float wetness = 1;
11850 if (include_wetness)
11853 {
11854 weight = wetness * m_ConfigWeight;
11855 }
11857 {
11858 weight = 1;
11859 }
11860 return weight;
11861 }
11862
11863
11864
11866 {
11867 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11868 {
11869 GameInventory inv = GetInventory();
11870 array<EntityAI> items = new array<EntityAI>;
11872 for (int i = 0; i < items.Count(); i++)
11873 {
11875 if (item)
11876 {
11878 }
11879 }
11880 }
11881 }
11882
11883
11884
11885
11887 {
11888 float energy = 0;
11889 if (HasEnergyManager())
11890 {
11891 energy = GetCompEM().GetEnergy();
11892 }
11893 return energy;
11894 }
11895
11896
11898 {
11899 super.OnEnergyConsumed();
11900
11902 }
11903
11905 {
11906 super.OnEnergyAdded();
11907
11909 }
11910
11911
11913 {
11914 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11915 {
11917 {
11918 float energy_0to1 = GetCompEM().GetEnergy0To1();
11920 }
11921 }
11922 }
11923
11924
11926 {
11927 return ConfigGetFloat("heatIsolation");
11928 }
11929
11931 {
11933 }
11934
11936 {
11937 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11938 if (
GetGame().ConfigIsExisting(paramPath))
11940
11941 return 0.0;
11942 }
11943
11945 {
11946 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11947 if (
GetGame().ConfigIsExisting(paramPath))
11949
11950 return 0.0;
11951 }
11952
11953 override void SetWet(
float value,
bool allow_client =
false)
11954 {
11955 if (!IsServerCheck(allow_client))
11956 return;
11957
11960
11962
11963 m_VarWet = Math.Clamp(value, min, max);
11964
11966 {
11969 }
11970 }
11971
11972 override void AddWet(
float value)
11973 {
11975 }
11976
11978 {
11980 }
11981
11983 {
11985 }
11986
11988 {
11990 }
11991
11993 {
11995 }
11996
11998 {
12000 }
12001
12002 override void OnWetChanged(
float newVal,
float oldVal)
12003 {
12006 if (newLevel != oldLevel)
12007 {
12009 }
12010 }
12011
12013 {
12014 SetWeightDirty();
12015 }
12016
12018 {
12019 return GetWetLevelInternal(
m_VarWet);
12020 }
12021
12022
12023
12025 {
12027 }
12028
12030 {
12032 }
12033
12035 {
12037 }
12038
12040 {
12042 }
12043
12044
12045
12047 {
12048 if (ConfigIsExisting("itemModelLength"))
12049 {
12050 return ConfigGetFloat("itemModelLength");
12051 }
12052 return 0;
12053 }
12054
12056 {
12057 if (ConfigIsExisting("itemAttachOffset"))
12058 {
12059 return ConfigGetFloat("itemAttachOffset");
12060 }
12061 return 0;
12062 }
12063
12064 override void SetCleanness(
int value,
bool allow_client =
false)
12065 {
12066 if (!IsServerCheck(allow_client))
12067 return;
12068
12070
12072
12075 }
12076
12078 {
12080 }
12081
12083 {
12084 return true;
12085 }
12086
12087
12088
12089
12091 {
12093 }
12094
12096 {
12098 }
12099
12100
12101
12102
12103 override void SetColor(
int r,
int g,
int b,
int a)
12104 {
12110 }
12112 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12113 {
12118 }
12119
12121 {
12123 }
12124
12127 {
12128 int r,g,b,a;
12130 r = r/255;
12131 g = g/255;
12132 b = b/255;
12133 a = a/255;
12134 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12135 }
12136
12137
12138
12139 override void SetLiquidType(
int value,
bool allow_client =
false)
12140 {
12141 if (!IsServerCheck(allow_client))
12142 return;
12143
12148 }
12149
12151 {
12152 return ConfigGetInt("varLiquidTypeInit");
12153 }
12154
12156 {
12158 }
12159
12161 {
12163 SetFrozen(false);
12164 }
12165
12168 {
12169 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12170 }
12171
12172
12175 {
12176 PlayerBase nplayer;
12177 if (PlayerBase.CastTo(nplayer, player))
12178 {
12180
12181 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12182 }
12183 }
12184
12185
12188 {
12189 PlayerBase nplayer;
12190 if (PlayerBase.CastTo(nplayer,player))
12191 {
12192
12193 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12194
12195 }
12196
12197
12198 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12199
12200
12201 if (HasEnergyManager())
12202 {
12203 GetCompEM().UpdatePlugState();
12204 }
12205 }
12206
12207
12209 {
12210 super.OnPlacementStarted(player);
12211
12213 }
12214
12215 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12216 {
12218 {
12219 m_AdminLog.OnPlacementComplete(player,
this);
12220 }
12221
12222 super.OnPlacementComplete(player, position, orientation);
12223 }
12224
12225
12226
12227
12228
12230 {
12232 {
12233 return true;
12234 }
12235 else
12236 {
12237 return false;
12238 }
12239 }
12240
12241
12243 {
12245 {
12247 }
12248 }
12249
12250
12252 {
12254 }
12255
12257 {
12259 }
12260
12261 override void InsertAgent(
int agent,
float count = 1)
12262 {
12263 if (count < 1)
12264 return;
12265
12267 }
12268
12271 {
12273 }
12274
12275
12277 {
12279 }
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12323 {
12325 return false;
12326 return true;
12327 }
12328
12330 {
12331
12333 }
12334
12335
12338 {
12339 super.CheckForRoofLimited(timeTresholdMS);
12340
12342 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12343 {
12344 m_PreviousRoofTestTime = time;
12345 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12346 }
12347 }
12348
12349
12351 {
12353 {
12354 return 0;
12355 }
12356
12357 if (GetInventory().GetAttachmentSlotsCount() != 0)
12358 {
12359 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12360 if (filter)
12361 return filter.GetProtectionLevel(type, false, system);
12362 else
12363 return 0;
12364 }
12365
12366 string subclassPath, entryName;
12367
12368 switch (type)
12369 {
12371 entryName = "biological";
12372 break;
12374 entryName = "chemical";
12375 break;
12376 default:
12377 entryName = "biological";
12378 break;
12379 }
12380
12381 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12382
12384 }
12385
12386
12387
12390 {
12391 if (!IsMagazine())
12393
12395 }
12396
12397
12398
12399
12400
12405 {
12406 return true;
12407 }
12408
12410 {
12412 }
12413
12414
12415
12416
12417
12419 {
12420 if (parent)
12421 {
12422 if (parent.IsInherited(DayZInfected))
12423 return true;
12424
12425 if (!parent.IsRuined())
12426 return true;
12427 }
12428
12429 return true;
12430 }
12431
12433 {
12434 if (!super.CanPutAsAttachment(parent))
12435 {
12436 return false;
12437 }
12438
12439 if (!IsRuined() && !parent.IsRuined())
12440 {
12441 return true;
12442 }
12443
12444 return false;
12445 }
12446
12448 {
12449
12450
12451
12452
12453 return super.CanReceiveItemIntoCargo(item);
12454 }
12455
12457 {
12458
12459
12460
12461
12462 GameInventory attachmentInv = attachment.GetInventory();
12464 {
12465 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12466 return false;
12467 }
12468
12469 InventoryLocation loc = new InventoryLocation();
12470 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12471 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12472 return false;
12473
12474 return super.CanReceiveAttachment(attachment, slotId);
12475 }
12476
12478 {
12479 if (!super.CanReleaseAttachment(attachment))
12480 return false;
12481
12482 return GetInventory().AreChildrenAccessible();
12483 }
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12506 {
12507 int id = muzzle_owner.GetMuzzleID();
12508 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12509
12510 if (WPOF_array)
12511 {
12512 for (int i = 0; i < WPOF_array.Count(); i++)
12513 {
12514 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12515
12516 if (WPOF)
12517 {
12518 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12519 }
12520 }
12521 }
12522 }
12523
12524
12526 {
12527 int id = muzzle_owner.GetMuzzleID();
12529
12530 if (WPOBE_array)
12531 {
12532 for (int i = 0; i < WPOBE_array.Count(); i++)
12533 {
12534 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12535
12536 if (WPOBE)
12537 {
12538 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12539 }
12540 }
12541 }
12542 }
12543
12544
12546 {
12547 int id = muzzle_owner.GetMuzzleID();
12548 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12549
12550 if (WPOOH_array)
12551 {
12552 for (int i = 0; i < WPOOH_array.Count(); i++)
12553 {
12554 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12555
12556 if (WPOOH)
12557 {
12558 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12559 }
12560 }
12561 }
12562 }
12563
12564
12566 {
12567 int id = muzzle_owner.GetMuzzleID();
12568 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12569
12570 if (WPOOH_array)
12571 {
12572 for (int i = 0; i < WPOOH_array.Count(); i++)
12573 {
12574 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12575
12576 if (WPOOH)
12577 {
12578 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12579 }
12580 }
12581 }
12582 }
12583
12584
12586 {
12587 int id = muzzle_owner.GetMuzzleID();
12588 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12589
12590 if (WPOOH_array)
12591 {
12592 for (int i = 0; i < WPOOH_array.Count(); i++)
12593 {
12594 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12595
12596 if (WPOOH)
12597 {
12598 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12599 }
12600 }
12601 }
12602 }
12603
12604
12605
12607 {
12609 {
12610 return true;
12611 }
12612
12613 return false;
12614 }
12615
12617 {
12619 {
12620 return true;
12621 }
12622
12623 return false;
12624 }
12625
12627 {
12629 {
12630 return true;
12631 }
12632
12633 return false;
12634 }
12635
12637 {
12638 return false;
12639 }
12640
12643 {
12644 return UATimeSpent.DEFAULT_DEPLOY;
12645 }
12646
12647
12648
12649
12651 {
12653 SetSynchDirty();
12654 }
12655
12657 {
12659 }
12660
12661
12663 {
12664 return false;
12665 }
12666
12669 {
12670 string att_type = "None";
12671
12672 if (ConfigIsExisting("soundAttType"))
12673 {
12674 att_type = ConfigGetString("soundAttType");
12675 }
12676
12678 }
12679
12681 {
12683 }
12684
12685
12686
12687
12688
12694
12696 {
12699
12701 }
12702
12703
12705 {
12707 return;
12708
12710
12713
12716
12717 SoundParameters params = new SoundParameters();
12721 }
12722
12723
12725 {
12727 return;
12728
12730 SetSynchDirty();
12731
12734 }
12735
12736
12738 {
12740 return;
12741
12743 SetSynchDirty();
12744
12747 }
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12761 {
12762 if (!
GetGame().IsDedicatedServer())
12763 {
12764 if (ConfigIsExisting("attachSoundSet"))
12765 {
12766 string cfg_path = "";
12767 string soundset = "";
12768 string type_name =
GetType();
12769
12772 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12773 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12774
12775 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12776 {
12777 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12778 {
12779 if (cfg_slot_array[i] == slot_type)
12780 {
12781 soundset = cfg_soundset_array[i];
12782 break;
12783 }
12784 }
12785 }
12786
12787 if (soundset != "")
12788 {
12789 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12791 }
12792 }
12793 }
12794 }
12795
12797 {
12798
12799 }
12800
12801 void OnApply(PlayerBase player);
12802
12804 {
12805 return 1.0;
12806 };
12807
12809 {
12811 }
12812
12814 {
12816 }
12817
12819
12821 {
12822 SetDynamicPhysicsLifeTime(0.01);
12824 }
12825
12827 {
12828 array<string> zone_names = new array<string>;
12829 GetDamageZones(zone_names);
12830 for (int i = 0; i < zone_names.Count(); i++)
12831 {
12832 SetHealthMax(zone_names.Get(i),"Health");
12833 }
12834 SetHealthMax("","Health");
12835 }
12836
12839 {
12840 float global_health = GetHealth01("","Health");
12841 array<string> zones = new array<string>;
12842 GetDamageZones(zones);
12843
12844 for (int i = 0; i < zones.Count(); i++)
12845 {
12846 SetHealth01(zones.Get(i),"Health",global_health);
12847 }
12848 }
12849
12852 {
12853 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12854 }
12855
12857 {
12858 if (!hasRootAsPlayer)
12859 {
12860 if (refParentIB)
12861 {
12862
12863 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12864 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12865
12866 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12867 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12868
12871 }
12872 else
12873 {
12874
12877 }
12878 }
12879 }
12880
12882 {
12884 {
12885 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12886 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12887 {
12888 float heatPermCoef = 1.0;
12890 while (ent)
12891 {
12892 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12893 ent = ent.GetHierarchyParent();
12894 }
12895
12896 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12897 }
12898 }
12899 }
12900
12902 {
12903
12904 EntityAI parent = GetHierarchyParent();
12905 if (!parent)
12906 {
12907 hasParent = false;
12908 hasRootAsPlayer = false;
12909 }
12910 else
12911 {
12912 hasParent = true;
12913 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12914 refParentIB =
ItemBase.Cast(parent);
12915 }
12916 }
12917
12918 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12919 {
12920
12921 }
12922
12924 {
12925
12926 return false;
12927 }
12928
12930 {
12931
12932
12933 return false;
12934 }
12935
12937 {
12938
12939 return false;
12940 }
12941
12944 {
12945 return !GetIsFrozen() &&
IsOpen();
12946 }
12947
12949 {
12950 bool hasParent = false, hasRootAsPlayer = false;
12952
12953 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12954 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12955
12956 if (wwtu || foodDecay)
12957 {
12961
12962 if (processWetness || processTemperature || processDecay)
12963 {
12965
12966 if (processWetness)
12967 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12968
12969 if (processTemperature)
12971
12972 if (processDecay)
12973 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12974 }
12975 }
12976 }
12977
12980 {
12982 }
12983
12985 {
12988
12989 return super.GetTemperatureFreezeThreshold();
12990 }
12991
12993 {
12996
12997 return super.GetTemperatureThawThreshold();
12998 }
12999
13001 {
13004
13005 return super.GetItemOverheatThreshold();
13006 }
13007
13009 {
13011 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13012
13013 return super.GetTemperatureFreezeTime();
13014 }
13015
13017 {
13019 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13020
13021 return super.GetTemperatureThawTime();
13022 }
13023
13028
13030 {
13031 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13032 }
13033
13035 {
13036 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13037 }
13038
13041 {
13043 }
13044
13046 {
13048 }
13049
13051 {
13053 }
13054
13057 {
13058 return null;
13059 }
13060
13063 {
13064 return false;
13065 }
13066
13068 {
13070 {
13073 if (!trg)
13074 {
13076 explosive = this;
13077 }
13078
13079 explosive.PairRemote(trg);
13081
13082 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13083 trg.SetPersistentPairID(persistentID);
13084 explosive.SetPersistentPairID(persistentID);
13085
13086 return true;
13087 }
13088 return false;
13089 }
13090
13093 {
13094 float ret = 1.0;
13097 ret *= GetHealth01();
13098
13099 return ret;
13100 }
13101
13102 #ifdef DEVELOPER
13103 override void SetDebugItem()
13104 {
13105 super.SetDebugItem();
13106 _itemBase = this;
13107 }
13108
13110 {
13111 string text = super.GetDebugText();
13112
13114 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13115
13116 return text;
13117 }
13118 #endif
13119
13121 {
13122 return true;
13123 }
13124
13126
13128
13130 {
13133 }
13134
13135
13143
13159}
13160
13162{
13164 if (entity)
13165 {
13166 bool is_item = entity.IsInherited(
ItemBase);
13167 if (is_item && full_quantity)
13168 {
13171 }
13172 }
13173 else
13174 {
13176 return NULL;
13177 }
13178 return entity;
13179}
13180
13182{
13183 if (item)
13184 {
13185 if (health > 0)
13186 item.SetHealth("", "", health);
13187
13188 if (item.CanHaveTemperature())
13189 {
13191 if (item.CanFreeze())
13192 item.SetFrozen(false);
13193 }
13194
13195 if (item.HasEnergyManager())
13196 {
13197 if (quantity >= 0)
13198 {
13199 item.GetCompEM().SetEnergy0To1(quantity);
13200 }
13201 else
13202 {
13204 }
13205 }
13206 else if (item.IsMagazine())
13207 {
13208 Magazine mag = Magazine.Cast(item);
13209 if (quantity >= 0)
13210 {
13211 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13212 }
13213 else
13214 {
13216 }
13217
13218 }
13219 else
13220 {
13221 if (quantity >= 0)
13222 {
13223 item.SetQuantityNormalized(quantity, false);
13224 }
13225 else
13226 {
13228 }
13229
13230 }
13231 }
13232}
13233
13234#ifdef DEVELOPER
13236#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.