7952{
7954 {
7955 return true;
7956 }
7957};
7958
7959
7960
7962{
7966
7968
7971
7972
7973
7974
7975
7984
7990
7995
8000
8021 protected bool m_IsResultOfSplit
8022
8024
8029
8030
8031
8033
8037
8038
8039
8041
8044
8045
8046
8052
8053
8061
8064
8065
8067
8068
8070
8071
8076
8077
8082
8083
8085
8086
8088 {
8093
8094 if (!
GetGame().IsDedicatedServer())
8095 {
8097 {
8099
8101 {
8103 }
8104 }
8105
8108 }
8109
8110 m_OldLocation = null;
8111
8113 {
8115 }
8116
8117 if (ConfigIsExisting("headSelectionsToHide"))
8118 {
8121 }
8122
8124 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8125 {
8127 }
8128
8130
8131 m_IsResultOfSplit = false;
8132
8134 }
8135
8137 {
8138 super.InitItemVariables();
8139
8145 m_Count = ConfigGetInt(
"count");
8146
8149
8154
8157
8162
8174
8178
8179
8182 if (ConfigIsExisting("canBeSplit"))
8183 {
8186 }
8187
8189 if (ConfigIsExisting("itemBehaviour"))
8191
8192
8195 RegisterNetSyncVariableInt("m_VarLiquidType");
8196 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8197
8198 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8199 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8200 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8201
8202 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8203 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8204 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8205 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8206
8207 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8208 RegisterNetSyncVariableBool("m_IsTakeable");
8209 RegisterNetSyncVariableBool("m_IsHologram");
8210
8213 {
8216 }
8217
8219
8221 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8223
8224 }
8225
8227 {
8229 }
8230
8232 {
8235 {
8240 }
8241 }
8242
8243 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8244 {
8246 {
8249 }
8250
8252 }
8253
8255 {
8261 }
8262
8264
8266 {
8268
8269 if (!action)
8270 {
8271 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8272 return;
8273 }
8274
8276 if (!ai)
8277 {
8279 return;
8280 }
8281
8283 if (!action_array)
8284 {
8285 action_array = new array<ActionBase_Basic>;
8287 }
8288 if (LogManager.IsActionLogEnable())
8289 {
8290 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8291 }
8292
8293 if (action_array.Find(action) != -1)
8294 {
8295 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8296 }
8297 else
8298 {
8299 action_array.Insert(action);
8300 }
8301 }
8302
8304 {
8306 ActionBase action = player.GetActionManager().GetAction(actionName);
8309
8310 if (action_array)
8311 {
8312 action_array.RemoveItem(action);
8313 }
8314 }
8315
8316
8317
8319 {
8320 ActionOverrideData overrideData = new ActionOverrideData();
8324
8326 if (!actionMap)
8327 {
8330 }
8331
8332 actionMap.Insert(this.
Type(), overrideData);
8333
8334 }
8335
8337
8339
8340
8342 {
8345
8348
8349 string config_to_search = "CfgVehicles";
8350 string muzzle_owner_config;
8351
8353 {
8354 if (IsInherited(Weapon))
8355 config_to_search = "CfgWeapons";
8356
8357 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8358
8359 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8360
8362
8363 if (config_OnFire_subclass_count > 0)
8364 {
8365 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8366
8367 for (int i = 0; i < config_OnFire_subclass_count; i++)
8368 {
8369 string particle_class = "";
8371 string config_OnFire_entry = config_OnFire_class + particle_class;
8372 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8373 WPOF_array.Insert(WPOF);
8374 }
8375
8376
8378 }
8379 }
8380
8382 {
8383 config_to_search = "CfgWeapons";
8384 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8385
8386 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8387
8389
8390 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8391 {
8392 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8393
8394 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8395 {
8396 string particle_class2 = "";
8398 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8399 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8400 WPOBE_array.Insert(WPOBE);
8401 }
8402
8403
8405 }
8406 }
8407 }
8408
8409
8411 {
8414
8416 {
8417 string config_to_search = "CfgVehicles";
8418
8419 if (IsInherited(Weapon))
8420 config_to_search = "CfgWeapons";
8421
8422 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8423 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8424
8425 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8426 {
8427
8429
8431 {
8433 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8435 return;
8436 }
8437
8440
8441
8442
8444 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8445
8446 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8447 {
8448 string particle_class = "";
8450 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8452
8453 if (entry_type == CT_CLASS)
8454 {
8455 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8456 WPOOH_array.Insert(WPOF);
8457 }
8458 }
8459
8460
8462 }
8463 }
8464 }
8465
8467 {
8469 }
8470
8472 {
8474 {
8476
8479
8482
8483 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8484 }
8485 }
8486
8488 {
8490 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8491
8493 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8494
8496 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8497
8499 {
8501 }
8502 }
8503
8505 {
8507 }
8508
8510 {
8513 else
8515
8517 {
8520 }
8521 else
8522 {
8525
8528 }
8529
8531 }
8532
8534 {
8536 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8537 }
8538
8540 {
8542 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8544 }
8545
8547 {
8549 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8550 }
8551
8553 {
8556
8557 OverheatingParticle OP = new OverheatingParticle();
8562
8564 }
8565
8567 {
8570
8571 return -1;
8572 }
8573
8575 {
8577 {
8580
8581 for (int i = count; i > 0; --i)
8582 {
8583 int id = i - 1;
8586
8589
8590 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8591 {
8592 if (p)
8593 {
8596 }
8597 }
8598 }
8599 }
8600 }
8601
8603 {
8605 {
8607 {
8608 int id = i - 1;
8610
8611 if (OP)
8612 {
8614
8615 if (p)
8616 {
8618 }
8619
8620 delete OP;
8621 }
8622 }
8623
8626 }
8627 }
8628
8631 {
8632 return 0.0;
8633 }
8634
8635
8637 {
8638 return 250;
8639 }
8640
8642 {
8643 return 0;
8644 }
8645
8648 {
8650 return true;
8651
8652 return false;
8653 }
8654
8657 {
8660
8662 {
8664 }
8665 else
8666 {
8667
8669 }
8670
8672 }
8673
8680 {
8681 return -1;
8682 }
8683
8684
8685
8686
8688 {
8690 {
8692 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8693
8694 if (r_index >= 0)
8695 {
8696 InventoryLocation r_il = new InventoryLocation;
8697 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8698
8699 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8702 {
8703 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8704 }
8706 {
8707 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8708 }
8709
8710 }
8711
8712 player.GetHumanInventory().ClearUserReservedLocation(this);
8713 }
8714
8717 }
8718
8719
8720
8721
8723 {
8724 return ItemBase.m_DebugActionsMask;
8725 }
8726
8728 {
8729 return ItemBase.m_DebugActionsMask & mask;
8730 }
8731
8733 {
8734 ItemBase.m_DebugActionsMask = mask;
8735 }
8736
8738 {
8739 ItemBase.m_DebugActionsMask |= mask;
8740 }
8741
8743 {
8744 ItemBase.m_DebugActionsMask &= ~mask;
8745 }
8746
8748 {
8750 {
8752 }
8753 else
8754 {
8756 }
8757 }
8758
8759
8761 {
8762 if (GetEconomyProfile())
8763 {
8764 float q_max = GetEconomyProfile().GetQuantityMax();
8765 if (q_max > 0)
8766 {
8767 float q_min = GetEconomyProfile().GetQuantityMin();
8768 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8769
8771 {
8772 ComponentEnergyManager comp = GetCompEM();
8774 {
8776 }
8777 }
8779 {
8781
8782 }
8783
8784 }
8785 }
8786 }
8787
8790 {
8791 EntityAI parent = GetHierarchyParent();
8792
8793 if (parent)
8794 {
8795 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8796 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8797 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8798 }
8799 }
8800
8803 {
8804 EntityAI parent = GetHierarchyParent();
8805
8806 if (parent)
8807 {
8808 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8809 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8810 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8811 }
8812 }
8813
8815 {
8816
8817
8818
8819
8821
8823 {
8824 if (ScriptInputUserData.CanStoreInputUserData())
8825 {
8826 ScriptInputUserData ctx = new ScriptInputUserData;
8832 ctx.
Write(use_stack_max);
8835
8837 {
8838 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8839 }
8840 }
8841 }
8842 else if (!
GetGame().IsMultiplayer())
8843 {
8845 }
8846 }
8847
8849 {
8851 }
8852
8854 {
8856 }
8857
8859 {
8861 }
8862
8864 {
8865
8866 return false;
8867 }
8868
8870 {
8871 return false;
8872 }
8873
8877 {
8878 return false;
8879 }
8880
8882 {
8883 return "";
8884 }
8885
8887
8889 {
8890 return false;
8891 }
8892
8894 {
8895 return true;
8896 }
8897
8898
8899
8901 {
8902 return true;
8903 }
8904
8906 {
8907 return true;
8908 }
8909
8911 {
8912 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8914 }
8915
8917 {
8919 }
8920
8922 {
8924 if (!is_being_placed)
8926 SetSynchDirty();
8927 }
8928
8929
8931
8933 {
8935 }
8936
8938 {
8940 }
8941
8943 {
8944 return 1;
8945 }
8946
8948 {
8949 return false;
8950 }
8951
8953 {
8955 SetSynchDirty();
8956 }
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8993 {
8994 super.OnMovedInsideCargo(container);
8995
8996 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8997 }
8998
8999 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9000 {
9001 super.EEItemLocationChanged(oldLoc,newLoc);
9002
9003 PlayerBase new_player = null;
9004 PlayerBase old_player = null;
9005
9006 if (newLoc.GetParent())
9007 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9008
9009 if (oldLoc.GetParent())
9010 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9011
9013 {
9014 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9015
9016 if (r_index >= 0)
9017 {
9018 InventoryLocation r_il = new InventoryLocation;
9019 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9020
9021 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9024 {
9025 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9026 }
9028 {
9029 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9030 }
9031
9032 }
9033 }
9034
9036 {
9037 if (new_player)
9038 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9039
9040 if (new_player == old_player)
9041 {
9042
9043 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9044 {
9046 {
9047 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9048 {
9049 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9050 }
9051 }
9052 else
9053 {
9054 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9055 }
9056 }
9057
9058 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9059 {
9060 int type = oldLoc.GetType();
9062 {
9063 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9064 }
9066 {
9067 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9068 }
9069 }
9070 if (!m_OldLocation)
9071 {
9072 m_OldLocation = new InventoryLocation;
9073 }
9074 m_OldLocation.Copy(oldLoc);
9075 }
9076 else
9077 {
9078 if (m_OldLocation)
9079 {
9080 m_OldLocation.Reset();
9081 }
9082 }
9083
9085 }
9086 else
9087 {
9088 if (new_player)
9089 {
9090 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9091 if (res_index >= 0)
9092 {
9093 InventoryLocation il = new InventoryLocation;
9094 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9096 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9099 {
9100 il.
GetParent().GetOnReleaseLock().Invoke(it);
9101 }
9103 {
9105 }
9106
9107 }
9108 }
9110 {
9111
9113 }
9114
9115 if (m_OldLocation)
9116 {
9117 m_OldLocation.Reset();
9118 }
9119 }
9120 }
9121
9122 override void EOnContact(IEntity other, Contact extra)
9123 {
9125 {
9126 int liquidType = -1;
9128 if (impactSpeed > 0.0)
9129 {
9131 #ifndef SERVER
9133 #else
9135 SetSynchDirty();
9136 #endif
9138 }
9139 }
9140
9141 #ifdef SERVER
9142 if (GetCompEM() && GetCompEM().IsPlugged())
9143 {
9144 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9145 GetCompEM().UnplugThis();
9146 }
9147 #endif
9148 }
9149
9151
9153 {
9155 }
9156
9158 {
9159
9160 }
9161
9163 {
9164 super.OnItemLocationChanged(old_owner, new_owner);
9165
9166 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9167 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9168
9169 if (!relatedPlayer && playerNew)
9170 relatedPlayer = playerNew;
9171
9172 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9173 {
9175 if (actionMgr)
9176 {
9177 ActionBase currentAction = actionMgr.GetRunningAction();
9178 if (currentAction)
9180 }
9181 }
9182
9183 Man ownerPlayerOld = null;
9184 Man ownerPlayerNew = null;
9185
9186 if (old_owner)
9187 {
9188 if (old_owner.
IsMan())
9189 {
9190 ownerPlayerOld = Man.Cast(old_owner);
9191 }
9192 else
9193 {
9194 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9195 }
9196 }
9197 else
9198 {
9200 {
9202
9203 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9204 {
9205 GetCompEM().UnplugThis();
9206 }
9207 }
9208 }
9209
9210 if (new_owner)
9211 {
9212 if (new_owner.
IsMan())
9213 {
9214 ownerPlayerNew = Man.Cast(new_owner);
9215 }
9216 else
9217 {
9218 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9219 }
9220 }
9221
9222 if (ownerPlayerOld != ownerPlayerNew)
9223 {
9224 if (ownerPlayerOld)
9225 {
9226 array<EntityAI> subItemsExit = new array<EntityAI>;
9228 for (int i = 0; i < subItemsExit.Count(); i++)
9229 {
9232 }
9233 }
9234
9235 if (ownerPlayerNew)
9236 {
9237 array<EntityAI> subItemsEnter = new array<EntityAI>;
9239 for (int j = 0; j < subItemsEnter.Count(); j++)
9240 {
9243 }
9244 }
9245 }
9246 else if (ownerPlayerNew != null)
9247 {
9248 PlayerBase nplayer;
9249 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9250 {
9251 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9253 for (int k = 0; k < subItemsUpdate.Count(); k++)
9254 {
9256 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9257 }
9258 }
9259 }
9260
9261 if (old_owner)
9262 old_owner.OnChildItemRemoved(this);
9263 if (new_owner)
9264 new_owner.OnChildItemReceived(this);
9265 }
9266
9267
9269 {
9270 super.EEDelete(parent);
9271 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9272 if (player)
9273 {
9275
9276 if (player.IsAlive())
9277 {
9278 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9279 if (r_index >= 0)
9280 {
9281 InventoryLocation r_il = new InventoryLocation;
9282 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9283
9284 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9287 {
9288 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9289 }
9291 {
9292 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9293 }
9294
9295 }
9296
9297 player.RemoveQuickBarEntityShortcut(this);
9298 }
9299 }
9300 }
9301
9303 {
9304 super.EEKilled(killer);
9305
9308 {
9309 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9310 {
9311 if (IsMagazine())
9312 {
9313 if (Magazine.Cast(this).GetAmmoCount() > 0)
9314 {
9316 }
9317 }
9318 else
9319 {
9321 }
9322 }
9323 }
9324 }
9325
9327 {
9328 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9329
9330 super.OnWasAttached(parent, slot_id);
9331
9334
9336 }
9337
9339 {
9340 super.OnWasDetached(parent, slot_id);
9341
9344 }
9345
9347 {
9348 int idx;
9351
9352 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9353 if (inventory_slots.Count() < 1)
9354 {
9355 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9356 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9357 }
9358 else
9359 {
9360 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9361 }
9362
9363 idx = inventory_slots.Find(slot);
9364 if (idx < 0)
9365 return "";
9366
9367 return attach_types.Get(idx);
9368 }
9369
9371 {
9372 int idx = -1;
9373 string slot;
9374
9377
9378 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9379 if (inventory_slots.Count() < 1)
9380 {
9381 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9382 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9383 }
9384 else
9385 {
9386 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9387 if (detach_types.Count() < 1)
9388 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9389 }
9390
9391 for (int i = 0; i < inventory_slots.Count(); i++)
9392 {
9393 slot = inventory_slots.Get(i);
9394 }
9395
9396 if (slot != "")
9397 {
9398 if (detach_types.Count() == 1)
9399 idx = 0;
9400 else
9401 idx = inventory_slots.Find(slot);
9402 }
9403 if (idx < 0)
9404 return "";
9405
9406 return detach_types.Get(idx);
9407 }
9408
9410 {
9411
9413
9414
9415 float min_time = 1;
9416 float max_time = 3;
9417 float delay = Math.RandomFloat(min_time, max_time);
9418
9419 explode_timer.Run(delay, this, "DoAmmoExplosion");
9420 }
9421
9423 {
9424 Magazine magazine = Magazine.Cast(this);
9425 int pop_sounds_count = 6;
9426 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9427
9428
9429 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9430 string sound_name = pop_sounds[ sound_idx ];
9432
9433
9434 magazine.ServerAddAmmoCount(-1);
9435
9436
9437 float min_temp_to_explode = 100;
9438
9439 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9440 {
9442 }
9443 }
9444
9445
9446 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9447 {
9448 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9449
9450 const int CHANCE_DAMAGE_CARGO = 4;
9451 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9452 const int CHANCE_DAMAGE_NOTHING = 2;
9453
9455 {
9456 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9457 int chances;
9458 int rnd;
9459
9460 if (GetInventory().GetCargo())
9461 {
9462 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9463 rnd = Math.RandomInt(0,chances);
9464
9465 if (rnd < CHANCE_DAMAGE_CARGO)
9466 {
9468 }
9469 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9470 {
9472 }
9473 }
9474 else
9475 {
9476 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9477 rnd = Math.RandomInt(0,chances);
9478
9479 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9480 {
9482 }
9483 }
9484 }
9485 }
9486
9488 {
9489 if (GetInventory().GetCargo())
9490 {
9491 int item_count = GetInventory().GetCargo().GetItemCount();
9492 if (item_count > 0)
9493 {
9494 int random_pick = Math.RandomInt(0, item_count);
9496 if (!item.IsExplosive())
9497 {
9498 item.AddHealth("","",damage);
9499 return true;
9500 }
9501 }
9502 }
9503 return false;
9504 }
9505
9507 {
9508 int attachment_count = GetInventory().AttachmentCount();
9509 if (attachment_count > 0)
9510 {
9511 int random_pick = Math.RandomInt(0, attachment_count);
9512 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9513 if (!attachment.IsExplosive())
9514 {
9515 attachment.AddHealth("","",damage);
9516 return true;
9517 }
9518 }
9519 return false;
9520 }
9521
9523 {
9525 }
9526
9528 {
9530 return GetInventory().CanRemoveEntity();
9531
9532 return false;
9533 }
9534
9536 {
9538 return;
9539
9541 {
9542 if (ScriptInputUserData.CanStoreInputUserData())
9543 {
9544 ScriptInputUserData ctx = new ScriptInputUserData;
9549 ctx.
Write(destination_entity);
9553 }
9554 }
9555 else if (!
GetGame().IsMultiplayer())
9556 {
9558 }
9559 }
9560
9562 {
9564 return;
9565
9566 float split_quantity_new;
9570 InventoryLocation loc = new InventoryLocation;
9571
9572 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9573 {
9575 split_quantity_new = stack_max;
9576 else
9578
9579 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9580 if (new_item)
9581 {
9582 new_item.SetResultOfSplit(true);
9583 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9585 new_item.SetQuantity(split_quantity_new);
9586 }
9587 }
9588 else if (destination_entity && slot_id == -1)
9589 {
9590 if (quantity > stack_max)
9591 split_quantity_new = stack_max;
9592 else
9593 split_quantity_new = quantity;
9594
9596 {
9599 }
9600
9601 if (new_item)
9602 {
9603 new_item.SetResultOfSplit(true);
9604 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9606 new_item.SetQuantity(split_quantity_new);
9607 }
9608 }
9609 else
9610 {
9611 if (stack_max != 0)
9612 {
9614 {
9616 }
9617
9618 if (split_quantity_new == 0)
9619 {
9620 if (!
GetGame().IsMultiplayer())
9621 player.PhysicalPredictiveDropItem(this);
9622 else
9623 player.ServerDropEntity(this);
9624 return;
9625 }
9626
9628
9629 if (new_item)
9630 {
9631 new_item.SetResultOfSplit(true);
9632 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9634 new_item.SetQuantity(stack_max);
9635 new_item.PlaceOnSurface();
9636 }
9637 }
9638 }
9639 }
9640
9642 {
9644 return;
9645
9646 float split_quantity_new;
9650 InventoryLocation loc = new InventoryLocation;
9651
9652 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9653 {
9655 split_quantity_new = stack_max;
9656 else
9658
9659 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9660 if (new_item)
9661 {
9662 new_item.SetResultOfSplit(true);
9663 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9665 new_item.SetQuantity(split_quantity_new);
9666 }
9667 }
9668 else if (destination_entity && slot_id == -1)
9669 {
9670 if (quantity > stack_max)
9671 split_quantity_new = stack_max;
9672 else
9673 split_quantity_new = quantity;
9674
9676 {
9679 }
9680
9681 if (new_item)
9682 {
9683 new_item.SetResultOfSplit(true);
9684 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9686 new_item.SetQuantity(split_quantity_new);
9687 }
9688 }
9689 else
9690 {
9691 if (stack_max != 0)
9692 {
9694 {
9696 }
9697
9699
9700 if (new_item)
9701 {
9702 new_item.SetResultOfSplit(true);
9703 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9705 new_item.SetQuantity(stack_max);
9706 new_item.PlaceOnSurface();
9707 }
9708 }
9709 }
9710 }
9711
9713 {
9715 return;
9716
9718 {
9719 if (ScriptInputUserData.CanStoreInputUserData())
9720 {
9721 ScriptInputUserData ctx = new ScriptInputUserData;
9726 dst.WriteToContext(ctx);
9728 }
9729 }
9730 else if (!
GetGame().IsMultiplayer())
9731 {
9733 }
9734 }
9735
9737 {
9739 return;
9740
9742 {
9743 if (ScriptInputUserData.CanStoreInputUserData())
9744 {
9745 ScriptInputUserData ctx = new ScriptInputUserData;
9750 ctx.
Write(destination_entity);
9756 }
9757 }
9758 else if (!
GetGame().IsMultiplayer())
9759 {
9761 }
9762 }
9763
9765 {
9767 }
9768
9770 {
9772 return this;
9773
9775 float split_quantity_new;
9777 if (dst.IsValid())
9778 {
9779 int slot_id = dst.GetSlot();
9781
9782 if (quantity > stack_max)
9783 split_quantity_new = stack_max;
9784 else
9785 split_quantity_new = quantity;
9786
9788
9789 if (new_item)
9790 {
9791 new_item.SetResultOfSplit(true);
9792 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9795 }
9796
9797 return new_item;
9798 }
9799
9800 return null;
9801 }
9802
9804 {
9806 return;
9807
9809 float split_quantity_new;
9811 if (destination_entity)
9812 {
9814 if (quantity > stackable)
9815 split_quantity_new = stackable;
9816 else
9817 split_quantity_new = quantity;
9818
9819 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9820 if (new_item)
9821 {
9822 new_item.SetResultOfSplit(true);
9823 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9825 new_item.SetQuantity(split_quantity_new);
9826 }
9827 }
9828 }
9829
9831 {
9833 return;
9834
9836 {
9837 if (ScriptInputUserData.CanStoreInputUserData())
9838 {
9839 ScriptInputUserData ctx = new ScriptInputUserData;
9844 ItemBase destination_entity =
this;
9845 ctx.
Write(destination_entity);
9849 }
9850 }
9851 else if (!
GetGame().IsMultiplayer())
9852 {
9854 }
9855 }
9856
9858 {
9860 return;
9861
9863 float split_quantity_new;
9865 if (player)
9866 {
9868 if (quantity > stackable)
9869 split_quantity_new = stackable;
9870 else
9871 split_quantity_new = quantity;
9872
9873 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9874 new_item =
ItemBase.Cast(in_hands);
9875 if (new_item)
9876 {
9877 new_item.SetResultOfSplit(true);
9878 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9880 new_item.SetQuantity(split_quantity_new);
9881 }
9882 }
9883 }
9884
9886 {
9888 return;
9889
9891 float split_quantity_new = Math.Floor(quantity * 0.5);
9892
9894
9895 if (new_item)
9896 {
9897 if (new_item.GetQuantityMax() < split_quantity_new)
9898 {
9899 split_quantity_new = new_item.GetQuantityMax();
9900 }
9901
9902 new_item.SetResultOfSplit(true);
9903 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9904
9906 {
9909 }
9910 else
9911 {
9914 }
9915 }
9916 }
9917
9919 {
9921 return;
9922
9924 float split_quantity_new = Math.Floor(quantity / 2);
9925
9926 InventoryLocation invloc = new InventoryLocation;
9928
9930 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9931
9932 if (new_item)
9933 {
9934 if (new_item.GetQuantityMax() < split_quantity_new)
9935 {
9936 split_quantity_new = new_item.GetQuantityMax();
9937 }
9939 {
9942 }
9943 else
9944 {
9947 }
9948 }
9949 }
9950
9953 {
9954 SetWeightDirty();
9956
9957 if (parent)
9958 parent.OnAttachmentQuantityChangedEx(this, delta);
9959
9961 {
9963 {
9965 }
9967 {
9968 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9970 }
9971 }
9972
9973 }
9974
9977 {
9978
9979 }
9980
9983 {
9985 }
9986
9988 {
9989 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9990
9992 {
9993 if (newLevel == GameConstants.STATE_RUINED)
9994 {
9996 EntityAI parent = GetHierarchyParent();
9997 if (parent && parent.IsFireplace())
9998 {
9999 CargoBase cargo = GetInventory().GetCargo();
10000 if (cargo)
10001 {
10003 {
10005 }
10006 }
10007 }
10008 }
10009
10011 {
10012
10014 return;
10015 }
10016
10017 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10018 {
10020 }
10021 }
10022 }
10023
10024
10026 {
10027 super.OnRightClick();
10028
10030 {
10032 {
10033 if (ScriptInputUserData.CanStoreInputUserData())
10034 {
10035 vector m4[4];
10037
10038 EntityAI root = GetHierarchyRoot();
10039
10040 InventoryLocation dst = new InventoryLocation;
10042 {
10043 if (root)
10044 {
10045 root.GetTransform(m4);
10047 }
10048 else
10049 GetInventory().GetCurrentInventoryLocation(dst);
10050 }
10051 else
10052 {
10054
10055
10056 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10057 {
10058 if (root)
10059 {
10060 root.GetTransform(m4);
10062 }
10063 else
10064 GetInventory().GetCurrentInventoryLocation(dst);
10065 }
10066 else
10067 {
10068 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10069 }
10070 }
10071
10072 ScriptInputUserData ctx = new ScriptInputUserData;
10080 }
10081 }
10082 else if (!
GetGame().IsMultiplayer())
10083 {
10085 }
10086 }
10087 }
10088
10089 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10090 {
10091
10092 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10093 return false;
10094
10095 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10096 return false;
10097
10098
10100 return false;
10101
10102
10103 Magazine mag = Magazine.Cast(this);
10104 if (mag)
10105 {
10106 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10107 return false;
10108
10109 if (stack_max_limit)
10110 {
10111 Magazine other_mag = Magazine.Cast(other_item);
10112 if (other_item)
10113 {
10114 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10115 return false;
10116 }
10117
10118 }
10119 }
10120 else
10121 {
10122
10124 return false;
10125
10127 return false;
10128 }
10129
10130 PlayerBase player = null;
10131 if (CastTo(player, GetHierarchyRootPlayer()))
10132 {
10133 if (player.GetInventory().HasAttachment(this))
10134 return false;
10135
10136 if (player.IsItemsToDelete())
10137 return false;
10138 }
10139
10140 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10141 return false;
10142
10143 int slotID;
10145 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10146 return false;
10147
10148 return true;
10149 }
10150
10152 {
10154 }
10155
10157 {
10158 return m_IsResultOfSplit;
10159 }
10160
10162 {
10163 m_IsResultOfSplit = value;
10164 }
10165
10167 {
10169 }
10170
10172 {
10173 float other_item_quantity = other_item.GetQuantity();
10174 float this_free_space;
10175
10177
10179
10180 if (other_item_quantity > this_free_space)
10181 {
10182 return this_free_space;
10183 }
10184 else
10185 {
10186 return other_item_quantity;
10187 }
10188 }
10189
10191 {
10193 }
10194
10196 {
10198 return;
10199
10200 if (!IsMagazine() && other_item)
10201 {
10203 if (quantity_used != 0)
10204 {
10205 float hp1 = GetHealth01("","");
10206 float hp2 = other_item.GetHealth01("","");
10207 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10208 hpResult = hpResult / (
GetQuantity() + quantity_used);
10209
10210 hpResult *= GetMaxHealth();
10211 Math.Round(hpResult);
10212 SetHealth("", "Health", hpResult);
10213
10215 other_item.AddQuantity(-quantity_used);
10216 }
10217 }
10219 }
10220
10222 {
10223 #ifdef SERVER
10224 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10225 GetHierarchyParent().IncreaseLifetimeUp();
10226 #endif
10227 };
10228
10230 {
10231 PlayerBase p = PlayerBase.Cast(player);
10232
10233 array<int> recipesIds = p.m_Recipes;
10234 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10235 if (moduleRecipesManager)
10236 {
10237 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10238 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10239 }
10240
10241 for (int i = 0;i < recipesIds.Count(); i++)
10242 {
10243 int key = recipesIds.Get(i);
10244 string recipeName = moduleRecipesManager.GetRecipeName(key);
10246 }
10247 }
10248
10249
10250 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10251 {
10252 super.GetDebugActions(outputList);
10253
10254
10259
10260
10264
10268
10269
10272
10273
10275 {
10278 }
10279
10281
10284
10288 }
10289
10290
10291
10292
10294 {
10295 super.OnAction(action_id, player, ctx);
10296 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10297 {
10298 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10299 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10300 PlayerBase p = PlayerBase.Cast(player);
10301 if (
EActions.RECIPES_RANGE_START < 1000)
10302 {
10303 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10304 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10305 }
10306 }
10307 #ifndef SERVER
10308 else if (action_id ==
EActions.WATCH_PLAYER)
10309 {
10310 PluginDeveloper.SetDeveloperItemClientEx(player);
10311 }
10312 #endif
10314 {
10315 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10316 {
10317 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10318 OnDebugButtonPressServer(id + 1);
10319 }
10320
10321 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10322 {
10323 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10325 }
10326
10327 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10328 {
10329 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10331 }
10332
10333 else if (action_id ==
EActions.ADD_QUANTITY)
10334 {
10335 if (IsMagazine())
10336 {
10337 Magazine mag = Magazine.Cast(this);
10338 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10339 }
10340 else
10341 {
10343 }
10344
10345 if (m_EM)
10346 {
10347 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10348 }
10349
10350 }
10351
10352 else if (action_id ==
EActions.REMOVE_QUANTITY)
10353 {
10354 if (IsMagazine())
10355 {
10356 Magazine mag2 = Magazine.Cast(this);
10357 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10358 }
10359 else
10360 {
10362 }
10363 if (m_EM)
10364 {
10365 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10366 }
10367
10368 }
10369
10370 else if (action_id ==
EActions.SET_QUANTITY_0)
10371 {
10373
10374 if (m_EM)
10375 {
10376 m_EM.SetEnergy(0);
10377 }
10378 }
10379
10380 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10381 {
10383
10384 if (m_EM)
10385 {
10386 m_EM.SetEnergy(m_EM.GetEnergyMax());
10387 }
10388 }
10389
10390 else if (action_id ==
EActions.ADD_HEALTH)
10391 {
10392 AddHealth("","",GetMaxHealth("","Health")/5);
10393 }
10394 else if (action_id ==
EActions.REMOVE_HEALTH)
10395 {
10396 AddHealth("","",-GetMaxHealth("","Health")/5);
10397 }
10398 else if (action_id ==
EActions.DESTROY_HEALTH)
10399 {
10400 SetHealth01("","",0);
10401 }
10402 else if (action_id ==
EActions.WATCH_ITEM)
10403 {
10405 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10406 #ifdef DEVELOPER
10407 SetDebugDeveloper_item(this);
10408 #endif
10409 }
10410
10411 else if (action_id ==
EActions.ADD_TEMPERATURE)
10412 {
10413 AddTemperature(20);
10414
10415 }
10416
10417 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10418 {
10419 AddTemperature(-20);
10420
10421 }
10422
10423 else if (action_id ==
EActions.FLIP_FROZEN)
10424 {
10425 SetFrozen(!GetIsFrozen());
10426
10427 }
10428
10429 else if (action_id ==
EActions.ADD_WETNESS)
10430 {
10432
10433 }
10434
10435 else if (action_id ==
EActions.REMOVE_WETNESS)
10436 {
10438
10439 }
10440
10441 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10442 {
10445
10446
10447 }
10448
10449 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10450 {
10453 }
10454
10455 else if (action_id ==
EActions.MAKE_SPECIAL)
10456 {
10457 auto debugParams = DebugSpawnParams.WithPlayer(player);
10458 OnDebugSpawnEx(debugParams);
10459 }
10460
10461 else if (action_id ==
EActions.DELETE)
10462 {
10463 Delete();
10464 }
10465
10466 }
10467
10468
10469 return false;
10470 }
10471
10472
10473
10474
10478
10481
10482
10483
10485 {
10486 return false;
10487 }
10488
10489
10491 {
10492 return true;
10493 }
10494
10495
10497 {
10498 return true;
10499 }
10500
10501
10502
10504 {
10505 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10507 }
10508
10511 {
10512 return null;
10513 }
10514
10516 {
10517 return false;
10518 }
10519
10521 {
10522 return false;
10523 }
10524
10528
10529
10531 {
10532 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10533 return module_repairing.CanRepair(this, item_repair_kit);
10534 }
10535
10536
10537 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10538 {
10539 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10540 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10541 }
10542
10543
10545 {
10546
10547
10548
10549
10550
10551
10552
10553
10554 return 1;
10555 }
10556
10557
10558
10560 {
10562 }
10563
10564
10565
10567 {
10569 }
10570
10571
10580 {
10581 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10582
10583 if (player)
10584 {
10585 player.MessageStatus(text);
10586 }
10587 }
10588
10589
10598 {
10599 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10600
10601 if (player)
10602 {
10603 player.MessageAction(text);
10604 }
10605 }
10606
10607
10616 {
10617 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10618
10619 if (player)
10620 {
10621 player.MessageFriendly(text);
10622 }
10623 }
10624
10625
10634 {
10635 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10636
10637 if (player)
10638 {
10639 player.MessageImportant(text);
10640 }
10641 }
10642
10644 {
10645 return true;
10646 }
10647
10648
10649 override bool KindOf(
string tag)
10650 {
10651 bool found = false;
10652 string item_name = this.
GetType();
10655
10656 int array_size = item_tag_array.Count();
10657 for (int i = 0; i < array_size; i++)
10658 {
10659 if (item_tag_array.Get(i) == tag)
10660 {
10661 found = true;
10662 break;
10663 }
10664 }
10665 return found;
10666 }
10667
10668
10670 {
10671
10672 super.OnRPC(sender, rpc_type,ctx);
10673
10674
10675 switch (rpc_type)
10676 {
10677 #ifndef SERVER
10678 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10679 Param2<bool, string> p = new Param2<bool, string>(false, "");
10680
10682 return;
10683
10684 bool play = p.param1;
10685 string soundSet = p.param2;
10686
10687 if (play)
10688 {
10690 {
10692 {
10694 }
10695 }
10696 else
10697 {
10699 }
10700 }
10701 else
10702 {
10704 }
10705
10706 break;
10707 #endif
10708
10709 }
10710
10712 {
10714 }
10715 }
10716
10717
10718
10719
10721 {
10722 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10723 return plugin.GetID(
name);
10724 }
10725
10727 {
10728 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10729 return plugin.GetName(id);
10730 }
10731
10734 {
10735
10736
10737 int varFlags;
10738 if (!ctx.
Read(varFlags))
10739 return;
10740
10741 if (varFlags & ItemVariableFlags.FLOAT)
10742 {
10744 }
10745 }
10746
10748 {
10749
10750 super.SerializeNumericalVars(floats_out);
10751
10752
10753
10755 {
10757 }
10758
10760 {
10762 }
10763
10765 {
10767 }
10768
10770 {
10775 }
10776
10778 {
10780 }
10781 }
10782
10784 {
10785
10786 super.DeSerializeNumericalVars(floats);
10787
10788
10789 int index = 0;
10790 int mask = Math.Round(floats.Get(index));
10791
10792 index++;
10793
10795 {
10797 {
10799 }
10800 else
10801 {
10802 float quantity = floats.Get(index);
10803 SetQuantity(quantity,
true,
false,
false,
false);
10804 }
10805 index++;
10806 }
10807
10809 {
10810 float wet = floats.Get(index);
10812 index++;
10813 }
10814
10816 {
10817 int liquidtype = Math.Round(floats.Get(index));
10819 index++;
10820 }
10821
10823 {
10825 index++;
10827 index++;
10829 index++;
10831 index++;
10832 }
10833
10835 {
10836 int cleanness = Math.Round(floats.Get(index));
10838 index++;
10839 }
10840 }
10841
10843 {
10844 super.WriteVarsToCTX(ctx);
10845
10846
10848 {
10850 }
10851
10853 {
10855 }
10856
10858 {
10860 }
10861
10863 {
10864 int r,g,b,a;
10870 }
10871
10873 {
10875 }
10876 }
10877
10879 {
10880 if (!super.ReadVarsFromCTX(ctx,version))
10881 return false;
10882
10883 int intValue;
10884 float value;
10885
10886 if (version < 140)
10887 {
10888 if (!ctx.
Read(intValue))
10889 return false;
10890
10891 m_VariablesMask = intValue;
10892 }
10893
10895 {
10896 if (!ctx.
Read(value))
10897 return false;
10898
10900 {
10902 }
10903 else
10904 {
10906 }
10907 }
10908
10909 if (version < 140)
10910 {
10912 {
10913 if (!ctx.
Read(value))
10914 return false;
10915 SetTemperatureDirect(value);
10916 }
10917 }
10918
10920 {
10921 if (!ctx.
Read(value))
10922 return false;
10924 }
10925
10927 {
10928 if (!ctx.
Read(intValue))
10929 return false;
10931 }
10932
10934 {
10935 int r,g,b,a;
10937 return false;
10939 return false;
10941 return false;
10943 return false;
10944
10946 }
10947
10949 {
10950 if (!ctx.
Read(intValue))
10951 return false;
10953 }
10954
10955 if (version >= 138 && version < 140)
10956 {
10958 {
10959 if (!ctx.
Read(intValue))
10960 return false;
10961 SetFrozen(intValue);
10962 }
10963 }
10964
10965 return true;
10966 }
10967
10968
10970 {
10973 {
10975 }
10976
10977 if (!super.OnStoreLoad(ctx, version))
10978 {
10980 return false;
10981 }
10982
10983 if (version >= 114)
10984 {
10985 bool hasQuickBarIndexSaved;
10986
10987 if (!ctx.
Read(hasQuickBarIndexSaved))
10988 {
10990 return false;
10991 }
10992
10993 if (hasQuickBarIndexSaved)
10994 {
10995 int itmQBIndex;
10996
10997
10998 if (!ctx.
Read(itmQBIndex))
10999 {
11001 return false;
11002 }
11003
11004 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11005 if (itmQBIndex != -1 && parentPlayer)
11006 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11007 }
11008 }
11009 else
11010 {
11011
11012 PlayerBase player;
11013 int itemQBIndex;
11014 if (version ==
int.
MAX)
11015 {
11016 if (!ctx.
Read(itemQBIndex))
11017 {
11019 return false;
11020 }
11021 }
11022 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11023 {
11024
11025 if (!ctx.
Read(itemQBIndex))
11026 {
11028 return false;
11029 }
11030 if (itemQBIndex != -1 && player)
11031 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11032 }
11033 }
11034
11035 if (version < 140)
11036 {
11037
11038 if (!LoadVariables(ctx, version))
11039 {
11041 return false;
11042 }
11043 }
11044
11045
11047 {
11049 return false;
11050 }
11051 if (version >= 132)
11052 {
11054 if (raib)
11055 {
11057 {
11059 return false;
11060 }
11061 }
11062 }
11063
11065 return true;
11066 }
11067
11068
11069
11071 {
11072 super.OnStoreSave(ctx);
11073
11074 PlayerBase player;
11075 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11076 {
11078
11079 int itemQBIndex = -1;
11080 itemQBIndex = player.FindQuickBarEntityIndex(this);
11081 ctx.
Write(itemQBIndex);
11082 }
11083 else
11084 {
11086 }
11087
11089
11091 if (raib)
11092 {
11094 }
11095 }
11096
11097
11099 {
11100 super.AfterStoreLoad();
11101
11103 {
11105 }
11106
11108 {
11111 }
11112 }
11113
11115 {
11116 super.EEOnAfterLoad();
11117
11119 {
11121 }
11122
11125 }
11126
11128 {
11129 return false;
11130 }
11131
11132
11133
11135 {
11137 {
11138 #ifdef PLATFORM_CONSOLE
11139
11141 {
11143 if (menu)
11144 {
11146 }
11147 }
11148 #endif
11149 }
11150
11152 {
11155 }
11156
11158 {
11159 SetWeightDirty();
11161 }
11163 {
11166 }
11167
11169 {
11172 }
11174 {
11177 }
11178
11179 super.OnVariablesSynchronized();
11180 }
11181
11182
11183
11185 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11186 {
11187 if (!IsServerCheck(allow_client))
11188 return false;
11189
11191 return false;
11192
11195
11196 if (value <= (min + 0.001))
11197 value = min;
11198
11199 if (value == min)
11200 {
11201 if (destroy_config)
11202 {
11203 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11204 if (dstr)
11205 {
11207 this.Delete();
11208 return true;
11209 }
11210 }
11211 else if (destroy_forced)
11212 {
11214 this.Delete();
11215 return true;
11216 }
11217
11219 }
11220
11223
11225 {
11227
11228 if (delta)
11230 }
11231
11233
11234 return false;
11235 }
11236
11237
11239 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11240 {
11242 }
11243
11245 {
11248 }
11249
11251 {
11254 }
11255
11258 {
11259 float value_clamped = Math.Clamp(value, 0, 1);
11261 SetQuantity(result, destroy_config, destroy_forced);
11262 }
11263
11264
11267 {
11269 }
11270
11272 {
11274 }
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11286 {
11287 int slot = -1;
11288 if (GetInventory())
11289 {
11290 InventoryLocation il = new InventoryLocation;
11291 GetInventory().GetCurrentInventoryLocation(il);
11293 }
11294
11296 }
11297
11299 {
11300 float quantity_max = 0;
11301
11303 {
11304 if (attSlotID != -1)
11305 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11306
11307 if (quantity_max <= 0)
11309 }
11310
11311 if (quantity_max <= 0)
11313
11314 return quantity_max;
11315 }
11316
11318 {
11320 }
11321
11323 {
11325 }
11326
11327
11329 {
11331 }
11332
11334 {
11336 }
11337
11339 {
11341 }
11342
11343
11345 {
11346
11347 float weightEx = GetWeightEx();
11348 float special = GetInventoryAndCargoWeight();
11349 return weightEx - special;
11350 }
11351
11352
11354 {
11356 }
11357
11359 {
11361 {
11362 #ifdef DEVELOPER
11363 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11364 {
11365 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11367 }
11368 #endif
11369
11370 return GetQuantity() * GetConfigWeightModified();
11371 }
11372 else if (HasEnergyManager())
11373 {
11374 #ifdef DEVELOPER
11375 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11376 {
11377 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11378 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11379 }
11380 #endif
11381 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11382 }
11383 else
11384 {
11385 #ifdef DEVELOPER
11386 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11387 {
11388 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11389 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11390 }
11391 #endif
11392 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11393 }
11394 }
11395
11398 {
11399 int item_count = 0;
11401
11402 if (GetInventory().GetCargo() != NULL)
11403 {
11404 item_count = GetInventory().GetCargo().GetItemCount();
11405 }
11406
11407 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11408 {
11409 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11410 if (item)
11411 item_count += item.GetNumberOfItems();
11412 }
11413 return item_count;
11414 }
11415
11418 {
11419 float weight = 0;
11420 float wetness = 1;
11421 if (include_wetness)
11424 {
11425 weight = wetness * m_ConfigWeight;
11426 }
11428 {
11429 weight = 1;
11430 }
11431 return weight;
11432 }
11433
11434
11435
11437 {
11438 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11439 {
11440 GameInventory inv = GetInventory();
11441 array<EntityAI> items = new array<EntityAI>;
11443 for (int i = 0; i < items.Count(); i++)
11444 {
11446 if (item)
11447 {
11449 }
11450 }
11451 }
11452 }
11453
11454
11455
11456
11458 {
11459 float energy = 0;
11460 if (HasEnergyManager())
11461 {
11462 energy = GetCompEM().GetEnergy();
11463 }
11464 return energy;
11465 }
11466
11467
11469 {
11470 super.OnEnergyConsumed();
11471
11473 }
11474
11476 {
11477 super.OnEnergyAdded();
11478
11480 }
11481
11482
11484 {
11485 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11486 {
11488 {
11489 float energy_0to1 = GetCompEM().GetEnergy0To1();
11491 }
11492 }
11493 }
11494
11495
11497 {
11498 return ConfigGetFloat("heatIsolation");
11499 }
11500
11502 {
11504 }
11505
11507 {
11508 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11509 if (
GetGame().ConfigIsExisting(paramPath))
11511
11512 return 0.0;
11513 }
11514
11516 {
11517 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11518 if (
GetGame().ConfigIsExisting(paramPath))
11520
11521 return 0.0;
11522 }
11523
11524 override void SetWet(
float value,
bool allow_client =
false)
11525 {
11526 if (!IsServerCheck(allow_client))
11527 return;
11528
11531
11533
11534 m_VarWet = Math.Clamp(value, min, max);
11535
11537 {
11540 }
11541 }
11542
11543 override void AddWet(
float value)
11544 {
11546 }
11547
11549 {
11551 }
11552
11554 {
11556 }
11557
11559 {
11561 }
11562
11564 {
11566 }
11567
11569 {
11571 }
11572
11573 override void OnWetChanged(
float newVal,
float oldVal)
11574 {
11577 if (newLevel != oldLevel)
11578 {
11580 }
11581 }
11582
11584 {
11585 SetWeightDirty();
11586 }
11587
11589 {
11590 return GetWetLevelInternal(
m_VarWet);
11591 }
11592
11593
11594
11596 {
11598 }
11599
11601 {
11603 }
11604
11606 {
11608 }
11609
11611 {
11613 }
11614
11615
11616
11618 {
11619 if (ConfigIsExisting("itemModelLength"))
11620 {
11621 return ConfigGetFloat("itemModelLength");
11622 }
11623 return 0;
11624 }
11625
11627 {
11628 if (ConfigIsExisting("itemAttachOffset"))
11629 {
11630 return ConfigGetFloat("itemAttachOffset");
11631 }
11632 return 0;
11633 }
11634
11635 override void SetCleanness(
int value,
bool allow_client =
false)
11636 {
11637 if (!IsServerCheck(allow_client))
11638 return;
11639
11641
11643
11646 }
11647
11649 {
11651 }
11652
11654 {
11655 return true;
11656 }
11657
11658
11659
11660
11662 {
11664 }
11665
11667 {
11669 }
11670
11671
11672
11673
11674 override void SetColor(
int r,
int g,
int b,
int a)
11675 {
11681 }
11683 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11684 {
11689 }
11690
11692 {
11694 }
11695
11698 {
11699 int r,g,b,a;
11701 r = r/255;
11702 g = g/255;
11703 b = b/255;
11704 a = a/255;
11705 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11706 }
11707
11708
11709
11710 override void SetLiquidType(
int value,
bool allow_client =
false)
11711 {
11712 if (!IsServerCheck(allow_client))
11713 return;
11714
11719 }
11720
11722 {
11723 return ConfigGetInt("varLiquidTypeInit");
11724 }
11725
11727 {
11729 }
11730
11732 {
11734 SetFrozen(false);
11735 }
11736
11739 {
11740 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11741 }
11742
11743
11746 {
11747 PlayerBase nplayer;
11748 if (PlayerBase.CastTo(nplayer, player))
11749 {
11751
11752 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11753 }
11754 }
11755
11756
11759 {
11760 PlayerBase nplayer;
11761 if (PlayerBase.CastTo(nplayer,player))
11762 {
11763
11764 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11765
11766 }
11767
11768
11769 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11770
11771
11772 if (HasEnergyManager())
11773 {
11774 GetCompEM().UpdatePlugState();
11775 }
11776 }
11777
11778
11780 {
11781 super.OnPlacementStarted(player);
11782
11784 }
11785
11786 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11787 {
11789 {
11790 m_AdminLog.OnPlacementComplete(player,
this);
11791 }
11792
11793 super.OnPlacementComplete(player, position, orientation);
11794 }
11795
11796
11797
11798
11799
11801 {
11803 {
11804 return true;
11805 }
11806 else
11807 {
11808 return false;
11809 }
11810 }
11811
11812
11814 {
11816 {
11818 }
11819 }
11820
11821
11823 {
11825 }
11826
11828 {
11830 }
11831
11832 override void InsertAgent(
int agent,
float count = 1)
11833 {
11834 if (count < 1)
11835 return;
11836
11838 }
11839
11842 {
11844 }
11845
11846
11848 {
11850 }
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11894 {
11896 return false;
11897 return true;
11898 }
11899
11901 {
11902
11904 }
11905
11906
11909 {
11910 super.CheckForRoofLimited(timeTresholdMS);
11911
11913 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11914 {
11915 m_PreviousRoofTestTime = time;
11916 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11917 }
11918 }
11919
11920
11922 {
11924 {
11925 return 0;
11926 }
11927
11928 if (GetInventory().GetAttachmentSlotsCount() != 0)
11929 {
11930 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11931 if (filter)
11932 return filter.GetProtectionLevel(type, false, system);
11933 else
11934 return 0;
11935 }
11936
11937 string subclassPath, entryName;
11938
11939 switch (type)
11940 {
11942 entryName = "biological";
11943 break;
11945 entryName = "chemical";
11946 break;
11947 default:
11948 entryName = "biological";
11949 break;
11950 }
11951
11952 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11953
11955 }
11956
11957
11958
11961 {
11962 if (!IsMagazine())
11964
11966 }
11967
11968
11969
11970
11971
11976 {
11977 return true;
11978 }
11979
11981 {
11983 }
11984
11985
11986
11987
11988
11990 {
11991 if (parent)
11992 {
11993 if (parent.IsInherited(DayZInfected))
11994 return true;
11995
11996 if (!parent.IsRuined())
11997 return true;
11998 }
11999
12000 return true;
12001 }
12002
12004 {
12005 if (!super.CanPutAsAttachment(parent))
12006 {
12007 return false;
12008 }
12009
12010 if (!IsRuined() && !parent.IsRuined())
12011 {
12012 return true;
12013 }
12014
12015 return false;
12016 }
12017
12019 {
12020
12021
12022
12023
12024 return super.CanReceiveItemIntoCargo(item);
12025 }
12026
12028 {
12029
12030
12031
12032
12033 GameInventory attachmentInv = attachment.GetInventory();
12035 {
12036 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12037 return false;
12038 }
12039
12040 InventoryLocation loc = new InventoryLocation();
12041 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12042 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12043 return false;
12044
12045 return super.CanReceiveAttachment(attachment, slotId);
12046 }
12047
12049 {
12050 if (!super.CanReleaseAttachment(attachment))
12051 return false;
12052
12053 return GetInventory().AreChildrenAccessible();
12054 }
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12077 {
12078 int id = muzzle_owner.GetMuzzleID();
12079 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12080
12081 if (WPOF_array)
12082 {
12083 for (int i = 0; i < WPOF_array.Count(); i++)
12084 {
12085 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12086
12087 if (WPOF)
12088 {
12089 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12090 }
12091 }
12092 }
12093 }
12094
12095
12097 {
12098 int id = muzzle_owner.GetMuzzleID();
12100
12101 if (WPOBE_array)
12102 {
12103 for (int i = 0; i < WPOBE_array.Count(); i++)
12104 {
12105 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12106
12107 if (WPOBE)
12108 {
12109 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12110 }
12111 }
12112 }
12113 }
12114
12115
12117 {
12118 int id = muzzle_owner.GetMuzzleID();
12119 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12120
12121 if (WPOOH_array)
12122 {
12123 for (int i = 0; i < WPOOH_array.Count(); i++)
12124 {
12125 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12126
12127 if (WPOOH)
12128 {
12129 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12130 }
12131 }
12132 }
12133 }
12134
12135
12137 {
12138 int id = muzzle_owner.GetMuzzleID();
12139 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12140
12141 if (WPOOH_array)
12142 {
12143 for (int i = 0; i < WPOOH_array.Count(); i++)
12144 {
12145 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12146
12147 if (WPOOH)
12148 {
12149 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12150 }
12151 }
12152 }
12153 }
12154
12155
12157 {
12158 int id = muzzle_owner.GetMuzzleID();
12159 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12160
12161 if (WPOOH_array)
12162 {
12163 for (int i = 0; i < WPOOH_array.Count(); i++)
12164 {
12165 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12166
12167 if (WPOOH)
12168 {
12169 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12170 }
12171 }
12172 }
12173 }
12174
12175
12176
12178 {
12180 {
12181 return true;
12182 }
12183
12184 return false;
12185 }
12186
12188 {
12190 {
12191 return true;
12192 }
12193
12194 return false;
12195 }
12196
12198 {
12200 {
12201 return true;
12202 }
12203
12204 return false;
12205 }
12206
12208 {
12209 return false;
12210 }
12211
12214 {
12215 return UATimeSpent.DEFAULT_DEPLOY;
12216 }
12217
12218
12219
12220
12222 {
12224 SetSynchDirty();
12225 }
12226
12228 {
12230 }
12231
12232
12234 {
12235 return false;
12236 }
12237
12240 {
12241 string att_type = "None";
12242
12243 if (ConfigIsExisting("soundAttType"))
12244 {
12245 att_type = ConfigGetString("soundAttType");
12246 }
12247
12249 }
12250
12252 {
12254 }
12255
12256
12257
12258
12259
12263
12265 {
12268
12270 }
12271
12272
12274 {
12276 return;
12277
12279
12282
12285
12286 SoundParameters params = new SoundParameters();
12290 }
12291
12292
12294 {
12296 return;
12297
12299 SetSynchDirty();
12300
12303 }
12304
12305
12307 {
12309 return;
12310
12312 SetSynchDirty();
12313
12316 }
12317
12319 {
12321 }
12322
12324 {
12326 }
12327
12330 {
12331 if (!
GetGame().IsDedicatedServer())
12332 {
12333 if (ConfigIsExisting("attachSoundSet"))
12334 {
12335 string cfg_path = "";
12336 string soundset = "";
12337 string type_name =
GetType();
12338
12341 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12342 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12343
12344 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12345 {
12346 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12347 {
12348 if (cfg_slot_array[i] == slot_type)
12349 {
12350 soundset = cfg_soundset_array[i];
12351 break;
12352 }
12353 }
12354 }
12355
12356 if (soundset != "")
12357 {
12358 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12360 }
12361 }
12362 }
12363 }
12364
12366 {
12367
12368 }
12369
12370 void OnApply(PlayerBase player);
12371
12373 {
12374 return 1.0;
12375 };
12376
12378 {
12380 }
12381
12383 {
12385 }
12386
12388
12390 {
12391 SetDynamicPhysicsLifeTime(0.01);
12393 }
12394
12396 {
12397 array<string> zone_names = new array<string>;
12398 GetDamageZones(zone_names);
12399 for (int i = 0; i < zone_names.Count(); i++)
12400 {
12401 SetHealthMax(zone_names.Get(i),"Health");
12402 }
12403 SetHealthMax("","Health");
12404 }
12405
12408 {
12409 float global_health = GetHealth01("","Health");
12410 array<string> zones = new array<string>;
12411 GetDamageZones(zones);
12412
12413 for (int i = 0; i < zones.Count(); i++)
12414 {
12415 SetHealth01(zones.Get(i),"Health",global_health);
12416 }
12417 }
12418
12421 {
12422 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12423 }
12424
12426 {
12427 if (!hasRootAsPlayer)
12428 {
12429 if (refParentIB)
12430 {
12431
12432 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12433 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12434
12435 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12436 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12437
12440 }
12441 else
12442 {
12443
12446 }
12447 }
12448 }
12449
12451 {
12453 {
12454 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12455 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12456 {
12457 float heatPermCoef = 1.0;
12459 while (ent)
12460 {
12461 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12462 ent = ent.GetHierarchyParent();
12463 }
12464
12465 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12466 }
12467 }
12468 }
12469
12471 {
12472
12473 EntityAI parent = GetHierarchyParent();
12474 if (!parent)
12475 {
12476 hasParent = false;
12477 hasRootAsPlayer = false;
12478 }
12479 else
12480 {
12481 hasParent = true;
12482 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12483 refParentIB =
ItemBase.Cast(parent);
12484 }
12485 }
12486
12487 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12488 {
12489
12490 }
12491
12493 {
12494
12495 return false;
12496 }
12497
12499 {
12500
12501
12502 return false;
12503 }
12504
12506 {
12507
12508 return false;
12509 }
12510
12513 {
12514 return !GetIsFrozen() &&
IsOpen();
12515 }
12516
12518 {
12519 bool hasParent = false, hasRootAsPlayer = false;
12521
12522 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12523 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12524
12525 if (wwtu || foodDecay)
12526 {
12530
12531 if (processWetness || processTemperature || processDecay)
12532 {
12534
12535 if (processWetness)
12536 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12537
12538 if (processTemperature)
12540
12541 if (processDecay)
12542 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12543 }
12544 }
12545 }
12546
12549 {
12551 }
12552
12554 {
12557
12558 return super.GetTemperatureFreezeThreshold();
12559 }
12560
12562 {
12565
12566 return super.GetTemperatureThawThreshold();
12567 }
12568
12570 {
12573
12574 return super.GetItemOverheatThreshold();
12575 }
12576
12578 {
12580 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12581
12582 return super.GetTemperatureFreezeTime();
12583 }
12584
12586 {
12588 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12589
12590 return super.GetTemperatureThawTime();
12591 }
12592
12597
12599 {
12600 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12601 }
12602
12604 {
12605 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12606 }
12607
12610 {
12612 }
12613
12615 {
12617 }
12618
12620 {
12622 }
12623
12626 {
12627 return null;
12628 }
12629
12632 {
12633 return false;
12634 }
12635
12637 {
12639 {
12642 if (!trg)
12643 {
12645 explosive = this;
12646 }
12647
12648 explosive.PairRemote(trg);
12650
12651 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12652 trg.SetPersistentPairID(persistentID);
12653 explosive.SetPersistentPairID(persistentID);
12654
12655 return true;
12656 }
12657 return false;
12658 }
12659
12662 {
12663 float ret = 1.0;
12666 ret *= GetHealth01();
12667
12668 return ret;
12669 }
12670
12671 #ifdef DEVELOPER
12672 override void SetDebugItem()
12673 {
12674 super.SetDebugItem();
12675 _itemBase = this;
12676 }
12677
12679 {
12680 string text = super.GetDebugText();
12681
12683 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12684
12685 return text;
12686 }
12687 #endif
12688
12690 {
12691 return true;
12692 }
12693
12695
12697
12699 {
12702 }
12703
12704
12712
12728}
12729
12731{
12733 if (entity)
12734 {
12735 bool is_item = entity.IsInherited(
ItemBase);
12736 if (is_item && full_quantity)
12737 {
12740 }
12741 }
12742 else
12743 {
12745 return NULL;
12746 }
12747 return entity;
12748}
12749
12751{
12752 if (item)
12753 {
12754 if (health > 0)
12755 item.SetHealth("", "", health);
12756
12757 if (item.CanHaveTemperature())
12758 {
12760 if (item.CanFreeze())
12761 item.SetFrozen(false);
12762 }
12763
12764 if (item.HasEnergyManager())
12765 {
12766 if (quantity >= 0)
12767 {
12768 item.GetCompEM().SetEnergy0To1(quantity);
12769 }
12770 else
12771 {
12773 }
12774 }
12775 else if (item.IsMagazine())
12776 {
12777 Magazine mag = Magazine.Cast(item);
12778 if (quantity >= 0)
12779 {
12780 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12781 }
12782 else
12783 {
12785 }
12786
12787 }
12788 else
12789 {
12790 if (quantity >= 0)
12791 {
12792 item.SetQuantityNormalized(quantity, false);
12793 }
12794 else
12795 {
12797 }
12798
12799 }
12800 }
12801}
12802
12803#ifdef DEVELOPER
12805#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.