7895{
7897 {
7898 return true;
7899 }
7900};
7901
7902
7903
7905{
7909
7911
7914
7915
7916
7917
7918
7927
7933
7938
7943
7964 protected bool m_IsResultOfSplit
7965
7967
7972
7973
7974
7976
7980
7981
7982
7984
7987
7988
7989
7995
7996
8004
8007
8008
8010
8011
8013
8014
8019
8020
8025
8026
8028
8029
8031 {
8036
8037 if (!
GetGame().IsDedicatedServer())
8038 {
8040 {
8042
8044 {
8046 }
8047 }
8048
8051 }
8052
8053 m_OldLocation = null;
8054
8056 {
8058 }
8059
8060 if (ConfigIsExisting("headSelectionsToHide"))
8061 {
8064 }
8065
8067 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8068 {
8070 }
8071
8073
8074 m_IsResultOfSplit = false;
8075
8077 }
8078
8080 {
8081 super.InitItemVariables();
8082
8088 m_Count = ConfigGetInt(
"count");
8089
8092
8097
8100
8105
8117
8121
8122
8125 if (ConfigIsExisting("canBeSplit"))
8126 {
8129 }
8130
8132 if (ConfigIsExisting("itemBehaviour"))
8134
8135
8138 RegisterNetSyncVariableInt("m_VarLiquidType");
8139 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8140
8141 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8142 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8143 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8144
8145 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8146 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8147 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8148 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8149
8150 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8151 RegisterNetSyncVariableBool("m_IsTakeable");
8152 RegisterNetSyncVariableBool("m_IsHologram");
8153
8156 {
8159 }
8160
8162
8164 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8166
8167 }
8168
8170 {
8172 }
8173
8175 {
8178 {
8183 }
8184 }
8185
8186 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8187 {
8189 {
8192 }
8193
8195 }
8196
8198 {
8204 }
8205
8207
8209 {
8211
8212 if (!action)
8213 {
8214 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8215 return;
8216 }
8217
8219 if (!ai)
8220 {
8222 return;
8223 }
8224
8226 if (!action_array)
8227 {
8228 action_array = new array<ActionBase_Basic>;
8230 }
8231 if (LogManager.IsActionLogEnable())
8232 {
8233 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8234 }
8235
8236 if (action_array.Find(action) != -1)
8237 {
8238 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8239 }
8240 else
8241 {
8242 action_array.Insert(action);
8243 }
8244 }
8245
8247 {
8249 ActionBase action = player.GetActionManager().GetAction(actionName);
8252
8253 if (action_array)
8254 {
8255 action_array.RemoveItem(action);
8256 }
8257 }
8258
8259
8260
8262 {
8263 ActionOverrideData overrideData = new ActionOverrideData();
8267
8269 if (!actionMap)
8270 {
8273 }
8274
8275 actionMap.Insert(this.
Type(), overrideData);
8276
8277 }
8278
8280
8282
8283
8285 {
8288
8291
8292 string config_to_search = "CfgVehicles";
8293 string muzzle_owner_config;
8294
8296 {
8297 if (IsInherited(Weapon))
8298 config_to_search = "CfgWeapons";
8299
8300 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8301
8302 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8303
8305
8306 if (config_OnFire_subclass_count > 0)
8307 {
8308 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8309
8310 for (int i = 0; i < config_OnFire_subclass_count; i++)
8311 {
8312 string particle_class = "";
8314 string config_OnFire_entry = config_OnFire_class + particle_class;
8315 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8316 WPOF_array.Insert(WPOF);
8317 }
8318
8319
8321 }
8322 }
8323
8325 {
8326 config_to_search = "CfgWeapons";
8327 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8328
8329 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8330
8332
8333 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8334 {
8335 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8336
8337 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8338 {
8339 string particle_class2 = "";
8341 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8342 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8343 WPOBE_array.Insert(WPOBE);
8344 }
8345
8346
8348 }
8349 }
8350 }
8351
8352
8354 {
8357
8359 {
8360 string config_to_search = "CfgVehicles";
8361
8362 if (IsInherited(Weapon))
8363 config_to_search = "CfgWeapons";
8364
8365 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8366 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8367
8368 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8369 {
8370
8372
8374 {
8376 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8378 return;
8379 }
8380
8383
8384
8385
8387 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8388
8389 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8390 {
8391 string particle_class = "";
8393 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8395
8396 if (entry_type == CT_CLASS)
8397 {
8398 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8399 WPOOH_array.Insert(WPOF);
8400 }
8401 }
8402
8403
8405 }
8406 }
8407 }
8408
8410 {
8412 }
8413
8415 {
8417 {
8419
8422
8425
8426 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8427 }
8428 }
8429
8431 {
8433 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8434
8436 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8437
8439 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8440
8442 {
8444 }
8445 }
8446
8448 {
8450 }
8451
8453 {
8456 else
8458
8460 {
8463 }
8464 else
8465 {
8468
8471 }
8472
8474 }
8475
8477 {
8479 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8480 }
8481
8483 {
8485 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8487 }
8488
8490 {
8492 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8493 }
8494
8496 {
8499
8500 OverheatingParticle OP = new OverheatingParticle();
8505
8507 }
8508
8510 {
8513
8514 return -1;
8515 }
8516
8518 {
8520 {
8523
8524 for (int i = count; i > 0; --i)
8525 {
8526 int id = i - 1;
8529
8532
8533 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8534 {
8535 if (p)
8536 {
8539 }
8540 }
8541 }
8542 }
8543 }
8544
8546 {
8548 {
8550 {
8551 int id = i - 1;
8553
8554 if (OP)
8555 {
8557
8558 if (p)
8559 {
8561 }
8562
8563 delete OP;
8564 }
8565 }
8566
8569 }
8570 }
8571
8574 {
8575 return 0.0;
8576 }
8577
8578
8580 {
8581 return 250;
8582 }
8583
8585 {
8586 return 0;
8587 }
8588
8591 {
8593 return true;
8594
8595 return false;
8596 }
8597
8600 {
8603
8605 {
8607 }
8608 else
8609 {
8610
8612 }
8613
8615 }
8616
8623 {
8624 return -1;
8625 }
8626
8627
8628
8629
8631 {
8633 {
8635 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8636
8637 if (r_index >= 0)
8638 {
8639 InventoryLocation r_il = new InventoryLocation;
8640 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8641
8642 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8645 {
8646 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8647 }
8649 {
8650 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8651 }
8652
8653 }
8654
8655 player.GetHumanInventory().ClearUserReservedLocation(this);
8656 }
8657
8660 }
8661
8662
8663
8664
8666 {
8667 return ItemBase.m_DebugActionsMask;
8668 }
8669
8671 {
8672 return ItemBase.m_DebugActionsMask & mask;
8673 }
8674
8676 {
8677 ItemBase.m_DebugActionsMask = mask;
8678 }
8679
8681 {
8682 ItemBase.m_DebugActionsMask |= mask;
8683 }
8684
8686 {
8687 ItemBase.m_DebugActionsMask &= ~mask;
8688 }
8689
8691 {
8693 {
8695 }
8696 else
8697 {
8699 }
8700 }
8701
8702
8704 {
8705 if (GetEconomyProfile())
8706 {
8707 float q_max = GetEconomyProfile().GetQuantityMax();
8708 if (q_max > 0)
8709 {
8710 float q_min = GetEconomyProfile().GetQuantityMin();
8711 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8712
8714 {
8715 ComponentEnergyManager comp = GetCompEM();
8717 {
8719 }
8720 }
8722 {
8724
8725 }
8726
8727 }
8728 }
8729 }
8730
8733 {
8734 EntityAI parent = GetHierarchyParent();
8735
8736 if (parent)
8737 {
8738 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8739 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8740 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8741 }
8742 }
8743
8746 {
8747 EntityAI parent = GetHierarchyParent();
8748
8749 if (parent)
8750 {
8751 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8752 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8753 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8754 }
8755 }
8756
8758 {
8759
8760
8761
8762
8764
8766 {
8767 if (ScriptInputUserData.CanStoreInputUserData())
8768 {
8769 ScriptInputUserData ctx = new ScriptInputUserData;
8775 ctx.
Write(use_stack_max);
8778
8780 {
8781 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8782 }
8783 }
8784 }
8785 else if (!
GetGame().IsMultiplayer())
8786 {
8788 }
8789 }
8790
8792 {
8794 }
8795
8797 {
8799 }
8800
8802 {
8804 }
8805
8807 {
8808
8809 return false;
8810 }
8811
8813 {
8814 return false;
8815 }
8816
8820 {
8821 return false;
8822 }
8823
8825 {
8826 return "";
8827 }
8828
8830
8832 {
8833 return false;
8834 }
8835
8837 {
8838 return true;
8839 }
8840
8841
8842
8844 {
8845 return true;
8846 }
8847
8849 {
8850 return true;
8851 }
8852
8854 {
8855 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8857 }
8858
8860 {
8862 }
8863
8865 {
8867 if (!is_being_placed)
8869 SetSynchDirty();
8870 }
8871
8872
8874
8876 {
8878 }
8879
8881 {
8883 }
8884
8886 {
8887 return 1;
8888 }
8889
8891 {
8892 return false;
8893 }
8894
8896 {
8898 SetSynchDirty();
8899 }
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8936 {
8937 super.OnMovedInsideCargo(container);
8938
8939 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8940 }
8941
8942 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8943 {
8944 super.EEItemLocationChanged(oldLoc,newLoc);
8945
8946 PlayerBase new_player = null;
8947 PlayerBase old_player = null;
8948
8949 if (newLoc.GetParent())
8950 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8951
8952 if (oldLoc.GetParent())
8953 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8954
8956 {
8957 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8958
8959 if (r_index >= 0)
8960 {
8961 InventoryLocation r_il = new InventoryLocation;
8962 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8963
8964 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8967 {
8968 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8969 }
8971 {
8972 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8973 }
8974
8975 }
8976 }
8977
8979 {
8980 if (new_player)
8981 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8982
8983 if (new_player == old_player)
8984 {
8985
8986 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8987 {
8989 {
8990 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8991 {
8992 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8993 }
8994 }
8995 else
8996 {
8997 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8998 }
8999 }
9000
9001 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9002 {
9003 int type = oldLoc.GetType();
9005 {
9006 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9007 }
9009 {
9010 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9011 }
9012 }
9013 if (!m_OldLocation)
9014 {
9015 m_OldLocation = new InventoryLocation;
9016 }
9017 m_OldLocation.Copy(oldLoc);
9018 }
9019 else
9020 {
9021 if (m_OldLocation)
9022 {
9023 m_OldLocation.Reset();
9024 }
9025 }
9026
9028 }
9029 else
9030 {
9031 if (new_player)
9032 {
9033 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9034 if (res_index >= 0)
9035 {
9036 InventoryLocation il = new InventoryLocation;
9037 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9039 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9042 {
9043 il.
GetParent().GetOnReleaseLock().Invoke(it);
9044 }
9046 {
9048 }
9049
9050 }
9051 }
9053 {
9054
9056 }
9057
9058 if (m_OldLocation)
9059 {
9060 m_OldLocation.Reset();
9061 }
9062 }
9063 }
9064
9065 override void EOnContact(IEntity other, Contact extra)
9066 {
9068 {
9069 int liquidType = -1;
9071 if (impactSpeed > 0.0)
9072 {
9074 #ifndef SERVER
9076 #else
9078 SetSynchDirty();
9079 #endif
9081 }
9082 }
9083
9084 #ifdef SERVER
9085 if (GetCompEM() && GetCompEM().IsPlugged())
9086 {
9087 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9088 GetCompEM().UnplugThis();
9089 }
9090 #endif
9091 }
9092
9094
9096 {
9098 }
9099
9101 {
9102
9103 }
9104
9106 {
9107 super.OnItemLocationChanged(old_owner, new_owner);
9108
9109 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9110 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9111
9112 if (!relatedPlayer && playerNew)
9113 relatedPlayer = playerNew;
9114
9115 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9116 {
9118 if (actionMgr)
9119 {
9120 ActionBase currentAction = actionMgr.GetRunningAction();
9121 if (currentAction)
9123 }
9124 }
9125
9126 Man ownerPlayerOld = null;
9127 Man ownerPlayerNew = null;
9128
9129 if (old_owner)
9130 {
9131 if (old_owner.
IsMan())
9132 {
9133 ownerPlayerOld = Man.Cast(old_owner);
9134 }
9135 else
9136 {
9137 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9138 }
9139 }
9140 else
9141 {
9143 {
9145
9146 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9147 {
9148 GetCompEM().UnplugThis();
9149 }
9150 }
9151 }
9152
9153 if (new_owner)
9154 {
9155 if (new_owner.
IsMan())
9156 {
9157 ownerPlayerNew = Man.Cast(new_owner);
9158 }
9159 else
9160 {
9161 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9162 }
9163 }
9164
9165 if (ownerPlayerOld != ownerPlayerNew)
9166 {
9167 if (ownerPlayerOld)
9168 {
9169 array<EntityAI> subItemsExit = new array<EntityAI>;
9171 for (int i = 0; i < subItemsExit.Count(); i++)
9172 {
9175 }
9176 }
9177
9178 if (ownerPlayerNew)
9179 {
9180 array<EntityAI> subItemsEnter = new array<EntityAI>;
9182 for (int j = 0; j < subItemsEnter.Count(); j++)
9183 {
9186 }
9187 }
9188 }
9189 else if (ownerPlayerNew != null)
9190 {
9191 PlayerBase nplayer;
9192 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9193 {
9194 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9196 for (int k = 0; k < subItemsUpdate.Count(); k++)
9197 {
9199 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9200 }
9201 }
9202 }
9203
9204 if (old_owner)
9205 old_owner.OnChildItemRemoved(this);
9206 if (new_owner)
9207 new_owner.OnChildItemReceived(this);
9208 }
9209
9210
9212 {
9213 super.EEDelete(parent);
9214 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9215 if (player)
9216 {
9218
9219 if (player.IsAlive())
9220 {
9221 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9222 if (r_index >= 0)
9223 {
9224 InventoryLocation r_il = new InventoryLocation;
9225 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9226
9227 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9230 {
9231 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9232 }
9234 {
9235 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9236 }
9237
9238 }
9239
9240 player.RemoveQuickBarEntityShortcut(this);
9241 }
9242 }
9243 }
9244
9246 {
9247 super.EEKilled(killer);
9248
9251 {
9252 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9253 {
9254 if (IsMagazine())
9255 {
9256 if (Magazine.Cast(this).GetAmmoCount() > 0)
9257 {
9259 }
9260 }
9261 else
9262 {
9264 }
9265 }
9266 }
9267 }
9268
9270 {
9271 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9272
9273 super.OnWasAttached(parent, slot_id);
9274
9277
9279 }
9280
9282 {
9283 super.OnWasDetached(parent, slot_id);
9284
9287 }
9288
9290 {
9291 int idx;
9294
9295 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9296 if (inventory_slots.Count() < 1)
9297 {
9298 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9299 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9300 }
9301 else
9302 {
9303 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9304 }
9305
9306 idx = inventory_slots.Find(slot);
9307 if (idx < 0)
9308 return "";
9309
9310 return attach_types.Get(idx);
9311 }
9312
9314 {
9315 int idx = -1;
9316 string slot;
9317
9320
9321 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9322 if (inventory_slots.Count() < 1)
9323 {
9324 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9325 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9326 }
9327 else
9328 {
9329 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9330 if (detach_types.Count() < 1)
9331 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9332 }
9333
9334 for (int i = 0; i < inventory_slots.Count(); i++)
9335 {
9336 slot = inventory_slots.Get(i);
9337 }
9338
9339 if (slot != "")
9340 {
9341 if (detach_types.Count() == 1)
9342 idx = 0;
9343 else
9344 idx = inventory_slots.Find(slot);
9345 }
9346 if (idx < 0)
9347 return "";
9348
9349 return detach_types.Get(idx);
9350 }
9351
9353 {
9354
9356
9357
9358 float min_time = 1;
9359 float max_time = 3;
9360 float delay = Math.RandomFloat(min_time, max_time);
9361
9362 explode_timer.Run(delay, this, "DoAmmoExplosion");
9363 }
9364
9366 {
9367 Magazine magazine = Magazine.Cast(this);
9368 int pop_sounds_count = 6;
9369 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9370
9371
9372 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9373 string sound_name = pop_sounds[ sound_idx ];
9375
9376
9377 magazine.ServerAddAmmoCount(-1);
9378
9379
9380 float min_temp_to_explode = 100;
9381
9382 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9383 {
9385 }
9386 }
9387
9388
9389 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9390 {
9391 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9392
9393 const int CHANCE_DAMAGE_CARGO = 4;
9394 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9395 const int CHANCE_DAMAGE_NOTHING = 2;
9396
9398 {
9399 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9400 int chances;
9401 int rnd;
9402
9403 if (GetInventory().GetCargo())
9404 {
9405 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9406 rnd = Math.RandomInt(0,chances);
9407
9408 if (rnd < CHANCE_DAMAGE_CARGO)
9409 {
9411 }
9412 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9413 {
9415 }
9416 }
9417 else
9418 {
9419 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9420 rnd = Math.RandomInt(0,chances);
9421
9422 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9423 {
9425 }
9426 }
9427 }
9428 }
9429
9431 {
9432 if (GetInventory().GetCargo())
9433 {
9434 int item_count = GetInventory().GetCargo().GetItemCount();
9435 if (item_count > 0)
9436 {
9437 int random_pick = Math.RandomInt(0, item_count);
9439 if (!item.IsExplosive())
9440 {
9441 item.AddHealth("","",damage);
9442 return true;
9443 }
9444 }
9445 }
9446 return false;
9447 }
9448
9450 {
9451 int attachment_count = GetInventory().AttachmentCount();
9452 if (attachment_count > 0)
9453 {
9454 int random_pick = Math.RandomInt(0, attachment_count);
9455 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9456 if (!attachment.IsExplosive())
9457 {
9458 attachment.AddHealth("","",damage);
9459 return true;
9460 }
9461 }
9462 return false;
9463 }
9464
9466 {
9468 }
9469
9471 {
9473 return GetInventory().CanRemoveEntity();
9474
9475 return false;
9476 }
9477
9479 {
9481 return;
9482
9484 {
9485 if (ScriptInputUserData.CanStoreInputUserData())
9486 {
9487 ScriptInputUserData ctx = new ScriptInputUserData;
9492 ctx.
Write(destination_entity);
9496 }
9497 }
9498 else if (!
GetGame().IsMultiplayer())
9499 {
9501 }
9502 }
9503
9505 {
9507 return;
9508
9509 float split_quantity_new;
9513 InventoryLocation loc = new InventoryLocation;
9514
9515 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9516 {
9518 split_quantity_new = stack_max;
9519 else
9521
9522 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9523 if (new_item)
9524 {
9525 new_item.SetResultOfSplit(true);
9526 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9528 new_item.SetQuantity(split_quantity_new);
9529 }
9530 }
9531 else if (destination_entity && slot_id == -1)
9532 {
9533 if (quantity > stack_max)
9534 split_quantity_new = stack_max;
9535 else
9536 split_quantity_new = quantity;
9537
9539 {
9542 }
9543
9544 if (new_item)
9545 {
9546 new_item.SetResultOfSplit(true);
9547 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9549 new_item.SetQuantity(split_quantity_new);
9550 }
9551 }
9552 else
9553 {
9554 if (stack_max != 0)
9555 {
9557 {
9559 }
9560
9561 if (split_quantity_new == 0)
9562 {
9563 if (!
GetGame().IsMultiplayer())
9564 player.PhysicalPredictiveDropItem(this);
9565 else
9566 player.ServerDropEntity(this);
9567 return;
9568 }
9569
9571
9572 if (new_item)
9573 {
9574 new_item.SetResultOfSplit(true);
9575 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9577 new_item.SetQuantity(stack_max);
9578 new_item.PlaceOnSurface();
9579 }
9580 }
9581 }
9582 }
9583
9585 {
9587 return;
9588
9589 float split_quantity_new;
9593 InventoryLocation loc = new InventoryLocation;
9594
9595 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9596 {
9598 split_quantity_new = stack_max;
9599 else
9601
9602 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9603 if (new_item)
9604 {
9605 new_item.SetResultOfSplit(true);
9606 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9608 new_item.SetQuantity(split_quantity_new);
9609 }
9610 }
9611 else if (destination_entity && slot_id == -1)
9612 {
9613 if (quantity > stack_max)
9614 split_quantity_new = stack_max;
9615 else
9616 split_quantity_new = quantity;
9617
9619 {
9622 }
9623
9624 if (new_item)
9625 {
9626 new_item.SetResultOfSplit(true);
9627 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9629 new_item.SetQuantity(split_quantity_new);
9630 }
9631 }
9632 else
9633 {
9634 if (stack_max != 0)
9635 {
9637 {
9639 }
9640
9642
9643 if (new_item)
9644 {
9645 new_item.SetResultOfSplit(true);
9646 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9648 new_item.SetQuantity(stack_max);
9649 new_item.PlaceOnSurface();
9650 }
9651 }
9652 }
9653 }
9654
9656 {
9658 return;
9659
9661 {
9662 if (ScriptInputUserData.CanStoreInputUserData())
9663 {
9664 ScriptInputUserData ctx = new ScriptInputUserData;
9669 dst.WriteToContext(ctx);
9671 }
9672 }
9673 else if (!
GetGame().IsMultiplayer())
9674 {
9676 }
9677 }
9678
9680 {
9682 return;
9683
9685 {
9686 if (ScriptInputUserData.CanStoreInputUserData())
9687 {
9688 ScriptInputUserData ctx = new ScriptInputUserData;
9693 ctx.
Write(destination_entity);
9699 }
9700 }
9701 else if (!
GetGame().IsMultiplayer())
9702 {
9704 }
9705 }
9706
9708 {
9710 }
9711
9713 {
9715 return this;
9716
9718 float split_quantity_new;
9720 if (dst.IsValid())
9721 {
9722 int slot_id = dst.GetSlot();
9724
9725 if (quantity > stack_max)
9726 split_quantity_new = stack_max;
9727 else
9728 split_quantity_new = quantity;
9729
9731
9732 if (new_item)
9733 {
9734 new_item.SetResultOfSplit(true);
9735 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9738 }
9739
9740 return new_item;
9741 }
9742
9743 return null;
9744 }
9745
9747 {
9749 return;
9750
9752 float split_quantity_new;
9754 if (destination_entity)
9755 {
9757 if (quantity > stackable)
9758 split_quantity_new = stackable;
9759 else
9760 split_quantity_new = quantity;
9761
9762 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9763 if (new_item)
9764 {
9765 new_item.SetResultOfSplit(true);
9766 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9768 new_item.SetQuantity(split_quantity_new);
9769 }
9770 }
9771 }
9772
9774 {
9776 return;
9777
9779 {
9780 if (ScriptInputUserData.CanStoreInputUserData())
9781 {
9782 ScriptInputUserData ctx = new ScriptInputUserData;
9787 ItemBase destination_entity =
this;
9788 ctx.
Write(destination_entity);
9792 }
9793 }
9794 else if (!
GetGame().IsMultiplayer())
9795 {
9797 }
9798 }
9799
9801 {
9803 return;
9804
9806 float split_quantity_new;
9808 if (player)
9809 {
9811 if (quantity > stackable)
9812 split_quantity_new = stackable;
9813 else
9814 split_quantity_new = quantity;
9815
9816 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9817 new_item =
ItemBase.Cast(in_hands);
9818 if (new_item)
9819 {
9820 new_item.SetResultOfSplit(true);
9821 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9823 new_item.SetQuantity(split_quantity_new);
9824 }
9825 }
9826 }
9827
9829 {
9831 return;
9832
9834 float split_quantity_new = Math.Floor(quantity * 0.5);
9835
9837
9838 if (new_item)
9839 {
9840 if (new_item.GetQuantityMax() < split_quantity_new)
9841 {
9842 split_quantity_new = new_item.GetQuantityMax();
9843 }
9844
9845 new_item.SetResultOfSplit(true);
9846 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9847
9849 {
9852 }
9853 else
9854 {
9857 }
9858 }
9859 }
9860
9862 {
9864 return;
9865
9867 float split_quantity_new = Math.Floor(quantity / 2);
9868
9869 InventoryLocation invloc = new InventoryLocation;
9871
9873 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9874
9875 if (new_item)
9876 {
9877 if (new_item.GetQuantityMax() < split_quantity_new)
9878 {
9879 split_quantity_new = new_item.GetQuantityMax();
9880 }
9882 {
9885 }
9886 else
9887 {
9890 }
9891 }
9892 }
9893
9896 {
9897 SetWeightDirty();
9899
9900 if (parent)
9901 parent.OnAttachmentQuantityChangedEx(this, delta);
9902
9904 {
9906 {
9908 }
9910 {
9911 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9913 }
9914 }
9915
9916 }
9917
9920 {
9921
9922 }
9923
9926 {
9928 }
9929
9931 {
9932 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9933
9935 {
9936 if (newLevel == GameConstants.STATE_RUINED)
9937 {
9939 EntityAI parent = GetHierarchyParent();
9940 if (parent && parent.IsFireplace())
9941 {
9942 CargoBase cargo = GetInventory().GetCargo();
9943 if (cargo)
9944 {
9946 {
9948 }
9949 }
9950 }
9951 }
9952
9954 {
9955
9957 return;
9958 }
9959
9960 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9961 {
9963 }
9964 }
9965 }
9966
9967
9969 {
9970 super.OnRightClick();
9971
9973 {
9975 {
9976 if (ScriptInputUserData.CanStoreInputUserData())
9977 {
9978 vector m4[4];
9980
9981 EntityAI root = GetHierarchyRoot();
9982
9983 InventoryLocation dst = new InventoryLocation;
9985 {
9986 if (root)
9987 {
9988 root.GetTransform(m4);
9990 }
9991 else
9992 GetInventory().GetCurrentInventoryLocation(dst);
9993 }
9994 else
9995 {
9997
9998
9999 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10000 {
10001 if (root)
10002 {
10003 root.GetTransform(m4);
10005 }
10006 else
10007 GetInventory().GetCurrentInventoryLocation(dst);
10008 }
10009 else
10010 {
10011 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10012 }
10013 }
10014
10015 ScriptInputUserData ctx = new ScriptInputUserData;
10023 }
10024 }
10025 else if (!
GetGame().IsMultiplayer())
10026 {
10028 }
10029 }
10030 }
10031
10032 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10033 {
10034
10035 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10036 return false;
10037
10038 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10039 return false;
10040
10041
10043 return false;
10044
10045
10046 Magazine mag = Magazine.Cast(this);
10047 if (mag)
10048 {
10049 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10050 return false;
10051
10052 if (stack_max_limit)
10053 {
10054 Magazine other_mag = Magazine.Cast(other_item);
10055 if (other_item)
10056 {
10057 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10058 return false;
10059 }
10060
10061 }
10062 }
10063 else
10064 {
10065
10067 return false;
10068
10070 return false;
10071 }
10072
10073 PlayerBase player = null;
10074 if (CastTo(player, GetHierarchyRootPlayer()))
10075 {
10076 if (player.GetInventory().HasAttachment(this))
10077 return false;
10078
10079 if (player.IsItemsToDelete())
10080 return false;
10081 }
10082
10083 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10084 return false;
10085
10086 int slotID;
10088 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10089 return false;
10090
10091 return true;
10092 }
10093
10095 {
10097 }
10098
10100 {
10101 return m_IsResultOfSplit;
10102 }
10103
10105 {
10106 m_IsResultOfSplit = value;
10107 }
10108
10110 {
10112 }
10113
10115 {
10116 float other_item_quantity = other_item.GetQuantity();
10117 float this_free_space;
10118
10120
10122
10123 if (other_item_quantity > this_free_space)
10124 {
10125 return this_free_space;
10126 }
10127 else
10128 {
10129 return other_item_quantity;
10130 }
10131 }
10132
10134 {
10136 }
10137
10139 {
10141 return;
10142
10143 if (!IsMagazine() && other_item)
10144 {
10146 if (quantity_used != 0)
10147 {
10148 float hp1 = GetHealth01("","");
10149 float hp2 = other_item.GetHealth01("","");
10150 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10151 hpResult = hpResult / (
GetQuantity() + quantity_used);
10152
10153 hpResult *= GetMaxHealth();
10154 Math.Round(hpResult);
10155 SetHealth("", "Health", hpResult);
10156
10158 other_item.AddQuantity(-quantity_used);
10159 }
10160 }
10162 }
10163
10165 {
10166 #ifdef SERVER
10167 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10168 GetHierarchyParent().IncreaseLifetimeUp();
10169 #endif
10170 };
10171
10173 {
10174 PlayerBase p = PlayerBase.Cast(player);
10175
10176 array<int> recipesIds = p.m_Recipes;
10177 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10178 if (moduleRecipesManager)
10179 {
10180 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10181 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10182 }
10183
10184 for (int i = 0;i < recipesIds.Count(); i++)
10185 {
10186 int key = recipesIds.Get(i);
10187 string recipeName = moduleRecipesManager.GetRecipeName(key);
10189 }
10190 }
10191
10192
10193 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10194 {
10195 super.GetDebugActions(outputList);
10196
10197
10202
10203
10207
10211
10212
10215
10216
10218 {
10221 }
10222
10224
10227
10231 }
10232
10233
10234
10235
10237 {
10238 super.OnAction(action_id, player, ctx);
10239 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10240 {
10241 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10242 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10243 PlayerBase p = PlayerBase.Cast(player);
10244 if (
EActions.RECIPES_RANGE_START < 1000)
10245 {
10246 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10247 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10248 }
10249 }
10250 #ifndef SERVER
10251 else if (action_id ==
EActions.WATCH_PLAYER)
10252 {
10253 PluginDeveloper.SetDeveloperItemClientEx(player);
10254 }
10255 #endif
10257 {
10258 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10259 {
10260 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10261 OnDebugButtonPressServer(id + 1);
10262 }
10263
10264 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10265 {
10266 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10268 }
10269
10270 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10271 {
10272 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10274 }
10275
10276 else if (action_id ==
EActions.ADD_QUANTITY)
10277 {
10278 if (IsMagazine())
10279 {
10280 Magazine mag = Magazine.Cast(this);
10281 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10282 }
10283 else
10284 {
10286 }
10287
10288 if (m_EM)
10289 {
10290 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10291 }
10292
10293 }
10294
10295 else if (action_id ==
EActions.REMOVE_QUANTITY)
10296 {
10297 if (IsMagazine())
10298 {
10299 Magazine mag2 = Magazine.Cast(this);
10300 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10301 }
10302 else
10303 {
10305 }
10306 if (m_EM)
10307 {
10308 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10309 }
10310
10311 }
10312
10313 else if (action_id ==
EActions.SET_QUANTITY_0)
10314 {
10316
10317 if (m_EM)
10318 {
10319 m_EM.SetEnergy(0);
10320 }
10321 }
10322
10323 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10324 {
10326
10327 if (m_EM)
10328 {
10329 m_EM.SetEnergy(m_EM.GetEnergyMax());
10330 }
10331 }
10332
10333 else if (action_id ==
EActions.ADD_HEALTH)
10334 {
10335 AddHealth("","",GetMaxHealth("","Health")/5);
10336 }
10337 else if (action_id ==
EActions.REMOVE_HEALTH)
10338 {
10339 AddHealth("","",-GetMaxHealth("","Health")/5);
10340 }
10341 else if (action_id ==
EActions.DESTROY_HEALTH)
10342 {
10343 SetHealth01("","",0);
10344 }
10345 else if (action_id ==
EActions.WATCH_ITEM)
10346 {
10348 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10349 #ifdef DEVELOPER
10350 SetDebugDeveloper_item(this);
10351 #endif
10352 }
10353
10354 else if (action_id ==
EActions.ADD_TEMPERATURE)
10355 {
10356 AddTemperature(20);
10357
10358 }
10359
10360 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10361 {
10362 AddTemperature(-20);
10363
10364 }
10365
10366 else if (action_id ==
EActions.FLIP_FROZEN)
10367 {
10368 SetFrozen(!GetIsFrozen());
10369
10370 }
10371
10372 else if (action_id ==
EActions.ADD_WETNESS)
10373 {
10375
10376 }
10377
10378 else if (action_id ==
EActions.REMOVE_WETNESS)
10379 {
10381
10382 }
10383
10384 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10385 {
10388
10389
10390 }
10391
10392 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10393 {
10396 }
10397
10398 else if (action_id ==
EActions.MAKE_SPECIAL)
10399 {
10400 auto debugParams = DebugSpawnParams.WithPlayer(player);
10401 OnDebugSpawnEx(debugParams);
10402 }
10403
10404 else if (action_id ==
EActions.DELETE)
10405 {
10406 Delete();
10407 }
10408
10409 }
10410
10411
10412 return false;
10413 }
10414
10415
10416
10417
10421
10424
10425
10426
10428 {
10429 return false;
10430 }
10431
10432
10434 {
10435 return true;
10436 }
10437
10438
10440 {
10441 return true;
10442 }
10443
10444
10445
10447 {
10448 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10450 }
10451
10454 {
10455 return null;
10456 }
10457
10459 {
10460 return false;
10461 }
10462
10464 {
10465 return false;
10466 }
10467
10471
10472
10474 {
10475 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10476 return module_repairing.CanRepair(this, item_repair_kit);
10477 }
10478
10479
10480 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10481 {
10482 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10483 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10484 }
10485
10486
10488 {
10489
10490
10491
10492
10493
10494
10495
10496
10497 return 1;
10498 }
10499
10500
10501
10503 {
10505 }
10506
10507
10508
10510 {
10512 }
10513
10514
10523 {
10524 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10525
10526 if (player)
10527 {
10528 player.MessageStatus(text);
10529 }
10530 }
10531
10532
10541 {
10542 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10543
10544 if (player)
10545 {
10546 player.MessageAction(text);
10547 }
10548 }
10549
10550
10559 {
10560 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10561
10562 if (player)
10563 {
10564 player.MessageFriendly(text);
10565 }
10566 }
10567
10568
10577 {
10578 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10579
10580 if (player)
10581 {
10582 player.MessageImportant(text);
10583 }
10584 }
10585
10587 {
10588 return true;
10589 }
10590
10591
10592 override bool KindOf(
string tag)
10593 {
10594 bool found = false;
10595 string item_name = this.
GetType();
10598
10599 int array_size = item_tag_array.Count();
10600 for (int i = 0; i < array_size; i++)
10601 {
10602 if (item_tag_array.Get(i) == tag)
10603 {
10604 found = true;
10605 break;
10606 }
10607 }
10608 return found;
10609 }
10610
10611
10613 {
10614
10615 super.OnRPC(sender, rpc_type,ctx);
10616
10617
10618 switch (rpc_type)
10619 {
10620 #ifndef SERVER
10621 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10622 Param2<bool, string> p = new Param2<bool, string>(false, "");
10623
10625 return;
10626
10627 bool play = p.param1;
10628 string soundSet = p.param2;
10629
10630 if (play)
10631 {
10633 {
10635 {
10637 }
10638 }
10639 else
10640 {
10642 }
10643 }
10644 else
10645 {
10647 }
10648
10649 break;
10650 #endif
10651
10652 }
10653
10655 {
10657 }
10658 }
10659
10660
10661
10662
10664 {
10665 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10666 return plugin.GetID(
name);
10667 }
10668
10670 {
10671 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10672 return plugin.GetName(id);
10673 }
10674
10677 {
10678
10679
10680 int varFlags;
10681 if (!ctx.
Read(varFlags))
10682 return;
10683
10684 if (varFlags & ItemVariableFlags.FLOAT)
10685 {
10687 }
10688 }
10689
10691 {
10692
10693 super.SerializeNumericalVars(floats_out);
10694
10695
10696
10698 {
10700 }
10701
10703 {
10705 }
10706
10708 {
10710 }
10711
10713 {
10718 }
10719
10721 {
10723 }
10724 }
10725
10727 {
10728
10729 super.DeSerializeNumericalVars(floats);
10730
10731
10732 int index = 0;
10733 int mask = Math.Round(floats.Get(index));
10734
10735 index++;
10736
10738 {
10740 {
10742 }
10743 else
10744 {
10745 float quantity = floats.Get(index);
10746 SetQuantity(quantity,
true,
false,
false,
false);
10747 }
10748 index++;
10749 }
10750
10752 {
10753 float wet = floats.Get(index);
10755 index++;
10756 }
10757
10759 {
10760 int liquidtype = Math.Round(floats.Get(index));
10762 index++;
10763 }
10764
10766 {
10768 index++;
10770 index++;
10772 index++;
10774 index++;
10775 }
10776
10778 {
10779 int cleanness = Math.Round(floats.Get(index));
10781 index++;
10782 }
10783 }
10784
10786 {
10787 super.WriteVarsToCTX(ctx);
10788
10789
10791 {
10793 }
10794
10796 {
10798 }
10799
10801 {
10803 }
10804
10806 {
10807 int r,g,b,a;
10813 }
10814
10816 {
10818 }
10819 }
10820
10822 {
10823 if (!super.ReadVarsFromCTX(ctx,version))
10824 return false;
10825
10826 int intValue;
10827 float value;
10828
10829 if (version < 140)
10830 {
10831 if (!ctx.
Read(intValue))
10832 return false;
10833
10834 m_VariablesMask = intValue;
10835 }
10836
10838 {
10839 if (!ctx.
Read(value))
10840 return false;
10841
10843 {
10845 }
10846 else
10847 {
10849 }
10850 }
10851
10852 if (version < 140)
10853 {
10855 {
10856 if (!ctx.
Read(value))
10857 return false;
10858 SetTemperatureDirect(value);
10859 }
10860 }
10861
10863 {
10864 if (!ctx.
Read(value))
10865 return false;
10867 }
10868
10870 {
10871 if (!ctx.
Read(intValue))
10872 return false;
10874 }
10875
10877 {
10878 int r,g,b,a;
10880 return false;
10882 return false;
10884 return false;
10886 return false;
10887
10889 }
10890
10892 {
10893 if (!ctx.
Read(intValue))
10894 return false;
10896 }
10897
10898 if (version >= 138 && version < 140)
10899 {
10901 {
10902 if (!ctx.
Read(intValue))
10903 return false;
10904 SetFrozen(intValue);
10905 }
10906 }
10907
10908 return true;
10909 }
10910
10911
10913 {
10916 {
10918 }
10919
10920 if (!super.OnStoreLoad(ctx, version))
10921 {
10923 return false;
10924 }
10925
10926 if (version >= 114)
10927 {
10928 bool hasQuickBarIndexSaved;
10929
10930 if (!ctx.
Read(hasQuickBarIndexSaved))
10931 {
10933 return false;
10934 }
10935
10936 if (hasQuickBarIndexSaved)
10937 {
10938 int itmQBIndex;
10939
10940
10941 if (!ctx.
Read(itmQBIndex))
10942 {
10944 return false;
10945 }
10946
10947 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10948 if (itmQBIndex != -1 && parentPlayer)
10949 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10950 }
10951 }
10952 else
10953 {
10954
10955 PlayerBase player;
10956 int itemQBIndex;
10957 if (version ==
int.
MAX)
10958 {
10959 if (!ctx.
Read(itemQBIndex))
10960 {
10962 return false;
10963 }
10964 }
10965 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10966 {
10967
10968 if (!ctx.
Read(itemQBIndex))
10969 {
10971 return false;
10972 }
10973 if (itemQBIndex != -1 && player)
10974 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10975 }
10976 }
10977
10978 if (version < 140)
10979 {
10980
10981 if (!LoadVariables(ctx, version))
10982 {
10984 return false;
10985 }
10986 }
10987
10988
10990 {
10992 return false;
10993 }
10994 if (version >= 132)
10995 {
10997 if (raib)
10998 {
11000 {
11002 return false;
11003 }
11004 }
11005 }
11006
11008 return true;
11009 }
11010
11011
11012
11014 {
11015 super.OnStoreSave(ctx);
11016
11017 PlayerBase player;
11018 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11019 {
11021
11022 int itemQBIndex = -1;
11023 itemQBIndex = player.FindQuickBarEntityIndex(this);
11024 ctx.
Write(itemQBIndex);
11025 }
11026 else
11027 {
11029 }
11030
11032
11034 if (raib)
11035 {
11037 }
11038 }
11039
11040
11042 {
11043 super.AfterStoreLoad();
11044
11046 {
11048 }
11049
11051 {
11054 }
11055 }
11056
11058 {
11059 super.EEOnAfterLoad();
11060
11062 {
11064 }
11065
11068 }
11069
11071 {
11072 return false;
11073 }
11074
11075
11076
11078 {
11080 {
11081 #ifdef PLATFORM_CONSOLE
11082
11084 {
11086 if (menu)
11087 {
11089 }
11090 }
11091 #endif
11092 }
11093
11095 {
11098 }
11099
11101 {
11102 SetWeightDirty();
11104 }
11106 {
11109 }
11110
11112 {
11115 }
11117 {
11120 }
11121
11122 super.OnVariablesSynchronized();
11123 }
11124
11125
11126
11128 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11129 {
11130 if (!IsServerCheck(allow_client))
11131 return false;
11132
11134 return false;
11135
11138
11139 if (value <= (min + 0.001))
11140 value = min;
11141
11142 if (value == min)
11143 {
11144 if (destroy_config)
11145 {
11146 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11147 if (dstr)
11148 {
11150 this.Delete();
11151 return true;
11152 }
11153 }
11154 else if (destroy_forced)
11155 {
11157 this.Delete();
11158 return true;
11159 }
11160
11162 }
11163
11166
11168 {
11170
11171 if (delta)
11173 }
11174
11176
11177 return false;
11178 }
11179
11180
11182 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11183 {
11185 }
11186
11188 {
11191 }
11192
11194 {
11197 }
11198
11201 {
11202 float value_clamped = Math.Clamp(value, 0, 1);
11204 SetQuantity(result, destroy_config, destroy_forced);
11205 }
11206
11207
11210 {
11212 }
11213
11215 {
11217 }
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11229 {
11230 int slot = -1;
11231 if (GetInventory())
11232 {
11233 InventoryLocation il = new InventoryLocation;
11234 GetInventory().GetCurrentInventoryLocation(il);
11236 }
11237
11239 }
11240
11242 {
11243 float quantity_max = 0;
11244
11246 {
11247 if (attSlotID != -1)
11248 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11249
11250 if (quantity_max <= 0)
11252 }
11253
11254 if (quantity_max <= 0)
11256
11257 return quantity_max;
11258 }
11259
11261 {
11263 }
11264
11266 {
11268 }
11269
11270
11272 {
11274 }
11275
11277 {
11279 }
11280
11282 {
11284 }
11285
11286
11288 {
11289
11290 float weightEx = GetWeightEx();
11291 float special = GetInventoryAndCargoWeight();
11292 return weightEx - special;
11293 }
11294
11295
11297 {
11299 }
11300
11302 {
11304 {
11305 #ifdef DEVELOPER
11306 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11307 {
11308 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11310 }
11311 #endif
11312
11313 return GetQuantity() * GetConfigWeightModified();
11314 }
11315 else if (HasEnergyManager())
11316 {
11317 #ifdef DEVELOPER
11318 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11319 {
11320 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11321 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11322 }
11323 #endif
11324 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11325 }
11326 else
11327 {
11328 #ifdef DEVELOPER
11329 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11330 {
11331 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11332 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11333 }
11334 #endif
11335 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11336 }
11337 }
11338
11341 {
11342 int item_count = 0;
11344
11345 if (GetInventory().GetCargo() != NULL)
11346 {
11347 item_count = GetInventory().GetCargo().GetItemCount();
11348 }
11349
11350 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11351 {
11352 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11353 if (item)
11354 item_count += item.GetNumberOfItems();
11355 }
11356 return item_count;
11357 }
11358
11361 {
11362 float weight = 0;
11363 float wetness = 1;
11364 if (include_wetness)
11367 {
11368 weight = wetness * m_ConfigWeight;
11369 }
11371 {
11372 weight = 1;
11373 }
11374 return weight;
11375 }
11376
11377
11378
11380 {
11381 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11382 {
11383 GameInventory inv = GetInventory();
11384 array<EntityAI> items = new array<EntityAI>;
11386 for (int i = 0; i < items.Count(); i++)
11387 {
11389 if (item)
11390 {
11392 }
11393 }
11394 }
11395 }
11396
11397
11398
11399
11401 {
11402 float energy = 0;
11403 if (HasEnergyManager())
11404 {
11405 energy = GetCompEM().GetEnergy();
11406 }
11407 return energy;
11408 }
11409
11410
11412 {
11413 super.OnEnergyConsumed();
11414
11416 }
11417
11419 {
11420 super.OnEnergyAdded();
11421
11423 }
11424
11425
11427 {
11428 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11429 {
11431 {
11432 float energy_0to1 = GetCompEM().GetEnergy0To1();
11434 }
11435 }
11436 }
11437
11438
11440 {
11441 return ConfigGetFloat("heatIsolation");
11442 }
11443
11445 {
11447 }
11448
11450 {
11451 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11452 if (
GetGame().ConfigIsExisting(paramPath))
11454
11455 return 0.0;
11456 }
11457
11459 {
11460 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11461 if (
GetGame().ConfigIsExisting(paramPath))
11463
11464 return 0.0;
11465 }
11466
11467 override void SetWet(
float value,
bool allow_client =
false)
11468 {
11469 if (!IsServerCheck(allow_client))
11470 return;
11471
11474
11476
11477 m_VarWet = Math.Clamp(value, min, max);
11478
11480 {
11483 }
11484 }
11485
11486 override void AddWet(
float value)
11487 {
11489 }
11490
11492 {
11494 }
11495
11497 {
11499 }
11500
11502 {
11504 }
11505
11507 {
11509 }
11510
11512 {
11514 }
11515
11516 override void OnWetChanged(
float newVal,
float oldVal)
11517 {
11520 if (newLevel != oldLevel)
11521 {
11523 }
11524 }
11525
11527 {
11528 SetWeightDirty();
11529 }
11530
11532 {
11533 return GetWetLevelInternal(
m_VarWet);
11534 }
11535
11536
11537
11539 {
11541 }
11542
11544 {
11546 }
11547
11549 {
11551 }
11552
11554 {
11556 }
11557
11558
11559
11561 {
11562 if (ConfigIsExisting("itemModelLength"))
11563 {
11564 return ConfigGetFloat("itemModelLength");
11565 }
11566 return 0;
11567 }
11568
11570 {
11571 if (ConfigIsExisting("itemAttachOffset"))
11572 {
11573 return ConfigGetFloat("itemAttachOffset");
11574 }
11575 return 0;
11576 }
11577
11578 override void SetCleanness(
int value,
bool allow_client =
false)
11579 {
11580 if (!IsServerCheck(allow_client))
11581 return;
11582
11584
11586
11589 }
11590
11592 {
11594 }
11595
11597 {
11598 return true;
11599 }
11600
11601
11602
11603
11605 {
11607 }
11608
11610 {
11612 }
11613
11614
11615
11616
11617 override void SetColor(
int r,
int g,
int b,
int a)
11618 {
11624 }
11626 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11627 {
11632 }
11633
11635 {
11637 }
11638
11641 {
11642 int r,g,b,a;
11644 r = r/255;
11645 g = g/255;
11646 b = b/255;
11647 a = a/255;
11648 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11649 }
11650
11651
11652
11653 override void SetLiquidType(
int value,
bool allow_client =
false)
11654 {
11655 if (!IsServerCheck(allow_client))
11656 return;
11657
11662 }
11663
11665 {
11666 return ConfigGetInt("varLiquidTypeInit");
11667 }
11668
11670 {
11672 }
11673
11675 {
11677 SetFrozen(false);
11678 }
11679
11682 {
11683 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11684 }
11685
11686
11689 {
11690 PlayerBase nplayer;
11691 if (PlayerBase.CastTo(nplayer, player))
11692 {
11694
11695 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11696 }
11697 }
11698
11699
11702 {
11703 PlayerBase nplayer;
11704 if (PlayerBase.CastTo(nplayer,player))
11705 {
11706
11707 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11708
11709 }
11710
11711
11712 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11713
11714
11715 if (HasEnergyManager())
11716 {
11717 GetCompEM().UpdatePlugState();
11718 }
11719 }
11720
11721
11723 {
11724 super.OnPlacementStarted(player);
11725
11727 }
11728
11729 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11730 {
11732 {
11733 m_AdminLog.OnPlacementComplete(player,
this);
11734 }
11735
11736 super.OnPlacementComplete(player, position, orientation);
11737 }
11738
11739
11740
11741
11742
11744 {
11746 {
11747 return true;
11748 }
11749 else
11750 {
11751 return false;
11752 }
11753 }
11754
11755
11757 {
11759 {
11761 }
11762 }
11763
11764
11766 {
11768 }
11769
11771 {
11773 }
11774
11775 override void InsertAgent(
int agent,
float count = 1)
11776 {
11777 if (count < 1)
11778 return;
11779
11781 }
11782
11785 {
11787 }
11788
11789
11791 {
11793 }
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11837 {
11839 return false;
11840 return true;
11841 }
11842
11844 {
11845
11847 }
11848
11849
11852 {
11853 super.CheckForRoofLimited(timeTresholdMS);
11854
11856 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11857 {
11858 m_PreviousRoofTestTime = time;
11859 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11860 }
11861 }
11862
11863
11865 {
11867 {
11868 return 0;
11869 }
11870
11871 if (GetInventory().GetAttachmentSlotsCount() != 0)
11872 {
11873 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11874 if (filter)
11875 return filter.GetProtectionLevel(type, false, system);
11876 else
11877 return 0;
11878 }
11879
11880 string subclassPath, entryName;
11881
11882 switch (type)
11883 {
11885 entryName = "biological";
11886 break;
11888 entryName = "chemical";
11889 break;
11890 default:
11891 entryName = "biological";
11892 break;
11893 }
11894
11895 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11896
11898 }
11899
11900
11901
11904 {
11905 if (!IsMagazine())
11907
11909 }
11910
11911
11912
11913
11914
11919 {
11920 return true;
11921 }
11922
11924 {
11926 }
11927
11928
11929
11930
11931
11933 {
11934 if (parent)
11935 {
11936 if (parent.IsInherited(DayZInfected))
11937 return true;
11938
11939 if (!parent.IsRuined())
11940 return true;
11941 }
11942
11943 return true;
11944 }
11945
11947 {
11948 if (!super.CanPutAsAttachment(parent))
11949 {
11950 return false;
11951 }
11952
11953 if (!IsRuined() && !parent.IsRuined())
11954 {
11955 return true;
11956 }
11957
11958 return false;
11959 }
11960
11962 {
11963
11964
11965
11966
11967 return super.CanReceiveItemIntoCargo(item);
11968 }
11969
11971 {
11972
11973
11974
11975
11976 GameInventory attachmentInv = attachment.GetInventory();
11978 {
11979 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11980 return false;
11981 }
11982
11983 InventoryLocation loc = new InventoryLocation();
11984 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11985 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11986 return false;
11987
11988 return super.CanReceiveAttachment(attachment, slotId);
11989 }
11990
11992 {
11993 if (!super.CanReleaseAttachment(attachment))
11994 return false;
11995
11996 return GetInventory().AreChildrenAccessible();
11997 }
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12020 {
12021 int id = muzzle_owner.GetMuzzleID();
12022 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12023
12024 if (WPOF_array)
12025 {
12026 for (int i = 0; i < WPOF_array.Count(); i++)
12027 {
12028 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12029
12030 if (WPOF)
12031 {
12032 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12033 }
12034 }
12035 }
12036 }
12037
12038
12040 {
12041 int id = muzzle_owner.GetMuzzleID();
12043
12044 if (WPOBE_array)
12045 {
12046 for (int i = 0; i < WPOBE_array.Count(); i++)
12047 {
12048 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12049
12050 if (WPOBE)
12051 {
12052 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12053 }
12054 }
12055 }
12056 }
12057
12058
12060 {
12061 int id = muzzle_owner.GetMuzzleID();
12062 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12063
12064 if (WPOOH_array)
12065 {
12066 for (int i = 0; i < WPOOH_array.Count(); i++)
12067 {
12068 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12069
12070 if (WPOOH)
12071 {
12072 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12073 }
12074 }
12075 }
12076 }
12077
12078
12080 {
12081 int id = muzzle_owner.GetMuzzleID();
12082 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12083
12084 if (WPOOH_array)
12085 {
12086 for (int i = 0; i < WPOOH_array.Count(); i++)
12087 {
12088 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12089
12090 if (WPOOH)
12091 {
12092 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12093 }
12094 }
12095 }
12096 }
12097
12098
12100 {
12101 int id = muzzle_owner.GetMuzzleID();
12102 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12103
12104 if (WPOOH_array)
12105 {
12106 for (int i = 0; i < WPOOH_array.Count(); i++)
12107 {
12108 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12109
12110 if (WPOOH)
12111 {
12112 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12113 }
12114 }
12115 }
12116 }
12117
12118
12119
12121 {
12123 {
12124 return true;
12125 }
12126
12127 return false;
12128 }
12129
12131 {
12133 {
12134 return true;
12135 }
12136
12137 return false;
12138 }
12139
12141 {
12143 {
12144 return true;
12145 }
12146
12147 return false;
12148 }
12149
12151 {
12152 return false;
12153 }
12154
12157 {
12158 return UATimeSpent.DEFAULT_DEPLOY;
12159 }
12160
12161
12162
12163
12165 {
12167 SetSynchDirty();
12168 }
12169
12171 {
12173 }
12174
12175
12177 {
12178 return false;
12179 }
12180
12183 {
12184 string att_type = "None";
12185
12186 if (ConfigIsExisting("soundAttType"))
12187 {
12188 att_type = ConfigGetString("soundAttType");
12189 }
12190
12192 }
12193
12195 {
12197 }
12198
12199
12200
12201
12202
12206
12208 {
12211
12213 }
12214
12215
12217 {
12219 return;
12220
12222
12225
12228
12229 SoundParameters params = new SoundParameters();
12233 }
12234
12235
12237 {
12239 return;
12240
12242 SetSynchDirty();
12243
12246 }
12247
12248
12250 {
12252 return;
12253
12255 SetSynchDirty();
12256
12259 }
12260
12262 {
12264 }
12265
12267 {
12269 }
12270
12273 {
12274 if (!
GetGame().IsDedicatedServer())
12275 {
12276 if (ConfigIsExisting("attachSoundSet"))
12277 {
12278 string cfg_path = "";
12279 string soundset = "";
12280 string type_name =
GetType();
12281
12284 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12285 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12286
12287 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12288 {
12289 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12290 {
12291 if (cfg_slot_array[i] == slot_type)
12292 {
12293 soundset = cfg_soundset_array[i];
12294 break;
12295 }
12296 }
12297 }
12298
12299 if (soundset != "")
12300 {
12301 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12303 }
12304 }
12305 }
12306 }
12307
12309 {
12310
12311 }
12312
12313 void OnApply(PlayerBase player);
12314
12316 {
12317 return 1.0;
12318 };
12319
12321 {
12323 }
12324
12326 {
12328 }
12329
12331
12333 {
12334 SetDynamicPhysicsLifeTime(0.01);
12336 }
12337
12339 {
12340 array<string> zone_names = new array<string>;
12341 GetDamageZones(zone_names);
12342 for (int i = 0; i < zone_names.Count(); i++)
12343 {
12344 SetHealthMax(zone_names.Get(i),"Health");
12345 }
12346 SetHealthMax("","Health");
12347 }
12348
12351 {
12352 float global_health = GetHealth01("","Health");
12353 array<string> zones = new array<string>;
12354 GetDamageZones(zones);
12355
12356 for (int i = 0; i < zones.Count(); i++)
12357 {
12358 SetHealth01(zones.Get(i),"Health",global_health);
12359 }
12360 }
12361
12364 {
12365 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12366 }
12367
12369 {
12370 if (!hasRootAsPlayer)
12371 {
12372 if (refParentIB)
12373 {
12374
12375 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12376 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12377
12378 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12379 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12380
12383 }
12384 else
12385 {
12386
12389 }
12390 }
12391 }
12392
12394 {
12396 {
12397 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12398 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12399 {
12400 float heatPermCoef = 1.0;
12402 while (ent)
12403 {
12404 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12405 ent = ent.GetHierarchyParent();
12406 }
12407
12408 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12409 }
12410 }
12411 }
12412
12414 {
12415
12416 EntityAI parent = GetHierarchyParent();
12417 if (!parent)
12418 {
12419 hasParent = false;
12420 hasRootAsPlayer = false;
12421 }
12422 else
12423 {
12424 hasParent = true;
12425 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12426 refParentIB =
ItemBase.Cast(parent);
12427 }
12428 }
12429
12430 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12431 {
12432
12433 }
12434
12436 {
12437
12438 return false;
12439 }
12440
12442 {
12443
12444
12445 return false;
12446 }
12447
12449 {
12450
12451 return false;
12452 }
12453
12456 {
12457 return !GetIsFrozen() &&
IsOpen();
12458 }
12459
12461 {
12462 bool hasParent = false, hasRootAsPlayer = false;
12464
12465 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12466 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12467
12468 if (wwtu || foodDecay)
12469 {
12473
12474 if (processWetness || processTemperature || processDecay)
12475 {
12477
12478 if (processWetness)
12479 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12480
12481 if (processTemperature)
12483
12484 if (processDecay)
12485 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12486 }
12487 }
12488 }
12489
12492 {
12494 }
12495
12497 {
12500
12501 return super.GetTemperatureFreezeThreshold();
12502 }
12503
12505 {
12508
12509 return super.GetTemperatureThawThreshold();
12510 }
12511
12513 {
12516
12517 return super.GetItemOverheatThreshold();
12518 }
12519
12521 {
12523 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12524
12525 return super.GetTemperatureFreezeTime();
12526 }
12527
12529 {
12531 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12532
12533 return super.GetTemperatureThawTime();
12534 }
12535
12540
12542 {
12543 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12544 }
12545
12547 {
12548 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12549 }
12550
12553 {
12555 }
12556
12558 {
12560 }
12561
12563 {
12565 }
12566
12569 {
12570 return null;
12571 }
12572
12575 {
12576 return false;
12577 }
12578
12580 {
12582 {
12585 if (!trg)
12586 {
12588 explosive = this;
12589 }
12590
12591 explosive.PairRemote(trg);
12593
12594 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12595 trg.SetPersistentPairID(persistentID);
12596 explosive.SetPersistentPairID(persistentID);
12597
12598 return true;
12599 }
12600 return false;
12601 }
12602
12605 {
12606 float ret = 1.0;
12609 ret *= GetHealth01();
12610
12611 return ret;
12612 }
12613
12614 #ifdef DEVELOPER
12615 override void SetDebugItem()
12616 {
12617 super.SetDebugItem();
12618 _itemBase = this;
12619 }
12620
12622 {
12623 string text = super.GetDebugText();
12624
12626 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12627
12628 return text;
12629 }
12630 #endif
12631
12633 {
12634 return true;
12635 }
12636
12638
12640
12642 {
12645 }
12646
12647
12655
12671}
12672
12674{
12676 if (entity)
12677 {
12678 bool is_item = entity.IsInherited(
ItemBase);
12679 if (is_item && full_quantity)
12680 {
12683 }
12684 }
12685 else
12686 {
12688 return NULL;
12689 }
12690 return entity;
12691}
12692
12694{
12695 if (item)
12696 {
12697 if (health > 0)
12698 item.SetHealth("", "", health);
12699
12700 if (item.CanHaveTemperature())
12701 {
12703 if (item.CanFreeze())
12704 item.SetFrozen(false);
12705 }
12706
12707 if (item.HasEnergyManager())
12708 {
12709 if (quantity >= 0)
12710 {
12711 item.GetCompEM().SetEnergy0To1(quantity);
12712 }
12713 else
12714 {
12716 }
12717 }
12718 else if (item.IsMagazine())
12719 {
12720 Magazine mag = Magazine.Cast(item);
12721 if (quantity >= 0)
12722 {
12723 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12724 }
12725 else
12726 {
12728 }
12729
12730 }
12731 else
12732 {
12733 if (quantity >= 0)
12734 {
12735 item.SetQuantityNormalized(quantity, false);
12736 }
12737 else
12738 {
12740 }
12741
12742 }
12743 }
12744}
12745
12746#ifdef DEVELOPER
12748#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.