8147{
8149 {
8150 return true;
8151 }
8152};
8153
8154
8155
8157{
8161
8163
8166
8167
8168
8169
8170
8179
8185
8190
8195
8216 protected bool m_IsResultOfSplit
8217
8219
8224
8225
8226
8228
8232
8233
8234
8236
8239
8240
8241
8247
8248
8256
8259
8260
8262
8263
8265
8266
8271
8272
8277
8278
8280
8281
8283 {
8288
8289 if (!
GetGame().IsDedicatedServer())
8290 {
8292 {
8294
8296 {
8298 }
8299 }
8300
8303 }
8304
8305 m_OldLocation = null;
8306
8308 {
8310 }
8311
8312 if (ConfigIsExisting("headSelectionsToHide"))
8313 {
8316 }
8317
8319 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8320 {
8322 }
8323
8325
8326 m_IsResultOfSplit = false;
8327
8329 }
8330
8332 {
8333 super.InitItemVariables();
8334
8340 m_Count = ConfigGetInt(
"count");
8341
8344
8349
8352
8357
8369
8373
8374
8377 if (ConfigIsExisting("canBeSplit"))
8378 {
8381 }
8382
8384 if (ConfigIsExisting("itemBehaviour"))
8386
8387
8390 RegisterNetSyncVariableInt("m_VarLiquidType");
8391 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8392
8393 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8394 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8395 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8396
8397 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8398 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8399 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8400 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8401
8402 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8403 RegisterNetSyncVariableBool("m_IsTakeable");
8404 RegisterNetSyncVariableBool("m_IsHologram");
8405
8408 {
8411 }
8412
8414
8416 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8418
8419 }
8420
8422 {
8424 }
8425
8427 {
8430 {
8435 }
8436 }
8437
8438 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8439 {
8441 {
8444 }
8445
8447 }
8448
8450 {
8456 }
8457
8459
8461 {
8463
8464 if (!action)
8465 {
8466 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8467 return;
8468 }
8469
8471 if (!ai)
8472 {
8474 return;
8475 }
8476
8478 if (!action_array)
8479 {
8480 action_array = new array<ActionBase_Basic>;
8482 }
8483 if (LogManager.IsActionLogEnable())
8484 {
8485 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8486 }
8487
8488 if (action_array.Find(action) != -1)
8489 {
8490 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8491 }
8492 else
8493 {
8494 action_array.Insert(action);
8495 }
8496 }
8497
8499 {
8501 ActionBase action = player.GetActionManager().GetAction(actionName);
8504
8505 if (action_array)
8506 {
8507 action_array.RemoveItem(action);
8508 }
8509 }
8510
8511
8512
8514 {
8515 ActionOverrideData overrideData = new ActionOverrideData();
8519
8521 if (!actionMap)
8522 {
8525 }
8526
8527 actionMap.Insert(this.
Type(), overrideData);
8528
8529 }
8530
8532
8534
8535
8537 {
8540
8543
8544 string config_to_search = "CfgVehicles";
8545 string muzzle_owner_config;
8546
8548 {
8549 if (IsInherited(Weapon))
8550 config_to_search = "CfgWeapons";
8551
8552 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8553
8554 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8555
8557
8558 if (config_OnFire_subclass_count > 0)
8559 {
8560 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8561
8562 for (int i = 0; i < config_OnFire_subclass_count; i++)
8563 {
8564 string particle_class = "";
8566 string config_OnFire_entry = config_OnFire_class + particle_class;
8567 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8568 WPOF_array.Insert(WPOF);
8569 }
8570
8571
8573 }
8574 }
8575
8577 {
8578 config_to_search = "CfgWeapons";
8579 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8580
8581 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8582
8584
8585 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8586 {
8587 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8588
8589 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8590 {
8591 string particle_class2 = "";
8593 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8594 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8595 WPOBE_array.Insert(WPOBE);
8596 }
8597
8598
8600 }
8601 }
8602 }
8603
8604
8606 {
8609
8611 {
8612 string config_to_search = "CfgVehicles";
8613
8614 if (IsInherited(Weapon))
8615 config_to_search = "CfgWeapons";
8616
8617 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8618 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8619
8620 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8621 {
8622
8624
8626 {
8628 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8630 return;
8631 }
8632
8635
8636
8637
8639 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8640
8641 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8642 {
8643 string particle_class = "";
8645 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8647
8648 if (entry_type == CT_CLASS)
8649 {
8650 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8651 WPOOH_array.Insert(WPOF);
8652 }
8653 }
8654
8655
8657 }
8658 }
8659 }
8660
8662 {
8664 }
8665
8667 {
8669 {
8671
8674
8677
8678 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8679 }
8680 }
8681
8683 {
8685 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8686
8688 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8689
8691 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8692
8694 {
8696 }
8697 }
8698
8700 {
8702 }
8703
8705 {
8708 else
8710
8712 {
8715 }
8716 else
8717 {
8720
8723 }
8724
8726 }
8727
8729 {
8731 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8732 }
8733
8735 {
8737 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8739 }
8740
8742 {
8744 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8745 }
8746
8748 {
8751
8752 OverheatingParticle OP = new OverheatingParticle();
8757
8759 }
8760
8762 {
8765
8766 return -1;
8767 }
8768
8770 {
8772 {
8775
8776 for (int i = count; i > 0; --i)
8777 {
8778 int id = i - 1;
8781
8784
8785 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8786 {
8787 if (p)
8788 {
8791 }
8792 }
8793 }
8794 }
8795 }
8796
8798 {
8800 {
8802 {
8803 int id = i - 1;
8805
8806 if (OP)
8807 {
8809
8810 if (p)
8811 {
8813 }
8814
8815 delete OP;
8816 }
8817 }
8818
8821 }
8822 }
8823
8826 {
8827 return 0.0;
8828 }
8829
8830
8832 {
8833 return 250;
8834 }
8835
8837 {
8838 return 0;
8839 }
8840
8843 {
8845 return true;
8846
8847 return false;
8848 }
8849
8852 {
8855
8857 {
8859 }
8860 else
8861 {
8862
8864 }
8865
8867 }
8868
8875 {
8876 return -1;
8877 }
8878
8879
8880
8881
8883 {
8885 {
8887 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8888
8889 if (r_index >= 0)
8890 {
8891 InventoryLocation r_il = new InventoryLocation;
8892 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8893
8894 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8897 {
8898 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8899 }
8901 {
8902 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8903 }
8904
8905 }
8906
8907 player.GetHumanInventory().ClearUserReservedLocation(this);
8908 }
8909
8912 }
8913
8914
8915
8916
8918 {
8919 return ItemBase.m_DebugActionsMask;
8920 }
8921
8923 {
8924 return ItemBase.m_DebugActionsMask & mask;
8925 }
8926
8928 {
8929 ItemBase.m_DebugActionsMask = mask;
8930 }
8931
8933 {
8934 ItemBase.m_DebugActionsMask |= mask;
8935 }
8936
8938 {
8939 ItemBase.m_DebugActionsMask &= ~mask;
8940 }
8941
8943 {
8945 {
8947 }
8948 else
8949 {
8951 }
8952 }
8953
8954
8956 {
8957 if (GetEconomyProfile())
8958 {
8959 float q_max = GetEconomyProfile().GetQuantityMax();
8960 if (q_max > 0)
8961 {
8962 float q_min = GetEconomyProfile().GetQuantityMin();
8963 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8964
8966 {
8967 ComponentEnergyManager comp = GetCompEM();
8969 {
8971 }
8972 }
8974 {
8976
8977 }
8978
8979 }
8980 }
8981 }
8982
8985 {
8986 EntityAI parent = GetHierarchyParent();
8987
8988 if (parent)
8989 {
8990 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8991 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8992 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8993 }
8994 }
8995
8998 {
8999 EntityAI parent = GetHierarchyParent();
9000
9001 if (parent)
9002 {
9003 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9004 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9005 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9006 }
9007 }
9008
9010 {
9011
9012
9013
9014
9016
9018 {
9019 if (ScriptInputUserData.CanStoreInputUserData())
9020 {
9021 ScriptInputUserData ctx = new ScriptInputUserData;
9027 ctx.
Write(use_stack_max);
9030
9032 {
9033 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9034 }
9035 }
9036 }
9037 else if (!
GetGame().IsMultiplayer())
9038 {
9040 }
9041 }
9042
9044 {
9046 }
9047
9049 {
9051 }
9052
9054 {
9056 }
9057
9059 {
9060
9061 return false;
9062 }
9063
9065 {
9066 return false;
9067 }
9068
9072 {
9073 return false;
9074 }
9075
9077 {
9078 return "";
9079 }
9080
9082
9084 {
9085 return false;
9086 }
9087
9089 {
9090 return true;
9091 }
9092
9093
9094
9096 {
9097 return true;
9098 }
9099
9101 {
9102 return true;
9103 }
9104
9106 {
9107 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9109 }
9110
9112 {
9114 }
9115
9117 {
9119 if (!is_being_placed)
9121 SetSynchDirty();
9122 }
9123
9124
9126
9128 {
9130 }
9131
9133 {
9135 }
9136
9138 {
9139 return 1;
9140 }
9141
9143 {
9144 return false;
9145 }
9146
9148 {
9150 SetSynchDirty();
9151 }
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9188 {
9189 super.OnMovedInsideCargo(container);
9190
9191 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9192 }
9193
9194 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9195 {
9196 super.EEItemLocationChanged(oldLoc,newLoc);
9197
9198 PlayerBase new_player = null;
9199 PlayerBase old_player = null;
9200
9201 if (newLoc.GetParent())
9202 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9203
9204 if (oldLoc.GetParent())
9205 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9206
9208 {
9209 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9210
9211 if (r_index >= 0)
9212 {
9213 InventoryLocation r_il = new InventoryLocation;
9214 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9215
9216 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9219 {
9220 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9221 }
9223 {
9224 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9225 }
9226
9227 }
9228 }
9229
9231 {
9232 if (new_player)
9233 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9234
9235 if (new_player == old_player)
9236 {
9237
9238 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9239 {
9241 {
9242 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9243 {
9244 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9245 }
9246 }
9247 else
9248 {
9249 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9250 }
9251 }
9252
9253 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9254 {
9255 int type = oldLoc.GetType();
9257 {
9258 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9259 }
9261 {
9262 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9263 }
9264 }
9265 if (!m_OldLocation)
9266 {
9267 m_OldLocation = new InventoryLocation;
9268 }
9269 m_OldLocation.Copy(oldLoc);
9270 }
9271 else
9272 {
9273 if (m_OldLocation)
9274 {
9275 m_OldLocation.Reset();
9276 }
9277 }
9278
9280 }
9281 else
9282 {
9283 if (new_player)
9284 {
9285 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9286 if (res_index >= 0)
9287 {
9288 InventoryLocation il = new InventoryLocation;
9289 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9291 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9294 {
9295 il.
GetParent().GetOnReleaseLock().Invoke(it);
9296 }
9298 {
9300 }
9301
9302 }
9303 }
9305 {
9306
9308 }
9309
9310 if (m_OldLocation)
9311 {
9312 m_OldLocation.Reset();
9313 }
9314 }
9315 }
9316
9317 override void EOnContact(IEntity other, Contact extra)
9318 {
9320 {
9321 int liquidType = -1;
9323 if (impactSpeed > 0.0)
9324 {
9326 #ifndef SERVER
9328 #else
9330 SetSynchDirty();
9331 #endif
9333 }
9334 }
9335
9336 #ifdef SERVER
9337 if (GetCompEM() && GetCompEM().IsPlugged())
9338 {
9339 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9340 GetCompEM().UnplugThis();
9341 }
9342 #endif
9343 }
9344
9346
9348 {
9350 }
9351
9353 {
9354
9355 }
9356
9358 {
9359 super.OnItemLocationChanged(old_owner, new_owner);
9360
9361 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9362 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9363
9364 if (!relatedPlayer && playerNew)
9365 relatedPlayer = playerNew;
9366
9367 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9368 {
9370 if (actionMgr)
9371 {
9372 ActionBase currentAction = actionMgr.GetRunningAction();
9373 if (currentAction)
9375 }
9376 }
9377
9378 Man ownerPlayerOld = null;
9379 Man ownerPlayerNew = null;
9380
9381 if (old_owner)
9382 {
9383 if (old_owner.
IsMan())
9384 {
9385 ownerPlayerOld = Man.Cast(old_owner);
9386 }
9387 else
9388 {
9389 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9390 }
9391 }
9392 else
9393 {
9395 {
9397
9398 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9399 {
9400 GetCompEM().UnplugThis();
9401 }
9402 }
9403 }
9404
9405 if (new_owner)
9406 {
9407 if (new_owner.
IsMan())
9408 {
9409 ownerPlayerNew = Man.Cast(new_owner);
9410 }
9411 else
9412 {
9413 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9414 }
9415 }
9416
9417 if (ownerPlayerOld != ownerPlayerNew)
9418 {
9419 if (ownerPlayerOld)
9420 {
9421 array<EntityAI> subItemsExit = new array<EntityAI>;
9423 for (int i = 0; i < subItemsExit.Count(); i++)
9424 {
9427 }
9428 }
9429
9430 if (ownerPlayerNew)
9431 {
9432 array<EntityAI> subItemsEnter = new array<EntityAI>;
9434 for (int j = 0; j < subItemsEnter.Count(); j++)
9435 {
9438 }
9439 }
9440 }
9441 else if (ownerPlayerNew != null)
9442 {
9443 PlayerBase nplayer;
9444 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9445 {
9446 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9448 for (int k = 0; k < subItemsUpdate.Count(); k++)
9449 {
9451 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9452 }
9453 }
9454 }
9455
9456 if (old_owner)
9457 old_owner.OnChildItemRemoved(this);
9458 if (new_owner)
9459 new_owner.OnChildItemReceived(this);
9460 }
9461
9462
9464 {
9465 super.EEDelete(parent);
9466 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9467 if (player)
9468 {
9470
9471 if (player.IsAlive())
9472 {
9473 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9474 if (r_index >= 0)
9475 {
9476 InventoryLocation r_il = new InventoryLocation;
9477 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9478
9479 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9482 {
9483 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9484 }
9486 {
9487 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9488 }
9489
9490 }
9491
9492 player.RemoveQuickBarEntityShortcut(this);
9493 }
9494 }
9495 }
9496
9498 {
9499 super.EEKilled(killer);
9500
9503 {
9504 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9505 {
9506 if (IsMagazine())
9507 {
9508 if (Magazine.Cast(this).GetAmmoCount() > 0)
9509 {
9511 }
9512 }
9513 else
9514 {
9516 }
9517 }
9518 }
9519 }
9520
9522 {
9523 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9524
9525 super.OnWasAttached(parent, slot_id);
9526
9529
9531 }
9532
9534 {
9535 super.OnWasDetached(parent, slot_id);
9536
9539 }
9540
9542 {
9543 int idx;
9546
9547 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9548 if (inventory_slots.Count() < 1)
9549 {
9550 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9551 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9552 }
9553 else
9554 {
9555 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9556 }
9557
9558 idx = inventory_slots.Find(slot);
9559 if (idx < 0)
9560 return "";
9561
9562 return attach_types.Get(idx);
9563 }
9564
9566 {
9567 int idx = -1;
9568 string slot;
9569
9572
9573 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9574 if (inventory_slots.Count() < 1)
9575 {
9576 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9577 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9578 }
9579 else
9580 {
9581 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9582 if (detach_types.Count() < 1)
9583 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9584 }
9585
9586 for (int i = 0; i < inventory_slots.Count(); i++)
9587 {
9588 slot = inventory_slots.Get(i);
9589 }
9590
9591 if (slot != "")
9592 {
9593 if (detach_types.Count() == 1)
9594 idx = 0;
9595 else
9596 idx = inventory_slots.Find(slot);
9597 }
9598 if (idx < 0)
9599 return "";
9600
9601 return detach_types.Get(idx);
9602 }
9603
9605 {
9606
9608
9609
9610 float min_time = 1;
9611 float max_time = 3;
9612 float delay = Math.RandomFloat(min_time, max_time);
9613
9614 explode_timer.Run(delay, this, "DoAmmoExplosion");
9615 }
9616
9618 {
9619 Magazine magazine = Magazine.Cast(this);
9620 int pop_sounds_count = 6;
9621 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9622
9623
9624 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9625 string sound_name = pop_sounds[ sound_idx ];
9627
9628
9629 magazine.ServerAddAmmoCount(-1);
9630
9631
9632 float min_temp_to_explode = 100;
9633
9634 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9635 {
9637 }
9638 }
9639
9640
9641 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9642 {
9643 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9644
9645 const int CHANCE_DAMAGE_CARGO = 4;
9646 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9647 const int CHANCE_DAMAGE_NOTHING = 2;
9648
9650 {
9651 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9652 int chances;
9653 int rnd;
9654
9655 if (GetInventory().GetCargo())
9656 {
9657 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9658 rnd = Math.RandomInt(0,chances);
9659
9660 if (rnd < CHANCE_DAMAGE_CARGO)
9661 {
9663 }
9664 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9665 {
9667 }
9668 }
9669 else
9670 {
9671 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9672 rnd = Math.RandomInt(0,chances);
9673
9674 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9675 {
9677 }
9678 }
9679 }
9680 }
9681
9683 {
9684 if (GetInventory().GetCargo())
9685 {
9686 int item_count = GetInventory().GetCargo().GetItemCount();
9687 if (item_count > 0)
9688 {
9689 int random_pick = Math.RandomInt(0, item_count);
9691 if (!item.IsExplosive())
9692 {
9693 item.AddHealth("","",damage);
9694 return true;
9695 }
9696 }
9697 }
9698 return false;
9699 }
9700
9702 {
9703 int attachment_count = GetInventory().AttachmentCount();
9704 if (attachment_count > 0)
9705 {
9706 int random_pick = Math.RandomInt(0, attachment_count);
9707 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9708 if (!attachment.IsExplosive())
9709 {
9710 attachment.AddHealth("","",damage);
9711 return true;
9712 }
9713 }
9714 return false;
9715 }
9716
9718 {
9720 }
9721
9723 {
9725 return GetInventory().CanRemoveEntity();
9726
9727 return false;
9728 }
9729
9731 {
9733 return;
9734
9736 {
9737 if (ScriptInputUserData.CanStoreInputUserData())
9738 {
9739 ScriptInputUserData ctx = new ScriptInputUserData;
9744 ctx.
Write(destination_entity);
9748 }
9749 }
9750 else if (!
GetGame().IsMultiplayer())
9751 {
9753 }
9754 }
9755
9757 {
9759 return;
9760
9761 float split_quantity_new;
9765 InventoryLocation loc = new InventoryLocation;
9766
9767 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9768 {
9770 split_quantity_new = stack_max;
9771 else
9773
9774 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9775 if (new_item)
9776 {
9777 new_item.SetResultOfSplit(true);
9778 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9780 new_item.SetQuantity(split_quantity_new);
9781 }
9782 }
9783 else if (destination_entity && slot_id == -1)
9784 {
9785 if (quantity > stack_max)
9786 split_quantity_new = stack_max;
9787 else
9788 split_quantity_new = quantity;
9789
9791 {
9794 }
9795
9796 if (new_item)
9797 {
9798 new_item.SetResultOfSplit(true);
9799 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9801 new_item.SetQuantity(split_quantity_new);
9802 }
9803 }
9804 else
9805 {
9806 if (stack_max != 0)
9807 {
9809 {
9811 }
9812
9813 if (split_quantity_new == 0)
9814 {
9815 if (!
GetGame().IsMultiplayer())
9816 player.PhysicalPredictiveDropItem(this);
9817 else
9818 player.ServerDropEntity(this);
9819 return;
9820 }
9821
9823
9824 if (new_item)
9825 {
9826 new_item.SetResultOfSplit(true);
9827 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9829 new_item.SetQuantity(stack_max);
9830 new_item.PlaceOnSurface();
9831 }
9832 }
9833 }
9834 }
9835
9837 {
9839 return;
9840
9841 float split_quantity_new;
9845 InventoryLocation loc = new InventoryLocation;
9846
9847 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9848 {
9850 split_quantity_new = stack_max;
9851 else
9853
9854 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9855 if (new_item)
9856 {
9857 new_item.SetResultOfSplit(true);
9858 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9860 new_item.SetQuantity(split_quantity_new);
9861 }
9862 }
9863 else if (destination_entity && slot_id == -1)
9864 {
9865 if (quantity > stack_max)
9866 split_quantity_new = stack_max;
9867 else
9868 split_quantity_new = quantity;
9869
9871 {
9874 }
9875
9876 if (new_item)
9877 {
9878 new_item.SetResultOfSplit(true);
9879 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9881 new_item.SetQuantity(split_quantity_new);
9882 }
9883 }
9884 else
9885 {
9886 if (stack_max != 0)
9887 {
9889 {
9891 }
9892
9894
9895 if (new_item)
9896 {
9897 new_item.SetResultOfSplit(true);
9898 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9900 new_item.SetQuantity(stack_max);
9901 new_item.PlaceOnSurface();
9902 }
9903 }
9904 }
9905 }
9906
9908 {
9910 return;
9911
9913 {
9914 if (ScriptInputUserData.CanStoreInputUserData())
9915 {
9916 ScriptInputUserData ctx = new ScriptInputUserData;
9921 dst.WriteToContext(ctx);
9923 }
9924 }
9925 else if (!
GetGame().IsMultiplayer())
9926 {
9928 }
9929 }
9930
9932 {
9934 return;
9935
9937 {
9938 if (ScriptInputUserData.CanStoreInputUserData())
9939 {
9940 ScriptInputUserData ctx = new ScriptInputUserData;
9945 ctx.
Write(destination_entity);
9951 }
9952 }
9953 else if (!
GetGame().IsMultiplayer())
9954 {
9956 }
9957 }
9958
9960 {
9962 }
9963
9965 {
9967 return this;
9968
9970 float split_quantity_new;
9972 if (dst.IsValid())
9973 {
9974 int slot_id = dst.GetSlot();
9976
9977 if (quantity > stack_max)
9978 split_quantity_new = stack_max;
9979 else
9980 split_quantity_new = quantity;
9981
9983
9984 if (new_item)
9985 {
9986 new_item.SetResultOfSplit(true);
9987 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9990 }
9991
9992 return new_item;
9993 }
9994
9995 return null;
9996 }
9997
9999 {
10001 return;
10002
10004 float split_quantity_new;
10006 if (destination_entity)
10007 {
10009 if (quantity > stackable)
10010 split_quantity_new = stackable;
10011 else
10012 split_quantity_new = quantity;
10013
10014 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10015 if (new_item)
10016 {
10017 new_item.SetResultOfSplit(true);
10018 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10020 new_item.SetQuantity(split_quantity_new);
10021 }
10022 }
10023 }
10024
10026 {
10028 return;
10029
10031 {
10032 if (ScriptInputUserData.CanStoreInputUserData())
10033 {
10034 ScriptInputUserData ctx = new ScriptInputUserData;
10039 ItemBase destination_entity =
this;
10040 ctx.
Write(destination_entity);
10044 }
10045 }
10046 else if (!
GetGame().IsMultiplayer())
10047 {
10049 }
10050 }
10051
10053 {
10055 return;
10056
10058 float split_quantity_new;
10060 if (player)
10061 {
10063 if (quantity > stackable)
10064 split_quantity_new = stackable;
10065 else
10066 split_quantity_new = quantity;
10067
10068 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10069 new_item =
ItemBase.Cast(in_hands);
10070 if (new_item)
10071 {
10072 new_item.SetResultOfSplit(true);
10073 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10075 new_item.SetQuantity(split_quantity_new);
10076 }
10077 }
10078 }
10079
10081 {
10083 return;
10084
10086 float split_quantity_new = Math.Floor(quantity * 0.5);
10087
10089
10090 if (new_item)
10091 {
10092 if (new_item.GetQuantityMax() < split_quantity_new)
10093 {
10094 split_quantity_new = new_item.GetQuantityMax();
10095 }
10096
10097 new_item.SetResultOfSplit(true);
10098 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10099
10101 {
10104 }
10105 else
10106 {
10109 }
10110 }
10111 }
10112
10114 {
10116 return;
10117
10119 float split_quantity_new = Math.Floor(quantity / 2);
10120
10121 InventoryLocation invloc = new InventoryLocation;
10123
10125 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10126
10127 if (new_item)
10128 {
10129 if (new_item.GetQuantityMax() < split_quantity_new)
10130 {
10131 split_quantity_new = new_item.GetQuantityMax();
10132 }
10134 {
10137 }
10138 else
10139 {
10142 }
10143 }
10144 }
10145
10148 {
10149 SetWeightDirty();
10151
10152 if (parent)
10153 parent.OnAttachmentQuantityChangedEx(this, delta);
10154
10156 {
10158 {
10160 }
10162 {
10163 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10165 }
10166 }
10167
10168 }
10169
10172 {
10173
10174 }
10175
10178 {
10180 }
10181
10183 {
10184 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10185
10187 {
10188 if (newLevel == GameConstants.STATE_RUINED)
10189 {
10191 EntityAI parent = GetHierarchyParent();
10192 if (parent && parent.IsFireplace())
10193 {
10194 CargoBase cargo = GetInventory().GetCargo();
10195 if (cargo)
10196 {
10198 {
10200 }
10201 }
10202 }
10203 }
10204
10206 {
10207
10209 return;
10210 }
10211
10212 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10213 {
10215 }
10216 }
10217 }
10218
10219
10221 {
10222 super.OnRightClick();
10223
10225 {
10227 {
10228 if (ScriptInputUserData.CanStoreInputUserData())
10229 {
10230 vector m4[4];
10232
10233 EntityAI root = GetHierarchyRoot();
10234
10235 InventoryLocation dst = new InventoryLocation;
10237 {
10238 if (root)
10239 {
10240 root.GetTransform(m4);
10242 }
10243 else
10244 GetInventory().GetCurrentInventoryLocation(dst);
10245 }
10246 else
10247 {
10249
10250
10251 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10252 {
10253 if (root)
10254 {
10255 root.GetTransform(m4);
10257 }
10258 else
10259 GetInventory().GetCurrentInventoryLocation(dst);
10260 }
10261 else
10262 {
10263 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10264 }
10265 }
10266
10267 ScriptInputUserData ctx = new ScriptInputUserData;
10275 }
10276 }
10277 else if (!
GetGame().IsMultiplayer())
10278 {
10280 }
10281 }
10282 }
10283
10284 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10285 {
10286
10287 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10288 return false;
10289
10290 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10291 return false;
10292
10293
10295 return false;
10296
10297
10298 Magazine mag = Magazine.Cast(this);
10299 if (mag)
10300 {
10301 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10302 return false;
10303
10304 if (stack_max_limit)
10305 {
10306 Magazine other_mag = Magazine.Cast(other_item);
10307 if (other_item)
10308 {
10309 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10310 return false;
10311 }
10312
10313 }
10314 }
10315 else
10316 {
10317
10319 return false;
10320
10322 return false;
10323 }
10324
10325 PlayerBase player = null;
10326 if (CastTo(player, GetHierarchyRootPlayer()))
10327 {
10328 if (player.GetInventory().HasAttachment(this))
10329 return false;
10330
10331 if (player.IsItemsToDelete())
10332 return false;
10333 }
10334
10335 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10336 return false;
10337
10338 int slotID;
10340 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10341 return false;
10342
10343 return true;
10344 }
10345
10347 {
10349 }
10350
10352 {
10353 return m_IsResultOfSplit;
10354 }
10355
10357 {
10358 m_IsResultOfSplit = value;
10359 }
10360
10362 {
10364 }
10365
10367 {
10368 float other_item_quantity = other_item.GetQuantity();
10369 float this_free_space;
10370
10372
10374
10375 if (other_item_quantity > this_free_space)
10376 {
10377 return this_free_space;
10378 }
10379 else
10380 {
10381 return other_item_quantity;
10382 }
10383 }
10384
10386 {
10388 }
10389
10391 {
10393 return;
10394
10395 if (!IsMagazine() && other_item)
10396 {
10398 if (quantity_used != 0)
10399 {
10400 float hp1 = GetHealth01("","");
10401 float hp2 = other_item.GetHealth01("","");
10402 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10403 hpResult = hpResult / (
GetQuantity() + quantity_used);
10404
10405 hpResult *= GetMaxHealth();
10406 Math.Round(hpResult);
10407 SetHealth("", "Health", hpResult);
10408
10410 other_item.AddQuantity(-quantity_used);
10411 }
10412 }
10414 }
10415
10417 {
10418 #ifdef SERVER
10419 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10420 GetHierarchyParent().IncreaseLifetimeUp();
10421 #endif
10422 };
10423
10425 {
10426 PlayerBase p = PlayerBase.Cast(player);
10427
10428 array<int> recipesIds = p.m_Recipes;
10429 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10430 if (moduleRecipesManager)
10431 {
10432 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10433 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10434 }
10435
10436 for (int i = 0;i < recipesIds.Count(); i++)
10437 {
10438 int key = recipesIds.Get(i);
10439 string recipeName = moduleRecipesManager.GetRecipeName(key);
10441 }
10442 }
10443
10444
10445 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10446 {
10447 super.GetDebugActions(outputList);
10448
10449
10454
10455
10459
10463
10464
10467
10468
10470 {
10473 }
10474
10476
10479
10483 }
10484
10485
10486
10487
10489 {
10490 super.OnAction(action_id, player, ctx);
10491 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10492 {
10493 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10494 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10495 PlayerBase p = PlayerBase.Cast(player);
10496 if (
EActions.RECIPES_RANGE_START < 1000)
10497 {
10498 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10499 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10500 }
10501 }
10502 #ifndef SERVER
10503 else if (action_id ==
EActions.WATCH_PLAYER)
10504 {
10505 PluginDeveloper.SetDeveloperItemClientEx(player);
10506 }
10507 #endif
10509 {
10510 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10511 {
10512 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10513 OnDebugButtonPressServer(id + 1);
10514 }
10515
10516 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10517 {
10518 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10520 }
10521
10522 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10523 {
10524 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10526 }
10527
10528 else if (action_id ==
EActions.ADD_QUANTITY)
10529 {
10530 if (IsMagazine())
10531 {
10532 Magazine mag = Magazine.Cast(this);
10533 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10534 }
10535 else
10536 {
10538 }
10539
10540 if (m_EM)
10541 {
10542 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10543 }
10544
10545 }
10546
10547 else if (action_id ==
EActions.REMOVE_QUANTITY)
10548 {
10549 if (IsMagazine())
10550 {
10551 Magazine mag2 = Magazine.Cast(this);
10552 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10553 }
10554 else
10555 {
10557 }
10558 if (m_EM)
10559 {
10560 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10561 }
10562
10563 }
10564
10565 else if (action_id ==
EActions.SET_QUANTITY_0)
10566 {
10568
10569 if (m_EM)
10570 {
10571 m_EM.SetEnergy(0);
10572 }
10573 }
10574
10575 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10576 {
10578
10579 if (m_EM)
10580 {
10581 m_EM.SetEnergy(m_EM.GetEnergyMax());
10582 }
10583 }
10584
10585 else if (action_id ==
EActions.ADD_HEALTH)
10586 {
10587 AddHealth("","",GetMaxHealth("","Health")/5);
10588 }
10589 else if (action_id ==
EActions.REMOVE_HEALTH)
10590 {
10591 AddHealth("","",-GetMaxHealth("","Health")/5);
10592 }
10593 else if (action_id ==
EActions.DESTROY_HEALTH)
10594 {
10595 SetHealth01("","",0);
10596 }
10597 else if (action_id ==
EActions.WATCH_ITEM)
10598 {
10600 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10601 #ifdef DEVELOPER
10602 SetDebugDeveloper_item(this);
10603 #endif
10604 }
10605
10606 else if (action_id ==
EActions.ADD_TEMPERATURE)
10607 {
10608 AddTemperature(20);
10609
10610 }
10611
10612 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10613 {
10614 AddTemperature(-20);
10615
10616 }
10617
10618 else if (action_id ==
EActions.FLIP_FROZEN)
10619 {
10620 SetFrozen(!GetIsFrozen());
10621
10622 }
10623
10624 else if (action_id ==
EActions.ADD_WETNESS)
10625 {
10627
10628 }
10629
10630 else if (action_id ==
EActions.REMOVE_WETNESS)
10631 {
10633
10634 }
10635
10636 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10637 {
10640
10641
10642 }
10643
10644 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10645 {
10648 }
10649
10650 else if (action_id ==
EActions.MAKE_SPECIAL)
10651 {
10652 auto debugParams = DebugSpawnParams.WithPlayer(player);
10653 OnDebugSpawnEx(debugParams);
10654 }
10655
10656 else if (action_id ==
EActions.DELETE)
10657 {
10658 Delete();
10659 }
10660
10661 }
10662
10663
10664 return false;
10665 }
10666
10667
10668
10669
10673
10676
10677
10678
10680 {
10681 return false;
10682 }
10683
10684
10686 {
10687 return true;
10688 }
10689
10690
10692 {
10693 return true;
10694 }
10695
10696
10697
10699 {
10700 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10702 }
10703
10706 {
10707 return null;
10708 }
10709
10711 {
10712 return false;
10713 }
10714
10716 {
10717 return false;
10718 }
10719
10723
10724
10726 {
10727 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10728 return module_repairing.CanRepair(this, item_repair_kit);
10729 }
10730
10731
10732 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10733 {
10734 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10735 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10736 }
10737
10738
10740 {
10741
10742
10743
10744
10745
10746
10747
10748
10749 return 1;
10750 }
10751
10752
10753
10755 {
10757 }
10758
10759
10760
10762 {
10764 }
10765
10766
10775 {
10776 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10777
10778 if (player)
10779 {
10780 player.MessageStatus(text);
10781 }
10782 }
10783
10784
10793 {
10794 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10795
10796 if (player)
10797 {
10798 player.MessageAction(text);
10799 }
10800 }
10801
10802
10811 {
10812 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10813
10814 if (player)
10815 {
10816 player.MessageFriendly(text);
10817 }
10818 }
10819
10820
10829 {
10830 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10831
10832 if (player)
10833 {
10834 player.MessageImportant(text);
10835 }
10836 }
10837
10839 {
10840 return true;
10841 }
10842
10843
10844 override bool KindOf(
string tag)
10845 {
10846 bool found = false;
10847 string item_name = this.
GetType();
10850
10851 int array_size = item_tag_array.Count();
10852 for (int i = 0; i < array_size; i++)
10853 {
10854 if (item_tag_array.Get(i) == tag)
10855 {
10856 found = true;
10857 break;
10858 }
10859 }
10860 return found;
10861 }
10862
10863
10865 {
10866
10867 super.OnRPC(sender, rpc_type,ctx);
10868
10869
10870 switch (rpc_type)
10871 {
10872 #ifndef SERVER
10873 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10874 Param2<bool, string> p = new Param2<bool, string>(false, "");
10875
10877 return;
10878
10879 bool play = p.param1;
10880 string soundSet = p.param2;
10881
10882 if (play)
10883 {
10885 {
10887 {
10889 }
10890 }
10891 else
10892 {
10894 }
10895 }
10896 else
10897 {
10899 }
10900
10901 break;
10902 #endif
10903
10904 }
10905
10907 {
10909 }
10910 }
10911
10912
10913
10914
10916 {
10917 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10918 return plugin.GetID(
name);
10919 }
10920
10922 {
10923 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10924 return plugin.GetName(id);
10925 }
10926
10929 {
10930
10931
10932 int varFlags;
10933 if (!ctx.
Read(varFlags))
10934 return;
10935
10936 if (varFlags & ItemVariableFlags.FLOAT)
10937 {
10939 }
10940 }
10941
10943 {
10944
10945 super.SerializeNumericalVars(floats_out);
10946
10947
10948
10950 {
10952 }
10953
10955 {
10957 }
10958
10960 {
10962 }
10963
10965 {
10970 }
10971
10973 {
10975 }
10976 }
10977
10979 {
10980
10981 super.DeSerializeNumericalVars(floats);
10982
10983
10984 int index = 0;
10985 int mask = Math.Round(floats.Get(index));
10986
10987 index++;
10988
10990 {
10992 {
10994 }
10995 else
10996 {
10997 float quantity = floats.Get(index);
10998 SetQuantity(quantity,
true,
false,
false,
false);
10999 }
11000 index++;
11001 }
11002
11004 {
11005 float wet = floats.Get(index);
11007 index++;
11008 }
11009
11011 {
11012 int liquidtype = Math.Round(floats.Get(index));
11014 index++;
11015 }
11016
11018 {
11020 index++;
11022 index++;
11024 index++;
11026 index++;
11027 }
11028
11030 {
11031 int cleanness = Math.Round(floats.Get(index));
11033 index++;
11034 }
11035 }
11036
11038 {
11039 super.WriteVarsToCTX(ctx);
11040
11041
11043 {
11045 }
11046
11048 {
11050 }
11051
11053 {
11055 }
11056
11058 {
11059 int r,g,b,a;
11065 }
11066
11068 {
11070 }
11071 }
11072
11074 {
11075 if (!super.ReadVarsFromCTX(ctx,version))
11076 return false;
11077
11078 int intValue;
11079 float value;
11080
11081 if (version < 140)
11082 {
11083 if (!ctx.
Read(intValue))
11084 return false;
11085
11086 m_VariablesMask = intValue;
11087 }
11088
11090 {
11091 if (!ctx.
Read(value))
11092 return false;
11093
11095 {
11097 }
11098 else
11099 {
11101 }
11102 }
11103
11104 if (version < 140)
11105 {
11107 {
11108 if (!ctx.
Read(value))
11109 return false;
11110 SetTemperatureDirect(value);
11111 }
11112 }
11113
11115 {
11116 if (!ctx.
Read(value))
11117 return false;
11119 }
11120
11122 {
11123 if (!ctx.
Read(intValue))
11124 return false;
11126 }
11127
11129 {
11130 int r,g,b,a;
11132 return false;
11134 return false;
11136 return false;
11138 return false;
11139
11141 }
11142
11144 {
11145 if (!ctx.
Read(intValue))
11146 return false;
11148 }
11149
11150 if (version >= 138 && version < 140)
11151 {
11153 {
11154 if (!ctx.
Read(intValue))
11155 return false;
11156 SetFrozen(intValue);
11157 }
11158 }
11159
11160 return true;
11161 }
11162
11163
11165 {
11168 {
11170 }
11171
11172 if (!super.OnStoreLoad(ctx, version))
11173 {
11175 return false;
11176 }
11177
11178 if (version >= 114)
11179 {
11180 bool hasQuickBarIndexSaved;
11181
11182 if (!ctx.
Read(hasQuickBarIndexSaved))
11183 {
11185 return false;
11186 }
11187
11188 if (hasQuickBarIndexSaved)
11189 {
11190 int itmQBIndex;
11191
11192
11193 if (!ctx.
Read(itmQBIndex))
11194 {
11196 return false;
11197 }
11198
11199 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11200 if (itmQBIndex != -1 && parentPlayer)
11201 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11202 }
11203 }
11204 else
11205 {
11206
11207 PlayerBase player;
11208 int itemQBIndex;
11209 if (version ==
int.
MAX)
11210 {
11211 if (!ctx.
Read(itemQBIndex))
11212 {
11214 return false;
11215 }
11216 }
11217 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11218 {
11219
11220 if (!ctx.
Read(itemQBIndex))
11221 {
11223 return false;
11224 }
11225 if (itemQBIndex != -1 && player)
11226 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11227 }
11228 }
11229
11230 if (version < 140)
11231 {
11232
11233 if (!LoadVariables(ctx, version))
11234 {
11236 return false;
11237 }
11238 }
11239
11240
11242 {
11244 return false;
11245 }
11246 if (version >= 132)
11247 {
11249 if (raib)
11250 {
11252 {
11254 return false;
11255 }
11256 }
11257 }
11258
11260 return true;
11261 }
11262
11263
11264
11266 {
11267 super.OnStoreSave(ctx);
11268
11269 PlayerBase player;
11270 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11271 {
11273
11274 int itemQBIndex = -1;
11275 itemQBIndex = player.FindQuickBarEntityIndex(this);
11276 ctx.
Write(itemQBIndex);
11277 }
11278 else
11279 {
11281 }
11282
11284
11286 if (raib)
11287 {
11289 }
11290 }
11291
11292
11294 {
11295 super.AfterStoreLoad();
11296
11298 {
11300 }
11301
11303 {
11306 }
11307 }
11308
11310 {
11311 super.EEOnAfterLoad();
11312
11314 {
11316 }
11317
11320 }
11321
11323 {
11324 return false;
11325 }
11326
11327
11328
11330 {
11332 {
11333 #ifdef PLATFORM_CONSOLE
11334
11336 {
11338 if (menu)
11339 {
11341 }
11342 }
11343 #endif
11344 }
11345
11347 {
11350 }
11351
11353 {
11354 SetWeightDirty();
11356 }
11358 {
11361 }
11362
11364 {
11367 }
11369 {
11372 }
11373
11374 super.OnVariablesSynchronized();
11375 }
11376
11377
11378
11380 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11381 {
11382 if (!IsServerCheck(allow_client))
11383 return false;
11384
11386 return false;
11387
11390
11391 if (value <= (min + 0.001))
11392 value = min;
11393
11394 if (value == min)
11395 {
11396 if (destroy_config)
11397 {
11398 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11399 if (dstr)
11400 {
11402 this.Delete();
11403 return true;
11404 }
11405 }
11406 else if (destroy_forced)
11407 {
11409 this.Delete();
11410 return true;
11411 }
11412
11414 }
11415
11418
11420 {
11422
11423 if (delta)
11425 }
11426
11428
11429 return false;
11430 }
11431
11432
11434 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11435 {
11437 }
11438
11440 {
11443 }
11444
11446 {
11449 }
11450
11453 {
11454 float value_clamped = Math.Clamp(value, 0, 1);
11456 SetQuantity(result, destroy_config, destroy_forced);
11457 }
11458
11459
11462 {
11464 }
11465
11467 {
11469 }
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11481 {
11482 int slot = -1;
11483 if (GetInventory())
11484 {
11485 InventoryLocation il = new InventoryLocation;
11486 GetInventory().GetCurrentInventoryLocation(il);
11488 }
11489
11491 }
11492
11494 {
11495 float quantity_max = 0;
11496
11498 {
11499 if (attSlotID != -1)
11500 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11501
11502 if (quantity_max <= 0)
11504 }
11505
11506 if (quantity_max <= 0)
11508
11509 return quantity_max;
11510 }
11511
11513 {
11515 }
11516
11518 {
11520 }
11521
11522
11524 {
11526 }
11527
11529 {
11531 }
11532
11534 {
11536 }
11537
11538
11540 {
11541
11542 float weightEx = GetWeightEx();
11543 float special = GetInventoryAndCargoWeight();
11544 return weightEx - special;
11545 }
11546
11547
11549 {
11551 }
11552
11554 {
11556 {
11557 #ifdef DEVELOPER
11558 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11559 {
11560 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11562 }
11563 #endif
11564
11565 return GetQuantity() * GetConfigWeightModified();
11566 }
11567 else if (HasEnergyManager())
11568 {
11569 #ifdef DEVELOPER
11570 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11571 {
11572 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11573 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11574 }
11575 #endif
11576 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11577 }
11578 else
11579 {
11580 #ifdef DEVELOPER
11581 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11582 {
11583 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11584 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11585 }
11586 #endif
11587 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11588 }
11589 }
11590
11593 {
11594 int item_count = 0;
11596
11597 if (GetInventory().GetCargo() != NULL)
11598 {
11599 item_count = GetInventory().GetCargo().GetItemCount();
11600 }
11601
11602 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11603 {
11604 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11605 if (item)
11606 item_count += item.GetNumberOfItems();
11607 }
11608 return item_count;
11609 }
11610
11613 {
11614 float weight = 0;
11615 float wetness = 1;
11616 if (include_wetness)
11619 {
11620 weight = wetness * m_ConfigWeight;
11621 }
11623 {
11624 weight = 1;
11625 }
11626 return weight;
11627 }
11628
11629
11630
11632 {
11633 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11634 {
11635 GameInventory inv = GetInventory();
11636 array<EntityAI> items = new array<EntityAI>;
11638 for (int i = 0; i < items.Count(); i++)
11639 {
11641 if (item)
11642 {
11644 }
11645 }
11646 }
11647 }
11648
11649
11650
11651
11653 {
11654 float energy = 0;
11655 if (HasEnergyManager())
11656 {
11657 energy = GetCompEM().GetEnergy();
11658 }
11659 return energy;
11660 }
11661
11662
11664 {
11665 super.OnEnergyConsumed();
11666
11668 }
11669
11671 {
11672 super.OnEnergyAdded();
11673
11675 }
11676
11677
11679 {
11680 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11681 {
11683 {
11684 float energy_0to1 = GetCompEM().GetEnergy0To1();
11686 }
11687 }
11688 }
11689
11690
11692 {
11693 return ConfigGetFloat("heatIsolation");
11694 }
11695
11697 {
11699 }
11700
11702 {
11703 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11704 if (
GetGame().ConfigIsExisting(paramPath))
11706
11707 return 0.0;
11708 }
11709
11711 {
11712 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11713 if (
GetGame().ConfigIsExisting(paramPath))
11715
11716 return 0.0;
11717 }
11718
11719 override void SetWet(
float value,
bool allow_client =
false)
11720 {
11721 if (!IsServerCheck(allow_client))
11722 return;
11723
11726
11728
11729 m_VarWet = Math.Clamp(value, min, max);
11730
11732 {
11735 }
11736 }
11737
11738 override void AddWet(
float value)
11739 {
11741 }
11742
11744 {
11746 }
11747
11749 {
11751 }
11752
11754 {
11756 }
11757
11759 {
11761 }
11762
11764 {
11766 }
11767
11768 override void OnWetChanged(
float newVal,
float oldVal)
11769 {
11772 if (newLevel != oldLevel)
11773 {
11775 }
11776 }
11777
11779 {
11780 SetWeightDirty();
11781 }
11782
11784 {
11785 return GetWetLevelInternal(
m_VarWet);
11786 }
11787
11788
11789
11791 {
11793 }
11794
11796 {
11798 }
11799
11801 {
11803 }
11804
11806 {
11808 }
11809
11810
11811
11813 {
11814 if (ConfigIsExisting("itemModelLength"))
11815 {
11816 return ConfigGetFloat("itemModelLength");
11817 }
11818 return 0;
11819 }
11820
11822 {
11823 if (ConfigIsExisting("itemAttachOffset"))
11824 {
11825 return ConfigGetFloat("itemAttachOffset");
11826 }
11827 return 0;
11828 }
11829
11830 override void SetCleanness(
int value,
bool allow_client =
false)
11831 {
11832 if (!IsServerCheck(allow_client))
11833 return;
11834
11836
11838
11841 }
11842
11844 {
11846 }
11847
11849 {
11850 return true;
11851 }
11852
11853
11854
11855
11857 {
11859 }
11860
11862 {
11864 }
11865
11866
11867
11868
11869 override void SetColor(
int r,
int g,
int b,
int a)
11870 {
11876 }
11878 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11879 {
11884 }
11885
11887 {
11889 }
11890
11893 {
11894 int r,g,b,a;
11896 r = r/255;
11897 g = g/255;
11898 b = b/255;
11899 a = a/255;
11900 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11901 }
11902
11903
11904
11905 override void SetLiquidType(
int value,
bool allow_client =
false)
11906 {
11907 if (!IsServerCheck(allow_client))
11908 return;
11909
11914 }
11915
11917 {
11918 return ConfigGetInt("varLiquidTypeInit");
11919 }
11920
11922 {
11924 }
11925
11927 {
11929 SetFrozen(false);
11930 }
11931
11934 {
11935 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11936 }
11937
11938
11941 {
11942 PlayerBase nplayer;
11943 if (PlayerBase.CastTo(nplayer, player))
11944 {
11946
11947 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11948 }
11949 }
11950
11951
11954 {
11955 PlayerBase nplayer;
11956 if (PlayerBase.CastTo(nplayer,player))
11957 {
11958
11959 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11960
11961 }
11962
11963
11964 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11965
11966
11967 if (HasEnergyManager())
11968 {
11969 GetCompEM().UpdatePlugState();
11970 }
11971 }
11972
11973
11975 {
11976 super.OnPlacementStarted(player);
11977
11979 }
11980
11981 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11982 {
11984 {
11985 m_AdminLog.OnPlacementComplete(player,
this);
11986 }
11987
11988 super.OnPlacementComplete(player, position, orientation);
11989 }
11990
11991
11992
11993
11994
11996 {
11998 {
11999 return true;
12000 }
12001 else
12002 {
12003 return false;
12004 }
12005 }
12006
12007
12009 {
12011 {
12013 }
12014 }
12015
12016
12018 {
12020 }
12021
12023 {
12025 }
12026
12027 override void InsertAgent(
int agent,
float count = 1)
12028 {
12029 if (count < 1)
12030 return;
12031
12033 }
12034
12037 {
12039 }
12040
12041
12043 {
12045 }
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12089 {
12091 return false;
12092 return true;
12093 }
12094
12096 {
12097
12099 }
12100
12101
12104 {
12105 super.CheckForRoofLimited(timeTresholdMS);
12106
12108 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12109 {
12110 m_PreviousRoofTestTime = time;
12111 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12112 }
12113 }
12114
12115
12117 {
12119 {
12120 return 0;
12121 }
12122
12123 if (GetInventory().GetAttachmentSlotsCount() != 0)
12124 {
12125 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12126 if (filter)
12127 return filter.GetProtectionLevel(type, false, system);
12128 else
12129 return 0;
12130 }
12131
12132 string subclassPath, entryName;
12133
12134 switch (type)
12135 {
12137 entryName = "biological";
12138 break;
12140 entryName = "chemical";
12141 break;
12142 default:
12143 entryName = "biological";
12144 break;
12145 }
12146
12147 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12148
12150 }
12151
12152
12153
12156 {
12157 if (!IsMagazine())
12159
12161 }
12162
12163
12164
12165
12166
12171 {
12172 return true;
12173 }
12174
12176 {
12178 }
12179
12180
12181
12182
12183
12185 {
12186 if (parent)
12187 {
12188 if (parent.IsInherited(DayZInfected))
12189 return true;
12190
12191 if (!parent.IsRuined())
12192 return true;
12193 }
12194
12195 return true;
12196 }
12197
12199 {
12200 if (!super.CanPutAsAttachment(parent))
12201 {
12202 return false;
12203 }
12204
12205 if (!IsRuined() && !parent.IsRuined())
12206 {
12207 return true;
12208 }
12209
12210 return false;
12211 }
12212
12214 {
12215
12216
12217
12218
12219 return super.CanReceiveItemIntoCargo(item);
12220 }
12221
12223 {
12224
12225
12226
12227
12228 GameInventory attachmentInv = attachment.GetInventory();
12230 {
12231 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12232 return false;
12233 }
12234
12235 InventoryLocation loc = new InventoryLocation();
12236 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12237 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12238 return false;
12239
12240 return super.CanReceiveAttachment(attachment, slotId);
12241 }
12242
12244 {
12245 if (!super.CanReleaseAttachment(attachment))
12246 return false;
12247
12248 return GetInventory().AreChildrenAccessible();
12249 }
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12272 {
12273 int id = muzzle_owner.GetMuzzleID();
12274 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12275
12276 if (WPOF_array)
12277 {
12278 for (int i = 0; i < WPOF_array.Count(); i++)
12279 {
12280 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12281
12282 if (WPOF)
12283 {
12284 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12285 }
12286 }
12287 }
12288 }
12289
12290
12292 {
12293 int id = muzzle_owner.GetMuzzleID();
12295
12296 if (WPOBE_array)
12297 {
12298 for (int i = 0; i < WPOBE_array.Count(); i++)
12299 {
12300 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12301
12302 if (WPOBE)
12303 {
12304 WPOBE.OnActivate(weapon, 0, 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.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12325 }
12326 }
12327 }
12328 }
12329
12330
12332 {
12333 int id = muzzle_owner.GetMuzzleID();
12334 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12335
12336 if (WPOOH_array)
12337 {
12338 for (int i = 0; i < WPOOH_array.Count(); i++)
12339 {
12340 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12341
12342 if (WPOOH)
12343 {
12344 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12345 }
12346 }
12347 }
12348 }
12349
12350
12352 {
12353 int id = muzzle_owner.GetMuzzleID();
12354 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12355
12356 if (WPOOH_array)
12357 {
12358 for (int i = 0; i < WPOOH_array.Count(); i++)
12359 {
12360 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12361
12362 if (WPOOH)
12363 {
12364 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12365 }
12366 }
12367 }
12368 }
12369
12370
12371
12373 {
12375 {
12376 return true;
12377 }
12378
12379 return false;
12380 }
12381
12383 {
12385 {
12386 return true;
12387 }
12388
12389 return false;
12390 }
12391
12393 {
12395 {
12396 return true;
12397 }
12398
12399 return false;
12400 }
12401
12403 {
12404 return false;
12405 }
12406
12409 {
12410 return UATimeSpent.DEFAULT_DEPLOY;
12411 }
12412
12413
12414
12415
12417 {
12419 SetSynchDirty();
12420 }
12421
12423 {
12425 }
12426
12427
12429 {
12430 return false;
12431 }
12432
12435 {
12436 string att_type = "None";
12437
12438 if (ConfigIsExisting("soundAttType"))
12439 {
12440 att_type = ConfigGetString("soundAttType");
12441 }
12442
12444 }
12445
12447 {
12449 }
12450
12451
12452
12453
12454
12458
12460 {
12463
12465 }
12466
12467
12469 {
12471 return;
12472
12474
12477
12480
12481 SoundParameters params = new SoundParameters();
12485 }
12486
12487
12489 {
12491 return;
12492
12494 SetSynchDirty();
12495
12498 }
12499
12500
12502 {
12504 return;
12505
12507 SetSynchDirty();
12508
12511 }
12512
12514 {
12516 }
12517
12519 {
12521 }
12522
12525 {
12526 if (!
GetGame().IsDedicatedServer())
12527 {
12528 if (ConfigIsExisting("attachSoundSet"))
12529 {
12530 string cfg_path = "";
12531 string soundset = "";
12532 string type_name =
GetType();
12533
12536 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12537 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12538
12539 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12540 {
12541 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12542 {
12543 if (cfg_slot_array[i] == slot_type)
12544 {
12545 soundset = cfg_soundset_array[i];
12546 break;
12547 }
12548 }
12549 }
12550
12551 if (soundset != "")
12552 {
12553 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12555 }
12556 }
12557 }
12558 }
12559
12561 {
12562
12563 }
12564
12565 void OnApply(PlayerBase player);
12566
12568 {
12569 return 1.0;
12570 };
12571
12573 {
12575 }
12576
12578 {
12580 }
12581
12583
12585 {
12586 SetDynamicPhysicsLifeTime(0.01);
12588 }
12589
12591 {
12592 array<string> zone_names = new array<string>;
12593 GetDamageZones(zone_names);
12594 for (int i = 0; i < zone_names.Count(); i++)
12595 {
12596 SetHealthMax(zone_names.Get(i),"Health");
12597 }
12598 SetHealthMax("","Health");
12599 }
12600
12603 {
12604 float global_health = GetHealth01("","Health");
12605 array<string> zones = new array<string>;
12606 GetDamageZones(zones);
12607
12608 for (int i = 0; i < zones.Count(); i++)
12609 {
12610 SetHealth01(zones.Get(i),"Health",global_health);
12611 }
12612 }
12613
12616 {
12617 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12618 }
12619
12621 {
12622 if (!hasRootAsPlayer)
12623 {
12624 if (refParentIB)
12625 {
12626
12627 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12628 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12629
12630 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12631 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12632
12635 }
12636 else
12637 {
12638
12641 }
12642 }
12643 }
12644
12646 {
12648 {
12649 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12650 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12651 {
12652 float heatPermCoef = 1.0;
12654 while (ent)
12655 {
12656 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12657 ent = ent.GetHierarchyParent();
12658 }
12659
12660 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12661 }
12662 }
12663 }
12664
12666 {
12667
12668 EntityAI parent = GetHierarchyParent();
12669 if (!parent)
12670 {
12671 hasParent = false;
12672 hasRootAsPlayer = false;
12673 }
12674 else
12675 {
12676 hasParent = true;
12677 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12678 refParentIB =
ItemBase.Cast(parent);
12679 }
12680 }
12681
12682 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12683 {
12684
12685 }
12686
12688 {
12689
12690 return false;
12691 }
12692
12694 {
12695
12696
12697 return false;
12698 }
12699
12701 {
12702
12703 return false;
12704 }
12705
12708 {
12709 return !GetIsFrozen() &&
IsOpen();
12710 }
12711
12713 {
12714 bool hasParent = false, hasRootAsPlayer = false;
12716
12717 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12718 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12719
12720 if (wwtu || foodDecay)
12721 {
12725
12726 if (processWetness || processTemperature || processDecay)
12727 {
12729
12730 if (processWetness)
12731 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12732
12733 if (processTemperature)
12735
12736 if (processDecay)
12737 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12738 }
12739 }
12740 }
12741
12744 {
12746 }
12747
12749 {
12752
12753 return super.GetTemperatureFreezeThreshold();
12754 }
12755
12757 {
12760
12761 return super.GetTemperatureThawThreshold();
12762 }
12763
12765 {
12768
12769 return super.GetItemOverheatThreshold();
12770 }
12771
12773 {
12775 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12776
12777 return super.GetTemperatureFreezeTime();
12778 }
12779
12781 {
12783 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12784
12785 return super.GetTemperatureThawTime();
12786 }
12787
12792
12794 {
12795 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12796 }
12797
12799 {
12800 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12801 }
12802
12805 {
12807 }
12808
12810 {
12812 }
12813
12815 {
12817 }
12818
12821 {
12822 return null;
12823 }
12824
12827 {
12828 return false;
12829 }
12830
12832 {
12834 {
12837 if (!trg)
12838 {
12840 explosive = this;
12841 }
12842
12843 explosive.PairRemote(trg);
12845
12846 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12847 trg.SetPersistentPairID(persistentID);
12848 explosive.SetPersistentPairID(persistentID);
12849
12850 return true;
12851 }
12852 return false;
12853 }
12854
12857 {
12858 float ret = 1.0;
12861 ret *= GetHealth01();
12862
12863 return ret;
12864 }
12865
12866 #ifdef DEVELOPER
12867 override void SetDebugItem()
12868 {
12869 super.SetDebugItem();
12870 _itemBase = this;
12871 }
12872
12874 {
12875 string text = super.GetDebugText();
12876
12878 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12879
12880 return text;
12881 }
12882 #endif
12883
12885 {
12886 return true;
12887 }
12888
12890
12892
12894 {
12897 }
12898
12899
12907
12923}
12924
12926{
12928 if (entity)
12929 {
12930 bool is_item = entity.IsInherited(
ItemBase);
12931 if (is_item && full_quantity)
12932 {
12935 }
12936 }
12937 else
12938 {
12940 return NULL;
12941 }
12942 return entity;
12943}
12944
12946{
12947 if (item)
12948 {
12949 if (health > 0)
12950 item.SetHealth("", "", health);
12951
12952 if (item.CanHaveTemperature())
12953 {
12955 if (item.CanFreeze())
12956 item.SetFrozen(false);
12957 }
12958
12959 if (item.HasEnergyManager())
12960 {
12961 if (quantity >= 0)
12962 {
12963 item.GetCompEM().SetEnergy0To1(quantity);
12964 }
12965 else
12966 {
12968 }
12969 }
12970 else if (item.IsMagazine())
12971 {
12972 Magazine mag = Magazine.Cast(item);
12973 if (quantity >= 0)
12974 {
12975 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12976 }
12977 else
12978 {
12980 }
12981
12982 }
12983 else
12984 {
12985 if (quantity >= 0)
12986 {
12987 item.SetQuantityNormalized(quantity, false);
12988 }
12989 else
12990 {
12992 }
12993
12994 }
12995 }
12996}
12997
12998#ifdef DEVELOPER
13000#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.