7939{
7941 {
7942 return true;
7943 }
7944};
7945
7946
7947
7949{
7953
7955
7958
7959
7960
7961
7962
7971
7977
7982
7987
8008 protected bool m_IsResultOfSplit
8009
8011
8016
8017
8018
8020
8024
8025
8026
8028
8031
8032
8033
8039
8040
8048
8051
8052
8054
8055
8057
8058
8063
8064
8069
8070
8072
8073
8075 {
8080
8081 if (!
GetGame().IsDedicatedServer())
8082 {
8084 {
8086
8088 {
8090 }
8091 }
8092
8095 }
8096
8097 m_OldLocation = null;
8098
8100 {
8102 }
8103
8104 if (ConfigIsExisting("headSelectionsToHide"))
8105 {
8108 }
8109
8111 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8112 {
8114 }
8115
8117
8118 m_IsResultOfSplit = false;
8119
8121 }
8122
8124 {
8125 super.InitItemVariables();
8126
8132 m_Count = ConfigGetInt(
"count");
8133
8136
8141
8144
8149
8161
8165
8166
8169 if (ConfigIsExisting("canBeSplit"))
8170 {
8173 }
8174
8176 if (ConfigIsExisting("itemBehaviour"))
8178
8179
8182 RegisterNetSyncVariableInt("m_VarLiquidType");
8183 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8184
8185 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8186 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8187 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8188
8189 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8190 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8191 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8192 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8193
8194 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8195 RegisterNetSyncVariableBool("m_IsTakeable");
8196 RegisterNetSyncVariableBool("m_IsHologram");
8197
8200 {
8203 }
8204
8206
8208 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8210
8211 }
8212
8214 {
8216 }
8217
8219 {
8222 {
8227 }
8228 }
8229
8230 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8231 {
8233 {
8236 }
8237
8239 }
8240
8242 {
8248 }
8249
8251
8253 {
8255
8256 if (!action)
8257 {
8258 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8259 return;
8260 }
8261
8263 if (!ai)
8264 {
8266 return;
8267 }
8268
8270 if (!action_array)
8271 {
8272 action_array = new array<ActionBase_Basic>;
8274 }
8275 if (LogManager.IsActionLogEnable())
8276 {
8277 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8278 }
8279
8280 if (action_array.Find(action) != -1)
8281 {
8282 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8283 }
8284 else
8285 {
8286 action_array.Insert(action);
8287 }
8288 }
8289
8291 {
8293 ActionBase action = player.GetActionManager().GetAction(actionName);
8296
8297 if (action_array)
8298 {
8299 action_array.RemoveItem(action);
8300 }
8301 }
8302
8303
8304
8306 {
8307 ActionOverrideData overrideData = new ActionOverrideData();
8311
8313 if (!actionMap)
8314 {
8317 }
8318
8319 actionMap.Insert(this.
Type(), overrideData);
8320
8321 }
8322
8324
8326
8327
8329 {
8332
8335
8336 string config_to_search = "CfgVehicles";
8337 string muzzle_owner_config;
8338
8340 {
8341 if (IsInherited(Weapon))
8342 config_to_search = "CfgWeapons";
8343
8344 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8345
8346 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8347
8349
8350 if (config_OnFire_subclass_count > 0)
8351 {
8352 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8353
8354 for (int i = 0; i < config_OnFire_subclass_count; i++)
8355 {
8356 string particle_class = "";
8358 string config_OnFire_entry = config_OnFire_class + particle_class;
8359 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8360 WPOF_array.Insert(WPOF);
8361 }
8362
8363
8365 }
8366 }
8367
8369 {
8370 config_to_search = "CfgWeapons";
8371 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8372
8373 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8374
8376
8377 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8378 {
8379 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8380
8381 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8382 {
8383 string particle_class2 = "";
8385 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8386 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8387 WPOBE_array.Insert(WPOBE);
8388 }
8389
8390
8392 }
8393 }
8394 }
8395
8396
8398 {
8401
8403 {
8404 string config_to_search = "CfgVehicles";
8405
8406 if (IsInherited(Weapon))
8407 config_to_search = "CfgWeapons";
8408
8409 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8410 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8411
8412 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8413 {
8414
8416
8418 {
8420 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8422 return;
8423 }
8424
8427
8428
8429
8431 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8432
8433 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8434 {
8435 string particle_class = "";
8437 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8439
8440 if (entry_type == CT_CLASS)
8441 {
8442 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8443 WPOOH_array.Insert(WPOF);
8444 }
8445 }
8446
8447
8449 }
8450 }
8451 }
8452
8454 {
8456 }
8457
8459 {
8461 {
8463
8466
8469
8470 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8471 }
8472 }
8473
8475 {
8477 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8478
8480 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8481
8483 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8484
8486 {
8488 }
8489 }
8490
8492 {
8494 }
8495
8497 {
8500 else
8502
8504 {
8507 }
8508 else
8509 {
8512
8515 }
8516
8518 }
8519
8521 {
8523 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8524 }
8525
8527 {
8529 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8531 }
8532
8534 {
8536 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8537 }
8538
8540 {
8543
8544 OverheatingParticle OP = new OverheatingParticle();
8549
8551 }
8552
8554 {
8557
8558 return -1;
8559 }
8560
8562 {
8564 {
8567
8568 for (int i = count; i > 0; --i)
8569 {
8570 int id = i - 1;
8573
8576
8577 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8578 {
8579 if (p)
8580 {
8583 }
8584 }
8585 }
8586 }
8587 }
8588
8590 {
8592 {
8594 {
8595 int id = i - 1;
8597
8598 if (OP)
8599 {
8601
8602 if (p)
8603 {
8605 }
8606
8607 delete OP;
8608 }
8609 }
8610
8613 }
8614 }
8615
8618 {
8619 return 0.0;
8620 }
8621
8622
8624 {
8625 return 250;
8626 }
8627
8629 {
8630 return 0;
8631 }
8632
8635 {
8637 return true;
8638
8639 return false;
8640 }
8641
8644 {
8647
8649 {
8651 }
8652 else
8653 {
8654
8656 }
8657
8659 }
8660
8667 {
8668 return -1;
8669 }
8670
8671
8672
8673
8675 {
8677 {
8679 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8680
8681 if (r_index >= 0)
8682 {
8683 InventoryLocation r_il = new InventoryLocation;
8684 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8685
8686 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8689 {
8690 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8691 }
8693 {
8694 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8695 }
8696
8697 }
8698
8699 player.GetHumanInventory().ClearUserReservedLocation(this);
8700 }
8701
8704 }
8705
8706
8707
8708
8710 {
8711 return ItemBase.m_DebugActionsMask;
8712 }
8713
8715 {
8716 return ItemBase.m_DebugActionsMask & mask;
8717 }
8718
8720 {
8721 ItemBase.m_DebugActionsMask = mask;
8722 }
8723
8725 {
8726 ItemBase.m_DebugActionsMask |= mask;
8727 }
8728
8730 {
8731 ItemBase.m_DebugActionsMask &= ~mask;
8732 }
8733
8735 {
8737 {
8739 }
8740 else
8741 {
8743 }
8744 }
8745
8746
8748 {
8749 if (GetEconomyProfile())
8750 {
8751 float q_max = GetEconomyProfile().GetQuantityMax();
8752 if (q_max > 0)
8753 {
8754 float q_min = GetEconomyProfile().GetQuantityMin();
8755 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8756
8758 {
8759 ComponentEnergyManager comp = GetCompEM();
8761 {
8763 }
8764 }
8766 {
8768
8769 }
8770
8771 }
8772 }
8773 }
8774
8777 {
8778 EntityAI parent = GetHierarchyParent();
8779
8780 if (parent)
8781 {
8782 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8783 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8784 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8785 }
8786 }
8787
8790 {
8791 EntityAI parent = GetHierarchyParent();
8792
8793 if (parent)
8794 {
8795 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8796 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8797 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8798 }
8799 }
8800
8802 {
8803
8804
8805
8806
8808
8810 {
8811 if (ScriptInputUserData.CanStoreInputUserData())
8812 {
8813 ScriptInputUserData ctx = new ScriptInputUserData;
8819 ctx.
Write(use_stack_max);
8822
8824 {
8825 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8826 }
8827 }
8828 }
8829 else if (!
GetGame().IsMultiplayer())
8830 {
8832 }
8833 }
8834
8836 {
8838 }
8839
8841 {
8843 }
8844
8846 {
8848 }
8849
8851 {
8852
8853 return false;
8854 }
8855
8857 {
8858 return false;
8859 }
8860
8864 {
8865 return false;
8866 }
8867
8869 {
8870 return "";
8871 }
8872
8874
8876 {
8877 return false;
8878 }
8879
8881 {
8882 return true;
8883 }
8884
8885
8886
8888 {
8889 return true;
8890 }
8891
8893 {
8894 return true;
8895 }
8896
8898 {
8899 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8901 }
8902
8904 {
8906 }
8907
8909 {
8911 if (!is_being_placed)
8913 SetSynchDirty();
8914 }
8915
8916
8918
8920 {
8922 }
8923
8925 {
8927 }
8928
8930 {
8931 return 1;
8932 }
8933
8935 {
8936 return false;
8937 }
8938
8940 {
8942 SetSynchDirty();
8943 }
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8980 {
8981 super.OnMovedInsideCargo(container);
8982
8983 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8984 }
8985
8986 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8987 {
8988 super.EEItemLocationChanged(oldLoc,newLoc);
8989
8990 PlayerBase new_player = null;
8991 PlayerBase old_player = null;
8992
8993 if (newLoc.GetParent())
8994 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8995
8996 if (oldLoc.GetParent())
8997 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8998
9000 {
9001 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9002
9003 if (r_index >= 0)
9004 {
9005 InventoryLocation r_il = new InventoryLocation;
9006 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9007
9008 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9011 {
9012 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9013 }
9015 {
9016 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9017 }
9018
9019 }
9020 }
9021
9023 {
9024 if (new_player)
9025 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9026
9027 if (new_player == old_player)
9028 {
9029
9030 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9031 {
9033 {
9034 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9035 {
9036 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9037 }
9038 }
9039 else
9040 {
9041 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9042 }
9043 }
9044
9045 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9046 {
9047 int type = oldLoc.GetType();
9049 {
9050 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9051 }
9053 {
9054 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9055 }
9056 }
9057 if (!m_OldLocation)
9058 {
9059 m_OldLocation = new InventoryLocation;
9060 }
9061 m_OldLocation.Copy(oldLoc);
9062 }
9063 else
9064 {
9065 if (m_OldLocation)
9066 {
9067 m_OldLocation.Reset();
9068 }
9069 }
9070
9072 }
9073 else
9074 {
9075 if (new_player)
9076 {
9077 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9078 if (res_index >= 0)
9079 {
9080 InventoryLocation il = new InventoryLocation;
9081 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9083 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9086 {
9087 il.
GetParent().GetOnReleaseLock().Invoke(it);
9088 }
9090 {
9092 }
9093
9094 }
9095 }
9097 {
9098
9100 }
9101
9102 if (m_OldLocation)
9103 {
9104 m_OldLocation.Reset();
9105 }
9106 }
9107 }
9108
9109 override void EOnContact(IEntity other, Contact extra)
9110 {
9112 {
9113 int liquidType = -1;
9115 if (impactSpeed > 0.0)
9116 {
9118 #ifndef SERVER
9120 #else
9122 SetSynchDirty();
9123 #endif
9125 }
9126 }
9127
9128 #ifdef SERVER
9129 if (GetCompEM() && GetCompEM().IsPlugged())
9130 {
9131 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9132 GetCompEM().UnplugThis();
9133 }
9134 #endif
9135 }
9136
9138
9140 {
9142 }
9143
9145 {
9146
9147 }
9148
9150 {
9151 super.OnItemLocationChanged(old_owner, new_owner);
9152
9153 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9154 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9155
9156 if (!relatedPlayer && playerNew)
9157 relatedPlayer = playerNew;
9158
9159 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9160 {
9162 if (actionMgr)
9163 {
9164 ActionBase currentAction = actionMgr.GetRunningAction();
9165 if (currentAction)
9167 }
9168 }
9169
9170 Man ownerPlayerOld = null;
9171 Man ownerPlayerNew = null;
9172
9173 if (old_owner)
9174 {
9175 if (old_owner.
IsMan())
9176 {
9177 ownerPlayerOld = Man.Cast(old_owner);
9178 }
9179 else
9180 {
9181 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9182 }
9183 }
9184 else
9185 {
9187 {
9189
9190 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9191 {
9192 GetCompEM().UnplugThis();
9193 }
9194 }
9195 }
9196
9197 if (new_owner)
9198 {
9199 if (new_owner.
IsMan())
9200 {
9201 ownerPlayerNew = Man.Cast(new_owner);
9202 }
9203 else
9204 {
9205 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9206 }
9207 }
9208
9209 if (ownerPlayerOld != ownerPlayerNew)
9210 {
9211 if (ownerPlayerOld)
9212 {
9213 array<EntityAI> subItemsExit = new array<EntityAI>;
9215 for (int i = 0; i < subItemsExit.Count(); i++)
9216 {
9219 }
9220 }
9221
9222 if (ownerPlayerNew)
9223 {
9224 array<EntityAI> subItemsEnter = new array<EntityAI>;
9226 for (int j = 0; j < subItemsEnter.Count(); j++)
9227 {
9230 }
9231 }
9232 }
9233 else if (ownerPlayerNew != null)
9234 {
9235 PlayerBase nplayer;
9236 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9237 {
9238 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9240 for (int k = 0; k < subItemsUpdate.Count(); k++)
9241 {
9243 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9244 }
9245 }
9246 }
9247
9248 if (old_owner)
9249 old_owner.OnChildItemRemoved(this);
9250 if (new_owner)
9251 new_owner.OnChildItemReceived(this);
9252 }
9253
9254
9256 {
9257 super.EEDelete(parent);
9258 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9259 if (player)
9260 {
9262
9263 if (player.IsAlive())
9264 {
9265 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9266 if (r_index >= 0)
9267 {
9268 InventoryLocation r_il = new InventoryLocation;
9269 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9270
9271 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9274 {
9275 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9276 }
9278 {
9279 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9280 }
9281
9282 }
9283
9284 player.RemoveQuickBarEntityShortcut(this);
9285 }
9286 }
9287 }
9288
9290 {
9291 super.EEKilled(killer);
9292
9295 {
9296 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9297 {
9298 if (IsMagazine())
9299 {
9300 if (Magazine.Cast(this).GetAmmoCount() > 0)
9301 {
9303 }
9304 }
9305 else
9306 {
9308 }
9309 }
9310 }
9311 }
9312
9314 {
9315 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9316
9317 super.OnWasAttached(parent, slot_id);
9318
9321
9323 }
9324
9326 {
9327 super.OnWasDetached(parent, slot_id);
9328
9331 }
9332
9334 {
9335 int idx;
9338
9339 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9340 if (inventory_slots.Count() < 1)
9341 {
9342 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9343 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9344 }
9345 else
9346 {
9347 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9348 }
9349
9350 idx = inventory_slots.Find(slot);
9351 if (idx < 0)
9352 return "";
9353
9354 return attach_types.Get(idx);
9355 }
9356
9358 {
9359 int idx = -1;
9360 string slot;
9361
9364
9365 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9366 if (inventory_slots.Count() < 1)
9367 {
9368 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9369 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9370 }
9371 else
9372 {
9373 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9374 if (detach_types.Count() < 1)
9375 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9376 }
9377
9378 for (int i = 0; i < inventory_slots.Count(); i++)
9379 {
9380 slot = inventory_slots.Get(i);
9381 }
9382
9383 if (slot != "")
9384 {
9385 if (detach_types.Count() == 1)
9386 idx = 0;
9387 else
9388 idx = inventory_slots.Find(slot);
9389 }
9390 if (idx < 0)
9391 return "";
9392
9393 return detach_types.Get(idx);
9394 }
9395
9397 {
9398
9400
9401
9402 float min_time = 1;
9403 float max_time = 3;
9404 float delay = Math.RandomFloat(min_time, max_time);
9405
9406 explode_timer.Run(delay, this, "DoAmmoExplosion");
9407 }
9408
9410 {
9411 Magazine magazine = Magazine.Cast(this);
9412 int pop_sounds_count = 6;
9413 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9414
9415
9416 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9417 string sound_name = pop_sounds[ sound_idx ];
9419
9420
9421 magazine.ServerAddAmmoCount(-1);
9422
9423
9424 float min_temp_to_explode = 100;
9425
9426 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9427 {
9429 }
9430 }
9431
9432
9433 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9434 {
9435 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9436
9437 const int CHANCE_DAMAGE_CARGO = 4;
9438 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9439 const int CHANCE_DAMAGE_NOTHING = 2;
9440
9442 {
9443 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9444 int chances;
9445 int rnd;
9446
9447 if (GetInventory().GetCargo())
9448 {
9449 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9450 rnd = Math.RandomInt(0,chances);
9451
9452 if (rnd < CHANCE_DAMAGE_CARGO)
9453 {
9455 }
9456 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9457 {
9459 }
9460 }
9461 else
9462 {
9463 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9464 rnd = Math.RandomInt(0,chances);
9465
9466 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9467 {
9469 }
9470 }
9471 }
9472 }
9473
9475 {
9476 if (GetInventory().GetCargo())
9477 {
9478 int item_count = GetInventory().GetCargo().GetItemCount();
9479 if (item_count > 0)
9480 {
9481 int random_pick = Math.RandomInt(0, item_count);
9483 if (!item.IsExplosive())
9484 {
9485 item.AddHealth("","",damage);
9486 return true;
9487 }
9488 }
9489 }
9490 return false;
9491 }
9492
9494 {
9495 int attachment_count = GetInventory().AttachmentCount();
9496 if (attachment_count > 0)
9497 {
9498 int random_pick = Math.RandomInt(0, attachment_count);
9499 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9500 if (!attachment.IsExplosive())
9501 {
9502 attachment.AddHealth("","",damage);
9503 return true;
9504 }
9505 }
9506 return false;
9507 }
9508
9510 {
9512 }
9513
9515 {
9517 return GetInventory().CanRemoveEntity();
9518
9519 return false;
9520 }
9521
9523 {
9525 return;
9526
9528 {
9529 if (ScriptInputUserData.CanStoreInputUserData())
9530 {
9531 ScriptInputUserData ctx = new ScriptInputUserData;
9536 ctx.
Write(destination_entity);
9540 }
9541 }
9542 else if (!
GetGame().IsMultiplayer())
9543 {
9545 }
9546 }
9547
9549 {
9551 return;
9552
9553 float split_quantity_new;
9557 InventoryLocation loc = new InventoryLocation;
9558
9559 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9560 {
9562 split_quantity_new = stack_max;
9563 else
9565
9566 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9567 if (new_item)
9568 {
9569 new_item.SetResultOfSplit(true);
9570 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9572 new_item.SetQuantity(split_quantity_new);
9573 }
9574 }
9575 else if (destination_entity && slot_id == -1)
9576 {
9577 if (quantity > stack_max)
9578 split_quantity_new = stack_max;
9579 else
9580 split_quantity_new = quantity;
9581
9583 {
9586 }
9587
9588 if (new_item)
9589 {
9590 new_item.SetResultOfSplit(true);
9591 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9593 new_item.SetQuantity(split_quantity_new);
9594 }
9595 }
9596 else
9597 {
9598 if (stack_max != 0)
9599 {
9601 {
9603 }
9604
9605 if (split_quantity_new == 0)
9606 {
9607 if (!
GetGame().IsMultiplayer())
9608 player.PhysicalPredictiveDropItem(this);
9609 else
9610 player.ServerDropEntity(this);
9611 return;
9612 }
9613
9615
9616 if (new_item)
9617 {
9618 new_item.SetResultOfSplit(true);
9619 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9621 new_item.SetQuantity(stack_max);
9622 new_item.PlaceOnSurface();
9623 }
9624 }
9625 }
9626 }
9627
9629 {
9631 return;
9632
9633 float split_quantity_new;
9637 InventoryLocation loc = new InventoryLocation;
9638
9639 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9640 {
9642 split_quantity_new = stack_max;
9643 else
9645
9646 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9647 if (new_item)
9648 {
9649 new_item.SetResultOfSplit(true);
9650 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9652 new_item.SetQuantity(split_quantity_new);
9653 }
9654 }
9655 else if (destination_entity && slot_id == -1)
9656 {
9657 if (quantity > stack_max)
9658 split_quantity_new = stack_max;
9659 else
9660 split_quantity_new = quantity;
9661
9663 {
9666 }
9667
9668 if (new_item)
9669 {
9670 new_item.SetResultOfSplit(true);
9671 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9673 new_item.SetQuantity(split_quantity_new);
9674 }
9675 }
9676 else
9677 {
9678 if (stack_max != 0)
9679 {
9681 {
9683 }
9684
9686
9687 if (new_item)
9688 {
9689 new_item.SetResultOfSplit(true);
9690 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9692 new_item.SetQuantity(stack_max);
9693 new_item.PlaceOnSurface();
9694 }
9695 }
9696 }
9697 }
9698
9700 {
9702 return;
9703
9705 {
9706 if (ScriptInputUserData.CanStoreInputUserData())
9707 {
9708 ScriptInputUserData ctx = new ScriptInputUserData;
9713 dst.WriteToContext(ctx);
9715 }
9716 }
9717 else if (!
GetGame().IsMultiplayer())
9718 {
9720 }
9721 }
9722
9724 {
9726 return;
9727
9729 {
9730 if (ScriptInputUserData.CanStoreInputUserData())
9731 {
9732 ScriptInputUserData ctx = new ScriptInputUserData;
9737 ctx.
Write(destination_entity);
9743 }
9744 }
9745 else if (!
GetGame().IsMultiplayer())
9746 {
9748 }
9749 }
9750
9752 {
9754 }
9755
9757 {
9759 return this;
9760
9762 float split_quantity_new;
9764 if (dst.IsValid())
9765 {
9766 int slot_id = dst.GetSlot();
9768
9769 if (quantity > stack_max)
9770 split_quantity_new = stack_max;
9771 else
9772 split_quantity_new = quantity;
9773
9775
9776 if (new_item)
9777 {
9778 new_item.SetResultOfSplit(true);
9779 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9782 }
9783
9784 return new_item;
9785 }
9786
9787 return null;
9788 }
9789
9791 {
9793 return;
9794
9796 float split_quantity_new;
9798 if (destination_entity)
9799 {
9801 if (quantity > stackable)
9802 split_quantity_new = stackable;
9803 else
9804 split_quantity_new = quantity;
9805
9806 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9807 if (new_item)
9808 {
9809 new_item.SetResultOfSplit(true);
9810 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9812 new_item.SetQuantity(split_quantity_new);
9813 }
9814 }
9815 }
9816
9818 {
9820 return;
9821
9823 {
9824 if (ScriptInputUserData.CanStoreInputUserData())
9825 {
9826 ScriptInputUserData ctx = new ScriptInputUserData;
9831 ItemBase destination_entity =
this;
9832 ctx.
Write(destination_entity);
9836 }
9837 }
9838 else if (!
GetGame().IsMultiplayer())
9839 {
9841 }
9842 }
9843
9845 {
9847 return;
9848
9850 float split_quantity_new;
9852 if (player)
9853 {
9855 if (quantity > stackable)
9856 split_quantity_new = stackable;
9857 else
9858 split_quantity_new = quantity;
9859
9860 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9861 new_item =
ItemBase.Cast(in_hands);
9862 if (new_item)
9863 {
9864 new_item.SetResultOfSplit(true);
9865 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9867 new_item.SetQuantity(split_quantity_new);
9868 }
9869 }
9870 }
9871
9873 {
9875 return;
9876
9878 float split_quantity_new = Math.Floor(quantity * 0.5);
9879
9881
9882 if (new_item)
9883 {
9884 if (new_item.GetQuantityMax() < split_quantity_new)
9885 {
9886 split_quantity_new = new_item.GetQuantityMax();
9887 }
9888
9889 new_item.SetResultOfSplit(true);
9890 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9891
9893 {
9896 }
9897 else
9898 {
9901 }
9902 }
9903 }
9904
9906 {
9908 return;
9909
9911 float split_quantity_new = Math.Floor(quantity / 2);
9912
9913 InventoryLocation invloc = new InventoryLocation;
9915
9917 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9918
9919 if (new_item)
9920 {
9921 if (new_item.GetQuantityMax() < split_quantity_new)
9922 {
9923 split_quantity_new = new_item.GetQuantityMax();
9924 }
9926 {
9929 }
9930 else
9931 {
9934 }
9935 }
9936 }
9937
9940 {
9941 SetWeightDirty();
9943
9944 if (parent)
9945 parent.OnAttachmentQuantityChangedEx(this, delta);
9946
9948 {
9950 {
9952 }
9954 {
9955 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9957 }
9958 }
9959
9960 }
9961
9964 {
9965
9966 }
9967
9970 {
9972 }
9973
9975 {
9976 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9977
9979 {
9980 if (newLevel == GameConstants.STATE_RUINED)
9981 {
9983 EntityAI parent = GetHierarchyParent();
9984 if (parent && parent.IsFireplace())
9985 {
9986 CargoBase cargo = GetInventory().GetCargo();
9987 if (cargo)
9988 {
9990 {
9992 }
9993 }
9994 }
9995 }
9996
9998 {
9999
10001 return;
10002 }
10003
10004 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10005 {
10007 }
10008 }
10009 }
10010
10011
10013 {
10014 super.OnRightClick();
10015
10017 {
10019 {
10020 if (ScriptInputUserData.CanStoreInputUserData())
10021 {
10022 vector m4[4];
10024
10025 EntityAI root = GetHierarchyRoot();
10026
10027 InventoryLocation dst = new InventoryLocation;
10029 {
10030 if (root)
10031 {
10032 root.GetTransform(m4);
10034 }
10035 else
10036 GetInventory().GetCurrentInventoryLocation(dst);
10037 }
10038 else
10039 {
10041
10042
10043 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10044 {
10045 if (root)
10046 {
10047 root.GetTransform(m4);
10049 }
10050 else
10051 GetInventory().GetCurrentInventoryLocation(dst);
10052 }
10053 else
10054 {
10055 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10056 }
10057 }
10058
10059 ScriptInputUserData ctx = new ScriptInputUserData;
10067 }
10068 }
10069 else if (!
GetGame().IsMultiplayer())
10070 {
10072 }
10073 }
10074 }
10075
10076 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10077 {
10078
10079 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10080 return false;
10081
10082 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10083 return false;
10084
10085
10087 return false;
10088
10089
10090 Magazine mag = Magazine.Cast(this);
10091 if (mag)
10092 {
10093 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10094 return false;
10095
10096 if (stack_max_limit)
10097 {
10098 Magazine other_mag = Magazine.Cast(other_item);
10099 if (other_item)
10100 {
10101 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10102 return false;
10103 }
10104
10105 }
10106 }
10107 else
10108 {
10109
10111 return false;
10112
10114 return false;
10115 }
10116
10117 PlayerBase player = null;
10118 if (CastTo(player, GetHierarchyRootPlayer()))
10119 {
10120 if (player.GetInventory().HasAttachment(this))
10121 return false;
10122
10123 if (player.IsItemsToDelete())
10124 return false;
10125 }
10126
10127 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10128 return false;
10129
10130 int slotID;
10132 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10133 return false;
10134
10135 return true;
10136 }
10137
10139 {
10141 }
10142
10144 {
10145 return m_IsResultOfSplit;
10146 }
10147
10149 {
10150 m_IsResultOfSplit = value;
10151 }
10152
10154 {
10156 }
10157
10159 {
10160 float other_item_quantity = other_item.GetQuantity();
10161 float this_free_space;
10162
10164
10166
10167 if (other_item_quantity > this_free_space)
10168 {
10169 return this_free_space;
10170 }
10171 else
10172 {
10173 return other_item_quantity;
10174 }
10175 }
10176
10178 {
10180 }
10181
10183 {
10185 return;
10186
10187 if (!IsMagazine() && other_item)
10188 {
10190 if (quantity_used != 0)
10191 {
10192 float hp1 = GetHealth01("","");
10193 float hp2 = other_item.GetHealth01("","");
10194 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10195 hpResult = hpResult / (
GetQuantity() + quantity_used);
10196
10197 hpResult *= GetMaxHealth();
10198 Math.Round(hpResult);
10199 SetHealth("", "Health", hpResult);
10200
10202 other_item.AddQuantity(-quantity_used);
10203 }
10204 }
10206 }
10207
10209 {
10210 #ifdef SERVER
10211 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10212 GetHierarchyParent().IncreaseLifetimeUp();
10213 #endif
10214 };
10215
10217 {
10218 PlayerBase p = PlayerBase.Cast(player);
10219
10220 array<int> recipesIds = p.m_Recipes;
10221 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10222 if (moduleRecipesManager)
10223 {
10224 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10225 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10226 }
10227
10228 for (int i = 0;i < recipesIds.Count(); i++)
10229 {
10230 int key = recipesIds.Get(i);
10231 string recipeName = moduleRecipesManager.GetRecipeName(key);
10233 }
10234 }
10235
10236
10237 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10238 {
10239 super.GetDebugActions(outputList);
10240
10241
10246
10247
10251
10255
10256
10259
10260
10262 {
10265 }
10266
10268
10271
10275 }
10276
10277
10278
10279
10281 {
10282 super.OnAction(action_id, player, ctx);
10283 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10284 {
10285 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10286 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10287 PlayerBase p = PlayerBase.Cast(player);
10288 if (
EActions.RECIPES_RANGE_START < 1000)
10289 {
10290 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10291 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10292 }
10293 }
10294 #ifndef SERVER
10295 else if (action_id ==
EActions.WATCH_PLAYER)
10296 {
10297 PluginDeveloper.SetDeveloperItemClientEx(player);
10298 }
10299 #endif
10301 {
10302 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10303 {
10304 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10305 OnDebugButtonPressServer(id + 1);
10306 }
10307
10308 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10309 {
10310 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10312 }
10313
10314 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10315 {
10316 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10318 }
10319
10320 else if (action_id ==
EActions.ADD_QUANTITY)
10321 {
10322 if (IsMagazine())
10323 {
10324 Magazine mag = Magazine.Cast(this);
10325 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10326 }
10327 else
10328 {
10330 }
10331
10332 if (m_EM)
10333 {
10334 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10335 }
10336
10337 }
10338
10339 else if (action_id ==
EActions.REMOVE_QUANTITY)
10340 {
10341 if (IsMagazine())
10342 {
10343 Magazine mag2 = Magazine.Cast(this);
10344 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10345 }
10346 else
10347 {
10349 }
10350 if (m_EM)
10351 {
10352 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10353 }
10354
10355 }
10356
10357 else if (action_id ==
EActions.SET_QUANTITY_0)
10358 {
10360
10361 if (m_EM)
10362 {
10363 m_EM.SetEnergy(0);
10364 }
10365 }
10366
10367 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10368 {
10370
10371 if (m_EM)
10372 {
10373 m_EM.SetEnergy(m_EM.GetEnergyMax());
10374 }
10375 }
10376
10377 else if (action_id ==
EActions.ADD_HEALTH)
10378 {
10379 AddHealth("","",GetMaxHealth("","Health")/5);
10380 }
10381 else if (action_id ==
EActions.REMOVE_HEALTH)
10382 {
10383 AddHealth("","",-GetMaxHealth("","Health")/5);
10384 }
10385 else if (action_id ==
EActions.DESTROY_HEALTH)
10386 {
10387 SetHealth01("","",0);
10388 }
10389 else if (action_id ==
EActions.WATCH_ITEM)
10390 {
10392 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10393 #ifdef DEVELOPER
10394 SetDebugDeveloper_item(this);
10395 #endif
10396 }
10397
10398 else if (action_id ==
EActions.ADD_TEMPERATURE)
10399 {
10400 AddTemperature(20);
10401
10402 }
10403
10404 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10405 {
10406 AddTemperature(-20);
10407
10408 }
10409
10410 else if (action_id ==
EActions.FLIP_FROZEN)
10411 {
10412 SetFrozen(!GetIsFrozen());
10413
10414 }
10415
10416 else if (action_id ==
EActions.ADD_WETNESS)
10417 {
10419
10420 }
10421
10422 else if (action_id ==
EActions.REMOVE_WETNESS)
10423 {
10425
10426 }
10427
10428 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10429 {
10432
10433
10434 }
10435
10436 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10437 {
10440 }
10441
10442 else if (action_id ==
EActions.MAKE_SPECIAL)
10443 {
10444 auto debugParams = DebugSpawnParams.WithPlayer(player);
10445 OnDebugSpawnEx(debugParams);
10446 }
10447
10448 else if (action_id ==
EActions.DELETE)
10449 {
10450 Delete();
10451 }
10452
10453 }
10454
10455
10456 return false;
10457 }
10458
10459
10460
10461
10465
10468
10469
10470
10472 {
10473 return false;
10474 }
10475
10476
10478 {
10479 return true;
10480 }
10481
10482
10484 {
10485 return true;
10486 }
10487
10488
10489
10491 {
10492 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10494 }
10495
10498 {
10499 return null;
10500 }
10501
10503 {
10504 return false;
10505 }
10506
10508 {
10509 return false;
10510 }
10511
10515
10516
10518 {
10519 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10520 return module_repairing.CanRepair(this, item_repair_kit);
10521 }
10522
10523
10524 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10525 {
10526 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10527 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10528 }
10529
10530
10532 {
10533
10534
10535
10536
10537
10538
10539
10540
10541 return 1;
10542 }
10543
10544
10545
10547 {
10549 }
10550
10551
10552
10554 {
10556 }
10557
10558
10567 {
10568 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10569
10570 if (player)
10571 {
10572 player.MessageStatus(text);
10573 }
10574 }
10575
10576
10585 {
10586 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10587
10588 if (player)
10589 {
10590 player.MessageAction(text);
10591 }
10592 }
10593
10594
10603 {
10604 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10605
10606 if (player)
10607 {
10608 player.MessageFriendly(text);
10609 }
10610 }
10611
10612
10621 {
10622 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10623
10624 if (player)
10625 {
10626 player.MessageImportant(text);
10627 }
10628 }
10629
10631 {
10632 return true;
10633 }
10634
10635
10636 override bool KindOf(
string tag)
10637 {
10638 bool found = false;
10639 string item_name = this.
GetType();
10642
10643 int array_size = item_tag_array.Count();
10644 for (int i = 0; i < array_size; i++)
10645 {
10646 if (item_tag_array.Get(i) == tag)
10647 {
10648 found = true;
10649 break;
10650 }
10651 }
10652 return found;
10653 }
10654
10655
10657 {
10658
10659 super.OnRPC(sender, rpc_type,ctx);
10660
10661
10662 switch (rpc_type)
10663 {
10664 #ifndef SERVER
10665 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10666 Param2<bool, string> p = new Param2<bool, string>(false, "");
10667
10669 return;
10670
10671 bool play = p.param1;
10672 string soundSet = p.param2;
10673
10674 if (play)
10675 {
10677 {
10679 {
10681 }
10682 }
10683 else
10684 {
10686 }
10687 }
10688 else
10689 {
10691 }
10692
10693 break;
10694 #endif
10695
10696 }
10697
10699 {
10701 }
10702 }
10703
10704
10705
10706
10708 {
10709 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10710 return plugin.GetID(
name);
10711 }
10712
10714 {
10715 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10716 return plugin.GetName(id);
10717 }
10718
10721 {
10722
10723
10724 int varFlags;
10725 if (!ctx.
Read(varFlags))
10726 return;
10727
10728 if (varFlags & ItemVariableFlags.FLOAT)
10729 {
10731 }
10732 }
10733
10735 {
10736
10737 super.SerializeNumericalVars(floats_out);
10738
10739
10740
10742 {
10744 }
10745
10747 {
10749 }
10750
10752 {
10754 }
10755
10757 {
10762 }
10763
10765 {
10767 }
10768 }
10769
10771 {
10772
10773 super.DeSerializeNumericalVars(floats);
10774
10775
10776 int index = 0;
10777 int mask = Math.Round(floats.Get(index));
10778
10779 index++;
10780
10782 {
10784 {
10786 }
10787 else
10788 {
10789 float quantity = floats.Get(index);
10790 SetQuantity(quantity,
true,
false,
false,
false);
10791 }
10792 index++;
10793 }
10794
10796 {
10797 float wet = floats.Get(index);
10799 index++;
10800 }
10801
10803 {
10804 int liquidtype = Math.Round(floats.Get(index));
10806 index++;
10807 }
10808
10810 {
10812 index++;
10814 index++;
10816 index++;
10818 index++;
10819 }
10820
10822 {
10823 int cleanness = Math.Round(floats.Get(index));
10825 index++;
10826 }
10827 }
10828
10830 {
10831 super.WriteVarsToCTX(ctx);
10832
10833
10835 {
10837 }
10838
10840 {
10842 }
10843
10845 {
10847 }
10848
10850 {
10851 int r,g,b,a;
10857 }
10858
10860 {
10862 }
10863 }
10864
10866 {
10867 if (!super.ReadVarsFromCTX(ctx,version))
10868 return false;
10869
10870 int intValue;
10871 float value;
10872
10873 if (version < 140)
10874 {
10875 if (!ctx.
Read(intValue))
10876 return false;
10877
10878 m_VariablesMask = intValue;
10879 }
10880
10882 {
10883 if (!ctx.
Read(value))
10884 return false;
10885
10887 {
10889 }
10890 else
10891 {
10893 }
10894 }
10895
10896 if (version < 140)
10897 {
10899 {
10900 if (!ctx.
Read(value))
10901 return false;
10902 SetTemperatureDirect(value);
10903 }
10904 }
10905
10907 {
10908 if (!ctx.
Read(value))
10909 return false;
10911 }
10912
10914 {
10915 if (!ctx.
Read(intValue))
10916 return false;
10918 }
10919
10921 {
10922 int r,g,b,a;
10924 return false;
10926 return false;
10928 return false;
10930 return false;
10931
10933 }
10934
10936 {
10937 if (!ctx.
Read(intValue))
10938 return false;
10940 }
10941
10942 if (version >= 138 && version < 140)
10943 {
10945 {
10946 if (!ctx.
Read(intValue))
10947 return false;
10948 SetFrozen(intValue);
10949 }
10950 }
10951
10952 return true;
10953 }
10954
10955
10957 {
10960 {
10962 }
10963
10964 if (!super.OnStoreLoad(ctx, version))
10965 {
10967 return false;
10968 }
10969
10970 if (version >= 114)
10971 {
10972 bool hasQuickBarIndexSaved;
10973
10974 if (!ctx.
Read(hasQuickBarIndexSaved))
10975 {
10977 return false;
10978 }
10979
10980 if (hasQuickBarIndexSaved)
10981 {
10982 int itmQBIndex;
10983
10984
10985 if (!ctx.
Read(itmQBIndex))
10986 {
10988 return false;
10989 }
10990
10991 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10992 if (itmQBIndex != -1 && parentPlayer)
10993 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10994 }
10995 }
10996 else
10997 {
10998
10999 PlayerBase player;
11000 int itemQBIndex;
11001 if (version ==
int.
MAX)
11002 {
11003 if (!ctx.
Read(itemQBIndex))
11004 {
11006 return false;
11007 }
11008 }
11009 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11010 {
11011
11012 if (!ctx.
Read(itemQBIndex))
11013 {
11015 return false;
11016 }
11017 if (itemQBIndex != -1 && player)
11018 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11019 }
11020 }
11021
11022 if (version < 140)
11023 {
11024
11025 if (!LoadVariables(ctx, version))
11026 {
11028 return false;
11029 }
11030 }
11031
11032
11034 {
11036 return false;
11037 }
11038 if (version >= 132)
11039 {
11041 if (raib)
11042 {
11044 {
11046 return false;
11047 }
11048 }
11049 }
11050
11052 return true;
11053 }
11054
11055
11056
11058 {
11059 super.OnStoreSave(ctx);
11060
11061 PlayerBase player;
11062 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11063 {
11065
11066 int itemQBIndex = -1;
11067 itemQBIndex = player.FindQuickBarEntityIndex(this);
11068 ctx.
Write(itemQBIndex);
11069 }
11070 else
11071 {
11073 }
11074
11076
11078 if (raib)
11079 {
11081 }
11082 }
11083
11084
11086 {
11087 super.AfterStoreLoad();
11088
11090 {
11092 }
11093
11095 {
11098 }
11099 }
11100
11102 {
11103 super.EEOnAfterLoad();
11104
11106 {
11108 }
11109
11112 }
11113
11115 {
11116 return false;
11117 }
11118
11119
11120
11122 {
11124 {
11125 #ifdef PLATFORM_CONSOLE
11126
11128 {
11130 if (menu)
11131 {
11133 }
11134 }
11135 #endif
11136 }
11137
11139 {
11142 }
11143
11145 {
11146 SetWeightDirty();
11148 }
11150 {
11153 }
11154
11156 {
11159 }
11161 {
11164 }
11165
11166 super.OnVariablesSynchronized();
11167 }
11168
11169
11170
11172 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11173 {
11174 if (!IsServerCheck(allow_client))
11175 return false;
11176
11178 return false;
11179
11182
11183 if (value <= (min + 0.001))
11184 value = min;
11185
11186 if (value == min)
11187 {
11188 if (destroy_config)
11189 {
11190 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11191 if (dstr)
11192 {
11194 this.Delete();
11195 return true;
11196 }
11197 }
11198 else if (destroy_forced)
11199 {
11201 this.Delete();
11202 return true;
11203 }
11204
11206 }
11207
11210
11212 {
11214
11215 if (delta)
11217 }
11218
11220
11221 return false;
11222 }
11223
11224
11226 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11227 {
11229 }
11230
11232 {
11235 }
11236
11238 {
11241 }
11242
11245 {
11246 float value_clamped = Math.Clamp(value, 0, 1);
11248 SetQuantity(result, destroy_config, destroy_forced);
11249 }
11250
11251
11254 {
11256 }
11257
11259 {
11261 }
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11273 {
11274 int slot = -1;
11275 if (GetInventory())
11276 {
11277 InventoryLocation il = new InventoryLocation;
11278 GetInventory().GetCurrentInventoryLocation(il);
11280 }
11281
11283 }
11284
11286 {
11287 float quantity_max = 0;
11288
11290 {
11291 if (attSlotID != -1)
11292 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11293
11294 if (quantity_max <= 0)
11296 }
11297
11298 if (quantity_max <= 0)
11300
11301 return quantity_max;
11302 }
11303
11305 {
11307 }
11308
11310 {
11312 }
11313
11314
11316 {
11318 }
11319
11321 {
11323 }
11324
11326 {
11328 }
11329
11330
11332 {
11333
11334 float weightEx = GetWeightEx();
11335 float special = GetInventoryAndCargoWeight();
11336 return weightEx - special;
11337 }
11338
11339
11341 {
11343 }
11344
11346 {
11348 {
11349 #ifdef DEVELOPER
11350 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11351 {
11352 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11354 }
11355 #endif
11356
11357 return GetQuantity() * GetConfigWeightModified();
11358 }
11359 else if (HasEnergyManager())
11360 {
11361 #ifdef DEVELOPER
11362 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11363 {
11364 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11365 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11366 }
11367 #endif
11368 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11369 }
11370 else
11371 {
11372 #ifdef DEVELOPER
11373 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11374 {
11375 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11376 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11377 }
11378 #endif
11379 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11380 }
11381 }
11382
11385 {
11386 int item_count = 0;
11388
11389 if (GetInventory().GetCargo() != NULL)
11390 {
11391 item_count = GetInventory().GetCargo().GetItemCount();
11392 }
11393
11394 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11395 {
11396 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11397 if (item)
11398 item_count += item.GetNumberOfItems();
11399 }
11400 return item_count;
11401 }
11402
11405 {
11406 float weight = 0;
11407 float wetness = 1;
11408 if (include_wetness)
11411 {
11412 weight = wetness * m_ConfigWeight;
11413 }
11415 {
11416 weight = 1;
11417 }
11418 return weight;
11419 }
11420
11421
11422
11424 {
11425 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11426 {
11427 GameInventory inv = GetInventory();
11428 array<EntityAI> items = new array<EntityAI>;
11430 for (int i = 0; i < items.Count(); i++)
11431 {
11433 if (item)
11434 {
11436 }
11437 }
11438 }
11439 }
11440
11441
11442
11443
11445 {
11446 float energy = 0;
11447 if (HasEnergyManager())
11448 {
11449 energy = GetCompEM().GetEnergy();
11450 }
11451 return energy;
11452 }
11453
11454
11456 {
11457 super.OnEnergyConsumed();
11458
11460 }
11461
11463 {
11464 super.OnEnergyAdded();
11465
11467 }
11468
11469
11471 {
11472 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11473 {
11475 {
11476 float energy_0to1 = GetCompEM().GetEnergy0To1();
11478 }
11479 }
11480 }
11481
11482
11484 {
11485 return ConfigGetFloat("heatIsolation");
11486 }
11487
11489 {
11491 }
11492
11494 {
11495 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11496 if (
GetGame().ConfigIsExisting(paramPath))
11498
11499 return 0.0;
11500 }
11501
11503 {
11504 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11505 if (
GetGame().ConfigIsExisting(paramPath))
11507
11508 return 0.0;
11509 }
11510
11511 override void SetWet(
float value,
bool allow_client =
false)
11512 {
11513 if (!IsServerCheck(allow_client))
11514 return;
11515
11518
11520
11521 m_VarWet = Math.Clamp(value, min, max);
11522
11524 {
11527 }
11528 }
11529
11530 override void AddWet(
float value)
11531 {
11533 }
11534
11536 {
11538 }
11539
11541 {
11543 }
11544
11546 {
11548 }
11549
11551 {
11553 }
11554
11556 {
11558 }
11559
11560 override void OnWetChanged(
float newVal,
float oldVal)
11561 {
11564 if (newLevel != oldLevel)
11565 {
11567 }
11568 }
11569
11571 {
11572 SetWeightDirty();
11573 }
11574
11576 {
11577 return GetWetLevelInternal(
m_VarWet);
11578 }
11579
11580
11581
11583 {
11585 }
11586
11588 {
11590 }
11591
11593 {
11595 }
11596
11598 {
11600 }
11601
11602
11603
11605 {
11606 if (ConfigIsExisting("itemModelLength"))
11607 {
11608 return ConfigGetFloat("itemModelLength");
11609 }
11610 return 0;
11611 }
11612
11614 {
11615 if (ConfigIsExisting("itemAttachOffset"))
11616 {
11617 return ConfigGetFloat("itemAttachOffset");
11618 }
11619 return 0;
11620 }
11621
11622 override void SetCleanness(
int value,
bool allow_client =
false)
11623 {
11624 if (!IsServerCheck(allow_client))
11625 return;
11626
11628
11630
11633 }
11634
11636 {
11638 }
11639
11641 {
11642 return true;
11643 }
11644
11645
11646
11647
11649 {
11651 }
11652
11654 {
11656 }
11657
11658
11659
11660
11661 override void SetColor(
int r,
int g,
int b,
int a)
11662 {
11668 }
11670 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11671 {
11676 }
11677
11679 {
11681 }
11682
11685 {
11686 int r,g,b,a;
11688 r = r/255;
11689 g = g/255;
11690 b = b/255;
11691 a = a/255;
11692 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11693 }
11694
11695
11696
11697 override void SetLiquidType(
int value,
bool allow_client =
false)
11698 {
11699 if (!IsServerCheck(allow_client))
11700 return;
11701
11706 }
11707
11709 {
11710 return ConfigGetInt("varLiquidTypeInit");
11711 }
11712
11714 {
11716 }
11717
11719 {
11721 SetFrozen(false);
11722 }
11723
11726 {
11727 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11728 }
11729
11730
11733 {
11734 PlayerBase nplayer;
11735 if (PlayerBase.CastTo(nplayer, player))
11736 {
11738
11739 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11740 }
11741 }
11742
11743
11746 {
11747 PlayerBase nplayer;
11748 if (PlayerBase.CastTo(nplayer,player))
11749 {
11750
11751 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11752
11753 }
11754
11755
11756 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11757
11758
11759 if (HasEnergyManager())
11760 {
11761 GetCompEM().UpdatePlugState();
11762 }
11763 }
11764
11765
11767 {
11768 super.OnPlacementStarted(player);
11769
11771 }
11772
11773 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11774 {
11776 {
11777 m_AdminLog.OnPlacementComplete(player,
this);
11778 }
11779
11780 super.OnPlacementComplete(player, position, orientation);
11781 }
11782
11783
11784
11785
11786
11788 {
11790 {
11791 return true;
11792 }
11793 else
11794 {
11795 return false;
11796 }
11797 }
11798
11799
11801 {
11803 {
11805 }
11806 }
11807
11808
11810 {
11812 }
11813
11815 {
11817 }
11818
11819 override void InsertAgent(
int agent,
float count = 1)
11820 {
11821 if (count < 1)
11822 return;
11823
11825 }
11826
11829 {
11831 }
11832
11833
11835 {
11837 }
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
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
11881 {
11883 return false;
11884 return true;
11885 }
11886
11888 {
11889
11891 }
11892
11893
11896 {
11897 super.CheckForRoofLimited(timeTresholdMS);
11898
11900 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11901 {
11902 m_PreviousRoofTestTime = time;
11903 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11904 }
11905 }
11906
11907
11909 {
11911 {
11912 return 0;
11913 }
11914
11915 if (GetInventory().GetAttachmentSlotsCount() != 0)
11916 {
11917 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11918 if (filter)
11919 return filter.GetProtectionLevel(type, false, system);
11920 else
11921 return 0;
11922 }
11923
11924 string subclassPath, entryName;
11925
11926 switch (type)
11927 {
11929 entryName = "biological";
11930 break;
11932 entryName = "chemical";
11933 break;
11934 default:
11935 entryName = "biological";
11936 break;
11937 }
11938
11939 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11940
11942 }
11943
11944
11945
11948 {
11949 if (!IsMagazine())
11951
11953 }
11954
11955
11956
11957
11958
11963 {
11964 return true;
11965 }
11966
11968 {
11970 }
11971
11972
11973
11974
11975
11977 {
11978 if (parent)
11979 {
11980 if (parent.IsInherited(DayZInfected))
11981 return true;
11982
11983 if (!parent.IsRuined())
11984 return true;
11985 }
11986
11987 return true;
11988 }
11989
11991 {
11992 if (!super.CanPutAsAttachment(parent))
11993 {
11994 return false;
11995 }
11996
11997 if (!IsRuined() && !parent.IsRuined())
11998 {
11999 return true;
12000 }
12001
12002 return false;
12003 }
12004
12006 {
12007
12008
12009
12010
12011 return super.CanReceiveItemIntoCargo(item);
12012 }
12013
12015 {
12016
12017
12018
12019
12020 GameInventory attachmentInv = attachment.GetInventory();
12022 {
12023 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12024 return false;
12025 }
12026
12027 InventoryLocation loc = new InventoryLocation();
12028 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12029 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12030 return false;
12031
12032 return super.CanReceiveAttachment(attachment, slotId);
12033 }
12034
12036 {
12037 if (!super.CanReleaseAttachment(attachment))
12038 return false;
12039
12040 return GetInventory().AreChildrenAccessible();
12041 }
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12064 {
12065 int id = muzzle_owner.GetMuzzleID();
12066 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12067
12068 if (WPOF_array)
12069 {
12070 for (int i = 0; i < WPOF_array.Count(); i++)
12071 {
12072 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12073
12074 if (WPOF)
12075 {
12076 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12077 }
12078 }
12079 }
12080 }
12081
12082
12084 {
12085 int id = muzzle_owner.GetMuzzleID();
12087
12088 if (WPOBE_array)
12089 {
12090 for (int i = 0; i < WPOBE_array.Count(); i++)
12091 {
12092 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12093
12094 if (WPOBE)
12095 {
12096 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12097 }
12098 }
12099 }
12100 }
12101
12102
12104 {
12105 int id = muzzle_owner.GetMuzzleID();
12106 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12107
12108 if (WPOOH_array)
12109 {
12110 for (int i = 0; i < WPOOH_array.Count(); i++)
12111 {
12112 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12113
12114 if (WPOOH)
12115 {
12116 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12117 }
12118 }
12119 }
12120 }
12121
12122
12124 {
12125 int id = muzzle_owner.GetMuzzleID();
12126 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12127
12128 if (WPOOH_array)
12129 {
12130 for (int i = 0; i < WPOOH_array.Count(); i++)
12131 {
12132 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12133
12134 if (WPOOH)
12135 {
12136 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12137 }
12138 }
12139 }
12140 }
12141
12142
12144 {
12145 int id = muzzle_owner.GetMuzzleID();
12146 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12147
12148 if (WPOOH_array)
12149 {
12150 for (int i = 0; i < WPOOH_array.Count(); i++)
12151 {
12152 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12153
12154 if (WPOOH)
12155 {
12156 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12157 }
12158 }
12159 }
12160 }
12161
12162
12163
12165 {
12167 {
12168 return true;
12169 }
12170
12171 return false;
12172 }
12173
12175 {
12177 {
12178 return true;
12179 }
12180
12181 return false;
12182 }
12183
12185 {
12187 {
12188 return true;
12189 }
12190
12191 return false;
12192 }
12193
12195 {
12196 return false;
12197 }
12198
12201 {
12202 return UATimeSpent.DEFAULT_DEPLOY;
12203 }
12204
12205
12206
12207
12209 {
12211 SetSynchDirty();
12212 }
12213
12215 {
12217 }
12218
12219
12221 {
12222 return false;
12223 }
12224
12227 {
12228 string att_type = "None";
12229
12230 if (ConfigIsExisting("soundAttType"))
12231 {
12232 att_type = ConfigGetString("soundAttType");
12233 }
12234
12236 }
12237
12239 {
12241 }
12242
12243
12244
12245
12246
12250
12252 {
12255
12257 }
12258
12259
12261 {
12263 return;
12264
12266
12269
12272
12273 SoundParameters params = new SoundParameters();
12277 }
12278
12279
12281 {
12283 return;
12284
12286 SetSynchDirty();
12287
12290 }
12291
12292
12294 {
12296 return;
12297
12299 SetSynchDirty();
12300
12303 }
12304
12306 {
12308 }
12309
12311 {
12313 }
12314
12317 {
12318 if (!
GetGame().IsDedicatedServer())
12319 {
12320 if (ConfigIsExisting("attachSoundSet"))
12321 {
12322 string cfg_path = "";
12323 string soundset = "";
12324 string type_name =
GetType();
12325
12328 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12329 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12330
12331 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12332 {
12333 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12334 {
12335 if (cfg_slot_array[i] == slot_type)
12336 {
12337 soundset = cfg_soundset_array[i];
12338 break;
12339 }
12340 }
12341 }
12342
12343 if (soundset != "")
12344 {
12345 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12347 }
12348 }
12349 }
12350 }
12351
12353 {
12354
12355 }
12356
12357 void OnApply(PlayerBase player);
12358
12360 {
12361 return 1.0;
12362 };
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12375
12377 {
12378 SetDynamicPhysicsLifeTime(0.01);
12380 }
12381
12383 {
12384 array<string> zone_names = new array<string>;
12385 GetDamageZones(zone_names);
12386 for (int i = 0; i < zone_names.Count(); i++)
12387 {
12388 SetHealthMax(zone_names.Get(i),"Health");
12389 }
12390 SetHealthMax("","Health");
12391 }
12392
12395 {
12396 float global_health = GetHealth01("","Health");
12397 array<string> zones = new array<string>;
12398 GetDamageZones(zones);
12399
12400 for (int i = 0; i < zones.Count(); i++)
12401 {
12402 SetHealth01(zones.Get(i),"Health",global_health);
12403 }
12404 }
12405
12408 {
12409 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12410 }
12411
12413 {
12414 if (!hasRootAsPlayer)
12415 {
12416 if (refParentIB)
12417 {
12418
12419 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12420 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12421
12422 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12423 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12424
12427 }
12428 else
12429 {
12430
12433 }
12434 }
12435 }
12436
12438 {
12440 {
12441 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12442 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12443 {
12444 float heatPermCoef = 1.0;
12446 while (ent)
12447 {
12448 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12449 ent = ent.GetHierarchyParent();
12450 }
12451
12452 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12453 }
12454 }
12455 }
12456
12458 {
12459
12460 EntityAI parent = GetHierarchyParent();
12461 if (!parent)
12462 {
12463 hasParent = false;
12464 hasRootAsPlayer = false;
12465 }
12466 else
12467 {
12468 hasParent = true;
12469 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12470 refParentIB =
ItemBase.Cast(parent);
12471 }
12472 }
12473
12474 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12475 {
12476
12477 }
12478
12480 {
12481
12482 return false;
12483 }
12484
12486 {
12487
12488
12489 return false;
12490 }
12491
12493 {
12494
12495 return false;
12496 }
12497
12500 {
12501 return !GetIsFrozen() &&
IsOpen();
12502 }
12503
12505 {
12506 bool hasParent = false, hasRootAsPlayer = false;
12508
12509 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12510 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12511
12512 if (wwtu || foodDecay)
12513 {
12517
12518 if (processWetness || processTemperature || processDecay)
12519 {
12521
12522 if (processWetness)
12523 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12524
12525 if (processTemperature)
12527
12528 if (processDecay)
12529 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12530 }
12531 }
12532 }
12533
12536 {
12538 }
12539
12541 {
12544
12545 return super.GetTemperatureFreezeThreshold();
12546 }
12547
12549 {
12552
12553 return super.GetTemperatureThawThreshold();
12554 }
12555
12557 {
12560
12561 return super.GetItemOverheatThreshold();
12562 }
12563
12565 {
12567 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12568
12569 return super.GetTemperatureFreezeTime();
12570 }
12571
12573 {
12575 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12576
12577 return super.GetTemperatureThawTime();
12578 }
12579
12584
12586 {
12587 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12588 }
12589
12591 {
12592 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12593 }
12594
12597 {
12599 }
12600
12602 {
12604 }
12605
12607 {
12609 }
12610
12613 {
12614 return null;
12615 }
12616
12619 {
12620 return false;
12621 }
12622
12624 {
12626 {
12629 if (!trg)
12630 {
12632 explosive = this;
12633 }
12634
12635 explosive.PairRemote(trg);
12637
12638 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12639 trg.SetPersistentPairID(persistentID);
12640 explosive.SetPersistentPairID(persistentID);
12641
12642 return true;
12643 }
12644 return false;
12645 }
12646
12649 {
12650 float ret = 1.0;
12653 ret *= GetHealth01();
12654
12655 return ret;
12656 }
12657
12658 #ifdef DEVELOPER
12659 override void SetDebugItem()
12660 {
12661 super.SetDebugItem();
12662 _itemBase = this;
12663 }
12664
12666 {
12667 string text = super.GetDebugText();
12668
12670 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12671
12672 return text;
12673 }
12674 #endif
12675
12677 {
12678 return true;
12679 }
12680
12682
12684
12686 {
12689 }
12690
12691
12699
12715}
12716
12718{
12720 if (entity)
12721 {
12722 bool is_item = entity.IsInherited(
ItemBase);
12723 if (is_item && full_quantity)
12724 {
12727 }
12728 }
12729 else
12730 {
12732 return NULL;
12733 }
12734 return entity;
12735}
12736
12738{
12739 if (item)
12740 {
12741 if (health > 0)
12742 item.SetHealth("", "", health);
12743
12744 if (item.CanHaveTemperature())
12745 {
12747 if (item.CanFreeze())
12748 item.SetFrozen(false);
12749 }
12750
12751 if (item.HasEnergyManager())
12752 {
12753 if (quantity >= 0)
12754 {
12755 item.GetCompEM().SetEnergy0To1(quantity);
12756 }
12757 else
12758 {
12760 }
12761 }
12762 else if (item.IsMagazine())
12763 {
12764 Magazine mag = Magazine.Cast(item);
12765 if (quantity >= 0)
12766 {
12767 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12768 }
12769 else
12770 {
12772 }
12773
12774 }
12775 else
12776 {
12777 if (quantity >= 0)
12778 {
12779 item.SetQuantityNormalized(quantity, false);
12780 }
12781 else
12782 {
12784 }
12785
12786 }
12787 }
12788}
12789
12790#ifdef DEVELOPER
12792#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.