Send message to owner player in yellow color.
7422{
7424 {
7425 return true;
7426 }
7427};
7428
7429
7430
7432{
7436
7438
7441
7442
7443
7444
7445
7454
7460
7465
7470
7491 protected bool m_IsResultOfSplit
7492
7494
7499
7500
7501
7503
7507
7508
7509
7511
7514
7515
7516
7522
7523
7531
7534
7535
7537
7538
7540
7541
7546
7547
7552
7553
7555
7556
7558 {
7563
7564 if (!
GetGame().IsDedicatedServer())
7565 {
7567 {
7569
7571 {
7573 }
7574 }
7575
7578 }
7579
7580 m_OldLocation = null;
7581
7583 {
7585 }
7586
7587 if (ConfigIsExisting("headSelectionsToHide"))
7588 {
7591 }
7592
7594 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7595 {
7597 }
7598
7600
7601 m_IsResultOfSplit = false;
7602
7604 }
7605
7607 {
7608 super.InitItemVariables();
7609
7615 m_Count = ConfigGetInt(
"count");
7616
7619
7624
7627
7632
7644
7648
7649
7652 if (ConfigIsExisting("canBeSplit"))
7653 {
7656 }
7657
7659 if (ConfigIsExisting("itemBehaviour"))
7661
7662
7665 RegisterNetSyncVariableInt("m_VarLiquidType");
7666 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7667
7668 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7669 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7670 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7671
7672 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7673 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7674 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7675 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7676
7677 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7678 RegisterNetSyncVariableBool("m_IsTakeable");
7679 RegisterNetSyncVariableBool("m_IsHologram");
7680
7683 {
7686 }
7687
7689
7691 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7693
7694 }
7695
7697 {
7699 }
7700
7702 {
7705 {
7710 }
7711 }
7712
7713 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7714 {
7716 {
7719 }
7720
7722 }
7723
7725 {
7731 }
7732
7734
7736 {
7738
7739 if (!action)
7740 {
7741 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7742 return;
7743 }
7744
7746 if (!ai)
7747 {
7749 return;
7750 }
7751
7753 if (!action_array)
7754 {
7755 action_array = new array<ActionBase_Basic>;
7757 }
7758 if (LogManager.IsActionLogEnable())
7759 {
7760 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7761 }
7762
7763 if (action_array.Find(action) != -1)
7764 {
7765 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7766 }
7767 else
7768 {
7769 action_array.Insert(action);
7770 }
7771 }
7772
7774 {
7776 ActionBase action = player.GetActionManager().GetAction(actionName);
7779
7780 if (action_array)
7781 {
7782 action_array.RemoveItem(action);
7783 }
7784 }
7785
7786
7787
7789 {
7790 ActionOverrideData overrideData = new ActionOverrideData();
7794
7796 if (!actionMap)
7797 {
7800 }
7801
7802 actionMap.Insert(this.
Type(), overrideData);
7803
7804 }
7805
7807
7809
7810
7812 {
7815
7818
7819 string config_to_search = "CfgVehicles";
7820 string muzzle_owner_config;
7821
7823 {
7824 if (IsInherited(Weapon))
7825 config_to_search = "CfgWeapons";
7826
7827 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7828
7829 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7830
7832
7833 if (config_OnFire_subclass_count > 0)
7834 {
7835 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7836
7837 for (int i = 0; i < config_OnFire_subclass_count; i++)
7838 {
7839 string particle_class = "";
7841 string config_OnFire_entry = config_OnFire_class + particle_class;
7842 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7843 WPOF_array.Insert(WPOF);
7844 }
7845
7846
7848 }
7849 }
7850
7852 {
7853 config_to_search = "CfgWeapons";
7854 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7855
7856 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7857
7859
7860 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7861 {
7862 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7863
7864 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7865 {
7866 string particle_class2 = "";
7868 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7869 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7870 WPOBE_array.Insert(WPOBE);
7871 }
7872
7873
7875 }
7876 }
7877 }
7878
7879
7881 {
7884
7886 {
7887 string config_to_search = "CfgVehicles";
7888
7889 if (IsInherited(Weapon))
7890 config_to_search = "CfgWeapons";
7891
7892 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7893 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7894
7895 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7896 {
7897
7899
7901 {
7903 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7905 return;
7906 }
7907
7910
7911
7912
7914 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7915
7916 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7917 {
7918 string particle_class = "";
7920 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7922
7923 if (entry_type == CT_CLASS)
7924 {
7925 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7926 WPOOH_array.Insert(WPOF);
7927 }
7928 }
7929
7930
7932 }
7933 }
7934 }
7935
7937 {
7939 }
7940
7942 {
7944 {
7946
7949
7952
7953 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7954 }
7955 }
7956
7958 {
7960 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7961
7963 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7964
7966 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7967
7969 {
7971 }
7972 }
7973
7975 {
7977 }
7978
7980 {
7983 else
7985
7987 {
7990 }
7991 else
7992 {
7995
7998 }
7999
8001 }
8002
8004 {
8006 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8007 }
8008
8010 {
8012 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8014 }
8015
8017 {
8019 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8020 }
8021
8023 {
8026
8027 OverheatingParticle OP = new OverheatingParticle();
8032
8034 }
8035
8037 {
8040
8041 return -1;
8042 }
8043
8045 {
8047 {
8050
8051 for (int i = count; i > 0; --i)
8052 {
8053 int id = i - 1;
8056
8059
8060 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8061 {
8062 if (p)
8063 {
8066 }
8067 }
8068 }
8069 }
8070 }
8071
8073 {
8075 {
8077 {
8078 int id = i - 1;
8080
8081 if (OP)
8082 {
8084
8085 if (p)
8086 {
8088 }
8089
8090 delete OP;
8091 }
8092 }
8093
8096 }
8097 }
8098
8101 {
8102 return 0.0;
8103 }
8104
8105
8107 {
8108 return 250;
8109 }
8110
8112 {
8113 return 0;
8114 }
8115
8118 {
8120 return true;
8121
8122 return false;
8123 }
8124
8127 {
8130
8132 {
8134 }
8135 else
8136 {
8137
8139 }
8140
8142 }
8143
8150 {
8151 return -1;
8152 }
8153
8154
8155
8156
8158 {
8160 {
8162 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8163
8164 if (r_index >= 0)
8165 {
8166 InventoryLocation r_il = new InventoryLocation;
8167 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8168
8169 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8172 {
8173 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8174 }
8176 {
8177 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8178 }
8179
8180 }
8181
8182 player.GetHumanInventory().ClearUserReservedLocation(this);
8183 }
8184
8187 }
8188
8189
8190
8191
8193 {
8194 return ItemBase.m_DebugActionsMask;
8195 }
8196
8198 {
8199 return ItemBase.m_DebugActionsMask & mask;
8200 }
8201
8203 {
8204 ItemBase.m_DebugActionsMask = mask;
8205 }
8206
8208 {
8209 ItemBase.m_DebugActionsMask |= mask;
8210 }
8211
8213 {
8214 ItemBase.m_DebugActionsMask &= ~mask;
8215 }
8216
8218 {
8220 {
8222 }
8223 else
8224 {
8226 }
8227 }
8228
8229
8231 {
8232 if (GetEconomyProfile())
8233 {
8234 float q_max = GetEconomyProfile().GetQuantityMax();
8235 if (q_max > 0)
8236 {
8237 float q_min = GetEconomyProfile().GetQuantityMin();
8238 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8239
8241 {
8242 ComponentEnergyManager comp = GetCompEM();
8244 {
8246 }
8247 }
8249 {
8251
8252 }
8253
8254 }
8255 }
8256 }
8257
8260 {
8261 EntityAI parent = GetHierarchyParent();
8262
8263 if (parent)
8264 {
8265 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8266 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8267 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8268 }
8269 }
8270
8273 {
8274 EntityAI parent = GetHierarchyParent();
8275
8276 if (parent)
8277 {
8278 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8279 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8280 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8281 }
8282 }
8283
8285 {
8286
8287
8288
8289
8291
8293 {
8294 if (ScriptInputUserData.CanStoreInputUserData())
8295 {
8296 ScriptInputUserData ctx = new ScriptInputUserData;
8302 ctx.
Write(use_stack_max);
8305
8307 {
8308 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8309 }
8310 }
8311 }
8312 else if (!
GetGame().IsMultiplayer())
8313 {
8315 }
8316 }
8317
8319 {
8321 }
8322
8324 {
8326 }
8327
8329 {
8331 }
8332
8334 {
8335
8336 return false;
8337 }
8338
8340 {
8341 return false;
8342 }
8343
8347 {
8348 return false;
8349 }
8350
8352 {
8353 return "";
8354 }
8355
8357
8359 {
8360 return false;
8361 }
8362
8364 {
8365 return true;
8366 }
8367
8368
8369
8371 {
8372 return true;
8373 }
8374
8376 {
8377 return true;
8378 }
8379
8381 {
8382 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8384 }
8385
8387 {
8389 }
8390
8392 {
8394 if (!is_being_placed)
8396 SetSynchDirty();
8397 }
8398
8399
8401
8403 {
8405 }
8406
8408 {
8410 }
8411
8413 {
8414 return 1;
8415 }
8416
8418 {
8419 return false;
8420 }
8421
8423 {
8425 SetSynchDirty();
8426 }
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8463 {
8464 super.OnMovedInsideCargo(container);
8465
8466 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8467 }
8468
8469 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8470 {
8471 super.EEItemLocationChanged(oldLoc,newLoc);
8472
8473 PlayerBase new_player = null;
8474 PlayerBase old_player = null;
8475
8476 if (newLoc.GetParent())
8477 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8478
8479 if (oldLoc.GetParent())
8480 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8481
8483 {
8484 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8485
8486 if (r_index >= 0)
8487 {
8488 InventoryLocation r_il = new InventoryLocation;
8489 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8490
8491 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8494 {
8495 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8496 }
8498 {
8499 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8500 }
8501
8502 }
8503 }
8504
8506 {
8507 if (new_player)
8508 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8509
8510 if (new_player == old_player)
8511 {
8512
8513 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8514 {
8516 {
8517 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8518 {
8519 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8520 }
8521 }
8522 else
8523 {
8524 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8525 }
8526 }
8527
8528 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8529 {
8530 int type = oldLoc.GetType();
8532 {
8533 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8534 }
8536 {
8537 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8538 }
8539 }
8540 if (!m_OldLocation)
8541 {
8542 m_OldLocation = new InventoryLocation;
8543 }
8544 m_OldLocation.Copy(oldLoc);
8545 }
8546 else
8547 {
8548 if (m_OldLocation)
8549 {
8550 m_OldLocation.Reset();
8551 }
8552 }
8553
8555 }
8556 else
8557 {
8558 if (new_player)
8559 {
8560 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8561 if (res_index >= 0)
8562 {
8563 InventoryLocation il = new InventoryLocation;
8564 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8566 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8569 {
8570 il.
GetParent().GetOnReleaseLock().Invoke(it);
8571 }
8573 {
8575 }
8576
8577 }
8578 }
8580 {
8581
8583 }
8584
8585 if (m_OldLocation)
8586 {
8587 m_OldLocation.Reset();
8588 }
8589 }
8590 }
8591
8592 override void EOnContact(IEntity other, Contact extra)
8593 {
8595 {
8596 int liquidType = -1;
8598 if (impactSpeed > 0.0)
8599 {
8601 #ifndef SERVER
8603 #else
8605 SetSynchDirty();
8606 #endif
8608 }
8609 }
8610
8611 #ifdef SERVER
8612 if (GetCompEM() && GetCompEM().IsPlugged())
8613 {
8614 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8615 GetCompEM().UnplugThis();
8616 }
8617 #endif
8618 }
8619
8621
8623 {
8625 }
8626
8628 {
8629
8630 }
8631
8633 {
8634 super.OnItemLocationChanged(old_owner, new_owner);
8635
8636 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8637 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8638
8639 if (!relatedPlayer && playerNew)
8640 relatedPlayer = playerNew;
8641
8642 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8643 {
8645 if (actionMgr)
8646 {
8647 ActionBase currentAction = actionMgr.GetRunningAction();
8648 if (currentAction)
8650 }
8651 }
8652
8653 Man ownerPlayerOld = null;
8654 Man ownerPlayerNew = null;
8655
8656 if (old_owner)
8657 {
8658 if (old_owner.
IsMan())
8659 {
8660 ownerPlayerOld = Man.Cast(old_owner);
8661 }
8662 else
8663 {
8664 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8665 }
8666 }
8667 else
8668 {
8670 {
8672
8673 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8674 {
8675 GetCompEM().UnplugThis();
8676 }
8677 }
8678 }
8679
8680 if (new_owner)
8681 {
8682 if (new_owner.
IsMan())
8683 {
8684 ownerPlayerNew = Man.Cast(new_owner);
8685 }
8686 else
8687 {
8688 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8689 }
8690 }
8691
8692 if (ownerPlayerOld != ownerPlayerNew)
8693 {
8694 if (ownerPlayerOld)
8695 {
8696 array<EntityAI> subItemsExit = new array<EntityAI>;
8698 for (int i = 0; i < subItemsExit.Count(); i++)
8699 {
8702 }
8703 }
8704
8705 if (ownerPlayerNew)
8706 {
8707 array<EntityAI> subItemsEnter = new array<EntityAI>;
8709 for (int j = 0; j < subItemsEnter.Count(); j++)
8710 {
8713 }
8714 }
8715 }
8716 else if (ownerPlayerNew != null)
8717 {
8718 PlayerBase nplayer;
8719 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8720 {
8721 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8723 for (int k = 0; k < subItemsUpdate.Count(); k++)
8724 {
8726 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8727 }
8728 }
8729 }
8730
8731 if (old_owner)
8732 old_owner.OnChildItemRemoved(this);
8733 if (new_owner)
8734 new_owner.OnChildItemReceived(this);
8735 }
8736
8737
8739 {
8740 super.EEDelete(parent);
8741 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8742 if (player)
8743 {
8745
8746 if (player.IsAlive())
8747 {
8748 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8749 if (r_index >= 0)
8750 {
8751 InventoryLocation r_il = new InventoryLocation;
8752 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8753
8754 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8757 {
8758 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8759 }
8761 {
8762 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8763 }
8764
8765 }
8766
8767 player.RemoveQuickBarEntityShortcut(this);
8768 }
8769 }
8770 }
8771
8773 {
8774 super.EEKilled(killer);
8775
8778 {
8779 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8780 {
8781 if (IsMagazine())
8782 {
8783 if (Magazine.Cast(this).GetAmmoCount() > 0)
8784 {
8786 }
8787 }
8788 else
8789 {
8791 }
8792 }
8793 }
8794 }
8795
8797 {
8798 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8799
8800 super.OnWasAttached(parent, slot_id);
8801
8804
8806 }
8807
8809 {
8810 super.OnWasDetached(parent, slot_id);
8811
8814 }
8815
8817 {
8818 int idx;
8821
8822 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8823 if (inventory_slots.Count() < 1)
8824 {
8825 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8826 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8827 }
8828 else
8829 {
8830 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8831 }
8832
8833 idx = inventory_slots.Find(slot);
8834 if (idx < 0)
8835 return "";
8836
8837 return attach_types.Get(idx);
8838 }
8839
8841 {
8842 int idx = -1;
8843 string slot;
8844
8847
8848 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8849 if (inventory_slots.Count() < 1)
8850 {
8851 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8852 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8853 }
8854 else
8855 {
8856 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8857 if (detach_types.Count() < 1)
8858 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8859 }
8860
8861 for (int i = 0; i < inventory_slots.Count(); i++)
8862 {
8863 slot = inventory_slots.Get(i);
8864 }
8865
8866 if (slot != "")
8867 {
8868 if (detach_types.Count() == 1)
8869 idx = 0;
8870 else
8871 idx = inventory_slots.Find(slot);
8872 }
8873 if (idx < 0)
8874 return "";
8875
8876 return detach_types.Get(idx);
8877 }
8878
8880 {
8881
8883
8884
8885 float min_time = 1;
8886 float max_time = 3;
8887 float delay = Math.RandomFloat(min_time, max_time);
8888
8889 explode_timer.Run(delay, this, "DoAmmoExplosion");
8890 }
8891
8893 {
8894 Magazine magazine = Magazine.Cast(this);
8895 int pop_sounds_count = 6;
8896 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8897
8898
8899 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8900 string sound_name = pop_sounds[ sound_idx ];
8902
8903
8904 magazine.ServerAddAmmoCount(-1);
8905
8906
8907 float min_temp_to_explode = 100;
8908
8909 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8910 {
8912 }
8913 }
8914
8915
8916 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8917 {
8918 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8919
8920 const int CHANCE_DAMAGE_CARGO = 4;
8921 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8922 const int CHANCE_DAMAGE_NOTHING = 2;
8923
8925 {
8926 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8927 int chances;
8928 int rnd;
8929
8930 if (GetInventory().GetCargo())
8931 {
8932 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8933 rnd = Math.RandomInt(0,chances);
8934
8935 if (rnd < CHANCE_DAMAGE_CARGO)
8936 {
8938 }
8939 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8940 {
8942 }
8943 }
8944 else
8945 {
8946 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8947 rnd = Math.RandomInt(0,chances);
8948
8949 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8950 {
8952 }
8953 }
8954 }
8955 }
8956
8958 {
8959 if (GetInventory().GetCargo())
8960 {
8961 int item_count = GetInventory().GetCargo().GetItemCount();
8962 if (item_count > 0)
8963 {
8964 int random_pick = Math.RandomInt(0, item_count);
8966 if (!item.IsExplosive())
8967 {
8968 item.AddHealth("","",damage);
8969 return true;
8970 }
8971 }
8972 }
8973 return false;
8974 }
8975
8977 {
8978 int attachment_count = GetInventory().AttachmentCount();
8979 if (attachment_count > 0)
8980 {
8981 int random_pick = Math.RandomInt(0, attachment_count);
8982 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8983 if (!attachment.IsExplosive())
8984 {
8985 attachment.AddHealth("","",damage);
8986 return true;
8987 }
8988 }
8989 return false;
8990 }
8991
8993 {
8995 }
8996
8998 {
9000 return GetInventory().CanRemoveEntity();
9001
9002 return false;
9003 }
9004
9006 {
9008 return;
9009
9011 {
9012 if (ScriptInputUserData.CanStoreInputUserData())
9013 {
9014 ScriptInputUserData ctx = new ScriptInputUserData;
9019 ctx.
Write(destination_entity);
9023 }
9024 }
9025 else if (!
GetGame().IsMultiplayer())
9026 {
9028 }
9029 }
9030
9032 {
9034 return;
9035
9036 float split_quantity_new;
9040 InventoryLocation loc = new InventoryLocation;
9041
9042 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9043 {
9045 split_quantity_new = stack_max;
9046 else
9048
9049 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9050 if (new_item)
9051 {
9052 new_item.SetResultOfSplit(true);
9053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9055 new_item.SetQuantity(split_quantity_new);
9056 }
9057 }
9058 else if (destination_entity && slot_id == -1)
9059 {
9060 if (quantity > stack_max)
9061 split_quantity_new = stack_max;
9062 else
9063 split_quantity_new = quantity;
9064
9066 {
9069 }
9070
9071 if (new_item)
9072 {
9073 new_item.SetResultOfSplit(true);
9074 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9076 new_item.SetQuantity(split_quantity_new);
9077 }
9078 }
9079 else
9080 {
9081 if (stack_max != 0)
9082 {
9084 {
9086 }
9087
9088 if (split_quantity_new == 0)
9089 {
9090 if (!
GetGame().IsMultiplayer())
9091 player.PhysicalPredictiveDropItem(this);
9092 else
9093 player.ServerDropEntity(this);
9094 return;
9095 }
9096
9098
9099 if (new_item)
9100 {
9101 new_item.SetResultOfSplit(true);
9102 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9104 new_item.SetQuantity(stack_max);
9105 new_item.PlaceOnSurface();
9106 }
9107 }
9108 }
9109 }
9110
9112 {
9114 return;
9115
9116 float split_quantity_new;
9120 InventoryLocation loc = new InventoryLocation;
9121
9122 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9123 {
9125 split_quantity_new = stack_max;
9126 else
9128
9129 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9130 if (new_item)
9131 {
9132 new_item.SetResultOfSplit(true);
9133 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9135 new_item.SetQuantity(split_quantity_new);
9136 }
9137 }
9138 else if (destination_entity && slot_id == -1)
9139 {
9140 if (quantity > stack_max)
9141 split_quantity_new = stack_max;
9142 else
9143 split_quantity_new = quantity;
9144
9146 {
9149 }
9150
9151 if (new_item)
9152 {
9153 new_item.SetResultOfSplit(true);
9154 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9156 new_item.SetQuantity(split_quantity_new);
9157 }
9158 }
9159 else
9160 {
9161 if (stack_max != 0)
9162 {
9164 {
9166 }
9167
9169
9170 if (new_item)
9171 {
9172 new_item.SetResultOfSplit(true);
9173 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9175 new_item.SetQuantity(stack_max);
9176 new_item.PlaceOnSurface();
9177 }
9178 }
9179 }
9180 }
9181
9183 {
9185 return;
9186
9188 {
9189 if (ScriptInputUserData.CanStoreInputUserData())
9190 {
9191 ScriptInputUserData ctx = new ScriptInputUserData;
9196 dst.WriteToContext(ctx);
9198 }
9199 }
9200 else if (!
GetGame().IsMultiplayer())
9201 {
9203 }
9204 }
9205
9207 {
9209 return;
9210
9212 {
9213 if (ScriptInputUserData.CanStoreInputUserData())
9214 {
9215 ScriptInputUserData ctx = new ScriptInputUserData;
9220 ctx.
Write(destination_entity);
9226 }
9227 }
9228 else if (!
GetGame().IsMultiplayer())
9229 {
9231 }
9232 }
9233
9235 {
9237 }
9238
9240 {
9242 return this;
9243
9245 float split_quantity_new;
9247 if (dst.IsValid())
9248 {
9249 int slot_id = dst.GetSlot();
9251
9252 if (quantity > stack_max)
9253 split_quantity_new = stack_max;
9254 else
9255 split_quantity_new = quantity;
9256
9258
9259 if (new_item)
9260 {
9261 new_item.SetResultOfSplit(true);
9262 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9265 }
9266
9267 return new_item;
9268 }
9269
9270 return null;
9271 }
9272
9274 {
9276 return;
9277
9279 float split_quantity_new;
9281 if (destination_entity)
9282 {
9284 if (quantity > stackable)
9285 split_quantity_new = stackable;
9286 else
9287 split_quantity_new = quantity;
9288
9289 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9290 if (new_item)
9291 {
9292 new_item.SetResultOfSplit(true);
9293 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9295 new_item.SetQuantity(split_quantity_new);
9296 }
9297 }
9298 }
9299
9301 {
9303 return;
9304
9306 {
9307 if (ScriptInputUserData.CanStoreInputUserData())
9308 {
9309 ScriptInputUserData ctx = new ScriptInputUserData;
9314 ItemBase destination_entity =
this;
9315 ctx.
Write(destination_entity);
9319 }
9320 }
9321 else if (!
GetGame().IsMultiplayer())
9322 {
9324 }
9325 }
9326
9328 {
9330 return;
9331
9333 float split_quantity_new;
9335 if (player)
9336 {
9338 if (quantity > stackable)
9339 split_quantity_new = stackable;
9340 else
9341 split_quantity_new = quantity;
9342
9343 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9344 new_item =
ItemBase.Cast(in_hands);
9345 if (new_item)
9346 {
9347 new_item.SetResultOfSplit(true);
9348 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9350 new_item.SetQuantity(split_quantity_new);
9351 }
9352 }
9353 }
9354
9356 {
9358 return;
9359
9361 float split_quantity_new = Math.Floor(quantity * 0.5);
9362
9364
9365 if (new_item)
9366 {
9367 if (new_item.GetQuantityMax() < split_quantity_new)
9368 {
9369 split_quantity_new = new_item.GetQuantityMax();
9370 }
9371
9372 new_item.SetResultOfSplit(true);
9373 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9374
9376 {
9379 }
9380 else
9381 {
9384 }
9385 }
9386 }
9387
9389 {
9391 return;
9392
9394 float split_quantity_new = Math.Floor(quantity / 2);
9395
9396 InventoryLocation invloc = new InventoryLocation;
9398
9400 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9401
9402 if (new_item)
9403 {
9404 if (new_item.GetQuantityMax() < split_quantity_new)
9405 {
9406 split_quantity_new = new_item.GetQuantityMax();
9407 }
9409 {
9412 }
9413 else
9414 {
9417 }
9418 }
9419 }
9420
9423 {
9424 SetWeightDirty();
9426
9427 if (parent)
9428 parent.OnAttachmentQuantityChangedEx(this, delta);
9429
9431 {
9433 {
9435 }
9437 {
9438 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9440 }
9441 }
9442
9443 }
9444
9447 {
9448
9449 }
9450
9453 {
9455 }
9456
9458 {
9459 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9460
9462 {
9463 if (newLevel == GameConstants.STATE_RUINED)
9464 {
9466 EntityAI parent = GetHierarchyParent();
9467 if (parent && parent.IsFireplace())
9468 {
9469 CargoBase cargo = GetInventory().GetCargo();
9470 if (cargo)
9471 {
9473 {
9475 }
9476 }
9477 }
9478 }
9479
9481 {
9482
9484 return;
9485 }
9486
9487 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9488 {
9490 }
9491 }
9492 }
9493
9494
9496 {
9497 super.OnRightClick();
9498
9500 {
9502 {
9503 if (ScriptInputUserData.CanStoreInputUserData())
9504 {
9505 vector m4[4];
9507
9508 EntityAI root = GetHierarchyRoot();
9509
9510 InventoryLocation dst = new InventoryLocation;
9512 {
9513 if (root)
9514 {
9515 root.GetTransform(m4);
9517 }
9518 else
9519 GetInventory().GetCurrentInventoryLocation(dst);
9520 }
9521 else
9522 {
9524
9525
9526 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9527 {
9528 if (root)
9529 {
9530 root.GetTransform(m4);
9532 }
9533 else
9534 GetInventory().GetCurrentInventoryLocation(dst);
9535 }
9536 else
9537 {
9538 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9539 }
9540 }
9541
9542 ScriptInputUserData ctx = new ScriptInputUserData;
9550 }
9551 }
9552 else if (!
GetGame().IsMultiplayer())
9553 {
9555 }
9556 }
9557 }
9558
9559 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9560 {
9561
9562 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9563 return false;
9564
9565 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9566 return false;
9567
9568
9570 return false;
9571
9572
9573 Magazine mag = Magazine.Cast(this);
9574 if (mag)
9575 {
9576 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9577 return false;
9578
9579 if (stack_max_limit)
9580 {
9581 Magazine other_mag = Magazine.Cast(other_item);
9582 if (other_item)
9583 {
9584 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9585 return false;
9586 }
9587
9588 }
9589 }
9590 else
9591 {
9592
9594 return false;
9595
9597 return false;
9598 }
9599
9600 PlayerBase player = null;
9601 if (CastTo(player, GetHierarchyRootPlayer()))
9602 {
9603 if (player.GetInventory().HasAttachment(this))
9604 return false;
9605
9606 if (player.IsItemsToDelete())
9607 return false;
9608 }
9609
9610 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9611 return false;
9612
9613 int slotID;
9615 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9616 return false;
9617
9618 return true;
9619 }
9620
9622 {
9624 }
9625
9627 {
9628 return m_IsResultOfSplit;
9629 }
9630
9632 {
9633 m_IsResultOfSplit = value;
9634 }
9635
9637 {
9639 }
9640
9642 {
9643 float other_item_quantity = other_item.GetQuantity();
9644 float this_free_space;
9645
9647
9649
9650 if (other_item_quantity > this_free_space)
9651 {
9652 return this_free_space;
9653 }
9654 else
9655 {
9656 return other_item_quantity;
9657 }
9658 }
9659
9661 {
9663 }
9664
9666 {
9668 return;
9669
9670 if (!IsMagazine() && other_item)
9671 {
9673 if (quantity_used != 0)
9674 {
9675 float hp1 = GetHealth01("","");
9676 float hp2 = other_item.GetHealth01("","");
9677 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9678 hpResult = hpResult / (
GetQuantity() + quantity_used);
9679
9680 hpResult *= GetMaxHealth();
9681 Math.Round(hpResult);
9682 SetHealth("", "Health", hpResult);
9683
9685 other_item.AddQuantity(-quantity_used);
9686 }
9687 }
9689 }
9690
9692 {
9693 #ifdef SERVER
9694 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9695 GetHierarchyParent().IncreaseLifetimeUp();
9696 #endif
9697 };
9698
9700 {
9701 PlayerBase p = PlayerBase.Cast(player);
9702
9703 array<int> recipesIds = p.m_Recipes;
9704 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9705 if (moduleRecipesManager)
9706 {
9707 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9708 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9709 }
9710
9711 for (int i = 0;i < recipesIds.Count(); i++)
9712 {
9713 int key = recipesIds.Get(i);
9714 string recipeName = moduleRecipesManager.GetRecipeName(key);
9716 }
9717 }
9718
9719
9720 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9721 {
9722 super.GetDebugActions(outputList);
9723
9724
9729
9730
9734
9738
9739
9742
9743
9745 {
9748 }
9749
9751
9754
9758 }
9759
9760
9761
9762
9764 {
9765 super.OnAction(action_id, player, ctx);
9766 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9767 {
9768 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9769 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9770 PlayerBase p = PlayerBase.Cast(player);
9771 if (
EActions.RECIPES_RANGE_START < 1000)
9772 {
9773 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9774 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9775 }
9776 }
9777 #ifndef SERVER
9778 else if (action_id ==
EActions.WATCH_PLAYER)
9779 {
9780 PluginDeveloper.SetDeveloperItemClientEx(player);
9781 }
9782 #endif
9784 {
9785 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9786 {
9787 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9788 OnDebugButtonPressServer(id + 1);
9789 }
9790
9791 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9792 {
9793 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9795 }
9796
9797 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9798 {
9799 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9801 }
9802
9803 else if (action_id ==
EActions.ADD_QUANTITY)
9804 {
9805 if (IsMagazine())
9806 {
9807 Magazine mag = Magazine.Cast(this);
9808 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9809 }
9810 else
9811 {
9813 }
9814
9815 if (m_EM)
9816 {
9817 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9818 }
9819
9820 }
9821
9822 else if (action_id ==
EActions.REMOVE_QUANTITY)
9823 {
9824 if (IsMagazine())
9825 {
9826 Magazine mag2 = Magazine.Cast(this);
9827 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9828 }
9829 else
9830 {
9832 }
9833 if (m_EM)
9834 {
9835 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9836 }
9837
9838 }
9839
9840 else if (action_id ==
EActions.SET_QUANTITY_0)
9841 {
9843
9844 if (m_EM)
9845 {
9846 m_EM.SetEnergy(0);
9847 }
9848 }
9849
9850 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9851 {
9853
9854 if (m_EM)
9855 {
9856 m_EM.SetEnergy(m_EM.GetEnergyMax());
9857 }
9858 }
9859
9860 else if (action_id ==
EActions.ADD_HEALTH)
9861 {
9862 AddHealth("","",GetMaxHealth("","Health")/5);
9863 }
9864 else if (action_id ==
EActions.REMOVE_HEALTH)
9865 {
9866 AddHealth("","",-GetMaxHealth("","Health")/5);
9867 }
9868 else if (action_id ==
EActions.DESTROY_HEALTH)
9869 {
9870 SetHealth01("","",0);
9871 }
9872 else if (action_id ==
EActions.WATCH_ITEM)
9873 {
9875 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9876 #ifdef DEVELOPER
9877 SetDebugDeveloper_item(this);
9878 #endif
9879 }
9880
9881 else if (action_id ==
EActions.ADD_TEMPERATURE)
9882 {
9883 AddTemperature(20);
9884
9885 }
9886
9887 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9888 {
9889 AddTemperature(-20);
9890
9891 }
9892
9893 else if (action_id ==
EActions.FLIP_FROZEN)
9894 {
9895 SetFrozen(!GetIsFrozen());
9896
9897 }
9898
9899 else if (action_id ==
EActions.ADD_WETNESS)
9900 {
9902
9903 }
9904
9905 else if (action_id ==
EActions.REMOVE_WETNESS)
9906 {
9908
9909 }
9910
9911 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9912 {
9915
9916
9917 }
9918
9919 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9920 {
9923 }
9924
9925 else if (action_id ==
EActions.MAKE_SPECIAL)
9926 {
9927 auto debugParams = DebugSpawnParams.WithPlayer(player);
9928 OnDebugSpawnEx(debugParams);
9929 }
9930
9931 else if (action_id ==
EActions.DELETE)
9932 {
9933 Delete();
9934 }
9935
9936 }
9937
9938
9939 return false;
9940 }
9941
9942
9943
9944
9948
9951
9952
9953
9955 {
9956 return false;
9957 }
9958
9959
9961 {
9962 return true;
9963 }
9964
9965
9967 {
9968 return true;
9969 }
9970
9971
9972
9974 {
9975 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9977 }
9978
9981 {
9982 return null;
9983 }
9984
9986 {
9987 return false;
9988 }
9989
9991 {
9992 return false;
9993 }
9994
9998
9999
10001 {
10002 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10003 return module_repairing.CanRepair(this, item_repair_kit);
10004 }
10005
10006
10007 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10008 {
10009 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10010 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10011 }
10012
10013
10015 {
10016
10017
10018
10019
10020
10021
10022
10023
10024 return 1;
10025 }
10026
10027
10028
10030 {
10032 }
10033
10034
10035
10037 {
10039 }
10040
10041
10050 {
10051 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10052
10053 if (player)
10054 {
10055 player.MessageStatus(text);
10056 }
10057 }
10058
10059
10068 {
10069 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10070
10071 if (player)
10072 {
10073 player.MessageAction(text);
10074 }
10075 }
10076
10077
10086 {
10087 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10088
10089 if (player)
10090 {
10091 player.MessageFriendly(text);
10092 }
10093 }
10094
10095
10104 {
10105 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10106
10107 if (player)
10108 {
10109 player.MessageImportant(text);
10110 }
10111 }
10112
10114 {
10115 return true;
10116 }
10117
10118
10119 override bool KindOf(
string tag)
10120 {
10121 bool found = false;
10122 string item_name = this.
GetType();
10125
10126 int array_size = item_tag_array.Count();
10127 for (int i = 0; i < array_size; i++)
10128 {
10129 if (item_tag_array.Get(i) == tag)
10130 {
10131 found = true;
10132 break;
10133 }
10134 }
10135 return found;
10136 }
10137
10138
10140 {
10141
10142 super.OnRPC(sender, rpc_type,ctx);
10143
10144
10145 switch (rpc_type)
10146 {
10147 #ifndef SERVER
10148 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10149 Param2<bool, string> p = new Param2<bool, string>(false, "");
10150
10152 return;
10153
10154 bool play = p.param1;
10155 string soundSet = p.param2;
10156
10157 if (play)
10158 {
10160 {
10162 {
10164 }
10165 }
10166 else
10167 {
10169 }
10170 }
10171 else
10172 {
10174 }
10175
10176 break;
10177 #endif
10178
10179 }
10180
10182 {
10184 }
10185 }
10186
10187
10188
10189
10191 {
10192 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10193 return plugin.GetID(
name);
10194 }
10195
10197 {
10198 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10199 return plugin.GetName(id);
10200 }
10201
10204 {
10205
10206
10207 int varFlags;
10208 if (!ctx.
Read(varFlags))
10209 return;
10210
10211 if (varFlags & ItemVariableFlags.FLOAT)
10212 {
10214 }
10215 }
10216
10218 {
10219
10220 super.SerializeNumericalVars(floats_out);
10221
10222
10223
10225 {
10227 }
10228
10230 {
10232 }
10233
10235 {
10237 }
10238
10240 {
10245 }
10246
10248 {
10250 }
10251 }
10252
10254 {
10255
10256 super.DeSerializeNumericalVars(floats);
10257
10258
10259 int index = 0;
10260 int mask = Math.Round(floats.Get(index));
10261
10262 index++;
10263
10265 {
10267 {
10269 }
10270 else
10271 {
10272 float quantity = floats.Get(index);
10273 SetQuantity(quantity,
true,
false,
false,
false);
10274 }
10275 index++;
10276 }
10277
10279 {
10280 float wet = floats.Get(index);
10282 index++;
10283 }
10284
10286 {
10287 int liquidtype = Math.Round(floats.Get(index));
10289 index++;
10290 }
10291
10293 {
10295 index++;
10297 index++;
10299 index++;
10301 index++;
10302 }
10303
10305 {
10306 int cleanness = Math.Round(floats.Get(index));
10308 index++;
10309 }
10310 }
10311
10313 {
10314 super.WriteVarsToCTX(ctx);
10315
10316
10318 {
10320 }
10321
10323 {
10325 }
10326
10328 {
10330 }
10331
10333 {
10334 int r,g,b,a;
10340 }
10341
10343 {
10345 }
10346 }
10347
10349 {
10350 if (!super.ReadVarsFromCTX(ctx,version))
10351 return false;
10352
10353 int intValue;
10354 float value;
10355
10356 if (version < 140)
10357 {
10358 if (!ctx.
Read(intValue))
10359 return false;
10360
10361 m_VariablesMask = intValue;
10362 }
10363
10365 {
10366 if (!ctx.
Read(value))
10367 return false;
10368
10370 {
10372 }
10373 else
10374 {
10376 }
10377 }
10378
10379 if (version < 140)
10380 {
10382 {
10383 if (!ctx.
Read(value))
10384 return false;
10385 SetTemperatureDirect(value);
10386 }
10387 }
10388
10390 {
10391 if (!ctx.
Read(value))
10392 return false;
10394 }
10395
10397 {
10398 if (!ctx.
Read(intValue))
10399 return false;
10401 }
10402
10404 {
10405 int r,g,b,a;
10407 return false;
10409 return false;
10411 return false;
10413 return false;
10414
10416 }
10417
10419 {
10420 if (!ctx.
Read(intValue))
10421 return false;
10423 }
10424
10425 if (version >= 138 && version < 140)
10426 {
10428 {
10429 if (!ctx.
Read(intValue))
10430 return false;
10431 SetFrozen(intValue);
10432 }
10433 }
10434
10435 return true;
10436 }
10437
10438
10440 {
10443 {
10445 }
10446
10447 if (!super.OnStoreLoad(ctx, version))
10448 {
10450 return false;
10451 }
10452
10453 if (version >= 114)
10454 {
10455 bool hasQuickBarIndexSaved;
10456
10457 if (!ctx.
Read(hasQuickBarIndexSaved))
10458 {
10460 return false;
10461 }
10462
10463 if (hasQuickBarIndexSaved)
10464 {
10465 int itmQBIndex;
10466
10467
10468 if (!ctx.
Read(itmQBIndex))
10469 {
10471 return false;
10472 }
10473
10474 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10475 if (itmQBIndex != -1 && parentPlayer)
10476 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10477 }
10478 }
10479 else
10480 {
10481
10482 PlayerBase player;
10483 int itemQBIndex;
10484 if (version ==
int.
MAX)
10485 {
10486 if (!ctx.
Read(itemQBIndex))
10487 {
10489 return false;
10490 }
10491 }
10492 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10493 {
10494
10495 if (!ctx.
Read(itemQBIndex))
10496 {
10498 return false;
10499 }
10500 if (itemQBIndex != -1 && player)
10501 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10502 }
10503 }
10504
10505 if (version < 140)
10506 {
10507
10508 if (!LoadVariables(ctx, version))
10509 {
10511 return false;
10512 }
10513 }
10514
10515
10517 {
10519 return false;
10520 }
10521 if (version >= 132)
10522 {
10524 if (raib)
10525 {
10527 {
10529 return false;
10530 }
10531 }
10532 }
10533
10535 return true;
10536 }
10537
10538
10539
10541 {
10542 super.OnStoreSave(ctx);
10543
10544 PlayerBase player;
10545 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10546 {
10548
10549 int itemQBIndex = -1;
10550 itemQBIndex = player.FindQuickBarEntityIndex(this);
10551 ctx.
Write(itemQBIndex);
10552 }
10553 else
10554 {
10556 }
10557
10559
10561 if (raib)
10562 {
10564 }
10565 }
10566
10567
10569 {
10570 super.AfterStoreLoad();
10571
10573 {
10575 }
10576
10578 {
10581 }
10582 }
10583
10585 {
10586 super.EEOnAfterLoad();
10587
10589 {
10591 }
10592
10595 }
10596
10598 {
10599 return false;
10600 }
10601
10602
10603
10605 {
10607 {
10608 #ifdef PLATFORM_CONSOLE
10609
10611 {
10613 if (menu)
10614 {
10616 }
10617 }
10618 #endif
10619 }
10620
10622 {
10625 }
10626
10628 {
10629 SetWeightDirty();
10631 }
10633 {
10636 }
10637
10639 {
10642 }
10644 {
10647 }
10648
10649 super.OnVariablesSynchronized();
10650 }
10651
10652
10653
10655 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10656 {
10657 if (!IsServerCheck(allow_client))
10658 return false;
10659
10661 return false;
10662
10665
10666 if (value <= (min + 0.001))
10667 value = min;
10668
10669 if (value == min)
10670 {
10671 if (destroy_config)
10672 {
10673 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10674 if (dstr)
10675 {
10677 this.Delete();
10678 return true;
10679 }
10680 }
10681 else if (destroy_forced)
10682 {
10684 this.Delete();
10685 return true;
10686 }
10687
10689 }
10690
10693
10695 {
10697
10698 if (delta)
10700 }
10701
10703
10704 return false;
10705 }
10706
10707
10709 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10710 {
10712 }
10713
10715 {
10718 }
10719
10721 {
10724 }
10725
10728 {
10729 float value_clamped = Math.Clamp(value, 0, 1);
10731 SetQuantity(result, destroy_config, destroy_forced);
10732 }
10733
10734
10737 {
10739 }
10740
10742 {
10744 }
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10756 {
10757 int slot = -1;
10758 if (GetInventory())
10759 {
10760 InventoryLocation il = new InventoryLocation;
10761 GetInventory().GetCurrentInventoryLocation(il);
10763 }
10764
10766 }
10767
10769 {
10770 float quantity_max = 0;
10771
10773 {
10774 if (attSlotID != -1)
10775 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10776
10777 if (quantity_max <= 0)
10779 }
10780
10781 if (quantity_max <= 0)
10783
10784 return quantity_max;
10785 }
10786
10788 {
10790 }
10791
10793 {
10795 }
10796
10797
10799 {
10801 }
10802
10804 {
10806 }
10807
10809 {
10811 }
10812
10813
10815 {
10816
10817 float weightEx = GetWeightEx();
10818 float special = GetInventoryAndCargoWeight();
10819 return weightEx - special;
10820 }
10821
10822
10824 {
10826 }
10827
10829 {
10831 {
10832 #ifdef DEVELOPER
10833 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10834 {
10835 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10837 }
10838 #endif
10839
10840 return GetQuantity() * GetConfigWeightModified();
10841 }
10842 else if (HasEnergyManager())
10843 {
10844 #ifdef DEVELOPER
10845 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10846 {
10847 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10848 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10849 }
10850 #endif
10851 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10852 }
10853 else
10854 {
10855 #ifdef DEVELOPER
10856 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10857 {
10858 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10859 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10860 }
10861 #endif
10862 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10863 }
10864 }
10865
10868 {
10869 int item_count = 0;
10871
10872 if (GetInventory().GetCargo() != NULL)
10873 {
10874 item_count = GetInventory().GetCargo().GetItemCount();
10875 }
10876
10877 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10878 {
10879 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10880 if (item)
10881 item_count += item.GetNumberOfItems();
10882 }
10883 return item_count;
10884 }
10885
10888 {
10889 float weight = 0;
10890 float wetness = 1;
10891 if (include_wetness)
10894 {
10895 weight = wetness * m_ConfigWeight;
10896 }
10898 {
10899 weight = 1;
10900 }
10901 return weight;
10902 }
10903
10904
10905
10907 {
10908 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10909 {
10910 GameInventory inv = GetInventory();
10911 array<EntityAI> items = new array<EntityAI>;
10913 for (int i = 0; i < items.Count(); i++)
10914 {
10916 if (item)
10917 {
10919 }
10920 }
10921 }
10922 }
10923
10924
10925
10926
10928 {
10929 float energy = 0;
10930 if (HasEnergyManager())
10931 {
10932 energy = GetCompEM().GetEnergy();
10933 }
10934 return energy;
10935 }
10936
10937
10939 {
10940 super.OnEnergyConsumed();
10941
10943 }
10944
10946 {
10947 super.OnEnergyAdded();
10948
10950 }
10951
10952
10954 {
10955 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10956 {
10958 {
10959 float energy_0to1 = GetCompEM().GetEnergy0To1();
10961 }
10962 }
10963 }
10964
10965
10967 {
10968 return ConfigGetFloat("heatIsolation");
10969 }
10970
10972 {
10974 }
10975
10977 {
10978 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10979 if (
GetGame().ConfigIsExisting(paramPath))
10981
10982 return 0.0;
10983 }
10984
10986 {
10987 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10988 if (
GetGame().ConfigIsExisting(paramPath))
10990
10991 return 0.0;
10992 }
10993
10994 override void SetWet(
float value,
bool allow_client =
false)
10995 {
10996 if (!IsServerCheck(allow_client))
10997 return;
10998
11001
11003
11004 m_VarWet = Math.Clamp(value, min, max);
11005
11007 {
11010 }
11011 }
11012
11013 override void AddWet(
float value)
11014 {
11016 }
11017
11019 {
11021 }
11022
11024 {
11026 }
11027
11029 {
11031 }
11032
11034 {
11036 }
11037
11039 {
11041 }
11042
11043 override void OnWetChanged(
float newVal,
float oldVal)
11044 {
11047 if (newLevel != oldLevel)
11048 {
11050 }
11051 }
11052
11054 {
11055 SetWeightDirty();
11056 }
11057
11059 {
11060 return GetWetLevelInternal(
m_VarWet);
11061 }
11062
11063
11064
11066 {
11068 }
11069
11071 {
11073 }
11074
11076 {
11078 }
11079
11081 {
11083 }
11084
11085
11086
11088 {
11089 if (ConfigIsExisting("itemModelLength"))
11090 {
11091 return ConfigGetFloat("itemModelLength");
11092 }
11093 return 0;
11094 }
11095
11097 {
11098 if (ConfigIsExisting("itemAttachOffset"))
11099 {
11100 return ConfigGetFloat("itemAttachOffset");
11101 }
11102 return 0;
11103 }
11104
11105 override void SetCleanness(
int value,
bool allow_client =
false)
11106 {
11107 if (!IsServerCheck(allow_client))
11108 return;
11109
11111
11113
11116 }
11117
11119 {
11121 }
11122
11124 {
11125 return true;
11126 }
11127
11128
11129
11130
11132 {
11134 }
11135
11137 {
11139 }
11140
11141
11142
11143
11144 override void SetColor(
int r,
int g,
int b,
int a)
11145 {
11151 }
11153 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11154 {
11159 }
11160
11162 {
11164 }
11165
11168 {
11169 int r,g,b,a;
11171 r = r/255;
11172 g = g/255;
11173 b = b/255;
11174 a = a/255;
11175 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11176 }
11177
11178
11179
11180 override void SetLiquidType(
int value,
bool allow_client =
false)
11181 {
11182 if (!IsServerCheck(allow_client))
11183 return;
11184
11189 }
11190
11192 {
11193 return ConfigGetInt("varLiquidTypeInit");
11194 }
11195
11197 {
11199 }
11200
11202 {
11204 SetFrozen(false);
11205 }
11206
11209 {
11210 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11211 }
11212
11213
11216 {
11217 PlayerBase nplayer;
11218 if (PlayerBase.CastTo(nplayer, player))
11219 {
11221
11222 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11223 }
11224 }
11225
11226
11229 {
11230 PlayerBase nplayer;
11231 if (PlayerBase.CastTo(nplayer,player))
11232 {
11233
11234 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11235
11236 }
11237
11238
11239 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11240
11241
11242 if (HasEnergyManager())
11243 {
11244 GetCompEM().UpdatePlugState();
11245 }
11246 }
11247
11248
11250 {
11251 super.OnPlacementStarted(player);
11252
11254 }
11255
11256 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11257 {
11259 {
11260 m_AdminLog.OnPlacementComplete(player,
this);
11261 }
11262
11263 super.OnPlacementComplete(player, position, orientation);
11264 }
11265
11266
11267
11268
11269
11271 {
11273 {
11274 return true;
11275 }
11276 else
11277 {
11278 return false;
11279 }
11280 }
11281
11282
11284 {
11286 {
11288 }
11289 }
11290
11291
11293 {
11295 }
11296
11298 {
11300 }
11301
11302 override void InsertAgent(
int agent,
float count = 1)
11303 {
11304 if (count < 1)
11305 return;
11306
11308 }
11309
11312 {
11314 }
11315
11316
11318 {
11320 }
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11364 {
11366 return false;
11367 return true;
11368 }
11369
11371 {
11372
11374 }
11375
11376
11379 {
11380 super.CheckForRoofLimited(timeTresholdMS);
11381
11383 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11384 {
11385 m_PreviousRoofTestTime = time;
11386 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11387 }
11388 }
11389
11390
11392 {
11394 {
11395 return 0;
11396 }
11397
11398 if (GetInventory().GetAttachmentSlotsCount() != 0)
11399 {
11400 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11401 if (filter)
11402 return filter.GetProtectionLevel(type, false, system);
11403 else
11404 return 0;
11405 }
11406
11407 string subclassPath, entryName;
11408
11409 switch (type)
11410 {
11412 entryName = "biological";
11413 break;
11415 entryName = "chemical";
11416 break;
11417 default:
11418 entryName = "biological";
11419 break;
11420 }
11421
11422 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11423
11425 }
11426
11427
11428
11431 {
11432 if (!IsMagazine())
11434
11436 }
11437
11438
11439
11440
11441
11446 {
11447 return true;
11448 }
11449
11451 {
11453 }
11454
11455
11456
11457
11458
11460 {
11461 if (parent)
11462 {
11463 if (parent.IsInherited(DayZInfected))
11464 return true;
11465
11466 if (!parent.IsRuined())
11467 return true;
11468 }
11469
11470 return true;
11471 }
11472
11474 {
11475 if (!super.CanPutAsAttachment(parent))
11476 {
11477 return false;
11478 }
11479
11480 if (!IsRuined() && !parent.IsRuined())
11481 {
11482 return true;
11483 }
11484
11485 return false;
11486 }
11487
11489 {
11490
11491
11492
11493
11494 return super.CanReceiveItemIntoCargo(item);
11495 }
11496
11498 {
11499
11500
11501
11502
11503 GameInventory attachmentInv = attachment.GetInventory();
11505 {
11506 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11507 return false;
11508 }
11509
11510 InventoryLocation loc = new InventoryLocation();
11511 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11512 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11513 return false;
11514
11515 return super.CanReceiveAttachment(attachment, slotId);
11516 }
11517
11519 {
11520 if (!super.CanReleaseAttachment(attachment))
11521 return false;
11522
11523 return GetInventory().AreChildrenAccessible();
11524 }
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11547 {
11548 int id = muzzle_owner.GetMuzzleID();
11549 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11550
11551 if (WPOF_array)
11552 {
11553 for (int i = 0; i < WPOF_array.Count(); i++)
11554 {
11555 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11556
11557 if (WPOF)
11558 {
11559 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11560 }
11561 }
11562 }
11563 }
11564
11565
11567 {
11568 int id = muzzle_owner.GetMuzzleID();
11570
11571 if (WPOBE_array)
11572 {
11573 for (int i = 0; i < WPOBE_array.Count(); i++)
11574 {
11575 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11576
11577 if (WPOBE)
11578 {
11579 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11580 }
11581 }
11582 }
11583 }
11584
11585
11587 {
11588 int id = muzzle_owner.GetMuzzleID();
11589 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11590
11591 if (WPOOH_array)
11592 {
11593 for (int i = 0; i < WPOOH_array.Count(); i++)
11594 {
11595 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11596
11597 if (WPOOH)
11598 {
11599 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11600 }
11601 }
11602 }
11603 }
11604
11605
11607 {
11608 int id = muzzle_owner.GetMuzzleID();
11609 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11610
11611 if (WPOOH_array)
11612 {
11613 for (int i = 0; i < WPOOH_array.Count(); i++)
11614 {
11615 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11616
11617 if (WPOOH)
11618 {
11619 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11620 }
11621 }
11622 }
11623 }
11624
11625
11627 {
11628 int id = muzzle_owner.GetMuzzleID();
11629 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11630
11631 if (WPOOH_array)
11632 {
11633 for (int i = 0; i < WPOOH_array.Count(); i++)
11634 {
11635 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11636
11637 if (WPOOH)
11638 {
11639 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11640 }
11641 }
11642 }
11643 }
11644
11645
11646
11648 {
11650 {
11651 return true;
11652 }
11653
11654 return false;
11655 }
11656
11658 {
11660 {
11661 return true;
11662 }
11663
11664 return false;
11665 }
11666
11668 {
11670 {
11671 return true;
11672 }
11673
11674 return false;
11675 }
11676
11678 {
11679 return false;
11680 }
11681
11684 {
11685 return UATimeSpent.DEFAULT_DEPLOY;
11686 }
11687
11688
11689
11690
11692 {
11694 SetSynchDirty();
11695 }
11696
11698 {
11700 }
11701
11702
11704 {
11705 return false;
11706 }
11707
11710 {
11711 string att_type = "None";
11712
11713 if (ConfigIsExisting("soundAttType"))
11714 {
11715 att_type = ConfigGetString("soundAttType");
11716 }
11717
11719 }
11720
11722 {
11724 }
11725
11726
11727
11728
11729
11733
11735 {
11738
11740 }
11741
11742
11744 {
11746 return;
11747
11749
11752
11755
11756 SoundParameters params = new SoundParameters();
11760 }
11761
11762
11764 {
11766 return;
11767
11769 SetSynchDirty();
11770
11773 }
11774
11775
11777 {
11779 return;
11780
11782 SetSynchDirty();
11783
11786 }
11787
11789 {
11791 }
11792
11794 {
11796 }
11797
11800 {
11801 if (!
GetGame().IsDedicatedServer())
11802 {
11803 if (ConfigIsExisting("attachSoundSet"))
11804 {
11805 string cfg_path = "";
11806 string soundset = "";
11807 string type_name =
GetType();
11808
11811 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11812 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11813
11814 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11815 {
11816 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11817 {
11818 if (cfg_slot_array[i] == slot_type)
11819 {
11820 soundset = cfg_soundset_array[i];
11821 break;
11822 }
11823 }
11824 }
11825
11826 if (soundset != "")
11827 {
11828 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11830 }
11831 }
11832 }
11833 }
11834
11836 {
11837
11838 }
11839
11840 void OnApply(PlayerBase player);
11841
11843 {
11844 return 1.0;
11845 };
11846
11848 {
11850 }
11851
11853 {
11855 }
11856
11858
11860 {
11861 SetDynamicPhysicsLifeTime(0.01);
11863 }
11864
11866 {
11867 array<string> zone_names = new array<string>;
11868 GetDamageZones(zone_names);
11869 for (int i = 0; i < zone_names.Count(); i++)
11870 {
11871 SetHealthMax(zone_names.Get(i),"Health");
11872 }
11873 SetHealthMax("","Health");
11874 }
11875
11878 {
11879 float global_health = GetHealth01("","Health");
11880 array<string> zones = new array<string>;
11881 GetDamageZones(zones);
11882
11883 for (int i = 0; i < zones.Count(); i++)
11884 {
11885 SetHealth01(zones.Get(i),"Health",global_health);
11886 }
11887 }
11888
11891 {
11892 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11893 }
11894
11896 {
11897 if (!hasRootAsPlayer)
11898 {
11899 if (refParentIB)
11900 {
11901
11902 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11903 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11904
11905 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11906 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11907
11910 }
11911 else
11912 {
11913
11916 }
11917 }
11918 }
11919
11921 {
11923 {
11924 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11925 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11926 {
11927 float heatPermCoef = 1.0;
11929 while (ent)
11930 {
11931 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11932 ent = ent.GetHierarchyParent();
11933 }
11934
11935 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11936 }
11937 }
11938 }
11939
11941 {
11942
11943 EntityAI parent = GetHierarchyParent();
11944 if (!parent)
11945 {
11946 hasParent = false;
11947 hasRootAsPlayer = false;
11948 }
11949 else
11950 {
11951 hasParent = true;
11952 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11953 refParentIB =
ItemBase.Cast(parent);
11954 }
11955 }
11956
11957 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11958 {
11959
11960 }
11961
11963 {
11964
11965 return false;
11966 }
11967
11969 {
11970
11971
11972 return false;
11973 }
11974
11976 {
11977
11978 return false;
11979 }
11980
11983 {
11984 return !GetIsFrozen() &&
IsOpen();
11985 }
11986
11988 {
11989 bool hasParent = false, hasRootAsPlayer = false;
11991
11992 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11993 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11994
11995 if (wwtu || foodDecay)
11996 {
12000
12001 if (processWetness || processTemperature || processDecay)
12002 {
12004
12005 if (processWetness)
12006 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12007
12008 if (processTemperature)
12010
12011 if (processDecay)
12012 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12013 }
12014 }
12015 }
12016
12019 {
12021 }
12022
12024 {
12027
12028 return super.GetTemperatureFreezeThreshold();
12029 }
12030
12032 {
12035
12036 return super.GetTemperatureThawThreshold();
12037 }
12038
12040 {
12043
12044 return super.GetItemOverheatThreshold();
12045 }
12046
12048 {
12050 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12051
12052 return super.GetTemperatureFreezeTime();
12053 }
12054
12056 {
12058 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12059
12060 return super.GetTemperatureThawTime();
12061 }
12062
12067
12069 {
12070 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12071 }
12072
12074 {
12075 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12076 }
12077
12080 {
12082 }
12083
12085 {
12087 }
12088
12090 {
12092 }
12093
12096 {
12097 return null;
12098 }
12099
12102 {
12103 return false;
12104 }
12105
12107 {
12109 {
12112 if (!trg)
12113 {
12115 explosive = this;
12116 }
12117
12118 explosive.PairRemote(trg);
12120
12121 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12122 trg.SetPersistentPairID(persistentID);
12123 explosive.SetPersistentPairID(persistentID);
12124
12125 return true;
12126 }
12127 return false;
12128 }
12129
12132 {
12133 float ret = 1.0;
12136 ret *= GetHealth01();
12137
12138 return ret;
12139 }
12140
12141 #ifdef DEVELOPER
12142 override void SetDebugItem()
12143 {
12144 super.SetDebugItem();
12145 _itemBase = this;
12146 }
12147
12149 {
12150 string text = super.GetDebugText();
12151
12153 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12154
12155 return text;
12156 }
12157 #endif
12158
12160 {
12161 return true;
12162 }
12163
12165
12167
12169 {
12172 }
12173
12174
12182
12198}
12199
12201{
12203 if (entity)
12204 {
12205 bool is_item = entity.IsInherited(
ItemBase);
12206 if (is_item && full_quantity)
12207 {
12210 }
12211 }
12212 else
12213 {
12215 return NULL;
12216 }
12217 return entity;
12218}
12219
12221{
12222 if (item)
12223 {
12224 if (health > 0)
12225 item.SetHealth("", "", health);
12226
12227 if (item.CanHaveTemperature())
12228 {
12230 if (item.CanFreeze())
12231 item.SetFrozen(false);
12232 }
12233
12234 if (item.HasEnergyManager())
12235 {
12236 if (quantity >= 0)
12237 {
12238 item.GetCompEM().SetEnergy0To1(quantity);
12239 }
12240 else
12241 {
12243 }
12244 }
12245 else if (item.IsMagazine())
12246 {
12247 Magazine mag = Magazine.Cast(item);
12248 if (quantity >= 0)
12249 {
12250 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12251 }
12252 else
12253 {
12255 }
12256
12257 }
12258 else
12259 {
12260 if (quantity >= 0)
12261 {
12262 item.SetQuantityNormalized(quantity, false);
12263 }
12264 else
12265 {
12267 }
12268
12269 }
12270 }
12271}
12272
12273#ifdef DEVELOPER
12275#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.