7309{
7311 {
7312 return true;
7313 }
7314};
7315
7316
7317
7319{
7323
7325
7328
7329
7330
7331
7332
7341
7347
7352
7357
7378 protected bool m_IsResultOfSplit
7379
7381
7386
7387
7388
7390
7394
7395
7396
7398
7401
7402
7403
7409
7410
7418
7421
7422
7424
7425
7427
7428
7433
7434
7439
7440
7442
7443
7445 {
7450
7451 if (!
GetGame().IsDedicatedServer())
7452 {
7454 {
7456
7458 {
7460 }
7461 }
7462
7465 }
7466
7467 m_OldLocation = null;
7468
7470 {
7472 }
7473
7474 if (ConfigIsExisting("headSelectionsToHide"))
7475 {
7478 }
7479
7481 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7482 {
7484 }
7485
7487
7488 m_IsResultOfSplit = false;
7489
7491 }
7492
7494 {
7495 super.InitItemVariables();
7496
7502 m_Count = ConfigGetInt(
"count");
7503
7506
7511
7514
7519
7531
7535
7536
7539 if (ConfigIsExisting("canBeSplit"))
7540 {
7543 }
7544
7546 if (ConfigIsExisting("itemBehaviour"))
7548
7549
7552 RegisterNetSyncVariableInt("m_VarLiquidType");
7553 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7554
7555 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7556 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7557 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7558
7559 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7560 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7561 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7562 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7563
7564 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7565 RegisterNetSyncVariableBool("m_IsTakeable");
7566 RegisterNetSyncVariableBool("m_IsHologram");
7567
7570 {
7573 }
7574
7576
7578 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7580
7581 }
7582
7584 {
7586 }
7587
7589 {
7592 {
7597 }
7598 }
7599
7600 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7601 {
7603 {
7606 }
7607
7609 }
7610
7612 {
7618 }
7619
7621
7623 {
7625
7626 if (!action)
7627 {
7628 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7629 return;
7630 }
7631
7633 if (!ai)
7634 {
7636 return;
7637 }
7638
7640 if (!action_array)
7641 {
7642 action_array = new array<ActionBase_Basic>;
7644 }
7645 if (LogManager.IsActionLogEnable())
7646 {
7647 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7648 }
7649
7650 if (action_array.Find(action) != -1)
7651 {
7652 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7653 }
7654 else
7655 {
7656 action_array.Insert(action);
7657 }
7658 }
7659
7661 {
7663 ActionBase action = player.GetActionManager().GetAction(actionName);
7666
7667 if (action_array)
7668 {
7669 action_array.RemoveItem(action);
7670 }
7671 }
7672
7673
7674
7676 {
7677 ActionOverrideData overrideData = new ActionOverrideData();
7681
7683 if (!actionMap)
7684 {
7687 }
7688
7689 actionMap.Insert(this.
Type(), overrideData);
7690
7691 }
7692
7694
7696
7697
7699 {
7702
7705
7706 string config_to_search = "CfgVehicles";
7707 string muzzle_owner_config;
7708
7710 {
7711 if (IsInherited(Weapon))
7712 config_to_search = "CfgWeapons";
7713
7714 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7715
7716 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7717
7719
7720 if (config_OnFire_subclass_count > 0)
7721 {
7722 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7723
7724 for (int i = 0; i < config_OnFire_subclass_count; i++)
7725 {
7726 string particle_class = "";
7728 string config_OnFire_entry = config_OnFire_class + particle_class;
7729 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7730 WPOF_array.Insert(WPOF);
7731 }
7732
7733
7735 }
7736 }
7737
7739 {
7740 config_to_search = "CfgWeapons";
7741 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7742
7743 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7744
7746
7747 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7748 {
7749 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7750
7751 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7752 {
7753 string particle_class2 = "";
7755 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7756 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7757 WPOBE_array.Insert(WPOBE);
7758 }
7759
7760
7762 }
7763 }
7764 }
7765
7766
7768 {
7771
7773 {
7774 string config_to_search = "CfgVehicles";
7775
7776 if (IsInherited(Weapon))
7777 config_to_search = "CfgWeapons";
7778
7779 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7780 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7781
7782 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7783 {
7784
7786
7788 {
7790 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7792 return;
7793 }
7794
7797
7798
7799
7801 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7802
7803 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7804 {
7805 string particle_class = "";
7807 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7809
7810 if (entry_type == CT_CLASS)
7811 {
7812 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7813 WPOOH_array.Insert(WPOF);
7814 }
7815 }
7816
7817
7819 }
7820 }
7821 }
7822
7824 {
7826 }
7827
7829 {
7831 {
7833
7836
7839
7840 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7841 }
7842 }
7843
7845 {
7847 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7848
7850 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7851
7853 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7854
7856 {
7858 }
7859 }
7860
7862 {
7864 }
7865
7867 {
7870 else
7872
7874 {
7877 }
7878 else
7879 {
7882
7885 }
7886
7888 }
7889
7891 {
7893 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7894 }
7895
7897 {
7899 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7901 }
7902
7904 {
7906 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7907 }
7908
7910 {
7913
7914 OverheatingParticle OP = new OverheatingParticle();
7919
7921 }
7922
7924 {
7927
7928 return -1;
7929 }
7930
7932 {
7934 {
7937
7938 for (int i = count; i > 0; --i)
7939 {
7940 int id = i - 1;
7943
7946
7947 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7948 {
7949 if (p)
7950 {
7953 }
7954 }
7955 }
7956 }
7957 }
7958
7960 {
7962 {
7964 {
7965 int id = i - 1;
7967
7968 if (OP)
7969 {
7971
7972 if (p)
7973 {
7975 }
7976
7977 delete OP;
7978 }
7979 }
7980
7983 }
7984 }
7985
7988 {
7989 return 0.0;
7990 }
7991
7992
7994 {
7995 return 250;
7996 }
7997
7999 {
8000 return 0;
8001 }
8002
8005 {
8007 return true;
8008
8009 return false;
8010 }
8011
8014 {
8017
8019 {
8021 }
8022 else
8023 {
8024
8026 }
8027
8029 }
8030
8037 {
8038 return -1;
8039 }
8040
8041
8042
8043
8045 {
8047 {
8049 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8050
8051 if (r_index >= 0)
8052 {
8053 InventoryLocation r_il = new InventoryLocation;
8054 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8055
8056 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8059 {
8060 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8061 }
8063 {
8064 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8065 }
8066
8067 }
8068
8069 player.GetHumanInventory().ClearUserReservedLocation(this);
8070 }
8071
8074 }
8075
8076
8077
8078
8080 {
8081 return ItemBase.m_DebugActionsMask;
8082 }
8083
8085 {
8086 return ItemBase.m_DebugActionsMask & mask;
8087 }
8088
8090 {
8091 ItemBase.m_DebugActionsMask = mask;
8092 }
8093
8095 {
8096 ItemBase.m_DebugActionsMask |= mask;
8097 }
8098
8100 {
8101 ItemBase.m_DebugActionsMask &= ~mask;
8102 }
8103
8105 {
8107 {
8109 }
8110 else
8111 {
8113 }
8114 }
8115
8116
8118 {
8119 if (GetEconomyProfile())
8120 {
8121 float q_max = GetEconomyProfile().GetQuantityMax();
8122 if (q_max > 0)
8123 {
8124 float q_min = GetEconomyProfile().GetQuantityMin();
8125 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8126
8128 {
8129 ComponentEnergyManager comp = GetCompEM();
8131 {
8133 }
8134 }
8136 {
8138
8139 }
8140
8141 }
8142 }
8143 }
8144
8147 {
8148 EntityAI parent = GetHierarchyParent();
8149
8150 if (parent)
8151 {
8152 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8153 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8154 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8155 }
8156 }
8157
8160 {
8161 EntityAI parent = GetHierarchyParent();
8162
8163 if (parent)
8164 {
8165 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8166 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8167 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8168 }
8169 }
8170
8172 {
8173
8174
8175
8176
8178
8180 {
8181 if (ScriptInputUserData.CanStoreInputUserData())
8182 {
8183 ScriptInputUserData ctx = new ScriptInputUserData;
8189 ctx.
Write(use_stack_max);
8192
8194 {
8195 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8196 }
8197 }
8198 }
8199 else if (!
GetGame().IsMultiplayer())
8200 {
8202 }
8203 }
8204
8206 {
8208 }
8209
8211 {
8213 }
8214
8216 {
8218 }
8219
8221 {
8222
8223 return false;
8224 }
8225
8227 {
8228 return false;
8229 }
8230
8234 {
8235 return false;
8236 }
8237
8239 {
8240 return "";
8241 }
8242
8244
8246 {
8247 return false;
8248 }
8249
8251 {
8252 return true;
8253 }
8254
8255
8256
8258 {
8259 return true;
8260 }
8261
8263 {
8264 return true;
8265 }
8266
8268 {
8269 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8271 }
8272
8274 {
8276 }
8277
8279 {
8281 if (!is_being_placed)
8283 SetSynchDirty();
8284 }
8285
8286
8288
8290 {
8292 }
8293
8295 {
8297 }
8298
8300 {
8301 return 1;
8302 }
8303
8305 {
8306 return false;
8307 }
8308
8310 {
8312 SetSynchDirty();
8313 }
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8350 {
8351 super.OnMovedInsideCargo(container);
8352
8353 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8354 }
8355
8356 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8357 {
8358 super.EEItemLocationChanged(oldLoc,newLoc);
8359
8360 PlayerBase new_player = null;
8361 PlayerBase old_player = null;
8362
8363 if (newLoc.GetParent())
8364 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8365
8366 if (oldLoc.GetParent())
8367 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8368
8370 {
8371 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8372
8373 if (r_index >= 0)
8374 {
8375 InventoryLocation r_il = new InventoryLocation;
8376 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8377
8378 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8381 {
8382 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8383 }
8385 {
8386 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8387 }
8388
8389 }
8390 }
8391
8393 {
8394 if (new_player)
8395 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8396
8397 if (new_player == old_player)
8398 {
8399
8400 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8401 {
8403 {
8404 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8405 {
8406 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8407 }
8408 }
8409 else
8410 {
8411 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8412 }
8413 }
8414
8415 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8416 {
8417 int type = oldLoc.GetType();
8419 {
8420 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8421 }
8423 {
8424 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8425 }
8426 }
8427 if (!m_OldLocation)
8428 {
8429 m_OldLocation = new InventoryLocation;
8430 }
8431 m_OldLocation.Copy(oldLoc);
8432 }
8433 else
8434 {
8435 if (m_OldLocation)
8436 {
8437 m_OldLocation.Reset();
8438 }
8439 }
8440
8442 }
8443 else
8444 {
8445 if (new_player)
8446 {
8447 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8448 if (res_index >= 0)
8449 {
8450 InventoryLocation il = new InventoryLocation;
8451 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8453 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8456 {
8457 il.
GetParent().GetOnReleaseLock().Invoke(it);
8458 }
8460 {
8462 }
8463
8464 }
8465 }
8467 {
8468
8470 }
8471
8472 if (m_OldLocation)
8473 {
8474 m_OldLocation.Reset();
8475 }
8476 }
8477 }
8478
8479 override void EOnContact(IEntity other, Contact extra)
8480 {
8482 {
8483 int liquidType = -1;
8485 if (impactSpeed > 0.0)
8486 {
8488 #ifndef SERVER
8490 #else
8492 SetSynchDirty();
8493 #endif
8495 }
8496 }
8497
8498 #ifdef SERVER
8499 if (GetCompEM() && GetCompEM().IsPlugged())
8500 {
8501 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8502 GetCompEM().UnplugThis();
8503 }
8504 #endif
8505 }
8506
8508
8510 {
8512 }
8513
8515 {
8516
8517 }
8518
8520 {
8521 super.OnItemLocationChanged(old_owner, new_owner);
8522
8523 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8524 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8525
8526 if (!relatedPlayer && playerNew)
8527 relatedPlayer = playerNew;
8528
8529 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8530 {
8532 if (actionMgr)
8533 {
8534 ActionBase currentAction = actionMgr.GetRunningAction();
8535 if (currentAction)
8537 }
8538 }
8539
8540 Man ownerPlayerOld = null;
8541 Man ownerPlayerNew = null;
8542
8543 if (old_owner)
8544 {
8545 if (old_owner.
IsMan())
8546 {
8547 ownerPlayerOld = Man.Cast(old_owner);
8548 }
8549 else
8550 {
8551 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8552 }
8553 }
8554 else
8555 {
8557 {
8559
8560 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8561 {
8562 GetCompEM().UnplugThis();
8563 }
8564 }
8565 }
8566
8567 if (new_owner)
8568 {
8569 if (new_owner.
IsMan())
8570 {
8571 ownerPlayerNew = Man.Cast(new_owner);
8572 }
8573 else
8574 {
8575 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8576 }
8577 }
8578
8579 if (ownerPlayerOld != ownerPlayerNew)
8580 {
8581 if (ownerPlayerOld)
8582 {
8583 array<EntityAI> subItemsExit = new array<EntityAI>;
8585 for (int i = 0; i < subItemsExit.Count(); i++)
8586 {
8589 }
8590 }
8591
8592 if (ownerPlayerNew)
8593 {
8594 array<EntityAI> subItemsEnter = new array<EntityAI>;
8596 for (int j = 0; j < subItemsEnter.Count(); j++)
8597 {
8600 }
8601 }
8602 }
8603 else if (ownerPlayerNew != null)
8604 {
8605 PlayerBase nplayer;
8606 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8607 {
8608 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8610 for (int k = 0; k < subItemsUpdate.Count(); k++)
8611 {
8613 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8614 }
8615 }
8616 }
8617
8618 if (old_owner)
8619 old_owner.OnChildItemRemoved(this);
8620 if (new_owner)
8621 new_owner.OnChildItemReceived(this);
8622 }
8623
8624
8626 {
8627 super.EEDelete(parent);
8628 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8629 if (player)
8630 {
8632
8633 if (player.IsAlive())
8634 {
8635 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8636 if (r_index >= 0)
8637 {
8638 InventoryLocation r_il = new InventoryLocation;
8639 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8640
8641 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8644 {
8645 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8646 }
8648 {
8649 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8650 }
8651
8652 }
8653
8654 player.RemoveQuickBarEntityShortcut(this);
8655 }
8656 }
8657 }
8658
8660 {
8661 super.EEKilled(killer);
8662
8665 {
8666 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8667 {
8668 if (IsMagazine())
8669 {
8670 if (Magazine.Cast(this).GetAmmoCount() > 0)
8671 {
8673 }
8674 }
8675 else
8676 {
8678 }
8679 }
8680 }
8681 }
8682
8684 {
8685 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8686
8687 super.OnWasAttached(parent, slot_id);
8688
8691
8693 }
8694
8696 {
8697 super.OnWasDetached(parent, slot_id);
8698
8701 }
8702
8704 {
8705 int idx;
8708
8709 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8710 if (inventory_slots.Count() < 1)
8711 {
8712 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8713 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8714 }
8715 else
8716 {
8717 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8718 }
8719
8720 idx = inventory_slots.Find(slot);
8721 if (idx < 0)
8722 return "";
8723
8724 return attach_types.Get(idx);
8725 }
8726
8728 {
8729 int idx = -1;
8730 string slot;
8731
8734
8735 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8736 if (inventory_slots.Count() < 1)
8737 {
8738 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8739 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8740 }
8741 else
8742 {
8743 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8744 if (detach_types.Count() < 1)
8745 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8746 }
8747
8748 for (int i = 0; i < inventory_slots.Count(); i++)
8749 {
8750 slot = inventory_slots.Get(i);
8751 }
8752
8753 if (slot != "")
8754 {
8755 if (detach_types.Count() == 1)
8756 idx = 0;
8757 else
8758 idx = inventory_slots.Find(slot);
8759 }
8760 if (idx < 0)
8761 return "";
8762
8763 return detach_types.Get(idx);
8764 }
8765
8767 {
8768
8770
8771
8772 float min_time = 1;
8773 float max_time = 3;
8774 float delay = Math.RandomFloat(min_time, max_time);
8775
8776 explode_timer.Run(delay, this, "DoAmmoExplosion");
8777 }
8778
8780 {
8781 Magazine magazine = Magazine.Cast(this);
8782 int pop_sounds_count = 6;
8783 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8784
8785
8786 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8787 string sound_name = pop_sounds[ sound_idx ];
8789
8790
8791 magazine.ServerAddAmmoCount(-1);
8792
8793
8794 float min_temp_to_explode = 100;
8795
8796 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8797 {
8799 }
8800 }
8801
8802
8803 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8804 {
8805 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8806
8807 const int CHANCE_DAMAGE_CARGO = 4;
8808 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8809 const int CHANCE_DAMAGE_NOTHING = 2;
8810
8812 {
8813 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8814 int chances;
8815 int rnd;
8816
8817 if (GetInventory().GetCargo())
8818 {
8819 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8820 rnd = Math.RandomInt(0,chances);
8821
8822 if (rnd < CHANCE_DAMAGE_CARGO)
8823 {
8825 }
8826 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8827 {
8829 }
8830 }
8831 else
8832 {
8833 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8834 rnd = Math.RandomInt(0,chances);
8835
8836 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8837 {
8839 }
8840 }
8841 }
8842 }
8843
8845 {
8846 if (GetInventory().GetCargo())
8847 {
8848 int item_count = GetInventory().GetCargo().GetItemCount();
8849 if (item_count > 0)
8850 {
8851 int random_pick = Math.RandomInt(0, item_count);
8853 if (!item.IsExplosive())
8854 {
8855 item.AddHealth("","",damage);
8856 return true;
8857 }
8858 }
8859 }
8860 return false;
8861 }
8862
8864 {
8865 int attachment_count = GetInventory().AttachmentCount();
8866 if (attachment_count > 0)
8867 {
8868 int random_pick = Math.RandomInt(0, attachment_count);
8869 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8870 if (!attachment.IsExplosive())
8871 {
8872 attachment.AddHealth("","",damage);
8873 return true;
8874 }
8875 }
8876 return false;
8877 }
8878
8880 {
8882 }
8883
8885 {
8887 return GetInventory().CanRemoveEntity();
8888
8889 return false;
8890 }
8891
8893 {
8895 return;
8896
8898 {
8899 if (ScriptInputUserData.CanStoreInputUserData())
8900 {
8901 ScriptInputUserData ctx = new ScriptInputUserData;
8906 ctx.
Write(destination_entity);
8910 }
8911 }
8912 else if (!
GetGame().IsMultiplayer())
8913 {
8915 }
8916 }
8917
8919 {
8921 return;
8922
8923 float split_quantity_new;
8927 InventoryLocation loc = new InventoryLocation;
8928
8929 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8930 {
8932 split_quantity_new = stack_max;
8933 else
8935
8936 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8937 if (new_item)
8938 {
8939 new_item.SetResultOfSplit(true);
8940 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8942 new_item.SetQuantity(split_quantity_new);
8943 }
8944 }
8945 else if (destination_entity && slot_id == -1)
8946 {
8947 if (quantity > stack_max)
8948 split_quantity_new = stack_max;
8949 else
8950 split_quantity_new = quantity;
8951
8953 {
8956 }
8957
8958 if (new_item)
8959 {
8960 new_item.SetResultOfSplit(true);
8961 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8963 new_item.SetQuantity(split_quantity_new);
8964 }
8965 }
8966 else
8967 {
8968 if (stack_max != 0)
8969 {
8971 {
8973 }
8974
8975 if (split_quantity_new == 0)
8976 {
8977 if (!
GetGame().IsMultiplayer())
8978 player.PhysicalPredictiveDropItem(this);
8979 else
8980 player.ServerDropEntity(this);
8981 return;
8982 }
8983
8985
8986 if (new_item)
8987 {
8988 new_item.SetResultOfSplit(true);
8989 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8991 new_item.SetQuantity(stack_max);
8992 new_item.PlaceOnSurface();
8993 }
8994 }
8995 }
8996 }
8997
8999 {
9001 return;
9002
9003 float split_quantity_new;
9007 InventoryLocation loc = new InventoryLocation;
9008
9009 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9010 {
9012 split_quantity_new = stack_max;
9013 else
9015
9016 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9017 if (new_item)
9018 {
9019 new_item.SetResultOfSplit(true);
9020 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9022 new_item.SetQuantity(split_quantity_new);
9023 }
9024 }
9025 else if (destination_entity && slot_id == -1)
9026 {
9027 if (quantity > stack_max)
9028 split_quantity_new = stack_max;
9029 else
9030 split_quantity_new = quantity;
9031
9033 {
9036 }
9037
9038 if (new_item)
9039 {
9040 new_item.SetResultOfSplit(true);
9041 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9043 new_item.SetQuantity(split_quantity_new);
9044 }
9045 }
9046 else
9047 {
9048 if (stack_max != 0)
9049 {
9051 {
9053 }
9054
9056
9057 if (new_item)
9058 {
9059 new_item.SetResultOfSplit(true);
9060 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9062 new_item.SetQuantity(stack_max);
9063 new_item.PlaceOnSurface();
9064 }
9065 }
9066 }
9067 }
9068
9070 {
9072 return;
9073
9075 {
9076 if (ScriptInputUserData.CanStoreInputUserData())
9077 {
9078 ScriptInputUserData ctx = new ScriptInputUserData;
9083 dst.WriteToContext(ctx);
9085 }
9086 }
9087 else if (!
GetGame().IsMultiplayer())
9088 {
9090 }
9091 }
9092
9094 {
9096 return;
9097
9099 {
9100 if (ScriptInputUserData.CanStoreInputUserData())
9101 {
9102 ScriptInputUserData ctx = new ScriptInputUserData;
9107 ctx.
Write(destination_entity);
9113 }
9114 }
9115 else if (!
GetGame().IsMultiplayer())
9116 {
9118 }
9119 }
9120
9122 {
9124 }
9125
9127 {
9129 return this;
9130
9132 float split_quantity_new;
9134 if (dst.IsValid())
9135 {
9136 int slot_id = dst.GetSlot();
9138
9139 if (quantity > stack_max)
9140 split_quantity_new = stack_max;
9141 else
9142 split_quantity_new = quantity;
9143
9145
9146 if (new_item)
9147 {
9148 new_item.SetResultOfSplit(true);
9149 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9152 }
9153
9154 return new_item;
9155 }
9156
9157 return null;
9158 }
9159
9161 {
9163 return;
9164
9166 float split_quantity_new;
9168 if (destination_entity)
9169 {
9171 if (quantity > stackable)
9172 split_quantity_new = stackable;
9173 else
9174 split_quantity_new = quantity;
9175
9176 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9177 if (new_item)
9178 {
9179 new_item.SetResultOfSplit(true);
9180 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9182 new_item.SetQuantity(split_quantity_new);
9183 }
9184 }
9185 }
9186
9188 {
9190 return;
9191
9193 {
9194 if (ScriptInputUserData.CanStoreInputUserData())
9195 {
9196 ScriptInputUserData ctx = new ScriptInputUserData;
9201 ItemBase destination_entity =
this;
9202 ctx.
Write(destination_entity);
9206 }
9207 }
9208 else if (!
GetGame().IsMultiplayer())
9209 {
9211 }
9212 }
9213
9215 {
9217 return;
9218
9220 float split_quantity_new;
9222 if (player)
9223 {
9225 if (quantity > stackable)
9226 split_quantity_new = stackable;
9227 else
9228 split_quantity_new = quantity;
9229
9230 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9231 new_item =
ItemBase.Cast(in_hands);
9232 if (new_item)
9233 {
9234 new_item.SetResultOfSplit(true);
9235 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9237 new_item.SetQuantity(split_quantity_new);
9238 }
9239 }
9240 }
9241
9243 {
9245 return;
9246
9248 float split_quantity_new = Math.Floor(quantity * 0.5);
9249
9251
9252 if (new_item)
9253 {
9254 if (new_item.GetQuantityMax() < split_quantity_new)
9255 {
9256 split_quantity_new = new_item.GetQuantityMax();
9257 }
9258
9259 new_item.SetResultOfSplit(true);
9260 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9261
9263 {
9266 }
9267 else
9268 {
9271 }
9272 }
9273 }
9274
9276 {
9278 return;
9279
9281 float split_quantity_new = Math.Floor(quantity / 2);
9282
9283 InventoryLocation invloc = new InventoryLocation;
9285
9287 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9288
9289 if (new_item)
9290 {
9291 if (new_item.GetQuantityMax() < split_quantity_new)
9292 {
9293 split_quantity_new = new_item.GetQuantityMax();
9294 }
9296 {
9299 }
9300 else
9301 {
9304 }
9305 }
9306 }
9307
9310 {
9311 SetWeightDirty();
9313
9314 if (parent)
9315 parent.OnAttachmentQuantityChangedEx(this, delta);
9316
9318 {
9320 {
9322 }
9324 {
9325 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9327 }
9328 }
9329
9330 }
9331
9334 {
9335
9336 }
9337
9340 {
9342 }
9343
9345 {
9346 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9347
9349 {
9350 if (newLevel == GameConstants.STATE_RUINED)
9351 {
9353 EntityAI parent = GetHierarchyParent();
9354 if (parent && parent.IsFireplace())
9355 {
9356 CargoBase cargo = GetInventory().GetCargo();
9357 if (cargo)
9358 {
9360 {
9362 }
9363 }
9364 }
9365 }
9366
9368 {
9369
9371 return;
9372 }
9373
9374 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9375 {
9377 }
9378 }
9379 }
9380
9381
9383 {
9384 super.OnRightClick();
9385
9387 {
9389 {
9390 if (ScriptInputUserData.CanStoreInputUserData())
9391 {
9392 vector m4[4];
9394
9395 EntityAI root = GetHierarchyRoot();
9396
9397 InventoryLocation dst = new InventoryLocation;
9399 {
9400 if (root)
9401 {
9402 root.GetTransform(m4);
9404 }
9405 else
9406 GetInventory().GetCurrentInventoryLocation(dst);
9407 }
9408 else
9409 {
9411
9412
9413 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9414 {
9415 if (root)
9416 {
9417 root.GetTransform(m4);
9419 }
9420 else
9421 GetInventory().GetCurrentInventoryLocation(dst);
9422 }
9423 else
9424 {
9425 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9426 }
9427 }
9428
9429 ScriptInputUserData ctx = new ScriptInputUserData;
9437 }
9438 }
9439 else if (!
GetGame().IsMultiplayer())
9440 {
9442 }
9443 }
9444 }
9445
9446 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9447 {
9448
9449 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9450 return false;
9451
9452 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9453 return false;
9454
9455
9457 return false;
9458
9459
9460 Magazine mag = Magazine.Cast(this);
9461 if (mag)
9462 {
9463 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9464 return false;
9465
9466 if (stack_max_limit)
9467 {
9468 Magazine other_mag = Magazine.Cast(other_item);
9469 if (other_item)
9470 {
9471 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9472 return false;
9473 }
9474
9475 }
9476 }
9477 else
9478 {
9479
9481 return false;
9482
9484 return false;
9485 }
9486
9487 PlayerBase player = null;
9488 if (CastTo(player, GetHierarchyRootPlayer()))
9489 {
9490 if (player.GetInventory().HasAttachment(this))
9491 return false;
9492
9493 if (player.IsItemsToDelete())
9494 return false;
9495 }
9496
9497 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9498 return false;
9499
9500 int slotID;
9502 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9503 return false;
9504
9505 return true;
9506 }
9507
9509 {
9511 }
9512
9514 {
9515 return m_IsResultOfSplit;
9516 }
9517
9519 {
9520 m_IsResultOfSplit = value;
9521 }
9522
9524 {
9526 }
9527
9529 {
9530 float other_item_quantity = other_item.GetQuantity();
9531 float this_free_space;
9532
9534
9536
9537 if (other_item_quantity > this_free_space)
9538 {
9539 return this_free_space;
9540 }
9541 else
9542 {
9543 return other_item_quantity;
9544 }
9545 }
9546
9548 {
9550 }
9551
9553 {
9555 return;
9556
9557 if (!IsMagazine() && other_item)
9558 {
9560 if (quantity_used != 0)
9561 {
9562 float hp1 = GetHealth01("","");
9563 float hp2 = other_item.GetHealth01("","");
9564 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9565 hpResult = hpResult / (
GetQuantity() + quantity_used);
9566
9567 hpResult *= GetMaxHealth();
9568 Math.Round(hpResult);
9569 SetHealth("", "Health", hpResult);
9570
9572 other_item.AddQuantity(-quantity_used);
9573 }
9574 }
9576 }
9577
9579 {
9580 #ifdef SERVER
9581 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9582 GetHierarchyParent().IncreaseLifetimeUp();
9583 #endif
9584 };
9585
9587 {
9588 PlayerBase p = PlayerBase.Cast(player);
9589
9590 array<int> recipesIds = p.m_Recipes;
9591 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9592 if (moduleRecipesManager)
9593 {
9594 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9595 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9596 }
9597
9598 for (int i = 0;i < recipesIds.Count(); i++)
9599 {
9600 int key = recipesIds.Get(i);
9601 string recipeName = moduleRecipesManager.GetRecipeName(key);
9603 }
9604 }
9605
9606
9607 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9608 {
9609 super.GetDebugActions(outputList);
9610
9611
9616
9617
9621
9625
9626
9629
9630
9632 {
9635 }
9636
9638
9641
9645 }
9646
9647
9648
9649
9651 {
9652 super.OnAction(action_id, player, ctx);
9653 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9654 {
9655 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9656 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9657 PlayerBase p = PlayerBase.Cast(player);
9658 if (
EActions.RECIPES_RANGE_START < 1000)
9659 {
9660 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9661 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9662 }
9663 }
9664 #ifndef SERVER
9665 else if (action_id ==
EActions.WATCH_PLAYER)
9666 {
9667 PluginDeveloper.SetDeveloperItemClientEx(player);
9668 }
9669 #endif
9671 {
9672 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9673 {
9674 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9675 OnDebugButtonPressServer(id + 1);
9676 }
9677
9678 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9679 {
9680 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9682 }
9683
9684 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9685 {
9686 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9688 }
9689
9690 else if (action_id ==
EActions.ADD_QUANTITY)
9691 {
9692 if (IsMagazine())
9693 {
9694 Magazine mag = Magazine.Cast(this);
9695 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9696 }
9697 else
9698 {
9700 }
9701
9702 if (m_EM)
9703 {
9704 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9705 }
9706
9707 }
9708
9709 else if (action_id ==
EActions.REMOVE_QUANTITY)
9710 {
9711 if (IsMagazine())
9712 {
9713 Magazine mag2 = Magazine.Cast(this);
9714 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9715 }
9716 else
9717 {
9719 }
9720 if (m_EM)
9721 {
9722 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9723 }
9724
9725 }
9726
9727 else if (action_id ==
EActions.SET_QUANTITY_0)
9728 {
9730
9731 if (m_EM)
9732 {
9733 m_EM.SetEnergy(0);
9734 }
9735 }
9736
9737 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9738 {
9740
9741 if (m_EM)
9742 {
9743 m_EM.SetEnergy(m_EM.GetEnergyMax());
9744 }
9745 }
9746
9747 else if (action_id ==
EActions.ADD_HEALTH)
9748 {
9749 AddHealth("","",GetMaxHealth("","Health")/5);
9750 }
9751 else if (action_id ==
EActions.REMOVE_HEALTH)
9752 {
9753 AddHealth("","",-GetMaxHealth("","Health")/5);
9754 }
9755 else if (action_id ==
EActions.DESTROY_HEALTH)
9756 {
9757 SetHealth01("","",0);
9758 }
9759 else if (action_id ==
EActions.WATCH_ITEM)
9760 {
9762 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9763 #ifdef DEVELOPER
9764 SetDebugDeveloper_item(this);
9765 #endif
9766 }
9767
9768 else if (action_id ==
EActions.ADD_TEMPERATURE)
9769 {
9770 AddTemperature(20);
9771
9772 }
9773
9774 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9775 {
9776 AddTemperature(-20);
9777
9778 }
9779
9780 else if (action_id ==
EActions.FLIP_FROZEN)
9781 {
9782 SetFrozen(!GetIsFrozen());
9783
9784 }
9785
9786 else if (action_id ==
EActions.ADD_WETNESS)
9787 {
9789
9790 }
9791
9792 else if (action_id ==
EActions.REMOVE_WETNESS)
9793 {
9795
9796 }
9797
9798 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9799 {
9802
9803
9804 }
9805
9806 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9807 {
9810 }
9811
9812 else if (action_id ==
EActions.MAKE_SPECIAL)
9813 {
9814 auto debugParams = DebugSpawnParams.WithPlayer(player);
9815 OnDebugSpawnEx(debugParams);
9816 }
9817
9818 else if (action_id ==
EActions.DELETE)
9819 {
9820 Delete();
9821 }
9822
9823 }
9824
9825
9826 return false;
9827 }
9828
9829
9830
9831
9835
9838
9839
9840
9842 {
9843 return false;
9844 }
9845
9846
9848 {
9849 return true;
9850 }
9851
9852
9854 {
9855 return true;
9856 }
9857
9858
9859
9861 {
9862 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9864 }
9865
9868 {
9869 return null;
9870 }
9871
9873 {
9874 return false;
9875 }
9876
9878 {
9879 return false;
9880 }
9881
9885
9886
9888 {
9889 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9890 return module_repairing.CanRepair(this, item_repair_kit);
9891 }
9892
9893
9894 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9895 {
9896 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9897 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9898 }
9899
9900
9902 {
9903
9904
9905
9906
9907
9908
9909
9910
9911 return 1;
9912 }
9913
9914
9915
9917 {
9919 }
9920
9921
9922
9924 {
9926 }
9927
9928
9937 {
9938 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9939
9940 if (player)
9941 {
9942 player.MessageStatus(text);
9943 }
9944 }
9945
9946
9955 {
9956 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9957
9958 if (player)
9959 {
9960 player.MessageAction(text);
9961 }
9962 }
9963
9964
9973 {
9974 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9975
9976 if (player)
9977 {
9978 player.MessageFriendly(text);
9979 }
9980 }
9981
9982
9991 {
9992 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9993
9994 if (player)
9995 {
9996 player.MessageImportant(text);
9997 }
9998 }
9999
10001 {
10002 return true;
10003 }
10004
10005
10006 override bool KindOf(
string tag)
10007 {
10008 bool found = false;
10009 string item_name = this.
GetType();
10012
10013 int array_size = item_tag_array.Count();
10014 for (int i = 0; i < array_size; i++)
10015 {
10016 if (item_tag_array.Get(i) == tag)
10017 {
10018 found = true;
10019 break;
10020 }
10021 }
10022 return found;
10023 }
10024
10025
10027 {
10028
10029 super.OnRPC(sender, rpc_type,ctx);
10030
10031
10032 switch (rpc_type)
10033 {
10034 #ifndef SERVER
10035 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10036 Param2<bool, string> p = new Param2<bool, string>(false, "");
10037
10039 return;
10040
10041 bool play = p.param1;
10042 string soundSet = p.param2;
10043
10044 if (play)
10045 {
10047 {
10049 {
10051 }
10052 }
10053 else
10054 {
10056 }
10057 }
10058 else
10059 {
10061 }
10062
10063 break;
10064 #endif
10065
10066 }
10067
10069 {
10071 }
10072 }
10073
10074
10075
10076
10078 {
10079 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10080 return plugin.GetID(
name);
10081 }
10082
10084 {
10085 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10086 return plugin.GetName(id);
10087 }
10088
10091 {
10092
10093
10094 int varFlags;
10095 if (!ctx.
Read(varFlags))
10096 return;
10097
10098 if (varFlags & ItemVariableFlags.FLOAT)
10099 {
10101 }
10102 }
10103
10105 {
10106
10107 super.SerializeNumericalVars(floats_out);
10108
10109
10110
10112 {
10114 }
10115
10117 {
10119 }
10120
10122 {
10124 }
10125
10127 {
10132 }
10133
10135 {
10137 }
10138 }
10139
10141 {
10142
10143 super.DeSerializeNumericalVars(floats);
10144
10145
10146 int index = 0;
10147 int mask = Math.Round(floats.Get(index));
10148
10149 index++;
10150
10152 {
10154 {
10156 }
10157 else
10158 {
10159 float quantity = floats.Get(index);
10160 SetQuantity(quantity,
true,
false,
false,
false);
10161 }
10162 index++;
10163 }
10164
10166 {
10167 float wet = floats.Get(index);
10169 index++;
10170 }
10171
10173 {
10174 int liquidtype = Math.Round(floats.Get(index));
10176 index++;
10177 }
10178
10180 {
10182 index++;
10184 index++;
10186 index++;
10188 index++;
10189 }
10190
10192 {
10193 int cleanness = Math.Round(floats.Get(index));
10195 index++;
10196 }
10197 }
10198
10200 {
10201 super.WriteVarsToCTX(ctx);
10202
10203
10205 {
10207 }
10208
10210 {
10212 }
10213
10215 {
10217 }
10218
10220 {
10221 int r,g,b,a;
10227 }
10228
10230 {
10232 }
10233 }
10234
10236 {
10237 if (!super.ReadVarsFromCTX(ctx,version))
10238 return false;
10239
10240 int intValue;
10241 float value;
10242
10243 if (version < 140)
10244 {
10245 if (!ctx.
Read(intValue))
10246 return false;
10247
10248 m_VariablesMask = intValue;
10249 }
10250
10252 {
10253 if (!ctx.
Read(value))
10254 return false;
10255
10257 {
10259 }
10260 else
10261 {
10263 }
10264 }
10265
10266 if (version < 140)
10267 {
10269 {
10270 if (!ctx.
Read(value))
10271 return false;
10272 SetTemperatureDirect(value);
10273 }
10274 }
10275
10277 {
10278 if (!ctx.
Read(value))
10279 return false;
10281 }
10282
10284 {
10285 if (!ctx.
Read(intValue))
10286 return false;
10288 }
10289
10291 {
10292 int r,g,b,a;
10294 return false;
10296 return false;
10298 return false;
10300 return false;
10301
10303 }
10304
10306 {
10307 if (!ctx.
Read(intValue))
10308 return false;
10310 }
10311
10312 if (version >= 138 && version < 140)
10313 {
10315 {
10316 if (!ctx.
Read(intValue))
10317 return false;
10318 SetFrozen(intValue);
10319 }
10320 }
10321
10322 return true;
10323 }
10324
10325
10327 {
10330 {
10332 }
10333
10334 if (!super.OnStoreLoad(ctx, version))
10335 {
10337 return false;
10338 }
10339
10340 if (version >= 114)
10341 {
10342 bool hasQuickBarIndexSaved;
10343
10344 if (!ctx.
Read(hasQuickBarIndexSaved))
10345 {
10347 return false;
10348 }
10349
10350 if (hasQuickBarIndexSaved)
10351 {
10352 int itmQBIndex;
10353
10354
10355 if (!ctx.
Read(itmQBIndex))
10356 {
10358 return false;
10359 }
10360
10361 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10362 if (itmQBIndex != -1 && parentPlayer)
10363 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10364 }
10365 }
10366 else
10367 {
10368
10369 PlayerBase player;
10370 int itemQBIndex;
10371 if (version ==
int.
MAX)
10372 {
10373 if (!ctx.
Read(itemQBIndex))
10374 {
10376 return false;
10377 }
10378 }
10379 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10380 {
10381
10382 if (!ctx.
Read(itemQBIndex))
10383 {
10385 return false;
10386 }
10387 if (itemQBIndex != -1 && player)
10388 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10389 }
10390 }
10391
10392 if (version < 140)
10393 {
10394
10395 if (!LoadVariables(ctx, version))
10396 {
10398 return false;
10399 }
10400 }
10401
10402
10404 {
10406 return false;
10407 }
10408 if (version >= 132)
10409 {
10411 if (raib)
10412 {
10414 {
10416 return false;
10417 }
10418 }
10419 }
10420
10422 return true;
10423 }
10424
10425
10426
10428 {
10429 super.OnStoreSave(ctx);
10430
10431 PlayerBase player;
10432 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10433 {
10435
10436 int itemQBIndex = -1;
10437 itemQBIndex = player.FindQuickBarEntityIndex(this);
10438 ctx.
Write(itemQBIndex);
10439 }
10440 else
10441 {
10443 }
10444
10446
10448 if (raib)
10449 {
10451 }
10452 }
10453
10454
10456 {
10457 super.AfterStoreLoad();
10458
10460 {
10462 }
10463
10465 {
10468 }
10469 }
10470
10472 {
10473 super.EEOnAfterLoad();
10474
10476 {
10478 }
10479
10482 }
10483
10485 {
10486 return false;
10487 }
10488
10489
10490
10492 {
10494 {
10495 #ifdef PLATFORM_CONSOLE
10496
10498 {
10500 if (menu)
10501 {
10503 }
10504 }
10505 #endif
10506 }
10507
10509 {
10512 }
10513
10515 {
10516 SetWeightDirty();
10518 }
10520 {
10523 }
10524
10526 {
10529 }
10531 {
10534 }
10535
10536 super.OnVariablesSynchronized();
10537 }
10538
10539
10540
10542 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10543 {
10544 if (!IsServerCheck(allow_client))
10545 return false;
10546
10548 return false;
10549
10552
10553 if (value <= (min + 0.001))
10554 value = min;
10555
10556 if (value == min)
10557 {
10558 if (destroy_config)
10559 {
10560 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10561 if (dstr)
10562 {
10564 this.Delete();
10565 return true;
10566 }
10567 }
10568 else if (destroy_forced)
10569 {
10571 this.Delete();
10572 return true;
10573 }
10574
10576 }
10577
10580
10582 {
10584
10585 if (delta)
10587 }
10588
10590
10591 return false;
10592 }
10593
10594
10596 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10597 {
10599 }
10600
10602 {
10605 }
10606
10608 {
10611 }
10612
10615 {
10616 float value_clamped = Math.Clamp(value, 0, 1);
10618 SetQuantity(result, destroy_config, destroy_forced);
10619 }
10620
10621
10624 {
10626 }
10627
10629 {
10631 }
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10643 {
10644 int slot = -1;
10645 if (GetInventory())
10646 {
10647 InventoryLocation il = new InventoryLocation;
10648 GetInventory().GetCurrentInventoryLocation(il);
10650 }
10651
10653 }
10654
10656 {
10657 float quantity_max = 0;
10658
10660 {
10661 if (attSlotID != -1)
10662 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10663
10664 if (quantity_max <= 0)
10666 }
10667
10668 if (quantity_max <= 0)
10670
10671 return quantity_max;
10672 }
10673
10675 {
10677 }
10678
10680 {
10682 }
10683
10684
10686 {
10688 }
10689
10691 {
10693 }
10694
10696 {
10698 }
10699
10700
10702 {
10703
10704 float weightEx = GetWeightEx();
10705 float special = GetInventoryAndCargoWeight();
10706 return weightEx - special;
10707 }
10708
10709
10711 {
10713 }
10714
10716 {
10718 {
10719 #ifdef DEVELOPER
10720 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10721 {
10722 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10724 }
10725 #endif
10726
10727 return GetQuantity() * GetConfigWeightModified();
10728 }
10729 else if (HasEnergyManager())
10730 {
10731 #ifdef DEVELOPER
10732 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10733 {
10734 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10735 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10736 }
10737 #endif
10738 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10739 }
10740 else
10741 {
10742 #ifdef DEVELOPER
10743 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10744 {
10745 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10746 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10747 }
10748 #endif
10749 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10750 }
10751 }
10752
10755 {
10756 int item_count = 0;
10758
10759 if (GetInventory().GetCargo() != NULL)
10760 {
10761 item_count = GetInventory().GetCargo().GetItemCount();
10762 }
10763
10764 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10765 {
10766 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10767 if (item)
10768 item_count += item.GetNumberOfItems();
10769 }
10770 return item_count;
10771 }
10772
10775 {
10776 float weight = 0;
10777 float wetness = 1;
10778 if (include_wetness)
10781 {
10782 weight = wetness * m_ConfigWeight;
10783 }
10785 {
10786 weight = 1;
10787 }
10788 return weight;
10789 }
10790
10791
10792
10794 {
10795 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10796 {
10797 GameInventory inv = GetInventory();
10798 array<EntityAI> items = new array<EntityAI>;
10800 for (int i = 0; i < items.Count(); i++)
10801 {
10803 if (item)
10804 {
10806 }
10807 }
10808 }
10809 }
10810
10811
10812
10813
10815 {
10816 float energy = 0;
10817 if (HasEnergyManager())
10818 {
10819 energy = GetCompEM().GetEnergy();
10820 }
10821 return energy;
10822 }
10823
10824
10826 {
10827 super.OnEnergyConsumed();
10828
10830 }
10831
10833 {
10834 super.OnEnergyAdded();
10835
10837 }
10838
10839
10841 {
10842 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10843 {
10845 {
10846 float energy_0to1 = GetCompEM().GetEnergy0To1();
10848 }
10849 }
10850 }
10851
10852
10854 {
10855 return ConfigGetFloat("heatIsolation");
10856 }
10857
10859 {
10861 }
10862
10864 {
10865 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10866 if (
GetGame().ConfigIsExisting(paramPath))
10868
10869 return 0.0;
10870 }
10871
10873 {
10874 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10875 if (
GetGame().ConfigIsExisting(paramPath))
10877
10878 return 0.0;
10879 }
10880
10881 override void SetWet(
float value,
bool allow_client =
false)
10882 {
10883 if (!IsServerCheck(allow_client))
10884 return;
10885
10888
10890
10891 m_VarWet = Math.Clamp(value, min, max);
10892
10894 {
10897 }
10898 }
10899
10900 override void AddWet(
float value)
10901 {
10903 }
10904
10906 {
10908 }
10909
10911 {
10913 }
10914
10916 {
10918 }
10919
10921 {
10923 }
10924
10926 {
10928 }
10929
10930 override void OnWetChanged(
float newVal,
float oldVal)
10931 {
10934 if (newLevel != oldLevel)
10935 {
10937 }
10938 }
10939
10941 {
10942 SetWeightDirty();
10943 }
10944
10946 {
10947 return GetWetLevelInternal(
m_VarWet);
10948 }
10949
10950
10951
10953 {
10955 }
10956
10958 {
10960 }
10961
10963 {
10965 }
10966
10968 {
10970 }
10971
10972
10973
10975 {
10976 if (ConfigIsExisting("itemModelLength"))
10977 {
10978 return ConfigGetFloat("itemModelLength");
10979 }
10980 return 0;
10981 }
10982
10984 {
10985 if (ConfigIsExisting("itemAttachOffset"))
10986 {
10987 return ConfigGetFloat("itemAttachOffset");
10988 }
10989 return 0;
10990 }
10991
10992 override void SetCleanness(
int value,
bool allow_client =
false)
10993 {
10994 if (!IsServerCheck(allow_client))
10995 return;
10996
10998
11000
11003 }
11004
11006 {
11008 }
11009
11011 {
11012 return true;
11013 }
11014
11015
11016
11017
11019 {
11021 }
11022
11024 {
11026 }
11027
11028
11029
11030
11031 override void SetColor(
int r,
int g,
int b,
int a)
11032 {
11038 }
11040 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11041 {
11046 }
11047
11049 {
11051 }
11052
11055 {
11056 int r,g,b,a;
11058 r = r/255;
11059 g = g/255;
11060 b = b/255;
11061 a = a/255;
11062 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11063 }
11064
11065
11066
11067 override void SetLiquidType(
int value,
bool allow_client =
false)
11068 {
11069 if (!IsServerCheck(allow_client))
11070 return;
11071
11076 }
11077
11079 {
11080 return ConfigGetInt("varLiquidTypeInit");
11081 }
11082
11084 {
11086 }
11087
11089 {
11091 SetFrozen(false);
11092 }
11093
11096 {
11097 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11098 }
11099
11100
11103 {
11104 PlayerBase nplayer;
11105 if (PlayerBase.CastTo(nplayer, player))
11106 {
11108
11109 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11110 }
11111 }
11112
11113
11116 {
11117 PlayerBase nplayer;
11118 if (PlayerBase.CastTo(nplayer,player))
11119 {
11120
11121 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11122
11123 }
11124
11125
11126 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11127
11128
11129 if (HasEnergyManager())
11130 {
11131 GetCompEM().UpdatePlugState();
11132 }
11133 }
11134
11135
11137 {
11138 super.OnPlacementStarted(player);
11139
11141 }
11142
11143 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11144 {
11146 {
11147 m_AdminLog.OnPlacementComplete(player,
this);
11148 }
11149
11150 super.OnPlacementComplete(player, position, orientation);
11151 }
11152
11153
11154
11155
11156
11158 {
11160 {
11161 return true;
11162 }
11163 else
11164 {
11165 return false;
11166 }
11167 }
11168
11169
11171 {
11173 {
11175 }
11176 }
11177
11178
11180 {
11182 }
11183
11185 {
11187 }
11188
11189 override void InsertAgent(
int agent,
float count = 1)
11190 {
11191 if (count < 1)
11192 return;
11193
11195 }
11196
11199 {
11201 }
11202
11203
11205 {
11207 }
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11251 {
11253 return false;
11254 return true;
11255 }
11256
11258 {
11259
11261 }
11262
11263
11266 {
11267 super.CheckForRoofLimited(timeTresholdMS);
11268
11270 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11271 {
11272 m_PreviousRoofTestTime = time;
11273 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11274 }
11275 }
11276
11277
11279 {
11281 {
11282 return 0;
11283 }
11284
11285 if (GetInventory().GetAttachmentSlotsCount() != 0)
11286 {
11287 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11288 if (filter)
11289 return filter.GetProtectionLevel(type, false, system);
11290 else
11291 return 0;
11292 }
11293
11294 string subclassPath, entryName;
11295
11296 switch (type)
11297 {
11299 entryName = "biological";
11300 break;
11302 entryName = "chemical";
11303 break;
11304 default:
11305 entryName = "biological";
11306 break;
11307 }
11308
11309 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11310
11312 }
11313
11314
11315
11318 {
11319 if (!IsMagazine())
11321
11323 }
11324
11325
11326
11327
11328
11333 {
11334 return true;
11335 }
11336
11338 {
11340 }
11341
11342
11343
11344
11345
11347 {
11348 if (parent)
11349 {
11350 if (parent.IsInherited(DayZInfected))
11351 return true;
11352
11353 if (!parent.IsRuined())
11354 return true;
11355 }
11356
11357 return true;
11358 }
11359
11361 {
11362 if (!super.CanPutAsAttachment(parent))
11363 {
11364 return false;
11365 }
11366
11367 if (!IsRuined() && !parent.IsRuined())
11368 {
11369 return true;
11370 }
11371
11372 return false;
11373 }
11374
11376 {
11377
11378
11379
11380
11381 return super.CanReceiveItemIntoCargo(item);
11382 }
11383
11385 {
11386
11387
11388
11389
11390 GameInventory attachmentInv = attachment.GetInventory();
11392 {
11393 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11394 return false;
11395 }
11396
11397 InventoryLocation loc = new InventoryLocation();
11398 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11399 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11400 return false;
11401
11402 return super.CanReceiveAttachment(attachment, slotId);
11403 }
11404
11406 {
11407 if (!super.CanReleaseAttachment(attachment))
11408 return false;
11409
11410 return GetInventory().AreChildrenAccessible();
11411 }
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11434 {
11435 int id = muzzle_owner.GetMuzzleID();
11436 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11437
11438 if (WPOF_array)
11439 {
11440 for (int i = 0; i < WPOF_array.Count(); i++)
11441 {
11442 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11443
11444 if (WPOF)
11445 {
11446 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11447 }
11448 }
11449 }
11450 }
11451
11452
11454 {
11455 int id = muzzle_owner.GetMuzzleID();
11457
11458 if (WPOBE_array)
11459 {
11460 for (int i = 0; i < WPOBE_array.Count(); i++)
11461 {
11462 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11463
11464 if (WPOBE)
11465 {
11466 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11467 }
11468 }
11469 }
11470 }
11471
11472
11474 {
11475 int id = muzzle_owner.GetMuzzleID();
11476 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11477
11478 if (WPOOH_array)
11479 {
11480 for (int i = 0; i < WPOOH_array.Count(); i++)
11481 {
11482 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11483
11484 if (WPOOH)
11485 {
11486 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11487 }
11488 }
11489 }
11490 }
11491
11492
11494 {
11495 int id = muzzle_owner.GetMuzzleID();
11496 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11497
11498 if (WPOOH_array)
11499 {
11500 for (int i = 0; i < WPOOH_array.Count(); i++)
11501 {
11502 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11503
11504 if (WPOOH)
11505 {
11506 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11507 }
11508 }
11509 }
11510 }
11511
11512
11514 {
11515 int id = muzzle_owner.GetMuzzleID();
11516 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11517
11518 if (WPOOH_array)
11519 {
11520 for (int i = 0; i < WPOOH_array.Count(); i++)
11521 {
11522 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11523
11524 if (WPOOH)
11525 {
11526 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11527 }
11528 }
11529 }
11530 }
11531
11532
11533
11535 {
11537 {
11538 return true;
11539 }
11540
11541 return false;
11542 }
11543
11545 {
11547 {
11548 return true;
11549 }
11550
11551 return false;
11552 }
11553
11555 {
11557 {
11558 return true;
11559 }
11560
11561 return false;
11562 }
11563
11565 {
11566 return false;
11567 }
11568
11571 {
11572 return UATimeSpent.DEFAULT_DEPLOY;
11573 }
11574
11575
11576
11577
11579 {
11581 SetSynchDirty();
11582 }
11583
11585 {
11587 }
11588
11589
11591 {
11592 return false;
11593 }
11594
11597 {
11598 string att_type = "None";
11599
11600 if (ConfigIsExisting("soundAttType"))
11601 {
11602 att_type = ConfigGetString("soundAttType");
11603 }
11604
11606 }
11607
11609 {
11611 }
11612
11613
11614
11615
11616
11620
11622 {
11625
11627 }
11628
11629
11631 {
11633 return;
11634
11636
11639
11642
11643 SoundParameters params = new SoundParameters();
11647 }
11648
11649
11651 {
11653 return;
11654
11656 SetSynchDirty();
11657
11660 }
11661
11662
11664 {
11666 return;
11667
11669 SetSynchDirty();
11670
11673 }
11674
11676 {
11678 }
11679
11681 {
11683 }
11684
11687 {
11688 if (!
GetGame().IsDedicatedServer())
11689 {
11690 if (ConfigIsExisting("attachSoundSet"))
11691 {
11692 string cfg_path = "";
11693 string soundset = "";
11694 string type_name =
GetType();
11695
11698 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11699 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11700
11701 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11702 {
11703 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11704 {
11705 if (cfg_slot_array[i] == slot_type)
11706 {
11707 soundset = cfg_soundset_array[i];
11708 break;
11709 }
11710 }
11711 }
11712
11713 if (soundset != "")
11714 {
11715 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11717 }
11718 }
11719 }
11720 }
11721
11723 {
11724
11725 }
11726
11727 void OnApply(PlayerBase player);
11728
11730 {
11731 return 1.0;
11732 };
11733
11735 {
11737 }
11738
11740 {
11742 }
11743
11745
11747 {
11748 SetDynamicPhysicsLifeTime(0.01);
11750 }
11751
11753 {
11754 array<string> zone_names = new array<string>;
11755 GetDamageZones(zone_names);
11756 for (int i = 0; i < zone_names.Count(); i++)
11757 {
11758 SetHealthMax(zone_names.Get(i),"Health");
11759 }
11760 SetHealthMax("","Health");
11761 }
11762
11765 {
11766 float global_health = GetHealth01("","Health");
11767 array<string> zones = new array<string>;
11768 GetDamageZones(zones);
11769
11770 for (int i = 0; i < zones.Count(); i++)
11771 {
11772 SetHealth01(zones.Get(i),"Health",global_health);
11773 }
11774 }
11775
11778 {
11779 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11780 }
11781
11783 {
11784 if (!hasRootAsPlayer)
11785 {
11786 if (refParentIB)
11787 {
11788
11789 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11790 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11791
11792 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11793 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11794
11797 }
11798 else
11799 {
11800
11803 }
11804 }
11805 }
11806
11808 {
11810 {
11811 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11812 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11813 {
11814 float heatPermCoef = 1.0;
11816 while (ent)
11817 {
11818 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11819 ent = ent.GetHierarchyParent();
11820 }
11821
11822 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11823 }
11824 }
11825 }
11826
11828 {
11829
11830 EntityAI parent = GetHierarchyParent();
11831 if (!parent)
11832 {
11833 hasParent = false;
11834 hasRootAsPlayer = false;
11835 }
11836 else
11837 {
11838 hasParent = true;
11839 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11840 refParentIB =
ItemBase.Cast(parent);
11841 }
11842 }
11843
11844 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11845 {
11846
11847 }
11848
11850 {
11851
11852 return false;
11853 }
11854
11856 {
11857
11858
11859 return false;
11860 }
11861
11863 {
11864
11865 return false;
11866 }
11867
11870 {
11871 return !GetIsFrozen() &&
IsOpen();
11872 }
11873
11875 {
11876 bool hasParent = false, hasRootAsPlayer = false;
11878
11879 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11880 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11881
11882 if (wwtu || foodDecay)
11883 {
11887
11888 if (processWetness || processTemperature || processDecay)
11889 {
11891
11892 if (processWetness)
11893 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11894
11895 if (processTemperature)
11897
11898 if (processDecay)
11899 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11900 }
11901 }
11902 }
11903
11906 {
11908 }
11909
11911 {
11914
11915 return super.GetTemperatureFreezeThreshold();
11916 }
11917
11919 {
11922
11923 return super.GetTemperatureThawThreshold();
11924 }
11925
11927 {
11930
11931 return super.GetItemOverheatThreshold();
11932 }
11933
11935 {
11937 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11938
11939 return super.GetTemperatureFreezeTime();
11940 }
11941
11943 {
11945 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11946
11947 return super.GetTemperatureThawTime();
11948 }
11949
11954
11956 {
11957 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11958 }
11959
11961 {
11962 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11963 }
11964
11967 {
11969 }
11970
11972 {
11974 }
11975
11977 {
11979 }
11980
11983 {
11984 return null;
11985 }
11986
11989 {
11990 return false;
11991 }
11992
11994 {
11996 {
11999 if (!trg)
12000 {
12002 explosive = this;
12003 }
12004
12005 explosive.PairRemote(trg);
12007
12008 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12009 trg.SetPersistentPairID(persistentID);
12010 explosive.SetPersistentPairID(persistentID);
12011
12012 return true;
12013 }
12014 return false;
12015 }
12016
12019 {
12020 float ret = 1.0;
12023 ret *= GetHealth01();
12024
12025 return ret;
12026 }
12027
12028 #ifdef DEVELOPER
12029 override void SetDebugItem()
12030 {
12031 super.SetDebugItem();
12032 _itemBase = this;
12033 }
12034
12036 {
12037 string text = super.GetDebugText();
12038
12040 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12041
12042 return text;
12043 }
12044 #endif
12045
12047 {
12048 return true;
12049 }
12050
12052
12054
12056 {
12059 }
12060
12061
12069
12085}
12086
12088{
12090 if (entity)
12091 {
12092 bool is_item = entity.IsInherited(
ItemBase);
12093 if (is_item && full_quantity)
12094 {
12097 }
12098 }
12099 else
12100 {
12102 return NULL;
12103 }
12104 return entity;
12105}
12106
12108{
12109 if (item)
12110 {
12111 if (health > 0)
12112 item.SetHealth("", "", health);
12113
12114 if (item.CanHaveTemperature())
12115 {
12117 if (item.CanFreeze())
12118 item.SetFrozen(false);
12119 }
12120
12121 if (item.HasEnergyManager())
12122 {
12123 if (quantity >= 0)
12124 {
12125 item.GetCompEM().SetEnergy0To1(quantity);
12126 }
12127 else
12128 {
12130 }
12131 }
12132 else if (item.IsMagazine())
12133 {
12134 Magazine mag = Magazine.Cast(item);
12135 if (quantity >= 0)
12136 {
12137 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12138 }
12139 else
12140 {
12142 }
12143
12144 }
12145 else
12146 {
12147 if (quantity >= 0)
12148 {
12149 item.SetQuantityNormalized(quantity, false);
12150 }
12151 else
12152 {
12154 }
12155
12156 }
12157 }
12158}
12159
12160#ifdef DEVELOPER
12162#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.