8037{
8039 {
8040 return true;
8041 }
8042};
8043
8044
8045
8047{
8051
8053
8056
8057
8058
8059
8060
8069
8075
8080
8085
8106 protected bool m_IsResultOfSplit
8107
8109
8114
8115
8116
8118
8122
8123
8124
8126
8129
8130
8131
8137
8138
8146
8149
8150
8152
8153
8155
8156
8161
8162
8167
8168
8170
8171
8173 {
8178
8179 if (!
GetGame().IsDedicatedServer())
8180 {
8182 {
8184
8186 {
8188 }
8189 }
8190
8193 }
8194
8195 m_OldLocation = null;
8196
8198 {
8200 }
8201
8202 if (ConfigIsExisting("headSelectionsToHide"))
8203 {
8206 }
8207
8209 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8210 {
8212 }
8213
8215
8216 m_IsResultOfSplit = false;
8217
8219 }
8220
8222 {
8223 super.InitItemVariables();
8224
8230 m_Count = ConfigGetInt(
"count");
8231
8234
8239
8242
8247
8259
8263
8264
8267 if (ConfigIsExisting("canBeSplit"))
8268 {
8271 }
8272
8274 if (ConfigIsExisting("itemBehaviour"))
8276
8277
8280 RegisterNetSyncVariableInt("m_VarLiquidType");
8281 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8282
8283 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8284 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8285 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8286
8287 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8288 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8289 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8290 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8291
8292 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8293 RegisterNetSyncVariableBool("m_IsTakeable");
8294 RegisterNetSyncVariableBool("m_IsHologram");
8295
8298 {
8301 }
8302
8304
8306 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8308
8309 }
8310
8312 {
8314 }
8315
8317 {
8320 {
8325 }
8326 }
8327
8328 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8329 {
8331 {
8334 }
8335
8337 }
8338
8340 {
8346 }
8347
8349
8351 {
8353
8354 if (!action)
8355 {
8356 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8357 return;
8358 }
8359
8361 if (!ai)
8362 {
8364 return;
8365 }
8366
8368 if (!action_array)
8369 {
8370 action_array = new array<ActionBase_Basic>;
8372 }
8373 if (LogManager.IsActionLogEnable())
8374 {
8375 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8376 }
8377
8378 if (action_array.Find(action) != -1)
8379 {
8380 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8381 }
8382 else
8383 {
8384 action_array.Insert(action);
8385 }
8386 }
8387
8389 {
8391 ActionBase action = player.GetActionManager().GetAction(actionName);
8394
8395 if (action_array)
8396 {
8397 action_array.RemoveItem(action);
8398 }
8399 }
8400
8401
8402
8404 {
8405 ActionOverrideData overrideData = new ActionOverrideData();
8409
8411 if (!actionMap)
8412 {
8415 }
8416
8417 actionMap.Insert(this.
Type(), overrideData);
8418
8419 }
8420
8422
8424
8425
8427 {
8430
8433
8434 string config_to_search = "CfgVehicles";
8435 string muzzle_owner_config;
8436
8438 {
8439 if (IsInherited(Weapon))
8440 config_to_search = "CfgWeapons";
8441
8442 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8443
8444 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8445
8447
8448 if (config_OnFire_subclass_count > 0)
8449 {
8450 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8451
8452 for (int i = 0; i < config_OnFire_subclass_count; i++)
8453 {
8454 string particle_class = "";
8456 string config_OnFire_entry = config_OnFire_class + particle_class;
8457 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8458 WPOF_array.Insert(WPOF);
8459 }
8460
8461
8463 }
8464 }
8465
8467 {
8468 config_to_search = "CfgWeapons";
8469 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8470
8471 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8472
8474
8475 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8476 {
8477 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8478
8479 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8480 {
8481 string particle_class2 = "";
8483 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8484 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8485 WPOBE_array.Insert(WPOBE);
8486 }
8487
8488
8490 }
8491 }
8492 }
8493
8494
8496 {
8499
8501 {
8502 string config_to_search = "CfgVehicles";
8503
8504 if (IsInherited(Weapon))
8505 config_to_search = "CfgWeapons";
8506
8507 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8508 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8509
8510 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8511 {
8512
8514
8516 {
8518 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8520 return;
8521 }
8522
8525
8526
8527
8529 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8530
8531 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8532 {
8533 string particle_class = "";
8535 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8537
8538 if (entry_type == CT_CLASS)
8539 {
8540 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8541 WPOOH_array.Insert(WPOF);
8542 }
8543 }
8544
8545
8547 }
8548 }
8549 }
8550
8552 {
8554 }
8555
8557 {
8559 {
8561
8564
8567
8568 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8569 }
8570 }
8571
8573 {
8575 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8576
8578 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8579
8581 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8582
8584 {
8586 }
8587 }
8588
8590 {
8592 }
8593
8595 {
8598 else
8600
8602 {
8605 }
8606 else
8607 {
8610
8613 }
8614
8616 }
8617
8619 {
8621 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8622 }
8623
8625 {
8627 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8629 }
8630
8632 {
8634 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8635 }
8636
8638 {
8641
8642 OverheatingParticle OP = new OverheatingParticle();
8647
8649 }
8650
8652 {
8655
8656 return -1;
8657 }
8658
8660 {
8662 {
8665
8666 for (int i = count; i > 0; --i)
8667 {
8668 int id = i - 1;
8671
8674
8675 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8676 {
8677 if (p)
8678 {
8681 }
8682 }
8683 }
8684 }
8685 }
8686
8688 {
8690 {
8692 {
8693 int id = i - 1;
8695
8696 if (OP)
8697 {
8699
8700 if (p)
8701 {
8703 }
8704
8705 delete OP;
8706 }
8707 }
8708
8711 }
8712 }
8713
8716 {
8717 return 0.0;
8718 }
8719
8720
8722 {
8723 return 250;
8724 }
8725
8727 {
8728 return 0;
8729 }
8730
8733 {
8735 return true;
8736
8737 return false;
8738 }
8739
8742 {
8745
8747 {
8749 }
8750 else
8751 {
8752
8754 }
8755
8757 }
8758
8765 {
8766 return -1;
8767 }
8768
8769
8770
8771
8773 {
8775 {
8777 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8778
8779 if (r_index >= 0)
8780 {
8781 InventoryLocation r_il = new InventoryLocation;
8782 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8783
8784 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8787 {
8788 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8789 }
8791 {
8792 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8793 }
8794
8795 }
8796
8797 player.GetHumanInventory().ClearUserReservedLocation(this);
8798 }
8799
8802 }
8803
8804
8805
8806
8808 {
8809 return ItemBase.m_DebugActionsMask;
8810 }
8811
8813 {
8814 return ItemBase.m_DebugActionsMask & mask;
8815 }
8816
8818 {
8819 ItemBase.m_DebugActionsMask = mask;
8820 }
8821
8823 {
8824 ItemBase.m_DebugActionsMask |= mask;
8825 }
8826
8828 {
8829 ItemBase.m_DebugActionsMask &= ~mask;
8830 }
8831
8833 {
8835 {
8837 }
8838 else
8839 {
8841 }
8842 }
8843
8844
8846 {
8847 if (GetEconomyProfile())
8848 {
8849 float q_max = GetEconomyProfile().GetQuantityMax();
8850 if (q_max > 0)
8851 {
8852 float q_min = GetEconomyProfile().GetQuantityMin();
8853 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8854
8856 {
8857 ComponentEnergyManager comp = GetCompEM();
8859 {
8861 }
8862 }
8864 {
8866
8867 }
8868
8869 }
8870 }
8871 }
8872
8875 {
8876 EntityAI parent = GetHierarchyParent();
8877
8878 if (parent)
8879 {
8880 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8881 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8882 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8883 }
8884 }
8885
8888 {
8889 EntityAI parent = GetHierarchyParent();
8890
8891 if (parent)
8892 {
8893 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8894 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8895 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8896 }
8897 }
8898
8900 {
8901
8902
8903
8904
8906
8908 {
8909 if (ScriptInputUserData.CanStoreInputUserData())
8910 {
8911 ScriptInputUserData ctx = new ScriptInputUserData;
8917 ctx.
Write(use_stack_max);
8920
8922 {
8923 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8924 }
8925 }
8926 }
8927 else if (!
GetGame().IsMultiplayer())
8928 {
8930 }
8931 }
8932
8934 {
8936 }
8937
8939 {
8941 }
8942
8944 {
8946 }
8947
8949 {
8950
8951 return false;
8952 }
8953
8955 {
8956 return false;
8957 }
8958
8962 {
8963 return false;
8964 }
8965
8967 {
8968 return "";
8969 }
8970
8972
8974 {
8975 return false;
8976 }
8977
8979 {
8980 return true;
8981 }
8982
8983
8984
8986 {
8987 return true;
8988 }
8989
8991 {
8992 return true;
8993 }
8994
8996 {
8997 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8999 }
9000
9002 {
9004 }
9005
9007 {
9009 if (!is_being_placed)
9011 SetSynchDirty();
9012 }
9013
9014
9016
9018 {
9020 }
9021
9023 {
9025 }
9026
9028 {
9029 return 1;
9030 }
9031
9033 {
9034 return false;
9035 }
9036
9038 {
9040 SetSynchDirty();
9041 }
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9078 {
9079 super.OnMovedInsideCargo(container);
9080
9081 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9082 }
9083
9084 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9085 {
9086 super.EEItemLocationChanged(oldLoc,newLoc);
9087
9088 PlayerBase new_player = null;
9089 PlayerBase old_player = null;
9090
9091 if (newLoc.GetParent())
9092 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9093
9094 if (oldLoc.GetParent())
9095 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9096
9098 {
9099 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9100
9101 if (r_index >= 0)
9102 {
9103 InventoryLocation r_il = new InventoryLocation;
9104 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9105
9106 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9109 {
9110 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9111 }
9113 {
9114 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9115 }
9116
9117 }
9118 }
9119
9121 {
9122 if (new_player)
9123 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9124
9125 if (new_player == old_player)
9126 {
9127
9128 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9129 {
9131 {
9132 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9133 {
9134 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9135 }
9136 }
9137 else
9138 {
9139 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9140 }
9141 }
9142
9143 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9144 {
9145 int type = oldLoc.GetType();
9147 {
9148 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9149 }
9151 {
9152 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9153 }
9154 }
9155 if (!m_OldLocation)
9156 {
9157 m_OldLocation = new InventoryLocation;
9158 }
9159 m_OldLocation.Copy(oldLoc);
9160 }
9161 else
9162 {
9163 if (m_OldLocation)
9164 {
9165 m_OldLocation.Reset();
9166 }
9167 }
9168
9170 }
9171 else
9172 {
9173 if (new_player)
9174 {
9175 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9176 if (res_index >= 0)
9177 {
9178 InventoryLocation il = new InventoryLocation;
9179 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9181 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9184 {
9185 il.
GetParent().GetOnReleaseLock().Invoke(it);
9186 }
9188 {
9190 }
9191
9192 }
9193 }
9195 {
9196
9198 }
9199
9200 if (m_OldLocation)
9201 {
9202 m_OldLocation.Reset();
9203 }
9204 }
9205 }
9206
9207 override void EOnContact(IEntity other, Contact extra)
9208 {
9210 {
9211 int liquidType = -1;
9213 if (impactSpeed > 0.0)
9214 {
9216 #ifndef SERVER
9218 #else
9220 SetSynchDirty();
9221 #endif
9223 }
9224 }
9225
9226 #ifdef SERVER
9227 if (GetCompEM() && GetCompEM().IsPlugged())
9228 {
9229 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9230 GetCompEM().UnplugThis();
9231 }
9232 #endif
9233 }
9234
9236
9238 {
9240 }
9241
9243 {
9244
9245 }
9246
9248 {
9249 super.OnItemLocationChanged(old_owner, new_owner);
9250
9251 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9252 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9253
9254 if (!relatedPlayer && playerNew)
9255 relatedPlayer = playerNew;
9256
9257 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9258 {
9260 if (actionMgr)
9261 {
9262 ActionBase currentAction = actionMgr.GetRunningAction();
9263 if (currentAction)
9265 }
9266 }
9267
9268 Man ownerPlayerOld = null;
9269 Man ownerPlayerNew = null;
9270
9271 if (old_owner)
9272 {
9273 if (old_owner.
IsMan())
9274 {
9275 ownerPlayerOld = Man.Cast(old_owner);
9276 }
9277 else
9278 {
9279 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9280 }
9281 }
9282 else
9283 {
9285 {
9287
9288 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9289 {
9290 GetCompEM().UnplugThis();
9291 }
9292 }
9293 }
9294
9295 if (new_owner)
9296 {
9297 if (new_owner.
IsMan())
9298 {
9299 ownerPlayerNew = Man.Cast(new_owner);
9300 }
9301 else
9302 {
9303 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9304 }
9305 }
9306
9307 if (ownerPlayerOld != ownerPlayerNew)
9308 {
9309 if (ownerPlayerOld)
9310 {
9311 array<EntityAI> subItemsExit = new array<EntityAI>;
9313 for (int i = 0; i < subItemsExit.Count(); i++)
9314 {
9317 }
9318 }
9319
9320 if (ownerPlayerNew)
9321 {
9322 array<EntityAI> subItemsEnter = new array<EntityAI>;
9324 for (int j = 0; j < subItemsEnter.Count(); j++)
9325 {
9328 }
9329 }
9330 }
9331 else if (ownerPlayerNew != null)
9332 {
9333 PlayerBase nplayer;
9334 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9335 {
9336 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9338 for (int k = 0; k < subItemsUpdate.Count(); k++)
9339 {
9341 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9342 }
9343 }
9344 }
9345
9346 if (old_owner)
9347 old_owner.OnChildItemRemoved(this);
9348 if (new_owner)
9349 new_owner.OnChildItemReceived(this);
9350 }
9351
9352
9354 {
9355 super.EEDelete(parent);
9356 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9357 if (player)
9358 {
9360
9361 if (player.IsAlive())
9362 {
9363 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9364 if (r_index >= 0)
9365 {
9366 InventoryLocation r_il = new InventoryLocation;
9367 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9368
9369 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9372 {
9373 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9374 }
9376 {
9377 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9378 }
9379
9380 }
9381
9382 player.RemoveQuickBarEntityShortcut(this);
9383 }
9384 }
9385 }
9386
9388 {
9389 super.EEKilled(killer);
9390
9393 {
9394 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9395 {
9396 if (IsMagazine())
9397 {
9398 if (Magazine.Cast(this).GetAmmoCount() > 0)
9399 {
9401 }
9402 }
9403 else
9404 {
9406 }
9407 }
9408 }
9409 }
9410
9412 {
9413 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9414
9415 super.OnWasAttached(parent, slot_id);
9416
9419
9421 }
9422
9424 {
9425 super.OnWasDetached(parent, slot_id);
9426
9429 }
9430
9432 {
9433 int idx;
9436
9437 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9438 if (inventory_slots.Count() < 1)
9439 {
9440 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9441 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9442 }
9443 else
9444 {
9445 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9446 }
9447
9448 idx = inventory_slots.Find(slot);
9449 if (idx < 0)
9450 return "";
9451
9452 return attach_types.Get(idx);
9453 }
9454
9456 {
9457 int idx = -1;
9458 string slot;
9459
9462
9463 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9464 if (inventory_slots.Count() < 1)
9465 {
9466 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9467 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9468 }
9469 else
9470 {
9471 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9472 if (detach_types.Count() < 1)
9473 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9474 }
9475
9476 for (int i = 0; i < inventory_slots.Count(); i++)
9477 {
9478 slot = inventory_slots.Get(i);
9479 }
9480
9481 if (slot != "")
9482 {
9483 if (detach_types.Count() == 1)
9484 idx = 0;
9485 else
9486 idx = inventory_slots.Find(slot);
9487 }
9488 if (idx < 0)
9489 return "";
9490
9491 return detach_types.Get(idx);
9492 }
9493
9495 {
9496
9498
9499
9500 float min_time = 1;
9501 float max_time = 3;
9502 float delay = Math.RandomFloat(min_time, max_time);
9503
9504 explode_timer.Run(delay, this, "DoAmmoExplosion");
9505 }
9506
9508 {
9509 Magazine magazine = Magazine.Cast(this);
9510 int pop_sounds_count = 6;
9511 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9512
9513
9514 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9515 string sound_name = pop_sounds[ sound_idx ];
9517
9518
9519 magazine.ServerAddAmmoCount(-1);
9520
9521
9522 float min_temp_to_explode = 100;
9523
9524 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9525 {
9527 }
9528 }
9529
9530
9531 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9532 {
9533 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9534
9535 const int CHANCE_DAMAGE_CARGO = 4;
9536 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9537 const int CHANCE_DAMAGE_NOTHING = 2;
9538
9540 {
9541 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9542 int chances;
9543 int rnd;
9544
9545 if (GetInventory().GetCargo())
9546 {
9547 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9548 rnd = Math.RandomInt(0,chances);
9549
9550 if (rnd < CHANCE_DAMAGE_CARGO)
9551 {
9553 }
9554 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9555 {
9557 }
9558 }
9559 else
9560 {
9561 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9562 rnd = Math.RandomInt(0,chances);
9563
9564 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9565 {
9567 }
9568 }
9569 }
9570 }
9571
9573 {
9574 if (GetInventory().GetCargo())
9575 {
9576 int item_count = GetInventory().GetCargo().GetItemCount();
9577 if (item_count > 0)
9578 {
9579 int random_pick = Math.RandomInt(0, item_count);
9581 if (!item.IsExplosive())
9582 {
9583 item.AddHealth("","",damage);
9584 return true;
9585 }
9586 }
9587 }
9588 return false;
9589 }
9590
9592 {
9593 int attachment_count = GetInventory().AttachmentCount();
9594 if (attachment_count > 0)
9595 {
9596 int random_pick = Math.RandomInt(0, attachment_count);
9597 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9598 if (!attachment.IsExplosive())
9599 {
9600 attachment.AddHealth("","",damage);
9601 return true;
9602 }
9603 }
9604 return false;
9605 }
9606
9608 {
9610 }
9611
9613 {
9615 return GetInventory().CanRemoveEntity();
9616
9617 return false;
9618 }
9619
9621 {
9622
9624 return false;
9625
9626
9628 return false;
9629
9630
9631
9633 if (delta == 0)
9634 return false;
9635
9636
9637 return true;
9638 }
9639
9641 {
9643 {
9644 if (ScriptInputUserData.CanStoreInputUserData())
9645 {
9646 ScriptInputUserData ctx = new ScriptInputUserData;
9651 ctx.
Write(destination_entity);
9655 }
9656 }
9657 else if (!
GetGame().IsMultiplayer())
9658 {
9660 }
9661 }
9662
9664 {
9665 float split_quantity_new;
9669 InventoryLocation loc = new InventoryLocation;
9670
9671 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9672 {
9674 split_quantity_new = stack_max;
9675 else
9677
9679 {
9680 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9681 if (new_item)
9682 {
9683 new_item.SetResultOfSplit(true);
9684 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9686 new_item.
SetQuantity(split_quantity_new,
false,
true);
9687 }
9688 }
9689 }
9690 else if (destination_entity && slot_id == -1)
9691 {
9692 if (quantity > stack_max)
9693 split_quantity_new = stack_max;
9694 else
9695 split_quantity_new = quantity;
9696
9698 {
9700 {
9703 }
9704
9705 if (new_item)
9706 {
9707 new_item.SetResultOfSplit(true);
9708 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9710 new_item.
SetQuantity(split_quantity_new,
false,
true);
9711 }
9712 }
9713 }
9714 else
9715 {
9716 if (stack_max != 0)
9717 {
9719 {
9721 }
9722
9723 if (split_quantity_new == 0)
9724 {
9725 if (!
GetGame().IsMultiplayer())
9726 player.PhysicalPredictiveDropItem(this);
9727 else
9728 player.ServerDropEntity(this);
9729 return;
9730 }
9731
9733 {
9735
9736 if (new_item)
9737 {
9738 new_item.SetResultOfSplit(true);
9739 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9742 new_item.PlaceOnSurface();
9743 }
9744 }
9745 }
9746 }
9747 }
9748
9750 {
9751 float split_quantity_new;
9755 InventoryLocation loc = new InventoryLocation;
9756
9757 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9758 {
9760 split_quantity_new = stack_max;
9761 else
9763
9765 {
9766 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9767 if (new_item)
9768 {
9769 new_item.SetResultOfSplit(true);
9770 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9772 new_item.
SetQuantity(split_quantity_new,
false,
true);
9773 }
9774 }
9775 }
9776 else if (destination_entity && slot_id == -1)
9777 {
9778 if (quantity > stack_max)
9779 split_quantity_new = stack_max;
9780 else
9781 split_quantity_new = quantity;
9782
9784 {
9786 {
9789 }
9790
9791 if (new_item)
9792 {
9793 new_item.SetResultOfSplit(true);
9794 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9796 new_item.
SetQuantity(split_quantity_new,
false,
true);
9797 }
9798 }
9799 }
9800 else
9801 {
9802 if (stack_max != 0)
9803 {
9805 {
9807 }
9808
9810 {
9812
9813 if (new_item)
9814 {
9815 new_item.SetResultOfSplit(true);
9816 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9819 new_item.PlaceOnSurface();
9820 }
9821 }
9822 }
9823 }
9824 }
9825
9827 {
9829 {
9830 if (ScriptInputUserData.CanStoreInputUserData())
9831 {
9832 ScriptInputUserData ctx = new ScriptInputUserData;
9837 dst.WriteToContext(ctx);
9839 }
9840 }
9841 else if (!
GetGame().IsMultiplayer())
9842 {
9844 }
9845 }
9846
9848 {
9850 {
9851 if (ScriptInputUserData.CanStoreInputUserData())
9852 {
9853 ScriptInputUserData ctx = new ScriptInputUserData;
9858 ctx.
Write(destination_entity);
9864 }
9865 }
9866 else if (!
GetGame().IsMultiplayer())
9867 {
9869 }
9870 }
9871
9873 {
9875 }
9876
9878 {
9880 float split_quantity_new;
9882 if (dst.IsValid())
9883 {
9884 int slot_id = dst.GetSlot();
9886
9887 if (quantity > stack_max)
9888 split_quantity_new = stack_max;
9889 else
9890 split_quantity_new = quantity;
9891
9893 {
9895
9896 if (new_item)
9897 {
9898 new_item.SetResultOfSplit(true);
9899 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9901 new_item.
SetQuantity(split_quantity_new,
false,
true);
9902 }
9903
9904 return new_item;
9905 }
9906 }
9907
9908 return null;
9909 }
9910
9912 {
9914 float split_quantity_new;
9916 if (destination_entity)
9917 {
9919 if (quantity > stackable)
9920 split_quantity_new = stackable;
9921 else
9922 split_quantity_new = quantity;
9923
9925 {
9926 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9927 if (new_item)
9928 {
9929 new_item.SetResultOfSplit(true);
9930 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9932 new_item.
SetQuantity(split_quantity_new,
false,
true);
9933 }
9934 }
9935 }
9936 }
9937
9939 {
9941 {
9942 if (ScriptInputUserData.CanStoreInputUserData())
9943 {
9944 ScriptInputUserData ctx = new ScriptInputUserData;
9949 ItemBase destination_entity =
this;
9950 ctx.
Write(destination_entity);
9954 }
9955 }
9956 else if (!
GetGame().IsMultiplayer())
9957 {
9959 }
9960 }
9961
9963 {
9965 float split_quantity_new;
9967 if (player)
9968 {
9970 if (quantity > stackable)
9971 split_quantity_new = stackable;
9972 else
9973 split_quantity_new = quantity;
9974
9976 {
9977 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9978 new_item =
ItemBase.Cast(in_hands);
9979 if (new_item)
9980 {
9981 new_item.SetResultOfSplit(true);
9982 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9984 new_item.SetQuantity(split_quantity_new, false, true);
9985 }
9986 }
9987 }
9988 }
9989
9991 {
9993 float split_quantity_new = Math.Floor(quantity * 0.5);
9994
9996 return;
9997
9999
10000 if (new_item)
10001 {
10002 if (new_item.GetQuantityMax() < split_quantity_new)
10003 {
10004 split_quantity_new = new_item.GetQuantityMax();
10005 }
10006
10007 new_item.SetResultOfSplit(true);
10008 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10009
10011 {
10014 }
10015 else
10016 {
10018 new_item.
SetQuantity(split_quantity_new,
false,
true);
10019 }
10020 }
10021 }
10022
10024 {
10026 float split_quantity_new = Math.Floor(quantity / 2);
10027
10029 return;
10030
10031 InventoryLocation invloc = new InventoryLocation;
10033
10035 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10036
10037 if (new_item)
10038 {
10039 if (new_item.GetQuantityMax() < split_quantity_new)
10040 {
10041 split_quantity_new = new_item.GetQuantityMax();
10042 }
10044 {
10047 }
10048 else if (split_quantity_new > 1)
10049 {
10051 new_item.
SetQuantity(split_quantity_new,
false,
true);
10052 }
10053 }
10054 }
10055
10058 {
10059 SetWeightDirty();
10061
10062 if (parent)
10063 parent.OnAttachmentQuantityChangedEx(this, delta);
10064
10066 {
10068 {
10070 }
10072 {
10073 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10075 }
10076 }
10077
10078 }
10079
10082 {
10083
10084 }
10085
10088 {
10090 }
10091
10093 {
10094 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10095
10097 {
10098 if (newLevel == GameConstants.STATE_RUINED)
10099 {
10101 EntityAI parent = GetHierarchyParent();
10102 if (parent && parent.IsFireplace())
10103 {
10104 CargoBase cargo = GetInventory().GetCargo();
10105 if (cargo)
10106 {
10108 {
10110 }
10111 }
10112 }
10113 }
10114
10116 {
10117
10119 return;
10120 }
10121
10122 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10123 {
10125 }
10126 }
10127 }
10128
10129
10131 {
10132 super.OnRightClick();
10133
10135 {
10137 {
10138 if (ScriptInputUserData.CanStoreInputUserData())
10139 {
10140 EntityAI root = GetHierarchyRoot();
10141 Man playerOwner = GetHierarchyRootPlayer();
10142 InventoryLocation dst = new InventoryLocation;
10143
10144
10145 if (!playerOwner && root && root == this)
10146 {
10148 }
10149 else
10150 {
10151
10152 GetInventory().GetCurrentInventoryLocation(dst);
10154 {
10157 {
10159 }
10160 else
10161 {
10163
10164
10165 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10166 {
10168 }
10169 else
10170 {
10171 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10172 }
10173 }
10174 }
10175 }
10176
10177 ScriptInputUserData ctx = new ScriptInputUserData;
10185 }
10186 }
10187 else if (!
GetGame().IsMultiplayer())
10188 {
10190 }
10191 }
10192 }
10193
10195 {
10196 if (root)
10197 {
10198 vector m4[4];
10199 root.GetTransform(m4);
10200 dst.SetGround(this, m4);
10201 }
10202 else
10203 {
10204 GetInventory().GetCurrentInventoryLocation(dst);
10205 }
10206 }
10207
10208 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10209 {
10210
10211 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10212 return false;
10213
10214 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10215 return false;
10216
10217
10219 return false;
10220
10221
10222 Magazine mag = Magazine.Cast(this);
10223 if (mag)
10224 {
10225 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10226 return false;
10227
10228 if (stack_max_limit)
10229 {
10230 Magazine other_mag = Magazine.Cast(other_item);
10231 if (other_item)
10232 {
10233 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10234 return false;
10235 }
10236
10237 }
10238 }
10239 else
10240 {
10241
10243 return false;
10244
10246 return false;
10247 }
10248
10249 PlayerBase player = null;
10250 if (CastTo(player, GetHierarchyRootPlayer()))
10251 {
10252 if (player.GetInventory().HasAttachment(this))
10253 return false;
10254
10255 if (player.IsItemsToDelete())
10256 return false;
10257 }
10258
10259 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10260 return false;
10261
10262 int slotID;
10264 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10265 return false;
10266
10267 return true;
10268 }
10269
10271 {
10273 }
10274
10276 {
10277 return m_IsResultOfSplit;
10278 }
10279
10281 {
10282 m_IsResultOfSplit = value;
10283 }
10284
10286 {
10288 }
10289
10291 {
10292 float other_item_quantity = other_item.GetQuantity();
10293 float this_free_space;
10294
10296
10298
10299 if (other_item_quantity > this_free_space)
10300 {
10301 return this_free_space;
10302 }
10303 else
10304 {
10305 return other_item_quantity;
10306 }
10307 }
10308
10310 {
10312 }
10313
10315 {
10317 return;
10318
10319 if (!IsMagazine() && other_item)
10320 {
10322 if (quantity_used != 0)
10323 {
10324 float hp1 = GetHealth01("","");
10325 float hp2 = other_item.GetHealth01("","");
10326 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10327 hpResult = hpResult / (
GetQuantity() + quantity_used);
10328
10329 hpResult *= GetMaxHealth();
10330 Math.Round(hpResult);
10331 SetHealth("", "Health", hpResult);
10332
10334 other_item.AddQuantity(-quantity_used);
10335 }
10336 }
10338 }
10339
10341 {
10342 #ifdef SERVER
10343 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10344 GetHierarchyParent().IncreaseLifetimeUp();
10345 #endif
10346 };
10347
10349 {
10350 PlayerBase p = PlayerBase.Cast(player);
10351
10352 array<int> recipesIds = p.m_Recipes;
10353 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10354 if (moduleRecipesManager)
10355 {
10356 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10357 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10358 }
10359
10360 for (int i = 0;i < recipesIds.Count(); i++)
10361 {
10362 int key = recipesIds.Get(i);
10363 string recipeName = moduleRecipesManager.GetRecipeName(key);
10365 }
10366 }
10367
10368
10369 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10370 {
10371 super.GetDebugActions(outputList);
10372
10373
10379
10380
10385
10390
10391
10395
10396
10398 {
10402 }
10403
10406
10407
10411
10413
10414 InventoryLocation loc = new InventoryLocation();
10415 GetInventory().GetCurrentInventoryLocation(loc);
10417 {
10418 if (Gizmo_IsSupported())
10421 }
10422
10424 }
10425
10426
10427
10428
10430 {
10431 super.OnAction(action_id, player, ctx);
10432
10434 {
10435 switch (action_id)
10436 {
10439 return true;
10442 return true;
10443 }
10444 }
10445
10447 {
10448 switch (action_id)
10449 {
10451 Delete();
10452 return true;
10453 }
10454 }
10455
10456 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10457 {
10458 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10459 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10460 PlayerBase p = PlayerBase.Cast(player);
10461 if (
EActions.RECIPES_RANGE_START < 1000)
10462 {
10463 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10464 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10465 }
10466 }
10467 #ifndef SERVER
10468 else if (action_id ==
EActions.WATCH_PLAYER)
10469 {
10470 PluginDeveloper.SetDeveloperItemClientEx(player);
10471 }
10472 #endif
10474 {
10475 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10476 {
10477 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10478 OnDebugButtonPressServer(id + 1);
10479 }
10480
10481 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10482 {
10483 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10485 }
10486
10487 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10488 {
10489 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10491 }
10492
10493 else if (action_id ==
EActions.ADD_QUANTITY)
10494 {
10495 if (IsMagazine())
10496 {
10497 Magazine mag = Magazine.Cast(this);
10498 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10499 }
10500 else
10501 {
10503 }
10504
10505 if (m_EM)
10506 {
10507 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10508 }
10509
10510 }
10511
10512 else if (action_id ==
EActions.REMOVE_QUANTITY)
10513 {
10514 if (IsMagazine())
10515 {
10516 Magazine mag2 = Magazine.Cast(this);
10517 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10518 }
10519 else
10520 {
10522 }
10523 if (m_EM)
10524 {
10525 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10526 }
10527
10528 }
10529
10530 else if (action_id ==
EActions.SET_QUANTITY_0)
10531 {
10533
10534 if (m_EM)
10535 {
10536 m_EM.SetEnergy(0);
10537 }
10538 }
10539
10540 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10541 {
10543
10544 if (m_EM)
10545 {
10546 m_EM.SetEnergy(m_EM.GetEnergyMax());
10547 }
10548 }
10549
10550 else if (action_id ==
EActions.ADD_HEALTH)
10551 {
10552 AddHealth("","",GetMaxHealth("","Health")/5);
10553 }
10554 else if (action_id ==
EActions.REMOVE_HEALTH)
10555 {
10556 AddHealth("","",-GetMaxHealth("","Health")/5);
10557 }
10558 else if (action_id ==
EActions.DESTROY_HEALTH)
10559 {
10560 SetHealth01("","",0);
10561 }
10562 else if (action_id ==
EActions.WATCH_ITEM)
10563 {
10565 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10566 #ifdef DEVELOPER
10567 SetDebugDeveloper_item(this);
10568 #endif
10569 }
10570
10571 else if (action_id ==
EActions.ADD_TEMPERATURE)
10572 {
10573 AddTemperature(20);
10574
10575 }
10576
10577 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10578 {
10579 AddTemperature(-20);
10580
10581 }
10582
10583 else if (action_id ==
EActions.FLIP_FROZEN)
10584 {
10585 SetFrozen(!GetIsFrozen());
10586
10587 }
10588
10589 else if (action_id ==
EActions.ADD_WETNESS)
10590 {
10592
10593 }
10594
10595 else if (action_id ==
EActions.REMOVE_WETNESS)
10596 {
10598
10599 }
10600
10601 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10602 {
10605
10606
10607 }
10608
10609 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10610 {
10613 }
10614
10615 else if (action_id ==
EActions.MAKE_SPECIAL)
10616 {
10617 auto debugParams = DebugSpawnParams.WithPlayer(player);
10618 OnDebugSpawnEx(debugParams);
10619 }
10620
10621 }
10622
10623
10624 return false;
10625 }
10626
10627
10628
10629
10633
10636
10637
10638
10640 {
10641 return false;
10642 }
10643
10644
10646 {
10647 return true;
10648 }
10649
10650
10652 {
10653 return true;
10654 }
10655
10656
10657
10659 {
10660 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10662 }
10663
10666 {
10667 return null;
10668 }
10669
10671 {
10672 return false;
10673 }
10674
10676 {
10677 return false;
10678 }
10679
10683
10684
10686 {
10687 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10688 return module_repairing.CanRepair(this, item_repair_kit);
10689 }
10690
10691
10692 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10693 {
10694 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10695 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10696 }
10697
10698
10700 {
10701
10702
10703
10704
10705
10706
10707
10708
10709 return 1;
10710 }
10711
10712
10713
10715 {
10717 }
10718
10719
10720
10722 {
10724 }
10725
10726
10735 {
10736 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10737
10738 if (player)
10739 {
10740 player.MessageStatus(text);
10741 }
10742 }
10743
10744
10753 {
10754 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10755
10756 if (player)
10757 {
10758 player.MessageAction(text);
10759 }
10760 }
10761
10762
10771 {
10772 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10773
10774 if (player)
10775 {
10776 player.MessageFriendly(text);
10777 }
10778 }
10779
10780
10789 {
10790 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10791
10792 if (player)
10793 {
10794 player.MessageImportant(text);
10795 }
10796 }
10797
10799 {
10800 return true;
10801 }
10802
10803
10804 override bool KindOf(
string tag)
10805 {
10806 bool found = false;
10807 string item_name = this.
GetType();
10810
10811 int array_size = item_tag_array.Count();
10812 for (int i = 0; i < array_size; i++)
10813 {
10814 if (item_tag_array.Get(i) == tag)
10815 {
10816 found = true;
10817 break;
10818 }
10819 }
10820 return found;
10821 }
10822
10823
10825 {
10826
10827 super.OnRPC(sender, rpc_type,ctx);
10828
10829
10830 switch (rpc_type)
10831 {
10832 #ifndef SERVER
10833 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10834 Param2<bool, string> p = new Param2<bool, string>(false, "");
10835
10837 return;
10838
10839 bool play = p.param1;
10840 string soundSet = p.param2;
10841
10842 if (play)
10843 {
10845 {
10847 {
10849 }
10850 }
10851 else
10852 {
10854 }
10855 }
10856 else
10857 {
10859 }
10860
10861 break;
10862 #endif
10863
10864 }
10865
10867 {
10869 }
10870 }
10871
10872
10873
10874
10876 {
10877 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10878 return plugin.GetID(
name);
10879 }
10880
10882 {
10883 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10884 return plugin.GetName(id);
10885 }
10886
10889 {
10890
10891
10892 int varFlags;
10893 if (!ctx.
Read(varFlags))
10894 return;
10895
10896 if (varFlags & ItemVariableFlags.FLOAT)
10897 {
10899 }
10900 }
10901
10903 {
10904
10905 super.SerializeNumericalVars(floats_out);
10906
10907
10908
10910 {
10912 }
10913
10915 {
10917 }
10918
10920 {
10922 }
10923
10925 {
10930 }
10931
10933 {
10935 }
10936 }
10937
10939 {
10940
10941 super.DeSerializeNumericalVars(floats);
10942
10943
10944 int index = 0;
10945 int mask = Math.Round(floats.Get(index));
10946
10947 index++;
10948
10950 {
10952 {
10954 }
10955 else
10956 {
10957 float quantity = floats.Get(index);
10958 SetQuantity(quantity,
true,
false,
false,
false);
10959 }
10960 index++;
10961 }
10962
10964 {
10965 float wet = floats.Get(index);
10967 index++;
10968 }
10969
10971 {
10972 int liquidtype = Math.Round(floats.Get(index));
10974 index++;
10975 }
10976
10978 {
10980 index++;
10982 index++;
10984 index++;
10986 index++;
10987 }
10988
10990 {
10991 int cleanness = Math.Round(floats.Get(index));
10993 index++;
10994 }
10995 }
10996
10998 {
10999 super.WriteVarsToCTX(ctx);
11000
11001
11003 {
11005 }
11006
11008 {
11010 }
11011
11013 {
11015 }
11016
11018 {
11019 int r,g,b,a;
11025 }
11026
11028 {
11030 }
11031 }
11032
11034 {
11035 if (!super.ReadVarsFromCTX(ctx,version))
11036 return false;
11037
11038 int intValue;
11039 float value;
11040
11041 if (version < 140)
11042 {
11043 if (!ctx.
Read(intValue))
11044 return false;
11045
11046 m_VariablesMask = intValue;
11047 }
11048
11050 {
11051 if (!ctx.
Read(value))
11052 return false;
11053
11055 {
11057 }
11058 else
11059 {
11061 }
11062 }
11063
11064 if (version < 140)
11065 {
11067 {
11068 if (!ctx.
Read(value))
11069 return false;
11070 SetTemperatureDirect(value);
11071 }
11072 }
11073
11075 {
11076 if (!ctx.
Read(value))
11077 return false;
11079 }
11080
11082 {
11083 if (!ctx.
Read(intValue))
11084 return false;
11086 }
11087
11089 {
11090 int r,g,b,a;
11092 return false;
11094 return false;
11096 return false;
11098 return false;
11099
11101 }
11102
11104 {
11105 if (!ctx.
Read(intValue))
11106 return false;
11108 }
11109
11110 if (version >= 138 && version < 140)
11111 {
11113 {
11114 if (!ctx.
Read(intValue))
11115 return false;
11116 SetFrozen(intValue);
11117 }
11118 }
11119
11120 return true;
11121 }
11122
11123
11125 {
11128 {
11130 }
11131
11132 if (!super.OnStoreLoad(ctx, version))
11133 {
11135 return false;
11136 }
11137
11138 if (version >= 114)
11139 {
11140 bool hasQuickBarIndexSaved;
11141
11142 if (!ctx.
Read(hasQuickBarIndexSaved))
11143 {
11145 return false;
11146 }
11147
11148 if (hasQuickBarIndexSaved)
11149 {
11150 int itmQBIndex;
11151
11152
11153 if (!ctx.
Read(itmQBIndex))
11154 {
11156 return false;
11157 }
11158
11159 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11160 if (itmQBIndex != -1 && parentPlayer)
11161 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11162 }
11163 }
11164 else
11165 {
11166
11167 PlayerBase player;
11168 int itemQBIndex;
11169 if (version ==
int.
MAX)
11170 {
11171 if (!ctx.
Read(itemQBIndex))
11172 {
11174 return false;
11175 }
11176 }
11177 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11178 {
11179
11180 if (!ctx.
Read(itemQBIndex))
11181 {
11183 return false;
11184 }
11185 if (itemQBIndex != -1 && player)
11186 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11187 }
11188 }
11189
11190 if (version < 140)
11191 {
11192
11193 if (!LoadVariables(ctx, version))
11194 {
11196 return false;
11197 }
11198 }
11199
11200
11202 {
11204 return false;
11205 }
11206 if (version >= 132)
11207 {
11209 if (raib)
11210 {
11212 {
11214 return false;
11215 }
11216 }
11217 }
11218
11220 return true;
11221 }
11222
11223
11224
11226 {
11227 super.OnStoreSave(ctx);
11228
11229 PlayerBase player;
11230 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11231 {
11233
11234 int itemQBIndex = -1;
11235 itemQBIndex = player.FindQuickBarEntityIndex(this);
11236 ctx.
Write(itemQBIndex);
11237 }
11238 else
11239 {
11241 }
11242
11244
11246 if (raib)
11247 {
11249 }
11250 }
11251
11252
11254 {
11255 super.AfterStoreLoad();
11256
11258 {
11260 }
11261
11263 {
11266 }
11267 }
11268
11270 {
11271 super.EEOnAfterLoad();
11272
11274 {
11276 }
11277
11280 }
11281
11283 {
11284 return false;
11285 }
11286
11287
11288
11290 {
11292 {
11293 #ifdef PLATFORM_CONSOLE
11294
11296 {
11298 if (menu)
11299 {
11301 }
11302 }
11303 #endif
11304 }
11305
11307 {
11310 }
11311
11313 {
11314 SetWeightDirty();
11316 }
11318 {
11321 }
11322
11324 {
11327 }
11329 {
11332 }
11333
11334 super.OnVariablesSynchronized();
11335 }
11336
11337
11338
11340 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11341 {
11342 if (!IsServerCheck(allow_client))
11343 return false;
11344
11346 return false;
11347
11350
11351 if (value <= (min + 0.001))
11352 value = min;
11353
11354 if (value == min)
11355 {
11356 if (destroy_config)
11357 {
11358 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11359 if (dstr)
11360 {
11362 this.Delete();
11363 return true;
11364 }
11365 }
11366 else if (destroy_forced)
11367 {
11369 this.Delete();
11370 return true;
11371 }
11372
11374 }
11375
11378
11380 {
11382
11383 if (delta)
11385 }
11386
11388
11389 return false;
11390 }
11391
11392
11394 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11395 {
11397 }
11398
11400 {
11403 }
11404
11406 {
11409 }
11410
11412 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11413 {
11414 float value_clamped = Math.Clamp(value, 0, 1);
11416 SetQuantity(result, destroy_config, destroy_forced);
11417 }
11418
11419
11422 {
11424 }
11425
11427 {
11429 }
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11441 {
11442 int slot = -1;
11443 if (GetInventory())
11444 {
11445 InventoryLocation il = new InventoryLocation;
11446 GetInventory().GetCurrentInventoryLocation(il);
11448 }
11449
11451 }
11452
11454 {
11455 float quantity_max = 0;
11456
11458 {
11459 if (attSlotID != -1)
11460 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11461
11462 if (quantity_max <= 0)
11464 }
11465
11466 if (quantity_max <= 0)
11468
11469 return quantity_max;
11470 }
11471
11473 {
11475 }
11476
11478 {
11480 }
11481
11482
11484 {
11486 }
11487
11489 {
11491 }
11492
11494 {
11496 }
11497
11498
11500 {
11501
11502 float weightEx = GetWeightEx();
11503 float special = GetInventoryAndCargoWeight();
11504 return weightEx - special;
11505 }
11506
11507
11509 {
11511 }
11512
11514 {
11516 {
11517 #ifdef DEVELOPER
11518 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11519 {
11520 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11522 }
11523 #endif
11524
11525 return GetQuantity() * GetConfigWeightModified();
11526 }
11527 else if (HasEnergyManager())
11528 {
11529 #ifdef DEVELOPER
11530 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11531 {
11532 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11533 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11534 }
11535 #endif
11536 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11537 }
11538 else
11539 {
11540 #ifdef DEVELOPER
11541 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11542 {
11543 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11544 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11545 }
11546 #endif
11547 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11548 }
11549 }
11550
11553 {
11554 int item_count = 0;
11556
11557 if (GetInventory().GetCargo() != NULL)
11558 {
11559 item_count = GetInventory().GetCargo().GetItemCount();
11560 }
11561
11562 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11563 {
11564 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11565 if (item)
11566 item_count += item.GetNumberOfItems();
11567 }
11568 return item_count;
11569 }
11570
11573 {
11574 float weight = 0;
11575 float wetness = 1;
11576 if (include_wetness)
11579 {
11580 weight = wetness * m_ConfigWeight;
11581 }
11583 {
11584 weight = 1;
11585 }
11586 return weight;
11587 }
11588
11589
11590
11592 {
11593 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11594 {
11595 GameInventory inv = GetInventory();
11596 array<EntityAI> items = new array<EntityAI>;
11598 for (int i = 0; i < items.Count(); i++)
11599 {
11601 if (item)
11602 {
11604 }
11605 }
11606 }
11607 }
11608
11609
11610
11611
11613 {
11614 float energy = 0;
11615 if (HasEnergyManager())
11616 {
11617 energy = GetCompEM().GetEnergy();
11618 }
11619 return energy;
11620 }
11621
11622
11624 {
11625 super.OnEnergyConsumed();
11626
11628 }
11629
11631 {
11632 super.OnEnergyAdded();
11633
11635 }
11636
11637
11639 {
11640 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11641 {
11643 {
11644 float energy_0to1 = GetCompEM().GetEnergy0To1();
11646 }
11647 }
11648 }
11649
11650
11652 {
11653 return ConfigGetFloat("heatIsolation");
11654 }
11655
11657 {
11659 }
11660
11662 {
11663 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11664 if (
GetGame().ConfigIsExisting(paramPath))
11666
11667 return 0.0;
11668 }
11669
11671 {
11672 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11673 if (
GetGame().ConfigIsExisting(paramPath))
11675
11676 return 0.0;
11677 }
11678
11679 override void SetWet(
float value,
bool allow_client =
false)
11680 {
11681 if (!IsServerCheck(allow_client))
11682 return;
11683
11686
11688
11689 m_VarWet = Math.Clamp(value, min, max);
11690
11692 {
11695 }
11696 }
11697
11698 override void AddWet(
float value)
11699 {
11701 }
11702
11704 {
11706 }
11707
11709 {
11711 }
11712
11714 {
11716 }
11717
11719 {
11721 }
11722
11724 {
11726 }
11727
11728 override void OnWetChanged(
float newVal,
float oldVal)
11729 {
11732 if (newLevel != oldLevel)
11733 {
11735 }
11736 }
11737
11739 {
11740 SetWeightDirty();
11741 }
11742
11744 {
11745 return GetWetLevelInternal(
m_VarWet);
11746 }
11747
11748
11749
11751 {
11753 }
11754
11756 {
11758 }
11759
11761 {
11763 }
11764
11766 {
11768 }
11769
11770
11771
11773 {
11774 if (ConfigIsExisting("itemModelLength"))
11775 {
11776 return ConfigGetFloat("itemModelLength");
11777 }
11778 return 0;
11779 }
11780
11782 {
11783 if (ConfigIsExisting("itemAttachOffset"))
11784 {
11785 return ConfigGetFloat("itemAttachOffset");
11786 }
11787 return 0;
11788 }
11789
11790 override void SetCleanness(
int value,
bool allow_client =
false)
11791 {
11792 if (!IsServerCheck(allow_client))
11793 return;
11794
11796
11798
11801 }
11802
11804 {
11806 }
11807
11809 {
11810 return true;
11811 }
11812
11813
11814
11815
11817 {
11819 }
11820
11822 {
11824 }
11825
11826
11827
11828
11829 override void SetColor(
int r,
int g,
int b,
int a)
11830 {
11836 }
11838 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11839 {
11844 }
11845
11847 {
11849 }
11850
11853 {
11854 int r,g,b,a;
11856 r = r/255;
11857 g = g/255;
11858 b = b/255;
11859 a = a/255;
11860 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11861 }
11862
11863
11864
11865 override void SetLiquidType(
int value,
bool allow_client =
false)
11866 {
11867 if (!IsServerCheck(allow_client))
11868 return;
11869
11874 }
11875
11877 {
11878 return ConfigGetInt("varLiquidTypeInit");
11879 }
11880
11882 {
11884 }
11885
11887 {
11889 SetFrozen(false);
11890 }
11891
11894 {
11895 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11896 }
11897
11898
11901 {
11902 PlayerBase nplayer;
11903 if (PlayerBase.CastTo(nplayer, player))
11904 {
11906
11907 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11908 }
11909 }
11910
11911
11914 {
11915 PlayerBase nplayer;
11916 if (PlayerBase.CastTo(nplayer,player))
11917 {
11918
11919 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11920
11921 }
11922
11923
11924 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11925
11926
11927 if (HasEnergyManager())
11928 {
11929 GetCompEM().UpdatePlugState();
11930 }
11931 }
11932
11933
11935 {
11936 super.OnPlacementStarted(player);
11937
11939 }
11940
11941 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11942 {
11944 {
11945 m_AdminLog.OnPlacementComplete(player,
this);
11946 }
11947
11948 super.OnPlacementComplete(player, position, orientation);
11949 }
11950
11951
11952
11953
11954
11956 {
11958 {
11959 return true;
11960 }
11961 else
11962 {
11963 return false;
11964 }
11965 }
11966
11967
11969 {
11971 {
11973 }
11974 }
11975
11976
11978 {
11980 }
11981
11983 {
11985 }
11986
11987 override void InsertAgent(
int agent,
float count = 1)
11988 {
11989 if (count < 1)
11990 return;
11991
11993 }
11994
11997 {
11999 }
12000
12001
12003 {
12005 }
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12049 {
12051 return false;
12052 return true;
12053 }
12054
12056 {
12057
12059 }
12060
12061
12064 {
12065 super.CheckForRoofLimited(timeTresholdMS);
12066
12068 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12069 {
12070 m_PreviousRoofTestTime = time;
12071 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12072 }
12073 }
12074
12075
12077 {
12079 {
12080 return 0;
12081 }
12082
12083 if (GetInventory().GetAttachmentSlotsCount() != 0)
12084 {
12085 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12086 if (filter)
12087 return filter.GetProtectionLevel(type, false, system);
12088 else
12089 return 0;
12090 }
12091
12092 string subclassPath, entryName;
12093
12094 switch (type)
12095 {
12097 entryName = "biological";
12098 break;
12100 entryName = "chemical";
12101 break;
12102 default:
12103 entryName = "biological";
12104 break;
12105 }
12106
12107 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12108
12110 }
12111
12112
12113
12116 {
12117 if (!IsMagazine())
12119
12121 }
12122
12123
12124
12125
12126
12131 {
12132 return true;
12133 }
12134
12136 {
12138 }
12139
12140
12141
12142
12143
12145 {
12146 if (parent)
12147 {
12148 if (parent.IsInherited(DayZInfected))
12149 return true;
12150
12151 if (!parent.IsRuined())
12152 return true;
12153 }
12154
12155 return true;
12156 }
12157
12159 {
12160 if (!super.CanPutAsAttachment(parent))
12161 {
12162 return false;
12163 }
12164
12165 if (!IsRuined() && !parent.IsRuined())
12166 {
12167 return true;
12168 }
12169
12170 return false;
12171 }
12172
12174 {
12175
12176
12177
12178
12179 return super.CanReceiveItemIntoCargo(item);
12180 }
12181
12183 {
12184
12185
12186
12187
12188 GameInventory attachmentInv = attachment.GetInventory();
12190 {
12191 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12192 return false;
12193 }
12194
12195 InventoryLocation loc = new InventoryLocation();
12196 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12197 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12198 return false;
12199
12200 return super.CanReceiveAttachment(attachment, slotId);
12201 }
12202
12204 {
12205 if (!super.CanReleaseAttachment(attachment))
12206 return false;
12207
12208 return GetInventory().AreChildrenAccessible();
12209 }
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12232 {
12233 int id = muzzle_owner.GetMuzzleID();
12234 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12235
12236 if (WPOF_array)
12237 {
12238 for (int i = 0; i < WPOF_array.Count(); i++)
12239 {
12240 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12241
12242 if (WPOF)
12243 {
12244 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12245 }
12246 }
12247 }
12248 }
12249
12250
12252 {
12253 int id = muzzle_owner.GetMuzzleID();
12255
12256 if (WPOBE_array)
12257 {
12258 for (int i = 0; i < WPOBE_array.Count(); i++)
12259 {
12260 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12261
12262 if (WPOBE)
12263 {
12264 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12265 }
12266 }
12267 }
12268 }
12269
12270
12272 {
12273 int id = muzzle_owner.GetMuzzleID();
12274 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12275
12276 if (WPOOH_array)
12277 {
12278 for (int i = 0; i < WPOOH_array.Count(); i++)
12279 {
12280 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12281
12282 if (WPOOH)
12283 {
12284 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12285 }
12286 }
12287 }
12288 }
12289
12290
12292 {
12293 int id = muzzle_owner.GetMuzzleID();
12294 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12295
12296 if (WPOOH_array)
12297 {
12298 for (int i = 0; i < WPOOH_array.Count(); i++)
12299 {
12300 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12301
12302 if (WPOOH)
12303 {
12304 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12305 }
12306 }
12307 }
12308 }
12309
12310
12312 {
12313 int id = muzzle_owner.GetMuzzleID();
12314 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12315
12316 if (WPOOH_array)
12317 {
12318 for (int i = 0; i < WPOOH_array.Count(); i++)
12319 {
12320 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12321
12322 if (WPOOH)
12323 {
12324 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12325 }
12326 }
12327 }
12328 }
12329
12330
12331
12333 {
12335 {
12336 return true;
12337 }
12338
12339 return false;
12340 }
12341
12343 {
12345 {
12346 return true;
12347 }
12348
12349 return false;
12350 }
12351
12353 {
12355 {
12356 return true;
12357 }
12358
12359 return false;
12360 }
12361
12363 {
12364 return false;
12365 }
12366
12369 {
12370 return UATimeSpent.DEFAULT_DEPLOY;
12371 }
12372
12373
12374
12375
12377 {
12379 SetSynchDirty();
12380 }
12381
12383 {
12385 }
12386
12387
12389 {
12390 return false;
12391 }
12392
12395 {
12396 string att_type = "None";
12397
12398 if (ConfigIsExisting("soundAttType"))
12399 {
12400 att_type = ConfigGetString("soundAttType");
12401 }
12402
12404 }
12405
12407 {
12409 }
12410
12411
12412
12413
12414
12420
12422 {
12425
12427 }
12428
12429
12431 {
12433 return;
12434
12436
12439
12442
12443 SoundParameters params = new SoundParameters();
12447 }
12448
12449
12451 {
12453 return;
12454
12456 SetSynchDirty();
12457
12460 }
12461
12462
12464 {
12466 return;
12467
12469 SetSynchDirty();
12470
12473 }
12474
12476 {
12478 }
12479
12481 {
12483 }
12484
12487 {
12488 if (!
GetGame().IsDedicatedServer())
12489 {
12490 if (ConfigIsExisting("attachSoundSet"))
12491 {
12492 string cfg_path = "";
12493 string soundset = "";
12494 string type_name =
GetType();
12495
12498 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12499 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12500
12501 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12502 {
12503 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12504 {
12505 if (cfg_slot_array[i] == slot_type)
12506 {
12507 soundset = cfg_soundset_array[i];
12508 break;
12509 }
12510 }
12511 }
12512
12513 if (soundset != "")
12514 {
12515 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12517 }
12518 }
12519 }
12520 }
12521
12523 {
12524
12525 }
12526
12527 void OnApply(PlayerBase player);
12528
12530 {
12531 return 1.0;
12532 };
12533
12535 {
12537 }
12538
12540 {
12542 }
12543
12545
12547 {
12548 SetDynamicPhysicsLifeTime(0.01);
12550 }
12551
12553 {
12554 array<string> zone_names = new array<string>;
12555 GetDamageZones(zone_names);
12556 for (int i = 0; i < zone_names.Count(); i++)
12557 {
12558 SetHealthMax(zone_names.Get(i),"Health");
12559 }
12560 SetHealthMax("","Health");
12561 }
12562
12565 {
12566 float global_health = GetHealth01("","Health");
12567 array<string> zones = new array<string>;
12568 GetDamageZones(zones);
12569
12570 for (int i = 0; i < zones.Count(); i++)
12571 {
12572 SetHealth01(zones.Get(i),"Health",global_health);
12573 }
12574 }
12575
12578 {
12579 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12580 }
12581
12583 {
12584 if (!hasRootAsPlayer)
12585 {
12586 if (refParentIB)
12587 {
12588
12589 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12590 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12591
12592 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12593 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12594
12597 }
12598 else
12599 {
12600
12603 }
12604 }
12605 }
12606
12608 {
12610 {
12611 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12612 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12613 {
12614 float heatPermCoef = 1.0;
12616 while (ent)
12617 {
12618 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12619 ent = ent.GetHierarchyParent();
12620 }
12621
12622 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12623 }
12624 }
12625 }
12626
12628 {
12629
12630 EntityAI parent = GetHierarchyParent();
12631 if (!parent)
12632 {
12633 hasParent = false;
12634 hasRootAsPlayer = false;
12635 }
12636 else
12637 {
12638 hasParent = true;
12639 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12640 refParentIB =
ItemBase.Cast(parent);
12641 }
12642 }
12643
12644 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12645 {
12646
12647 }
12648
12650 {
12651
12652 return false;
12653 }
12654
12656 {
12657
12658
12659 return false;
12660 }
12661
12663 {
12664
12665 return false;
12666 }
12667
12670 {
12671 return !GetIsFrozen() &&
IsOpen();
12672 }
12673
12675 {
12676 bool hasParent = false, hasRootAsPlayer = false;
12678
12679 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12680 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12681
12682 if (wwtu || foodDecay)
12683 {
12687
12688 if (processWetness || processTemperature || processDecay)
12689 {
12691
12692 if (processWetness)
12693 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12694
12695 if (processTemperature)
12697
12698 if (processDecay)
12699 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12700 }
12701 }
12702 }
12703
12706 {
12708 }
12709
12711 {
12714
12715 return super.GetTemperatureFreezeThreshold();
12716 }
12717
12719 {
12722
12723 return super.GetTemperatureThawThreshold();
12724 }
12725
12727 {
12730
12731 return super.GetItemOverheatThreshold();
12732 }
12733
12735 {
12737 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12738
12739 return super.GetTemperatureFreezeTime();
12740 }
12741
12743 {
12745 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12746
12747 return super.GetTemperatureThawTime();
12748 }
12749
12754
12756 {
12757 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12758 }
12759
12761 {
12762 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12763 }
12764
12767 {
12769 }
12770
12772 {
12774 }
12775
12777 {
12779 }
12780
12783 {
12784 return null;
12785 }
12786
12789 {
12790 return false;
12791 }
12792
12794 {
12796 {
12799 if (!trg)
12800 {
12802 explosive = this;
12803 }
12804
12805 explosive.PairRemote(trg);
12807
12808 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12809 trg.SetPersistentPairID(persistentID);
12810 explosive.SetPersistentPairID(persistentID);
12811
12812 return true;
12813 }
12814 return false;
12815 }
12816
12819 {
12820 float ret = 1.0;
12823 ret *= GetHealth01();
12824
12825 return ret;
12826 }
12827
12828 #ifdef DEVELOPER
12829 override void SetDebugItem()
12830 {
12831 super.SetDebugItem();
12832 _itemBase = this;
12833 }
12834
12836 {
12837 string text = super.GetDebugText();
12838
12840 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12841
12842 return text;
12843 }
12844 #endif
12845
12847 {
12848 return true;
12849 }
12850
12852
12854
12856 {
12859 }
12860
12861
12869
12885}
12886
12888{
12890 if (entity)
12891 {
12892 bool is_item = entity.IsInherited(
ItemBase);
12893 if (is_item && full_quantity)
12894 {
12897 }
12898 }
12899 else
12900 {
12902 return NULL;
12903 }
12904 return entity;
12905}
12906
12908{
12909 if (item)
12910 {
12911 if (health > 0)
12912 item.SetHealth("", "", health);
12913
12914 if (item.CanHaveTemperature())
12915 {
12917 if (item.CanFreeze())
12918 item.SetFrozen(false);
12919 }
12920
12921 if (item.HasEnergyManager())
12922 {
12923 if (quantity >= 0)
12924 {
12925 item.GetCompEM().SetEnergy0To1(quantity);
12926 }
12927 else
12928 {
12930 }
12931 }
12932 else if (item.IsMagazine())
12933 {
12934 Magazine mag = Magazine.Cast(item);
12935 if (quantity >= 0)
12936 {
12937 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12938 }
12939 else
12940 {
12942 }
12943
12944 }
12945 else
12946 {
12947 if (quantity >= 0)
12948 {
12949 item.SetQuantityNormalized(quantity, false);
12950 }
12951 else
12952 {
12954 }
12955
12956 }
12957 }
12958}
12959
12960#ifdef DEVELOPER
12962#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.