8069{
8071 {
8072 return true;
8073 }
8074};
8075
8076
8077
8079{
8083
8085
8088
8089
8090
8091
8092
8101
8107
8112
8117
8138 protected bool m_IsResultOfSplit
8139
8141
8146
8147
8148
8150
8154
8155
8156
8158
8161
8162
8163
8169
8170
8178
8181
8182
8184
8185
8187
8188
8193
8194
8199
8200
8202
8203
8205 {
8210
8211 if (!
GetGame().IsDedicatedServer())
8212 {
8214 {
8216
8218 {
8220 }
8221 }
8222
8225 }
8226
8227 m_OldLocation = null;
8228
8230 {
8232 }
8233
8234 if (ConfigIsExisting("headSelectionsToHide"))
8235 {
8238 }
8239
8241 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8242 {
8244 }
8245
8247
8248 m_IsResultOfSplit = false;
8249
8251 }
8252
8254 {
8255 super.InitItemVariables();
8256
8262 m_Count = ConfigGetInt(
"count");
8263
8266
8271
8274
8279
8291
8295
8296
8299 if (ConfigIsExisting("canBeSplit"))
8300 {
8303 }
8304
8306 if (ConfigIsExisting("itemBehaviour"))
8308
8309
8312 RegisterNetSyncVariableInt("m_VarLiquidType");
8313 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8314
8315 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8316 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8317 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8318
8319 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8320 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8321 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8322 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8323
8324 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8325 RegisterNetSyncVariableBool("m_IsTakeable");
8326 RegisterNetSyncVariableBool("m_IsHologram");
8327
8330 {
8333 }
8334
8336
8338 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8340
8341 }
8342
8344 {
8346 }
8347
8349 {
8352 {
8357 }
8358 }
8359
8360 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8361 {
8363 {
8366 }
8367
8369 }
8370
8372 {
8378 }
8379
8381
8383 {
8385
8386 if (!action)
8387 {
8388 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8389 return;
8390 }
8391
8393 if (!ai)
8394 {
8396 return;
8397 }
8398
8400 if (!action_array)
8401 {
8402 action_array = new array<ActionBase_Basic>;
8404 }
8405 if (LogManager.IsActionLogEnable())
8406 {
8407 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8408 }
8409
8410 if (action_array.Find(action) != -1)
8411 {
8412 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8413 }
8414 else
8415 {
8416 action_array.Insert(action);
8417 }
8418 }
8419
8421 {
8423 ActionBase action = player.GetActionManager().GetAction(actionName);
8426
8427 if (action_array)
8428 {
8429 action_array.RemoveItem(action);
8430 }
8431 }
8432
8433
8434
8436 {
8437 ActionOverrideData overrideData = new ActionOverrideData();
8441
8443 if (!actionMap)
8444 {
8447 }
8448
8449 actionMap.Insert(this.
Type(), overrideData);
8450
8451 }
8452
8454
8456
8457
8459 {
8462
8465
8466 string config_to_search = "CfgVehicles";
8467 string muzzle_owner_config;
8468
8470 {
8471 if (IsInherited(Weapon))
8472 config_to_search = "CfgWeapons";
8473
8474 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8475
8476 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8477
8479
8480 if (config_OnFire_subclass_count > 0)
8481 {
8482 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8483
8484 for (int i = 0; i < config_OnFire_subclass_count; i++)
8485 {
8486 string particle_class = "";
8488 string config_OnFire_entry = config_OnFire_class + particle_class;
8489 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8490 WPOF_array.Insert(WPOF);
8491 }
8492
8493
8495 }
8496 }
8497
8499 {
8500 config_to_search = "CfgWeapons";
8501 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8502
8503 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8504
8506
8507 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8508 {
8509 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8510
8511 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8512 {
8513 string particle_class2 = "";
8515 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8516 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8517 WPOBE_array.Insert(WPOBE);
8518 }
8519
8520
8522 }
8523 }
8524 }
8525
8526
8528 {
8531
8533 {
8534 string config_to_search = "CfgVehicles";
8535
8536 if (IsInherited(Weapon))
8537 config_to_search = "CfgWeapons";
8538
8539 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8540 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8541
8542 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8543 {
8544
8546
8548 {
8550 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8552 return;
8553 }
8554
8557
8558
8559
8561 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8562
8563 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8564 {
8565 string particle_class = "";
8567 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8569
8570 if (entry_type == CT_CLASS)
8571 {
8572 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8573 WPOOH_array.Insert(WPOF);
8574 }
8575 }
8576
8577
8579 }
8580 }
8581 }
8582
8584 {
8586 }
8587
8589 {
8591 {
8593
8596
8599
8600 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8601 }
8602 }
8603
8605 {
8607 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8608
8610 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8611
8613 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8614
8616 {
8618 }
8619 }
8620
8622 {
8624 }
8625
8627 {
8630 else
8632
8634 {
8637 }
8638 else
8639 {
8642
8645 }
8646
8648 }
8649
8651 {
8653 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8654 }
8655
8657 {
8659 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8661 }
8662
8664 {
8666 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8667 }
8668
8670 {
8673
8674 OverheatingParticle OP = new OverheatingParticle();
8679
8681 }
8682
8684 {
8687
8688 return -1;
8689 }
8690
8692 {
8694 {
8697
8698 for (int i = count; i > 0; --i)
8699 {
8700 int id = i - 1;
8703
8706
8707 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8708 {
8709 if (p)
8710 {
8713 }
8714 }
8715 }
8716 }
8717 }
8718
8720 {
8722 {
8724 {
8725 int id = i - 1;
8727
8728 if (OP)
8729 {
8731
8732 if (p)
8733 {
8735 }
8736
8737 delete OP;
8738 }
8739 }
8740
8743 }
8744 }
8745
8748 {
8749 return 0.0;
8750 }
8751
8752
8754 {
8755 return 250;
8756 }
8757
8759 {
8760 return 0;
8761 }
8762
8765 {
8767 return true;
8768
8769 return false;
8770 }
8771
8774 {
8777
8779 {
8781 }
8782 else
8783 {
8784
8786 }
8787
8789 }
8790
8797 {
8798 return -1;
8799 }
8800
8801
8802
8803
8805 {
8807 {
8809 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8810
8811 if (r_index >= 0)
8812 {
8813 InventoryLocation r_il = new InventoryLocation;
8814 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8815
8816 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8819 {
8820 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8821 }
8823 {
8824 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8825 }
8826
8827 }
8828
8829 player.GetHumanInventory().ClearUserReservedLocation(this);
8830 }
8831
8834 }
8835
8836
8837
8838
8840 {
8841 return ItemBase.m_DebugActionsMask;
8842 }
8843
8845 {
8846 return ItemBase.m_DebugActionsMask & mask;
8847 }
8848
8850 {
8851 ItemBase.m_DebugActionsMask = mask;
8852 }
8853
8855 {
8856 ItemBase.m_DebugActionsMask |= mask;
8857 }
8858
8860 {
8861 ItemBase.m_DebugActionsMask &= ~mask;
8862 }
8863
8865 {
8867 {
8869 }
8870 else
8871 {
8873 }
8874 }
8875
8876
8878 {
8879 if (GetEconomyProfile())
8880 {
8881 float q_max = GetEconomyProfile().GetQuantityMax();
8882 if (q_max > 0)
8883 {
8884 float q_min = GetEconomyProfile().GetQuantityMin();
8885 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8886
8888 {
8889 ComponentEnergyManager comp = GetCompEM();
8891 {
8893 }
8894 }
8896 {
8898
8899 }
8900
8901 }
8902 }
8903 }
8904
8907 {
8908 EntityAI parent = GetHierarchyParent();
8909
8910 if (parent)
8911 {
8912 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8913 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8914 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8915 }
8916 }
8917
8920 {
8921 EntityAI parent = GetHierarchyParent();
8922
8923 if (parent)
8924 {
8925 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8926 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8927 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8928 }
8929 }
8930
8932 {
8933
8934
8935
8936
8938
8940 {
8941 if (ScriptInputUserData.CanStoreInputUserData())
8942 {
8943 ScriptInputUserData ctx = new ScriptInputUserData;
8949 ctx.
Write(use_stack_max);
8952
8954 {
8955 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8956 }
8957 }
8958 }
8959 else if (!
GetGame().IsMultiplayer())
8960 {
8962 }
8963 }
8964
8966 {
8968 }
8969
8971 {
8973 }
8974
8976 {
8978 }
8979
8981 {
8982
8983 return false;
8984 }
8985
8987 {
8988 return false;
8989 }
8990
8994 {
8995 return false;
8996 }
8997
8999 {
9000 return "";
9001 }
9002
9004
9006 {
9007 return false;
9008 }
9009
9011 {
9012 return true;
9013 }
9014
9015
9016
9018 {
9019 return true;
9020 }
9021
9023 {
9024 return true;
9025 }
9026
9028 {
9029 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9031 }
9032
9034 {
9036 }
9037
9039 {
9041 if (!is_being_placed)
9043 SetSynchDirty();
9044 }
9045
9046
9048
9050 {
9052 }
9053
9055 {
9057 }
9058
9060 {
9061 return 1;
9062 }
9063
9065 {
9066 return false;
9067 }
9068
9070 {
9072 SetSynchDirty();
9073 }
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9110 {
9111 super.OnMovedInsideCargo(container);
9112
9113 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9114 }
9115
9116 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9117 {
9118 super.EEItemLocationChanged(oldLoc,newLoc);
9119
9120 PlayerBase new_player = null;
9121 PlayerBase old_player = null;
9122
9123 if (newLoc.GetParent())
9124 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9125
9126 if (oldLoc.GetParent())
9127 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9128
9130 {
9131 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9132
9133 if (r_index >= 0)
9134 {
9135 InventoryLocation r_il = new InventoryLocation;
9136 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9137
9138 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9141 {
9142 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9143 }
9145 {
9146 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9147 }
9148
9149 }
9150 }
9151
9153 {
9154 if (new_player)
9155 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9156
9157 if (new_player == old_player)
9158 {
9159
9160 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9161 {
9163 {
9164 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9165 {
9166 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9167 }
9168 }
9169 else
9170 {
9171 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9172 }
9173 }
9174
9175 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9176 {
9177 int type = oldLoc.GetType();
9179 {
9180 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9181 }
9183 {
9184 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9185 }
9186 }
9187 if (!m_OldLocation)
9188 {
9189 m_OldLocation = new InventoryLocation;
9190 }
9191 m_OldLocation.Copy(oldLoc);
9192 }
9193 else
9194 {
9195 if (m_OldLocation)
9196 {
9197 m_OldLocation.Reset();
9198 }
9199 }
9200
9202 }
9203 else
9204 {
9205 if (new_player)
9206 {
9207 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9208 if (res_index >= 0)
9209 {
9210 InventoryLocation il = new InventoryLocation;
9211 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9213 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9216 {
9217 il.
GetParent().GetOnReleaseLock().Invoke(it);
9218 }
9220 {
9222 }
9223
9224 }
9225 }
9227 {
9228
9230 }
9231
9232 if (m_OldLocation)
9233 {
9234 m_OldLocation.Reset();
9235 }
9236 }
9237 }
9238
9239 override void EOnContact(IEntity other, Contact extra)
9240 {
9242 {
9243 int liquidType = -1;
9245 if (impactSpeed > 0.0)
9246 {
9248 #ifndef SERVER
9250 #else
9252 SetSynchDirty();
9253 #endif
9255 }
9256 }
9257
9258 #ifdef SERVER
9259 if (GetCompEM() && GetCompEM().IsPlugged())
9260 {
9261 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9262 GetCompEM().UnplugThis();
9263 }
9264 #endif
9265 }
9266
9268
9270 {
9272 }
9273
9275 {
9276
9277 }
9278
9280 {
9281 super.OnItemLocationChanged(old_owner, new_owner);
9282
9283 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9284 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9285
9286 if (!relatedPlayer && playerNew)
9287 relatedPlayer = playerNew;
9288
9289 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9290 {
9292 if (actionMgr)
9293 {
9294 ActionBase currentAction = actionMgr.GetRunningAction();
9295 if (currentAction)
9297 }
9298 }
9299
9300 Man ownerPlayerOld = null;
9301 Man ownerPlayerNew = null;
9302
9303 if (old_owner)
9304 {
9305 if (old_owner.
IsMan())
9306 {
9307 ownerPlayerOld = Man.Cast(old_owner);
9308 }
9309 else
9310 {
9311 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9312 }
9313 }
9314 else
9315 {
9317 {
9319
9320 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9321 {
9322 GetCompEM().UnplugThis();
9323 }
9324 }
9325 }
9326
9327 if (new_owner)
9328 {
9329 if (new_owner.
IsMan())
9330 {
9331 ownerPlayerNew = Man.Cast(new_owner);
9332 }
9333 else
9334 {
9335 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9336 }
9337 }
9338
9339 if (ownerPlayerOld != ownerPlayerNew)
9340 {
9341 if (ownerPlayerOld)
9342 {
9343 array<EntityAI> subItemsExit = new array<EntityAI>;
9345 for (int i = 0; i < subItemsExit.Count(); i++)
9346 {
9349 }
9350 }
9351
9352 if (ownerPlayerNew)
9353 {
9354 array<EntityAI> subItemsEnter = new array<EntityAI>;
9356 for (int j = 0; j < subItemsEnter.Count(); j++)
9357 {
9360 }
9361 }
9362 }
9363 else if (ownerPlayerNew != null)
9364 {
9365 PlayerBase nplayer;
9366 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9367 {
9368 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9370 for (int k = 0; k < subItemsUpdate.Count(); k++)
9371 {
9373 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9374 }
9375 }
9376 }
9377
9378 if (old_owner)
9379 old_owner.OnChildItemRemoved(this);
9380 if (new_owner)
9381 new_owner.OnChildItemReceived(this);
9382 }
9383
9384
9386 {
9387 super.EEDelete(parent);
9388 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9389 if (player)
9390 {
9392
9393 if (player.IsAlive())
9394 {
9395 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9396 if (r_index >= 0)
9397 {
9398 InventoryLocation r_il = new InventoryLocation;
9399 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9400
9401 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9404 {
9405 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9406 }
9408 {
9409 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9410 }
9411
9412 }
9413
9414 player.RemoveQuickBarEntityShortcut(this);
9415 }
9416 }
9417 }
9418
9420 {
9421 super.EEKilled(killer);
9422
9425 {
9426 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9427 {
9428 if (IsMagazine())
9429 {
9430 if (Magazine.Cast(this).GetAmmoCount() > 0)
9431 {
9433 }
9434 }
9435 else
9436 {
9438 }
9439 }
9440 }
9441 }
9442
9444 {
9445 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9446
9447 super.OnWasAttached(parent, slot_id);
9448
9451
9453 }
9454
9456 {
9457 super.OnWasDetached(parent, slot_id);
9458
9461 }
9462
9464 {
9465 int idx;
9468
9469 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9470 if (inventory_slots.Count() < 1)
9471 {
9472 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9473 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9474 }
9475 else
9476 {
9477 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9478 }
9479
9480 idx = inventory_slots.Find(slot);
9481 if (idx < 0)
9482 return "";
9483
9484 return attach_types.Get(idx);
9485 }
9486
9488 {
9489 int idx = -1;
9490 string slot;
9491
9494
9495 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9496 if (inventory_slots.Count() < 1)
9497 {
9498 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9499 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9500 }
9501 else
9502 {
9503 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9504 if (detach_types.Count() < 1)
9505 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9506 }
9507
9508 for (int i = 0; i < inventory_slots.Count(); i++)
9509 {
9510 slot = inventory_slots.Get(i);
9511 }
9512
9513 if (slot != "")
9514 {
9515 if (detach_types.Count() == 1)
9516 idx = 0;
9517 else
9518 idx = inventory_slots.Find(slot);
9519 }
9520 if (idx < 0)
9521 return "";
9522
9523 return detach_types.Get(idx);
9524 }
9525
9527 {
9528
9530
9531
9532 float min_time = 1;
9533 float max_time = 3;
9534 float delay = Math.RandomFloat(min_time, max_time);
9535
9536 explode_timer.Run(delay, this, "DoAmmoExplosion");
9537 }
9538
9540 {
9541 Magazine magazine = Magazine.Cast(this);
9542 int pop_sounds_count = 6;
9543 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9544
9545
9546 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9547 string sound_name = pop_sounds[ sound_idx ];
9549
9550
9551 magazine.ServerAddAmmoCount(-1);
9552
9553
9554 float min_temp_to_explode = 100;
9555
9556 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9557 {
9559 }
9560 }
9561
9562
9563 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9564 {
9565 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9566
9567 const int CHANCE_DAMAGE_CARGO = 4;
9568 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9569 const int CHANCE_DAMAGE_NOTHING = 2;
9570
9572 {
9573 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9574 int chances;
9575 int rnd;
9576
9577 if (GetInventory().GetCargo())
9578 {
9579 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9580 rnd = Math.RandomInt(0,chances);
9581
9582 if (rnd < CHANCE_DAMAGE_CARGO)
9583 {
9585 }
9586 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9587 {
9589 }
9590 }
9591 else
9592 {
9593 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9594 rnd = Math.RandomInt(0,chances);
9595
9596 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9597 {
9599 }
9600 }
9601 }
9602 }
9603
9605 {
9606 if (GetInventory().GetCargo())
9607 {
9608 int item_count = GetInventory().GetCargo().GetItemCount();
9609 if (item_count > 0)
9610 {
9611 int random_pick = Math.RandomInt(0, item_count);
9613 if (!item.IsExplosive())
9614 {
9615 item.AddHealth("","",damage);
9616 return true;
9617 }
9618 }
9619 }
9620 return false;
9621 }
9622
9624 {
9625 int attachment_count = GetInventory().AttachmentCount();
9626 if (attachment_count > 0)
9627 {
9628 int random_pick = Math.RandomInt(0, attachment_count);
9629 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9630 if (!attachment.IsExplosive())
9631 {
9632 attachment.AddHealth("","",damage);
9633 return true;
9634 }
9635 }
9636 return false;
9637 }
9638
9640 {
9642 }
9643
9645 {
9647 return GetInventory().CanRemoveEntity();
9648
9649 return false;
9650 }
9651
9653 {
9655 return;
9656
9658 {
9659 if (ScriptInputUserData.CanStoreInputUserData())
9660 {
9661 ScriptInputUserData ctx = new ScriptInputUserData;
9666 ctx.
Write(destination_entity);
9670 }
9671 }
9672 else if (!
GetGame().IsMultiplayer())
9673 {
9675 }
9676 }
9677
9679 {
9681 return;
9682
9683 float split_quantity_new;
9687 InventoryLocation loc = new InventoryLocation;
9688
9689 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9690 {
9692 split_quantity_new = stack_max;
9693 else
9695
9696 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9697 if (new_item)
9698 {
9699 new_item.SetResultOfSplit(true);
9700 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9702 new_item.SetQuantity(split_quantity_new);
9703 }
9704 }
9705 else if (destination_entity && slot_id == -1)
9706 {
9707 if (quantity > stack_max)
9708 split_quantity_new = stack_max;
9709 else
9710 split_quantity_new = quantity;
9711
9713 {
9716 }
9717
9718 if (new_item)
9719 {
9720 new_item.SetResultOfSplit(true);
9721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9723 new_item.SetQuantity(split_quantity_new);
9724 }
9725 }
9726 else
9727 {
9728 if (stack_max != 0)
9729 {
9731 {
9733 }
9734
9735 if (split_quantity_new == 0)
9736 {
9737 if (!
GetGame().IsMultiplayer())
9738 player.PhysicalPredictiveDropItem(this);
9739 else
9740 player.ServerDropEntity(this);
9741 return;
9742 }
9743
9745
9746 if (new_item)
9747 {
9748 new_item.SetResultOfSplit(true);
9749 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9751 new_item.SetQuantity(stack_max);
9752 new_item.PlaceOnSurface();
9753 }
9754 }
9755 }
9756 }
9757
9759 {
9761 return;
9762
9763 float split_quantity_new;
9767 InventoryLocation loc = new InventoryLocation;
9768
9769 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9770 {
9772 split_quantity_new = stack_max;
9773 else
9775
9776 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9777 if (new_item)
9778 {
9779 new_item.SetResultOfSplit(true);
9780 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9782 new_item.SetQuantity(split_quantity_new);
9783 }
9784 }
9785 else if (destination_entity && slot_id == -1)
9786 {
9787 if (quantity > stack_max)
9788 split_quantity_new = stack_max;
9789 else
9790 split_quantity_new = quantity;
9791
9793 {
9796 }
9797
9798 if (new_item)
9799 {
9800 new_item.SetResultOfSplit(true);
9801 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9803 new_item.SetQuantity(split_quantity_new);
9804 }
9805 }
9806 else
9807 {
9808 if (stack_max != 0)
9809 {
9811 {
9813 }
9814
9816
9817 if (new_item)
9818 {
9819 new_item.SetResultOfSplit(true);
9820 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9822 new_item.SetQuantity(stack_max);
9823 new_item.PlaceOnSurface();
9824 }
9825 }
9826 }
9827 }
9828
9830 {
9832 return;
9833
9835 {
9836 if (ScriptInputUserData.CanStoreInputUserData())
9837 {
9838 ScriptInputUserData ctx = new ScriptInputUserData;
9843 dst.WriteToContext(ctx);
9845 }
9846 }
9847 else if (!
GetGame().IsMultiplayer())
9848 {
9850 }
9851 }
9852
9854 {
9856 return;
9857
9859 {
9860 if (ScriptInputUserData.CanStoreInputUserData())
9861 {
9862 ScriptInputUserData ctx = new ScriptInputUserData;
9867 ctx.
Write(destination_entity);
9873 }
9874 }
9875 else if (!
GetGame().IsMultiplayer())
9876 {
9878 }
9879 }
9880
9882 {
9884 }
9885
9887 {
9889 return this;
9890
9892 float split_quantity_new;
9894 if (dst.IsValid())
9895 {
9896 int slot_id = dst.GetSlot();
9898
9899 if (quantity > stack_max)
9900 split_quantity_new = stack_max;
9901 else
9902 split_quantity_new = quantity;
9903
9905
9906 if (new_item)
9907 {
9908 new_item.SetResultOfSplit(true);
9909 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9912 }
9913
9914 return new_item;
9915 }
9916
9917 return null;
9918 }
9919
9921 {
9923 return;
9924
9926 float split_quantity_new;
9928 if (destination_entity)
9929 {
9931 if (quantity > stackable)
9932 split_quantity_new = stackable;
9933 else
9934 split_quantity_new = quantity;
9935
9936 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9937 if (new_item)
9938 {
9939 new_item.SetResultOfSplit(true);
9940 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9942 new_item.SetQuantity(split_quantity_new);
9943 }
9944 }
9945 }
9946
9948 {
9950 return;
9951
9953 {
9954 if (ScriptInputUserData.CanStoreInputUserData())
9955 {
9956 ScriptInputUserData ctx = new ScriptInputUserData;
9961 ItemBase destination_entity =
this;
9962 ctx.
Write(destination_entity);
9966 }
9967 }
9968 else if (!
GetGame().IsMultiplayer())
9969 {
9971 }
9972 }
9973
9975 {
9977 return;
9978
9980 float split_quantity_new;
9982 if (player)
9983 {
9985 if (quantity > stackable)
9986 split_quantity_new = stackable;
9987 else
9988 split_quantity_new = quantity;
9989
9990 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9991 new_item =
ItemBase.Cast(in_hands);
9992 if (new_item)
9993 {
9994 new_item.SetResultOfSplit(true);
9995 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9997 new_item.SetQuantity(split_quantity_new);
9998 }
9999 }
10000 }
10001
10003 {
10005 return;
10006
10008 float split_quantity_new = Math.Floor(quantity * 0.5);
10009
10011
10012 if (new_item)
10013 {
10014 if (new_item.GetQuantityMax() < split_quantity_new)
10015 {
10016 split_quantity_new = new_item.GetQuantityMax();
10017 }
10018
10019 new_item.SetResultOfSplit(true);
10020 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10021
10023 {
10026 }
10027 else
10028 {
10031 }
10032 }
10033 }
10034
10036 {
10038 return;
10039
10041 float split_quantity_new = Math.Floor(quantity / 2);
10042
10043 InventoryLocation invloc = new InventoryLocation;
10045
10047 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10048
10049 if (new_item)
10050 {
10051 if (new_item.GetQuantityMax() < split_quantity_new)
10052 {
10053 split_quantity_new = new_item.GetQuantityMax();
10054 }
10056 {
10059 }
10060 else
10061 {
10064 }
10065 }
10066 }
10067
10070 {
10071 SetWeightDirty();
10073
10074 if (parent)
10075 parent.OnAttachmentQuantityChangedEx(this, delta);
10076
10078 {
10080 {
10082 }
10084 {
10085 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10087 }
10088 }
10089
10090 }
10091
10094 {
10095
10096 }
10097
10100 {
10102 }
10103
10105 {
10106 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10107
10109 {
10110 if (newLevel == GameConstants.STATE_RUINED)
10111 {
10113 EntityAI parent = GetHierarchyParent();
10114 if (parent && parent.IsFireplace())
10115 {
10116 CargoBase cargo = GetInventory().GetCargo();
10117 if (cargo)
10118 {
10120 {
10122 }
10123 }
10124 }
10125 }
10126
10128 {
10129
10131 return;
10132 }
10133
10134 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10135 {
10137 }
10138 }
10139 }
10140
10141
10143 {
10144 super.OnRightClick();
10145
10147 {
10149 {
10150 if (ScriptInputUserData.CanStoreInputUserData())
10151 {
10152 vector m4[4];
10154
10155 EntityAI root = GetHierarchyRoot();
10156
10157 InventoryLocation dst = new InventoryLocation;
10159 {
10160 if (root)
10161 {
10162 root.GetTransform(m4);
10164 }
10165 else
10166 GetInventory().GetCurrentInventoryLocation(dst);
10167 }
10168 else
10169 {
10171
10172
10173 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10174 {
10175 if (root)
10176 {
10177 root.GetTransform(m4);
10179 }
10180 else
10181 GetInventory().GetCurrentInventoryLocation(dst);
10182 }
10183 else
10184 {
10185 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10186 }
10187 }
10188
10189 ScriptInputUserData ctx = new ScriptInputUserData;
10197 }
10198 }
10199 else if (!
GetGame().IsMultiplayer())
10200 {
10202 }
10203 }
10204 }
10205
10206 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10207 {
10208
10209 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10210 return false;
10211
10212 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10213 return false;
10214
10215
10217 return false;
10218
10219
10220 Magazine mag = Magazine.Cast(this);
10221 if (mag)
10222 {
10223 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10224 return false;
10225
10226 if (stack_max_limit)
10227 {
10228 Magazine other_mag = Magazine.Cast(other_item);
10229 if (other_item)
10230 {
10231 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10232 return false;
10233 }
10234
10235 }
10236 }
10237 else
10238 {
10239
10241 return false;
10242
10244 return false;
10245 }
10246
10247 PlayerBase player = null;
10248 if (CastTo(player, GetHierarchyRootPlayer()))
10249 {
10250 if (player.GetInventory().HasAttachment(this))
10251 return false;
10252
10253 if (player.IsItemsToDelete())
10254 return false;
10255 }
10256
10257 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10258 return false;
10259
10260 int slotID;
10262 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10263 return false;
10264
10265 return true;
10266 }
10267
10269 {
10271 }
10272
10274 {
10275 return m_IsResultOfSplit;
10276 }
10277
10279 {
10280 m_IsResultOfSplit = value;
10281 }
10282
10284 {
10286 }
10287
10289 {
10290 float other_item_quantity = other_item.GetQuantity();
10291 float this_free_space;
10292
10294
10296
10297 if (other_item_quantity > this_free_space)
10298 {
10299 return this_free_space;
10300 }
10301 else
10302 {
10303 return other_item_quantity;
10304 }
10305 }
10306
10308 {
10310 }
10311
10313 {
10315 return;
10316
10317 if (!IsMagazine() && other_item)
10318 {
10320 if (quantity_used != 0)
10321 {
10322 float hp1 = GetHealth01("","");
10323 float hp2 = other_item.GetHealth01("","");
10324 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10325 hpResult = hpResult / (
GetQuantity() + quantity_used);
10326
10327 hpResult *= GetMaxHealth();
10328 Math.Round(hpResult);
10329 SetHealth("", "Health", hpResult);
10330
10332 other_item.AddQuantity(-quantity_used);
10333 }
10334 }
10336 }
10337
10339 {
10340 #ifdef SERVER
10341 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10342 GetHierarchyParent().IncreaseLifetimeUp();
10343 #endif
10344 };
10345
10347 {
10348 PlayerBase p = PlayerBase.Cast(player);
10349
10350 array<int> recipesIds = p.m_Recipes;
10351 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10352 if (moduleRecipesManager)
10353 {
10354 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10355 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10356 }
10357
10358 for (int i = 0;i < recipesIds.Count(); i++)
10359 {
10360 int key = recipesIds.Get(i);
10361 string recipeName = moduleRecipesManager.GetRecipeName(key);
10363 }
10364 }
10365
10366
10367 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10368 {
10369 super.GetDebugActions(outputList);
10370
10371
10376
10377
10381
10385
10386
10389
10390
10392 {
10395 }
10396
10398
10401
10405 }
10406
10407
10408
10409
10411 {
10412 super.OnAction(action_id, player, ctx);
10413 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10414 {
10415 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10416 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10417 PlayerBase p = PlayerBase.Cast(player);
10418 if (
EActions.RECIPES_RANGE_START < 1000)
10419 {
10420 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10421 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10422 }
10423 }
10424 #ifndef SERVER
10425 else if (action_id ==
EActions.WATCH_PLAYER)
10426 {
10427 PluginDeveloper.SetDeveloperItemClientEx(player);
10428 }
10429 #endif
10431 {
10432 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10433 {
10434 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10435 OnDebugButtonPressServer(id + 1);
10436 }
10437
10438 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10439 {
10440 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10442 }
10443
10444 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10445 {
10446 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10448 }
10449
10450 else if (action_id ==
EActions.ADD_QUANTITY)
10451 {
10452 if (IsMagazine())
10453 {
10454 Magazine mag = Magazine.Cast(this);
10455 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10456 }
10457 else
10458 {
10460 }
10461
10462 if (m_EM)
10463 {
10464 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10465 }
10466
10467 }
10468
10469 else if (action_id ==
EActions.REMOVE_QUANTITY)
10470 {
10471 if (IsMagazine())
10472 {
10473 Magazine mag2 = Magazine.Cast(this);
10474 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10475 }
10476 else
10477 {
10479 }
10480 if (m_EM)
10481 {
10482 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10483 }
10484
10485 }
10486
10487 else if (action_id ==
EActions.SET_QUANTITY_0)
10488 {
10490
10491 if (m_EM)
10492 {
10493 m_EM.SetEnergy(0);
10494 }
10495 }
10496
10497 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10498 {
10500
10501 if (m_EM)
10502 {
10503 m_EM.SetEnergy(m_EM.GetEnergyMax());
10504 }
10505 }
10506
10507 else if (action_id ==
EActions.ADD_HEALTH)
10508 {
10509 AddHealth("","",GetMaxHealth("","Health")/5);
10510 }
10511 else if (action_id ==
EActions.REMOVE_HEALTH)
10512 {
10513 AddHealth("","",-GetMaxHealth("","Health")/5);
10514 }
10515 else if (action_id ==
EActions.DESTROY_HEALTH)
10516 {
10517 SetHealth01("","",0);
10518 }
10519 else if (action_id ==
EActions.WATCH_ITEM)
10520 {
10522 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10523 #ifdef DEVELOPER
10524 SetDebugDeveloper_item(this);
10525 #endif
10526 }
10527
10528 else if (action_id ==
EActions.ADD_TEMPERATURE)
10529 {
10530 AddTemperature(20);
10531
10532 }
10533
10534 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10535 {
10536 AddTemperature(-20);
10537
10538 }
10539
10540 else if (action_id ==
EActions.FLIP_FROZEN)
10541 {
10542 SetFrozen(!GetIsFrozen());
10543
10544 }
10545
10546 else if (action_id ==
EActions.ADD_WETNESS)
10547 {
10549
10550 }
10551
10552 else if (action_id ==
EActions.REMOVE_WETNESS)
10553 {
10555
10556 }
10557
10558 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10559 {
10562
10563
10564 }
10565
10566 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10567 {
10570 }
10571
10572 else if (action_id ==
EActions.MAKE_SPECIAL)
10573 {
10574 auto debugParams = DebugSpawnParams.WithPlayer(player);
10575 OnDebugSpawnEx(debugParams);
10576 }
10577
10578 else if (action_id ==
EActions.DELETE)
10579 {
10580 Delete();
10581 }
10582
10583 }
10584
10585
10586 return false;
10587 }
10588
10589
10590
10591
10595
10598
10599
10600
10602 {
10603 return false;
10604 }
10605
10606
10608 {
10609 return true;
10610 }
10611
10612
10614 {
10615 return true;
10616 }
10617
10618
10619
10621 {
10622 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10624 }
10625
10628 {
10629 return null;
10630 }
10631
10633 {
10634 return false;
10635 }
10636
10638 {
10639 return false;
10640 }
10641
10645
10646
10648 {
10649 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10650 return module_repairing.CanRepair(this, item_repair_kit);
10651 }
10652
10653
10654 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10655 {
10656 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10657 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10658 }
10659
10660
10662 {
10663
10664
10665
10666
10667
10668
10669
10670
10671 return 1;
10672 }
10673
10674
10675
10677 {
10679 }
10680
10681
10682
10684 {
10686 }
10687
10688
10697 {
10698 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10699
10700 if (player)
10701 {
10702 player.MessageStatus(text);
10703 }
10704 }
10705
10706
10715 {
10716 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10717
10718 if (player)
10719 {
10720 player.MessageAction(text);
10721 }
10722 }
10723
10724
10733 {
10734 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10735
10736 if (player)
10737 {
10738 player.MessageFriendly(text);
10739 }
10740 }
10741
10742
10751 {
10752 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10753
10754 if (player)
10755 {
10756 player.MessageImportant(text);
10757 }
10758 }
10759
10761 {
10762 return true;
10763 }
10764
10765
10766 override bool KindOf(
string tag)
10767 {
10768 bool found = false;
10769 string item_name = this.
GetType();
10772
10773 int array_size = item_tag_array.Count();
10774 for (int i = 0; i < array_size; i++)
10775 {
10776 if (item_tag_array.Get(i) == tag)
10777 {
10778 found = true;
10779 break;
10780 }
10781 }
10782 return found;
10783 }
10784
10785
10787 {
10788
10789 super.OnRPC(sender, rpc_type,ctx);
10790
10791
10792 switch (rpc_type)
10793 {
10794 #ifndef SERVER
10795 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10796 Param2<bool, string> p = new Param2<bool, string>(false, "");
10797
10799 return;
10800
10801 bool play = p.param1;
10802 string soundSet = p.param2;
10803
10804 if (play)
10805 {
10807 {
10809 {
10811 }
10812 }
10813 else
10814 {
10816 }
10817 }
10818 else
10819 {
10821 }
10822
10823 break;
10824 #endif
10825
10826 }
10827
10829 {
10831 }
10832 }
10833
10834
10835
10836
10838 {
10839 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10840 return plugin.GetID(
name);
10841 }
10842
10844 {
10845 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10846 return plugin.GetName(id);
10847 }
10848
10851 {
10852
10853
10854 int varFlags;
10855 if (!ctx.
Read(varFlags))
10856 return;
10857
10858 if (varFlags & ItemVariableFlags.FLOAT)
10859 {
10861 }
10862 }
10863
10865 {
10866
10867 super.SerializeNumericalVars(floats_out);
10868
10869
10870
10872 {
10874 }
10875
10877 {
10879 }
10880
10882 {
10884 }
10885
10887 {
10892 }
10893
10895 {
10897 }
10898 }
10899
10901 {
10902
10903 super.DeSerializeNumericalVars(floats);
10904
10905
10906 int index = 0;
10907 int mask = Math.Round(floats.Get(index));
10908
10909 index++;
10910
10912 {
10914 {
10916 }
10917 else
10918 {
10919 float quantity = floats.Get(index);
10920 SetQuantity(quantity,
true,
false,
false,
false);
10921 }
10922 index++;
10923 }
10924
10926 {
10927 float wet = floats.Get(index);
10929 index++;
10930 }
10931
10933 {
10934 int liquidtype = Math.Round(floats.Get(index));
10936 index++;
10937 }
10938
10940 {
10942 index++;
10944 index++;
10946 index++;
10948 index++;
10949 }
10950
10952 {
10953 int cleanness = Math.Round(floats.Get(index));
10955 index++;
10956 }
10957 }
10958
10960 {
10961 super.WriteVarsToCTX(ctx);
10962
10963
10965 {
10967 }
10968
10970 {
10972 }
10973
10975 {
10977 }
10978
10980 {
10981 int r,g,b,a;
10987 }
10988
10990 {
10992 }
10993 }
10994
10996 {
10997 if (!super.ReadVarsFromCTX(ctx,version))
10998 return false;
10999
11000 int intValue;
11001 float value;
11002
11003 if (version < 140)
11004 {
11005 if (!ctx.
Read(intValue))
11006 return false;
11007
11008 m_VariablesMask = intValue;
11009 }
11010
11012 {
11013 if (!ctx.
Read(value))
11014 return false;
11015
11017 {
11019 }
11020 else
11021 {
11023 }
11024 }
11025
11026 if (version < 140)
11027 {
11029 {
11030 if (!ctx.
Read(value))
11031 return false;
11032 SetTemperatureDirect(value);
11033 }
11034 }
11035
11037 {
11038 if (!ctx.
Read(value))
11039 return false;
11041 }
11042
11044 {
11045 if (!ctx.
Read(intValue))
11046 return false;
11048 }
11049
11051 {
11052 int r,g,b,a;
11054 return false;
11056 return false;
11058 return false;
11060 return false;
11061
11063 }
11064
11066 {
11067 if (!ctx.
Read(intValue))
11068 return false;
11070 }
11071
11072 if (version >= 138 && version < 140)
11073 {
11075 {
11076 if (!ctx.
Read(intValue))
11077 return false;
11078 SetFrozen(intValue);
11079 }
11080 }
11081
11082 return true;
11083 }
11084
11085
11087 {
11090 {
11092 }
11093
11094 if (!super.OnStoreLoad(ctx, version))
11095 {
11097 return false;
11098 }
11099
11100 if (version >= 114)
11101 {
11102 bool hasQuickBarIndexSaved;
11103
11104 if (!ctx.
Read(hasQuickBarIndexSaved))
11105 {
11107 return false;
11108 }
11109
11110 if (hasQuickBarIndexSaved)
11111 {
11112 int itmQBIndex;
11113
11114
11115 if (!ctx.
Read(itmQBIndex))
11116 {
11118 return false;
11119 }
11120
11121 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11122 if (itmQBIndex != -1 && parentPlayer)
11123 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11124 }
11125 }
11126 else
11127 {
11128
11129 PlayerBase player;
11130 int itemQBIndex;
11131 if (version ==
int.
MAX)
11132 {
11133 if (!ctx.
Read(itemQBIndex))
11134 {
11136 return false;
11137 }
11138 }
11139 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11140 {
11141
11142 if (!ctx.
Read(itemQBIndex))
11143 {
11145 return false;
11146 }
11147 if (itemQBIndex != -1 && player)
11148 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11149 }
11150 }
11151
11152 if (version < 140)
11153 {
11154
11155 if (!LoadVariables(ctx, version))
11156 {
11158 return false;
11159 }
11160 }
11161
11162
11164 {
11166 return false;
11167 }
11168 if (version >= 132)
11169 {
11171 if (raib)
11172 {
11174 {
11176 return false;
11177 }
11178 }
11179 }
11180
11182 return true;
11183 }
11184
11185
11186
11188 {
11189 super.OnStoreSave(ctx);
11190
11191 PlayerBase player;
11192 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11193 {
11195
11196 int itemQBIndex = -1;
11197 itemQBIndex = player.FindQuickBarEntityIndex(this);
11198 ctx.
Write(itemQBIndex);
11199 }
11200 else
11201 {
11203 }
11204
11206
11208 if (raib)
11209 {
11211 }
11212 }
11213
11214
11216 {
11217 super.AfterStoreLoad();
11218
11220 {
11222 }
11223
11225 {
11228 }
11229 }
11230
11232 {
11233 super.EEOnAfterLoad();
11234
11236 {
11238 }
11239
11242 }
11243
11245 {
11246 return false;
11247 }
11248
11249
11250
11252 {
11254 {
11255 #ifdef PLATFORM_CONSOLE
11256
11258 {
11260 if (menu)
11261 {
11263 }
11264 }
11265 #endif
11266 }
11267
11269 {
11272 }
11273
11275 {
11276 SetWeightDirty();
11278 }
11280 {
11283 }
11284
11286 {
11289 }
11291 {
11294 }
11295
11296 super.OnVariablesSynchronized();
11297 }
11298
11299
11300
11302 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11303 {
11304 if (!IsServerCheck(allow_client))
11305 return false;
11306
11308 return false;
11309
11312
11313 if (value <= (min + 0.001))
11314 value = min;
11315
11316 if (value == min)
11317 {
11318 if (destroy_config)
11319 {
11320 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11321 if (dstr)
11322 {
11324 this.Delete();
11325 return true;
11326 }
11327 }
11328 else if (destroy_forced)
11329 {
11331 this.Delete();
11332 return true;
11333 }
11334
11336 }
11337
11340
11342 {
11344
11345 if (delta)
11347 }
11348
11350
11351 return false;
11352 }
11353
11354
11356 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11357 {
11359 }
11360
11362 {
11365 }
11366
11368 {
11371 }
11372
11375 {
11376 float value_clamped = Math.Clamp(value, 0, 1);
11378 SetQuantity(result, destroy_config, destroy_forced);
11379 }
11380
11381
11384 {
11386 }
11387
11389 {
11391 }
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11403 {
11404 int slot = -1;
11405 if (GetInventory())
11406 {
11407 InventoryLocation il = new InventoryLocation;
11408 GetInventory().GetCurrentInventoryLocation(il);
11410 }
11411
11413 }
11414
11416 {
11417 float quantity_max = 0;
11418
11420 {
11421 if (attSlotID != -1)
11422 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11423
11424 if (quantity_max <= 0)
11426 }
11427
11428 if (quantity_max <= 0)
11430
11431 return quantity_max;
11432 }
11433
11435 {
11437 }
11438
11440 {
11442 }
11443
11444
11446 {
11448 }
11449
11451 {
11453 }
11454
11456 {
11458 }
11459
11460
11462 {
11463
11464 float weightEx = GetWeightEx();
11465 float special = GetInventoryAndCargoWeight();
11466 return weightEx - special;
11467 }
11468
11469
11471 {
11473 }
11474
11476 {
11478 {
11479 #ifdef DEVELOPER
11480 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11481 {
11482 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11484 }
11485 #endif
11486
11487 return GetQuantity() * GetConfigWeightModified();
11488 }
11489 else if (HasEnergyManager())
11490 {
11491 #ifdef DEVELOPER
11492 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11493 {
11494 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11495 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11496 }
11497 #endif
11498 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11499 }
11500 else
11501 {
11502 #ifdef DEVELOPER
11503 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11504 {
11505 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11506 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11507 }
11508 #endif
11509 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11510 }
11511 }
11512
11515 {
11516 int item_count = 0;
11518
11519 if (GetInventory().GetCargo() != NULL)
11520 {
11521 item_count = GetInventory().GetCargo().GetItemCount();
11522 }
11523
11524 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11525 {
11526 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11527 if (item)
11528 item_count += item.GetNumberOfItems();
11529 }
11530 return item_count;
11531 }
11532
11535 {
11536 float weight = 0;
11537 float wetness = 1;
11538 if (include_wetness)
11541 {
11542 weight = wetness * m_ConfigWeight;
11543 }
11545 {
11546 weight = 1;
11547 }
11548 return weight;
11549 }
11550
11551
11552
11554 {
11555 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11556 {
11557 GameInventory inv = GetInventory();
11558 array<EntityAI> items = new array<EntityAI>;
11560 for (int i = 0; i < items.Count(); i++)
11561 {
11563 if (item)
11564 {
11566 }
11567 }
11568 }
11569 }
11570
11571
11572
11573
11575 {
11576 float energy = 0;
11577 if (HasEnergyManager())
11578 {
11579 energy = GetCompEM().GetEnergy();
11580 }
11581 return energy;
11582 }
11583
11584
11586 {
11587 super.OnEnergyConsumed();
11588
11590 }
11591
11593 {
11594 super.OnEnergyAdded();
11595
11597 }
11598
11599
11601 {
11602 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11603 {
11605 {
11606 float energy_0to1 = GetCompEM().GetEnergy0To1();
11608 }
11609 }
11610 }
11611
11612
11614 {
11615 return ConfigGetFloat("heatIsolation");
11616 }
11617
11619 {
11621 }
11622
11624 {
11625 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11626 if (
GetGame().ConfigIsExisting(paramPath))
11628
11629 return 0.0;
11630 }
11631
11633 {
11634 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11635 if (
GetGame().ConfigIsExisting(paramPath))
11637
11638 return 0.0;
11639 }
11640
11641 override void SetWet(
float value,
bool allow_client =
false)
11642 {
11643 if (!IsServerCheck(allow_client))
11644 return;
11645
11648
11650
11651 m_VarWet = Math.Clamp(value, min, max);
11652
11654 {
11657 }
11658 }
11659
11660 override void AddWet(
float value)
11661 {
11663 }
11664
11666 {
11668 }
11669
11671 {
11673 }
11674
11676 {
11678 }
11679
11681 {
11683 }
11684
11686 {
11688 }
11689
11690 override void OnWetChanged(
float newVal,
float oldVal)
11691 {
11694 if (newLevel != oldLevel)
11695 {
11697 }
11698 }
11699
11701 {
11702 SetWeightDirty();
11703 }
11704
11706 {
11707 return GetWetLevelInternal(
m_VarWet);
11708 }
11709
11710
11711
11713 {
11715 }
11716
11718 {
11720 }
11721
11723 {
11725 }
11726
11728 {
11730 }
11731
11732
11733
11735 {
11736 if (ConfigIsExisting("itemModelLength"))
11737 {
11738 return ConfigGetFloat("itemModelLength");
11739 }
11740 return 0;
11741 }
11742
11744 {
11745 if (ConfigIsExisting("itemAttachOffset"))
11746 {
11747 return ConfigGetFloat("itemAttachOffset");
11748 }
11749 return 0;
11750 }
11751
11752 override void SetCleanness(
int value,
bool allow_client =
false)
11753 {
11754 if (!IsServerCheck(allow_client))
11755 return;
11756
11758
11760
11763 }
11764
11766 {
11768 }
11769
11771 {
11772 return true;
11773 }
11774
11775
11776
11777
11779 {
11781 }
11782
11784 {
11786 }
11787
11788
11789
11790
11791 override void SetColor(
int r,
int g,
int b,
int a)
11792 {
11798 }
11800 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11801 {
11806 }
11807
11809 {
11811 }
11812
11815 {
11816 int r,g,b,a;
11818 r = r/255;
11819 g = g/255;
11820 b = b/255;
11821 a = a/255;
11822 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11823 }
11824
11825
11826
11827 override void SetLiquidType(
int value,
bool allow_client =
false)
11828 {
11829 if (!IsServerCheck(allow_client))
11830 return;
11831
11836 }
11837
11839 {
11840 return ConfigGetInt("varLiquidTypeInit");
11841 }
11842
11844 {
11846 }
11847
11849 {
11851 SetFrozen(false);
11852 }
11853
11856 {
11857 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11858 }
11859
11860
11863 {
11864 PlayerBase nplayer;
11865 if (PlayerBase.CastTo(nplayer, player))
11866 {
11868
11869 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11870 }
11871 }
11872
11873
11876 {
11877 PlayerBase nplayer;
11878 if (PlayerBase.CastTo(nplayer,player))
11879 {
11880
11881 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11882
11883 }
11884
11885
11886 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11887
11888
11889 if (HasEnergyManager())
11890 {
11891 GetCompEM().UpdatePlugState();
11892 }
11893 }
11894
11895
11897 {
11898 super.OnPlacementStarted(player);
11899
11901 }
11902
11903 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11904 {
11906 {
11907 m_AdminLog.OnPlacementComplete(player,
this);
11908 }
11909
11910 super.OnPlacementComplete(player, position, orientation);
11911 }
11912
11913
11914
11915
11916
11918 {
11920 {
11921 return true;
11922 }
11923 else
11924 {
11925 return false;
11926 }
11927 }
11928
11929
11931 {
11933 {
11935 }
11936 }
11937
11938
11940 {
11942 }
11943
11945 {
11947 }
11948
11949 override void InsertAgent(
int agent,
float count = 1)
11950 {
11951 if (count < 1)
11952 return;
11953
11955 }
11956
11959 {
11961 }
11962
11963
11965 {
11967 }
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12011 {
12013 return false;
12014 return true;
12015 }
12016
12018 {
12019
12021 }
12022
12023
12026 {
12027 super.CheckForRoofLimited(timeTresholdMS);
12028
12030 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12031 {
12032 m_PreviousRoofTestTime = time;
12033 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12034 }
12035 }
12036
12037
12039 {
12041 {
12042 return 0;
12043 }
12044
12045 if (GetInventory().GetAttachmentSlotsCount() != 0)
12046 {
12047 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12048 if (filter)
12049 return filter.GetProtectionLevel(type, false, system);
12050 else
12051 return 0;
12052 }
12053
12054 string subclassPath, entryName;
12055
12056 switch (type)
12057 {
12059 entryName = "biological";
12060 break;
12062 entryName = "chemical";
12063 break;
12064 default:
12065 entryName = "biological";
12066 break;
12067 }
12068
12069 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12070
12072 }
12073
12074
12075
12078 {
12079 if (!IsMagazine())
12081
12083 }
12084
12085
12086
12087
12088
12093 {
12094 return true;
12095 }
12096
12098 {
12100 }
12101
12102
12103
12104
12105
12107 {
12108 if (parent)
12109 {
12110 if (parent.IsInherited(DayZInfected))
12111 return true;
12112
12113 if (!parent.IsRuined())
12114 return true;
12115 }
12116
12117 return true;
12118 }
12119
12121 {
12122 if (!super.CanPutAsAttachment(parent))
12123 {
12124 return false;
12125 }
12126
12127 if (!IsRuined() && !parent.IsRuined())
12128 {
12129 return true;
12130 }
12131
12132 return false;
12133 }
12134
12136 {
12137
12138
12139
12140
12141 return super.CanReceiveItemIntoCargo(item);
12142 }
12143
12145 {
12146
12147
12148
12149
12150 GameInventory attachmentInv = attachment.GetInventory();
12152 {
12153 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12154 return false;
12155 }
12156
12157 InventoryLocation loc = new InventoryLocation();
12158 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12159 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12160 return false;
12161
12162 return super.CanReceiveAttachment(attachment, slotId);
12163 }
12164
12166 {
12167 if (!super.CanReleaseAttachment(attachment))
12168 return false;
12169
12170 return GetInventory().AreChildrenAccessible();
12171 }
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12194 {
12195 int id = muzzle_owner.GetMuzzleID();
12196 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12197
12198 if (WPOF_array)
12199 {
12200 for (int i = 0; i < WPOF_array.Count(); i++)
12201 {
12202 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12203
12204 if (WPOF)
12205 {
12206 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12207 }
12208 }
12209 }
12210 }
12211
12212
12214 {
12215 int id = muzzle_owner.GetMuzzleID();
12217
12218 if (WPOBE_array)
12219 {
12220 for (int i = 0; i < WPOBE_array.Count(); i++)
12221 {
12222 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12223
12224 if (WPOBE)
12225 {
12226 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12227 }
12228 }
12229 }
12230 }
12231
12232
12234 {
12235 int id = muzzle_owner.GetMuzzleID();
12236 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12237
12238 if (WPOOH_array)
12239 {
12240 for (int i = 0; i < WPOOH_array.Count(); i++)
12241 {
12242 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12243
12244 if (WPOOH)
12245 {
12246 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12247 }
12248 }
12249 }
12250 }
12251
12252
12254 {
12255 int id = muzzle_owner.GetMuzzleID();
12256 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12257
12258 if (WPOOH_array)
12259 {
12260 for (int i = 0; i < WPOOH_array.Count(); i++)
12261 {
12262 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12263
12264 if (WPOOH)
12265 {
12266 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12267 }
12268 }
12269 }
12270 }
12271
12272
12274 {
12275 int id = muzzle_owner.GetMuzzleID();
12276 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12277
12278 if (WPOOH_array)
12279 {
12280 for (int i = 0; i < WPOOH_array.Count(); i++)
12281 {
12282 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12283
12284 if (WPOOH)
12285 {
12286 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12287 }
12288 }
12289 }
12290 }
12291
12292
12293
12295 {
12297 {
12298 return true;
12299 }
12300
12301 return false;
12302 }
12303
12305 {
12307 {
12308 return true;
12309 }
12310
12311 return false;
12312 }
12313
12315 {
12317 {
12318 return true;
12319 }
12320
12321 return false;
12322 }
12323
12325 {
12326 return false;
12327 }
12328
12331 {
12332 return UATimeSpent.DEFAULT_DEPLOY;
12333 }
12334
12335
12336
12337
12339 {
12341 SetSynchDirty();
12342 }
12343
12345 {
12347 }
12348
12349
12351 {
12352 return false;
12353 }
12354
12357 {
12358 string att_type = "None";
12359
12360 if (ConfigIsExisting("soundAttType"))
12361 {
12362 att_type = ConfigGetString("soundAttType");
12363 }
12364
12366 }
12367
12369 {
12371 }
12372
12373
12374
12375
12376
12380
12382 {
12385
12387 }
12388
12389
12391 {
12393 return;
12394
12396
12399
12402
12403 SoundParameters params = new SoundParameters();
12407 }
12408
12409
12411 {
12413 return;
12414
12416 SetSynchDirty();
12417
12420 }
12421
12422
12424 {
12426 return;
12427
12429 SetSynchDirty();
12430
12433 }
12434
12436 {
12438 }
12439
12441 {
12443 }
12444
12447 {
12448 if (!
GetGame().IsDedicatedServer())
12449 {
12450 if (ConfigIsExisting("attachSoundSet"))
12451 {
12452 string cfg_path = "";
12453 string soundset = "";
12454 string type_name =
GetType();
12455
12458 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12459 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12460
12461 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12462 {
12463 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12464 {
12465 if (cfg_slot_array[i] == slot_type)
12466 {
12467 soundset = cfg_soundset_array[i];
12468 break;
12469 }
12470 }
12471 }
12472
12473 if (soundset != "")
12474 {
12475 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12477 }
12478 }
12479 }
12480 }
12481
12483 {
12484
12485 }
12486
12487 void OnApply(PlayerBase player);
12488
12490 {
12491 return 1.0;
12492 };
12493
12495 {
12497 }
12498
12500 {
12502 }
12503
12505
12507 {
12508 SetDynamicPhysicsLifeTime(0.01);
12510 }
12511
12513 {
12514 array<string> zone_names = new array<string>;
12515 GetDamageZones(zone_names);
12516 for (int i = 0; i < zone_names.Count(); i++)
12517 {
12518 SetHealthMax(zone_names.Get(i),"Health");
12519 }
12520 SetHealthMax("","Health");
12521 }
12522
12525 {
12526 float global_health = GetHealth01("","Health");
12527 array<string> zones = new array<string>;
12528 GetDamageZones(zones);
12529
12530 for (int i = 0; i < zones.Count(); i++)
12531 {
12532 SetHealth01(zones.Get(i),"Health",global_health);
12533 }
12534 }
12535
12538 {
12539 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12540 }
12541
12543 {
12544 if (!hasRootAsPlayer)
12545 {
12546 if (refParentIB)
12547 {
12548
12549 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12550 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12551
12552 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12553 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12554
12557 }
12558 else
12559 {
12560
12563 }
12564 }
12565 }
12566
12568 {
12570 {
12571 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12572 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12573 {
12574 float heatPermCoef = 1.0;
12576 while (ent)
12577 {
12578 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12579 ent = ent.GetHierarchyParent();
12580 }
12581
12582 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12583 }
12584 }
12585 }
12586
12588 {
12589
12590 EntityAI parent = GetHierarchyParent();
12591 if (!parent)
12592 {
12593 hasParent = false;
12594 hasRootAsPlayer = false;
12595 }
12596 else
12597 {
12598 hasParent = true;
12599 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12600 refParentIB =
ItemBase.Cast(parent);
12601 }
12602 }
12603
12604 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12605 {
12606
12607 }
12608
12610 {
12611
12612 return false;
12613 }
12614
12616 {
12617
12618
12619 return false;
12620 }
12621
12623 {
12624
12625 return false;
12626 }
12627
12630 {
12631 return !GetIsFrozen() &&
IsOpen();
12632 }
12633
12635 {
12636 bool hasParent = false, hasRootAsPlayer = false;
12638
12639 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12640 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12641
12642 if (wwtu || foodDecay)
12643 {
12647
12648 if (processWetness || processTemperature || processDecay)
12649 {
12651
12652 if (processWetness)
12653 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12654
12655 if (processTemperature)
12657
12658 if (processDecay)
12659 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12660 }
12661 }
12662 }
12663
12666 {
12668 }
12669
12671 {
12674
12675 return super.GetTemperatureFreezeThreshold();
12676 }
12677
12679 {
12682
12683 return super.GetTemperatureThawThreshold();
12684 }
12685
12687 {
12690
12691 return super.GetItemOverheatThreshold();
12692 }
12693
12695 {
12697 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12698
12699 return super.GetTemperatureFreezeTime();
12700 }
12701
12703 {
12705 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12706
12707 return super.GetTemperatureThawTime();
12708 }
12709
12714
12716 {
12717 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12718 }
12719
12721 {
12722 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12723 }
12724
12727 {
12729 }
12730
12732 {
12734 }
12735
12737 {
12739 }
12740
12743 {
12744 return null;
12745 }
12746
12749 {
12750 return false;
12751 }
12752
12754 {
12756 {
12759 if (!trg)
12760 {
12762 explosive = this;
12763 }
12764
12765 explosive.PairRemote(trg);
12767
12768 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12769 trg.SetPersistentPairID(persistentID);
12770 explosive.SetPersistentPairID(persistentID);
12771
12772 return true;
12773 }
12774 return false;
12775 }
12776
12779 {
12780 float ret = 1.0;
12783 ret *= GetHealth01();
12784
12785 return ret;
12786 }
12787
12788 #ifdef DEVELOPER
12789 override void SetDebugItem()
12790 {
12791 super.SetDebugItem();
12792 _itemBase = this;
12793 }
12794
12796 {
12797 string text = super.GetDebugText();
12798
12800 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12801
12802 return text;
12803 }
12804 #endif
12805
12807 {
12808 return true;
12809 }
12810
12812
12814
12816 {
12819 }
12820
12821
12829
12845}
12846
12848{
12850 if (entity)
12851 {
12852 bool is_item = entity.IsInherited(
ItemBase);
12853 if (is_item && full_quantity)
12854 {
12857 }
12858 }
12859 else
12860 {
12862 return NULL;
12863 }
12864 return entity;
12865}
12866
12868{
12869 if (item)
12870 {
12871 if (health > 0)
12872 item.SetHealth("", "", health);
12873
12874 if (item.CanHaveTemperature())
12875 {
12877 if (item.CanFreeze())
12878 item.SetFrozen(false);
12879 }
12880
12881 if (item.HasEnergyManager())
12882 {
12883 if (quantity >= 0)
12884 {
12885 item.GetCompEM().SetEnergy0To1(quantity);
12886 }
12887 else
12888 {
12890 }
12891 }
12892 else if (item.IsMagazine())
12893 {
12894 Magazine mag = Magazine.Cast(item);
12895 if (quantity >= 0)
12896 {
12897 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12898 }
12899 else
12900 {
12902 }
12903
12904 }
12905 else
12906 {
12907 if (quantity >= 0)
12908 {
12909 item.SetQuantityNormalized(quantity, false);
12910 }
12911 else
12912 {
12914 }
12915
12916 }
12917 }
12918}
12919
12920#ifdef DEVELOPER
12922#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.