7046{
7048 {
7049 return true;
7050 }
7051};
7052
7053
7054
7056{
7060
7062
7065
7066
7067
7068
7069
7078
7084
7089
7094
7115 protected bool m_IsResultOfSplit
7116
7118
7123
7124
7125
7127
7131
7132
7133
7135
7138
7139
7140
7146
7147
7155
7158
7159
7161
7162
7164
7165
7170
7171
7176
7177
7179
7180
7182 {
7187
7188 if (!
GetGame().IsDedicatedServer())
7189 {
7191 {
7193
7195 {
7197 }
7198 }
7199
7202 }
7203
7204 m_OldLocation = null;
7205
7207 {
7209 }
7210
7211 if (ConfigIsExisting("headSelectionsToHide"))
7212 {
7215 }
7216
7218 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7219 {
7221 }
7222
7224
7225 m_IsResultOfSplit = false;
7226
7228 }
7229
7231 {
7232 super.InitItemVariables();
7233
7239 m_Count = ConfigGetInt(
"count");
7240
7243
7248
7251
7256
7268
7272
7273
7276 if (ConfigIsExisting("canBeSplit"))
7277 {
7280 }
7281
7283 if (ConfigIsExisting("itemBehaviour"))
7285
7286
7289 RegisterNetSyncVariableInt("m_VarLiquidType");
7290 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7291
7292 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7293 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7294 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7295
7296 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7297 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7298 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7299 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7300
7301 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7302 RegisterNetSyncVariableBool("m_IsTakeable");
7303 RegisterNetSyncVariableBool("m_IsHologram");
7304
7307 {
7310 }
7311
7313
7315 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7317
7318 }
7319
7321 {
7323 }
7324
7326 {
7329 {
7334 }
7335 }
7336
7337 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7338 {
7340 {
7343 }
7344
7346 }
7347
7349 {
7355 }
7356
7358
7360 {
7362
7363 if (!action)
7364 {
7365 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7366 return;
7367 }
7368
7370 if (!ai)
7371 {
7373 return;
7374 }
7375
7377 if (!action_array)
7378 {
7379 action_array = new array<ActionBase_Basic>;
7381 }
7382 if (LogManager.IsActionLogEnable())
7383 {
7384 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7385 }
7386
7387 if (action_array.Find(action) != -1)
7388 {
7389 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7390 }
7391 else
7392 {
7393 action_array.Insert(action);
7394 }
7395 }
7396
7398 {
7400 ActionBase action = player.GetActionManager().GetAction(actionName);
7403
7404 if (action_array)
7405 {
7406 action_array.RemoveItem(action);
7407 }
7408 }
7409
7410
7411
7413 {
7414 ActionOverrideData overrideData = new ActionOverrideData();
7418
7420 if (!actionMap)
7421 {
7424 }
7425
7426 actionMap.Insert(this.
Type(), overrideData);
7427
7428 }
7429
7431
7433
7434
7436 {
7439
7442
7443 string config_to_search = "CfgVehicles";
7444 string muzzle_owner_config;
7445
7447 {
7448 if (IsInherited(Weapon))
7449 config_to_search = "CfgWeapons";
7450
7451 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7452
7453 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7454
7456
7457 if (config_OnFire_subclass_count > 0)
7458 {
7459 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7460
7461 for (int i = 0; i < config_OnFire_subclass_count; i++)
7462 {
7463 string particle_class = "";
7465 string config_OnFire_entry = config_OnFire_class + particle_class;
7466 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7467 WPOF_array.Insert(WPOF);
7468 }
7469
7470
7472 }
7473 }
7474
7476 {
7477 config_to_search = "CfgWeapons";
7478 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7479
7480 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7481
7483
7484 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7485 {
7486 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7487
7488 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7489 {
7490 string particle_class2 = "";
7492 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7493 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7494 WPOBE_array.Insert(WPOBE);
7495 }
7496
7497
7499 }
7500 }
7501 }
7502
7503
7505 {
7508
7510 {
7511 string config_to_search = "CfgVehicles";
7512
7513 if (IsInherited(Weapon))
7514 config_to_search = "CfgWeapons";
7515
7516 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7517 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7518
7519 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7520 {
7521
7523
7525 {
7527 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7529 return;
7530 }
7531
7534
7535
7536
7538 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7539
7540 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7541 {
7542 string particle_class = "";
7544 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7546
7547 if (entry_type == CT_CLASS)
7548 {
7549 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7550 WPOOH_array.Insert(WPOF);
7551 }
7552 }
7553
7554
7556 }
7557 }
7558 }
7559
7561 {
7563 }
7564
7566 {
7568 {
7570
7573
7576
7577 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7578 }
7579 }
7580
7582 {
7584 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7585
7587 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7588
7590 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7591
7593 {
7595 }
7596 }
7597
7599 {
7601 }
7602
7604 {
7607 else
7609
7611 {
7614 }
7615 else
7616 {
7619
7622 }
7623
7625 }
7626
7628 {
7630 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7631 }
7632
7634 {
7636 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7638 }
7639
7641 {
7643 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7644 }
7645
7647 {
7650
7651 OverheatingParticle OP = new OverheatingParticle();
7656
7658 }
7659
7661 {
7664
7665 return -1;
7666 }
7667
7669 {
7671 {
7674
7675 for (int i = count; i > 0; --i)
7676 {
7677 int id = i - 1;
7680
7683
7684 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7685 {
7686 if (p)
7687 {
7690 }
7691 }
7692 }
7693 }
7694 }
7695
7697 {
7699 {
7701 {
7702 int id = i - 1;
7704
7705 if (OP)
7706 {
7708
7709 if (p)
7710 {
7712 }
7713
7714 delete OP;
7715 }
7716 }
7717
7720 }
7721 }
7722
7725 {
7726 return 0.0;
7727 }
7728
7729
7731 {
7732 return 250;
7733 }
7734
7736 {
7737 return 0;
7738 }
7739
7742 {
7744 return true;
7745
7746 return false;
7747 }
7748
7751 {
7754
7756 {
7758 }
7759 else
7760 {
7761
7763 }
7764
7766 }
7767
7774 {
7775 return -1;
7776 }
7777
7778
7779
7780
7782 {
7784 {
7786 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7787
7788 if (r_index >= 0)
7789 {
7790 InventoryLocation r_il = new InventoryLocation;
7791 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7792
7793 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7796 {
7797 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7798 }
7800 {
7801 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7802 }
7803
7804 }
7805
7806 player.GetHumanInventory().ClearUserReservedLocation(this);
7807 }
7808
7811 }
7812
7813
7814
7815
7817 {
7818 return ItemBase.m_DebugActionsMask;
7819 }
7820
7822 {
7823 return ItemBase.m_DebugActionsMask & mask;
7824 }
7825
7827 {
7828 ItemBase.m_DebugActionsMask = mask;
7829 }
7830
7832 {
7833 ItemBase.m_DebugActionsMask |= mask;
7834 }
7835
7837 {
7838 ItemBase.m_DebugActionsMask &= ~mask;
7839 }
7840
7842 {
7844 {
7846 }
7847 else
7848 {
7850 }
7851 }
7852
7853
7855 {
7856 if (GetEconomyProfile())
7857 {
7858 float q_max = GetEconomyProfile().GetQuantityMax();
7859 if (q_max > 0)
7860 {
7861 float q_min = GetEconomyProfile().GetQuantityMin();
7862 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7863
7865 {
7866 ComponentEnergyManager comp = GetCompEM();
7868 {
7870 }
7871 }
7873 {
7875
7876 }
7877
7878 }
7879 }
7880 }
7881
7884 {
7885 EntityAI parent = GetHierarchyParent();
7886
7887 if (parent)
7888 {
7889 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7890 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7891 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7892 }
7893 }
7894
7897 {
7898 EntityAI parent = GetHierarchyParent();
7899
7900 if (parent)
7901 {
7902 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7903 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7904 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7905 }
7906 }
7907
7909 {
7910
7911
7912
7913
7915
7917 {
7918 if (ScriptInputUserData.CanStoreInputUserData())
7919 {
7920 ScriptInputUserData ctx = new ScriptInputUserData;
7926 ctx.
Write(use_stack_max);
7929
7931 {
7932 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7933 }
7934 }
7935 }
7936 else if (!
GetGame().IsMultiplayer())
7937 {
7939 }
7940 }
7941
7943 {
7945 }
7946
7948 {
7950 }
7951
7953 {
7955 }
7956
7958 {
7959
7960 return false;
7961 }
7962
7964 {
7965 return false;
7966 }
7967
7971 {
7972 return false;
7973 }
7974
7976 {
7977 return "";
7978 }
7979
7981
7983 {
7984 return false;
7985 }
7986
7988 {
7989 return true;
7990 }
7991
7992
7993
7995 {
7996 return true;
7997 }
7998
8000 {
8001 return true;
8002 }
8003
8005 {
8006 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8008 }
8009
8011 {
8013 }
8014
8016 {
8018 if (!is_being_placed)
8020 SetSynchDirty();
8021 }
8022
8023
8025
8027 {
8029 }
8030
8032 {
8034 }
8035
8037 {
8038 return 1;
8039 }
8040
8042 {
8043 return false;
8044 }
8045
8047 {
8049 SetSynchDirty();
8050 }
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8087 {
8088 super.OnMovedInsideCargo(container);
8089
8090 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8091 }
8092
8093 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8094 {
8095 super.EEItemLocationChanged(oldLoc,newLoc);
8096
8097 PlayerBase new_player = null;
8098 PlayerBase old_player = null;
8099
8100 if (newLoc.GetParent())
8101 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8102
8103 if (oldLoc.GetParent())
8104 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8105
8107 {
8108 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8109
8110 if (r_index >= 0)
8111 {
8112 InventoryLocation r_il = new InventoryLocation;
8113 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8114
8115 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8118 {
8119 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8120 }
8122 {
8123 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8124 }
8125
8126 }
8127 }
8128
8130 {
8131 if (new_player)
8132 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8133
8134 if (new_player == old_player)
8135 {
8136
8137 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8138 {
8140 {
8141 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8142 {
8143 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8144 }
8145 }
8146 else
8147 {
8148 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8149 }
8150 }
8151
8152 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8153 {
8154 int type = oldLoc.GetType();
8156 {
8157 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8158 }
8160 {
8161 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8162 }
8163 }
8164 if (!m_OldLocation)
8165 {
8166 m_OldLocation = new InventoryLocation;
8167 }
8168 m_OldLocation.Copy(oldLoc);
8169 }
8170 else
8171 {
8172 if (m_OldLocation)
8173 {
8174 m_OldLocation.Reset();
8175 }
8176 }
8177
8179 }
8180 else
8181 {
8182 if (new_player)
8183 {
8184 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8185 if (res_index >= 0)
8186 {
8187 InventoryLocation il = new InventoryLocation;
8188 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8190 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8193 {
8194 il.
GetParent().GetOnReleaseLock().Invoke(it);
8195 }
8197 {
8199 }
8200
8201 }
8202 }
8204 {
8205
8207 }
8208
8209 if (m_OldLocation)
8210 {
8211 m_OldLocation.Reset();
8212 }
8213 }
8214 }
8215
8216 override void EOnContact(IEntity other, Contact extra)
8217 {
8219 {
8220 int liquidType = -1;
8222 if (impactSpeed > 0.0)
8223 {
8225 #ifndef SERVER
8227 #else
8229 SetSynchDirty();
8230 #endif
8232 }
8233 }
8234
8235 #ifdef SERVER
8236 if (GetCompEM() && GetCompEM().IsPlugged())
8237 {
8238 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8239 GetCompEM().UnplugThis();
8240 }
8241 #endif
8242 }
8243
8245
8247 {
8249 }
8250
8252 {
8253
8254 }
8255
8257 {
8258 super.OnItemLocationChanged(old_owner, new_owner);
8259
8260 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8261 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8262
8263 if (!relatedPlayer && playerNew)
8264 relatedPlayer = playerNew;
8265
8266 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8267 {
8269 if (actionMgr)
8270 {
8271 ActionBase currentAction = actionMgr.GetRunningAction();
8272 if (currentAction)
8274 }
8275 }
8276
8277 Man ownerPlayerOld = null;
8278 Man ownerPlayerNew = null;
8279
8280 if (old_owner)
8281 {
8282 if (old_owner.
IsMan())
8283 {
8284 ownerPlayerOld = Man.Cast(old_owner);
8285 }
8286 else
8287 {
8288 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8289 }
8290 }
8291 else
8292 {
8294 {
8296
8297 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8298 {
8299 GetCompEM().UnplugThis();
8300 }
8301 }
8302 }
8303
8304 if (new_owner)
8305 {
8306 if (new_owner.
IsMan())
8307 {
8308 ownerPlayerNew = Man.Cast(new_owner);
8309 }
8310 else
8311 {
8312 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8313 }
8314 }
8315
8316 if (ownerPlayerOld != ownerPlayerNew)
8317 {
8318 if (ownerPlayerOld)
8319 {
8320 array<EntityAI> subItemsExit = new array<EntityAI>;
8322 for (int i = 0; i < subItemsExit.Count(); i++)
8323 {
8326 }
8327 }
8328
8329 if (ownerPlayerNew)
8330 {
8331 array<EntityAI> subItemsEnter = new array<EntityAI>;
8333 for (int j = 0; j < subItemsEnter.Count(); j++)
8334 {
8337 }
8338 }
8339 }
8340 else if (ownerPlayerNew != null)
8341 {
8342 PlayerBase nplayer;
8343 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8344 {
8345 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8347 for (int k = 0; k < subItemsUpdate.Count(); k++)
8348 {
8350 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8351 }
8352 }
8353 }
8354
8355 if (old_owner)
8356 old_owner.OnChildItemRemoved(this);
8357 if (new_owner)
8358 new_owner.OnChildItemReceived(this);
8359 }
8360
8361
8363 {
8364 super.EEDelete(parent);
8365 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8366 if (player)
8367 {
8369
8370 if (player.IsAlive())
8371 {
8372 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8373 if (r_index >= 0)
8374 {
8375 InventoryLocation r_il = new InventoryLocation;
8376 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8377
8378 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 player.RemoveQuickBarEntityShortcut(this);
8392 }
8393 }
8394 }
8395
8397 {
8398 super.EEKilled(killer);
8399
8402 {
8403 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8404 {
8405 if (IsMagazine())
8406 {
8407 if (Magazine.Cast(this).GetAmmoCount() > 0)
8408 {
8410 }
8411 }
8412 else
8413 {
8415 }
8416 }
8417 }
8418 }
8419
8421 {
8422 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8423
8424 super.OnWasAttached(parent, slot_id);
8425
8428
8430 }
8431
8433 {
8434 super.OnWasDetached(parent, slot_id);
8435
8438 }
8439
8441 {
8442 int idx;
8445
8446 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8447 if (inventory_slots.Count() < 1)
8448 {
8449 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8450 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8451 }
8452 else
8453 {
8454 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8455 }
8456
8457 idx = inventory_slots.Find(slot);
8458 if (idx < 0)
8459 return "";
8460
8461 return attach_types.Get(idx);
8462 }
8463
8465 {
8466 int idx = -1;
8467 string slot;
8468
8471
8472 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8473 if (inventory_slots.Count() < 1)
8474 {
8475 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8476 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8477 }
8478 else
8479 {
8480 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8481 if (detach_types.Count() < 1)
8482 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8483 }
8484
8485 for (int i = 0; i < inventory_slots.Count(); i++)
8486 {
8487 slot = inventory_slots.Get(i);
8488 }
8489
8490 if (slot != "")
8491 {
8492 if (detach_types.Count() == 1)
8493 idx = 0;
8494 else
8495 idx = inventory_slots.Find(slot);
8496 }
8497 if (idx < 0)
8498 return "";
8499
8500 return detach_types.Get(idx);
8501 }
8502
8504 {
8505
8507
8508
8509 float min_time = 1;
8510 float max_time = 3;
8511 float delay = Math.RandomFloat(min_time, max_time);
8512
8513 explode_timer.Run(delay, this, "DoAmmoExplosion");
8514 }
8515
8517 {
8518 Magazine magazine = Magazine.Cast(this);
8519 int pop_sounds_count = 6;
8520 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8521
8522
8523 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8524 string sound_name = pop_sounds[ sound_idx ];
8526
8527
8528 magazine.ServerAddAmmoCount(-1);
8529
8530
8531 float min_temp_to_explode = 100;
8532
8533 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8534 {
8536 }
8537 }
8538
8539
8540 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8541 {
8542 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8543
8544 const int CHANCE_DAMAGE_CARGO = 4;
8545 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8546 const int CHANCE_DAMAGE_NOTHING = 2;
8547
8549 {
8550 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8551 int chances;
8552 int rnd;
8553
8554 if (GetInventory().GetCargo())
8555 {
8556 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8557 rnd = Math.RandomInt(0,chances);
8558
8559 if (rnd < CHANCE_DAMAGE_CARGO)
8560 {
8562 }
8563 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8564 {
8566 }
8567 }
8568 else
8569 {
8570 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8571 rnd = Math.RandomInt(0,chances);
8572
8573 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8574 {
8576 }
8577 }
8578 }
8579 }
8580
8582 {
8583 if (GetInventory().GetCargo())
8584 {
8585 int item_count = GetInventory().GetCargo().GetItemCount();
8586 if (item_count > 0)
8587 {
8588 int random_pick = Math.RandomInt(0, item_count);
8590 if (!item.IsExplosive())
8591 {
8592 item.AddHealth("","",damage);
8593 return true;
8594 }
8595 }
8596 }
8597 return false;
8598 }
8599
8601 {
8602 int attachment_count = GetInventory().AttachmentCount();
8603 if (attachment_count > 0)
8604 {
8605 int random_pick = Math.RandomInt(0, attachment_count);
8606 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8607 if (!attachment.IsExplosive())
8608 {
8609 attachment.AddHealth("","",damage);
8610 return true;
8611 }
8612 }
8613 return false;
8614 }
8615
8617 {
8619 }
8620
8622 {
8624 return GetInventory().CanRemoveEntity();
8625
8626 return false;
8627 }
8628
8630 {
8632 return;
8633
8635 {
8636 if (ScriptInputUserData.CanStoreInputUserData())
8637 {
8638 ScriptInputUserData ctx = new ScriptInputUserData;
8643 ctx.
Write(destination_entity);
8647 }
8648 }
8649 else if (!
GetGame().IsMultiplayer())
8650 {
8652 }
8653 }
8654
8656 {
8658 return;
8659
8660 float split_quantity_new;
8664 InventoryLocation loc = new InventoryLocation;
8665
8666 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8667 {
8669 split_quantity_new = stack_max;
8670 else
8672
8673 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8674 if (new_item)
8675 {
8676 new_item.SetResultOfSplit(true);
8677 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8679 new_item.SetQuantity(split_quantity_new);
8680 }
8681 }
8682 else if (destination_entity && slot_id == -1)
8683 {
8684 if (quantity > stack_max)
8685 split_quantity_new = stack_max;
8686 else
8687 split_quantity_new = quantity;
8688
8690 {
8693 }
8694
8695 if (new_item)
8696 {
8697 new_item.SetResultOfSplit(true);
8698 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8700 new_item.SetQuantity(split_quantity_new);
8701 }
8702 }
8703 else
8704 {
8705 if (stack_max != 0)
8706 {
8708 {
8710 }
8711
8712 if (split_quantity_new == 0)
8713 {
8714 if (!
GetGame().IsMultiplayer())
8715 player.PhysicalPredictiveDropItem(this);
8716 else
8717 player.ServerDropEntity(this);
8718 return;
8719 }
8720
8722
8723 if (new_item)
8724 {
8725 new_item.SetResultOfSplit(true);
8726 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8728 new_item.SetQuantity(stack_max);
8729 new_item.PlaceOnSurface();
8730 }
8731 }
8732 }
8733 }
8734
8736 {
8738 return;
8739
8740 float split_quantity_new;
8744 InventoryLocation loc = new InventoryLocation;
8745
8746 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8747 {
8749 split_quantity_new = stack_max;
8750 else
8752
8753 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8754 if (new_item)
8755 {
8756 new_item.SetResultOfSplit(true);
8757 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8759 new_item.SetQuantity(split_quantity_new);
8760 }
8761 }
8762 else if (destination_entity && slot_id == -1)
8763 {
8764 if (quantity > stack_max)
8765 split_quantity_new = stack_max;
8766 else
8767 split_quantity_new = quantity;
8768
8770 {
8773 }
8774
8775 if (new_item)
8776 {
8777 new_item.SetResultOfSplit(true);
8778 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8780 new_item.SetQuantity(split_quantity_new);
8781 }
8782 }
8783 else
8784 {
8785 if (stack_max != 0)
8786 {
8788 {
8790 }
8791
8793
8794 if (new_item)
8795 {
8796 new_item.SetResultOfSplit(true);
8797 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8799 new_item.SetQuantity(stack_max);
8800 new_item.PlaceOnSurface();
8801 }
8802 }
8803 }
8804 }
8805
8807 {
8809 return;
8810
8812 {
8813 if (ScriptInputUserData.CanStoreInputUserData())
8814 {
8815 ScriptInputUserData ctx = new ScriptInputUserData;
8820 dst.WriteToContext(ctx);
8822 }
8823 }
8824 else if (!
GetGame().IsMultiplayer())
8825 {
8827 }
8828 }
8829
8831 {
8833 return;
8834
8836 {
8837 if (ScriptInputUserData.CanStoreInputUserData())
8838 {
8839 ScriptInputUserData ctx = new ScriptInputUserData;
8844 ctx.
Write(destination_entity);
8850 }
8851 }
8852 else if (!
GetGame().IsMultiplayer())
8853 {
8855 }
8856 }
8857
8859 {
8861 }
8862
8864 {
8866 return this;
8867
8869 float split_quantity_new;
8871 if (dst.IsValid())
8872 {
8873 int slot_id = dst.GetSlot();
8875
8876 if (quantity > stack_max)
8877 split_quantity_new = stack_max;
8878 else
8879 split_quantity_new = quantity;
8880
8882
8883 if (new_item)
8884 {
8885 new_item.SetResultOfSplit(true);
8886 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8889 }
8890
8891 return new_item;
8892 }
8893
8894 return null;
8895 }
8896
8898 {
8900 return;
8901
8903 float split_quantity_new;
8905 if (destination_entity)
8906 {
8908 if (quantity > stackable)
8909 split_quantity_new = stackable;
8910 else
8911 split_quantity_new = quantity;
8912
8913 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8914 if (new_item)
8915 {
8916 new_item.SetResultOfSplit(true);
8917 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8919 new_item.SetQuantity(split_quantity_new);
8920 }
8921 }
8922 }
8923
8925 {
8927 return;
8928
8930 {
8931 if (ScriptInputUserData.CanStoreInputUserData())
8932 {
8933 ScriptInputUserData ctx = new ScriptInputUserData;
8938 ItemBase destination_entity =
this;
8939 ctx.
Write(destination_entity);
8943 }
8944 }
8945 else if (!
GetGame().IsMultiplayer())
8946 {
8948 }
8949 }
8950
8952 {
8954 return;
8955
8957 float split_quantity_new;
8959 if (player)
8960 {
8962 if (quantity > stackable)
8963 split_quantity_new = stackable;
8964 else
8965 split_quantity_new = quantity;
8966
8967 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8968 new_item =
ItemBase.Cast(in_hands);
8969 if (new_item)
8970 {
8971 new_item.SetResultOfSplit(true);
8972 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8974 new_item.SetQuantity(split_quantity_new);
8975 }
8976 }
8977 }
8978
8980 {
8982 return;
8983
8985 float split_quantity_new = Math.Floor(quantity * 0.5);
8986
8988
8989 if (new_item)
8990 {
8991 if (new_item.GetQuantityMax() < split_quantity_new)
8992 {
8993 split_quantity_new = new_item.GetQuantityMax();
8994 }
8995
8996 new_item.SetResultOfSplit(true);
8997 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8998
9000 {
9003 }
9004 else
9005 {
9008 }
9009 }
9010 }
9011
9013 {
9015 return;
9016
9018 float split_quantity_new = Math.Floor(quantity / 2);
9019
9020 InventoryLocation invloc = new InventoryLocation;
9022
9024 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9025
9026 if (new_item)
9027 {
9028 if (new_item.GetQuantityMax() < split_quantity_new)
9029 {
9030 split_quantity_new = new_item.GetQuantityMax();
9031 }
9033 {
9036 }
9037 else
9038 {
9041 }
9042 }
9043 }
9044
9047 {
9048 SetWeightDirty();
9050
9051 if (parent)
9052 parent.OnAttachmentQuantityChangedEx(this, delta);
9053
9055 {
9057 {
9059 }
9061 {
9062 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9064 }
9065 }
9066
9067 }
9068
9071 {
9072
9073 }
9074
9077 {
9079 }
9080
9082 {
9083 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9084
9086 {
9087 if (newLevel == GameConstants.STATE_RUINED)
9088 {
9090 EntityAI parent = GetHierarchyParent();
9091 if (parent && parent.IsFireplace())
9092 {
9093 CargoBase cargo = GetInventory().GetCargo();
9094 if (cargo)
9095 {
9097 {
9099 }
9100 }
9101 }
9102 }
9103
9105 {
9106
9108 return;
9109 }
9110
9111 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9112 {
9114 }
9115 }
9116 }
9117
9118
9120 {
9121 super.OnRightClick();
9122
9124 {
9126 {
9127 if (ScriptInputUserData.CanStoreInputUserData())
9128 {
9129 vector m4[4];
9131
9132 EntityAI root = GetHierarchyRoot();
9133
9134 InventoryLocation dst = new InventoryLocation;
9136 {
9137 if (root)
9138 {
9139 root.GetTransform(m4);
9141 }
9142 else
9143 GetInventory().GetCurrentInventoryLocation(dst);
9144 }
9145 else
9146 {
9148
9149
9150 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9151 {
9152 if (root)
9153 {
9154 root.GetTransform(m4);
9156 }
9157 else
9158 GetInventory().GetCurrentInventoryLocation(dst);
9159 }
9160 else
9161 {
9162 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9163 }
9164 }
9165
9166 ScriptInputUserData ctx = new ScriptInputUserData;
9174 }
9175 }
9176 else if (!
GetGame().IsMultiplayer())
9177 {
9179 }
9180 }
9181 }
9182
9183 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9184 {
9185
9186 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9187 return false;
9188
9189 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9190 return false;
9191
9192
9194 return false;
9195
9196
9197 Magazine mag = Magazine.Cast(this);
9198 if (mag)
9199 {
9200 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9201 return false;
9202
9203 if (stack_max_limit)
9204 {
9205 Magazine other_mag = Magazine.Cast(other_item);
9206 if (other_item)
9207 {
9208 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9209 return false;
9210 }
9211
9212 }
9213 }
9214 else
9215 {
9216
9218 return false;
9219
9221 return false;
9222 }
9223
9224 PlayerBase player = null;
9225 if (CastTo(player, GetHierarchyRootPlayer()))
9226 {
9227 if (player.GetInventory().HasAttachment(this))
9228 return false;
9229
9230 if (player.IsItemsToDelete())
9231 return false;
9232 }
9233
9234 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9235 return false;
9236
9237 int slotID;
9239 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9240 return false;
9241
9242 return true;
9243 }
9244
9246 {
9248 }
9249
9251 {
9252 return m_IsResultOfSplit;
9253 }
9254
9256 {
9257 m_IsResultOfSplit = value;
9258 }
9259
9261 {
9263 }
9264
9266 {
9267 float other_item_quantity = other_item.GetQuantity();
9268 float this_free_space;
9269
9271
9273
9274 if (other_item_quantity > this_free_space)
9275 {
9276 return this_free_space;
9277 }
9278 else
9279 {
9280 return other_item_quantity;
9281 }
9282 }
9283
9285 {
9287 }
9288
9290 {
9292 return;
9293
9294 if (!IsMagazine() && other_item)
9295 {
9297 if (quantity_used != 0)
9298 {
9299 float hp1 = GetHealth01("","");
9300 float hp2 = other_item.GetHealth01("","");
9301 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9302 hpResult = hpResult / (
GetQuantity() + quantity_used);
9303
9304 hpResult *= GetMaxHealth();
9305 Math.Round(hpResult);
9306 SetHealth("", "Health", hpResult);
9307
9309 other_item.AddQuantity(-quantity_used);
9310 }
9311 }
9313 }
9314
9316 {
9317 #ifdef SERVER
9318 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9319 GetHierarchyParent().IncreaseLifetimeUp();
9320 #endif
9321 };
9322
9324 {
9325 PlayerBase p = PlayerBase.Cast(player);
9326
9327 array<int> recipesIds = p.m_Recipes;
9328 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9329 if (moduleRecipesManager)
9330 {
9331 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9332 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9333 }
9334
9335 for (int i = 0;i < recipesIds.Count(); i++)
9336 {
9337 int key = recipesIds.Get(i);
9338 string recipeName = moduleRecipesManager.GetRecipeName(key);
9340 }
9341 }
9342
9343
9344 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9345 {
9346 super.GetDebugActions(outputList);
9347
9348
9353
9354
9358
9362
9363
9366
9367
9369 {
9372 }
9373
9375
9378
9382 }
9383
9384
9385
9386
9388 {
9389 super.OnAction(action_id, player, ctx);
9390 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9391 {
9392 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9393 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9394 PlayerBase p = PlayerBase.Cast(player);
9395 if (
EActions.RECIPES_RANGE_START < 1000)
9396 {
9397 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9398 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9399 }
9400 }
9401 #ifndef SERVER
9402 else if (action_id ==
EActions.WATCH_PLAYER)
9403 {
9404 PluginDeveloper.SetDeveloperItemClientEx(player);
9405 }
9406 #endif
9408 {
9409 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9410 {
9411 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9412 OnDebugButtonPressServer(id + 1);
9413 }
9414
9415 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9416 {
9417 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9419 }
9420
9421 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9422 {
9423 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9425 }
9426
9427 else if (action_id ==
EActions.ADD_QUANTITY)
9428 {
9429 if (IsMagazine())
9430 {
9431 Magazine mag = Magazine.Cast(this);
9432 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9433 }
9434 else
9435 {
9437 }
9438
9439 if (m_EM)
9440 {
9441 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9442 }
9443
9444 }
9445
9446 else if (action_id ==
EActions.REMOVE_QUANTITY)
9447 {
9448 if (IsMagazine())
9449 {
9450 Magazine mag2 = Magazine.Cast(this);
9451 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9452 }
9453 else
9454 {
9456 }
9457 if (m_EM)
9458 {
9459 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9460 }
9461
9462 }
9463
9464 else if (action_id ==
EActions.SET_QUANTITY_0)
9465 {
9467
9468 if (m_EM)
9469 {
9470 m_EM.SetEnergy(0);
9471 }
9472 }
9473
9474 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9475 {
9477
9478 if (m_EM)
9479 {
9480 m_EM.SetEnergy(m_EM.GetEnergyMax());
9481 }
9482 }
9483
9484 else if (action_id ==
EActions.ADD_HEALTH)
9485 {
9486 AddHealth("","",GetMaxHealth("","Health")/5);
9487 }
9488 else if (action_id ==
EActions.REMOVE_HEALTH)
9489 {
9490 AddHealth("","",-GetMaxHealth("","Health")/5);
9491 }
9492 else if (action_id ==
EActions.DESTROY_HEALTH)
9493 {
9494 SetHealth01("","",0);
9495 }
9496 else if (action_id ==
EActions.WATCH_ITEM)
9497 {
9499 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9500 #ifdef DEVELOPER
9501 SetDebugDeveloper_item(this);
9502 #endif
9503 }
9504
9505 else if (action_id ==
EActions.ADD_TEMPERATURE)
9506 {
9507 AddTemperature(20);
9508
9509 }
9510
9511 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9512 {
9513 AddTemperature(-20);
9514
9515 }
9516
9517 else if (action_id ==
EActions.FLIP_FROZEN)
9518 {
9519 SetFrozen(!GetIsFrozen());
9520
9521 }
9522
9523 else if (action_id ==
EActions.ADD_WETNESS)
9524 {
9526
9527 }
9528
9529 else if (action_id ==
EActions.REMOVE_WETNESS)
9530 {
9532
9533 }
9534
9535 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9536 {
9539
9540
9541 }
9542
9543 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9544 {
9547 }
9548
9549 else if (action_id ==
EActions.MAKE_SPECIAL)
9550 {
9551 auto debugParams = DebugSpawnParams.WithPlayer(player);
9552 OnDebugSpawnEx(debugParams);
9553 }
9554
9555 else if (action_id ==
EActions.DELETE)
9556 {
9557 Delete();
9558 }
9559
9560 }
9561
9562
9563 return false;
9564 }
9565
9566
9567
9568
9572
9575
9576
9577
9579 {
9580 return false;
9581 }
9582
9583
9585 {
9586 return true;
9587 }
9588
9589
9591 {
9592 return true;
9593 }
9594
9595
9596
9598 {
9599 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9601 }
9602
9605 {
9606 return null;
9607 }
9608
9610 {
9611 return false;
9612 }
9613
9615 {
9616 return false;
9617 }
9618
9622
9623
9625 {
9626 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9627 return module_repairing.CanRepair(this, item_repair_kit);
9628 }
9629
9630
9631 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9632 {
9633 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9634 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9635 }
9636
9637
9639 {
9640
9641
9642
9643
9644
9645
9646
9647
9648 return 1;
9649 }
9650
9651
9652
9654 {
9656 }
9657
9658
9659
9661 {
9663 }
9664
9665
9674 {
9675 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9676
9677 if (player)
9678 {
9679 player.MessageStatus(text);
9680 }
9681 }
9682
9683
9692 {
9693 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9694
9695 if (player)
9696 {
9697 player.MessageAction(text);
9698 }
9699 }
9700
9701
9710 {
9711 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9712
9713 if (player)
9714 {
9715 player.MessageFriendly(text);
9716 }
9717 }
9718
9719
9728 {
9729 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9730
9731 if (player)
9732 {
9733 player.MessageImportant(text);
9734 }
9735 }
9736
9738 {
9739 return true;
9740 }
9741
9742
9743 override bool KindOf(
string tag)
9744 {
9745 bool found = false;
9746 string item_name = this.
GetType();
9749
9750 int array_size = item_tag_array.Count();
9751 for (int i = 0; i < array_size; i++)
9752 {
9753 if (item_tag_array.Get(i) == tag)
9754 {
9755 found = true;
9756 break;
9757 }
9758 }
9759 return found;
9760 }
9761
9762
9764 {
9765
9766 super.OnRPC(sender, rpc_type,ctx);
9767
9768
9769 switch (rpc_type)
9770 {
9771 #ifndef SERVER
9772 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9773 Param2<bool, string> p = new Param2<bool, string>(false, "");
9774
9776 return;
9777
9778 bool play = p.param1;
9779 string soundSet = p.param2;
9780
9781 if (play)
9782 {
9784 {
9786 {
9788 }
9789 }
9790 else
9791 {
9793 }
9794 }
9795 else
9796 {
9798 }
9799
9800 break;
9801 #endif
9802
9803 }
9804
9806 {
9808 }
9809 }
9810
9811
9812
9813
9815 {
9816 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9817 return plugin.GetID(
name);
9818 }
9819
9821 {
9822 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9823 return plugin.GetName(id);
9824 }
9825
9828 {
9829
9830
9831 int varFlags;
9832 if (!ctx.
Read(varFlags))
9833 return;
9834
9835 if (varFlags & ItemVariableFlags.FLOAT)
9836 {
9838 }
9839 }
9840
9842 {
9843
9844 super.SerializeNumericalVars(floats_out);
9845
9846
9847
9849 {
9851 }
9852
9854 {
9856 }
9857
9859 {
9861 }
9862
9864 {
9869 }
9870
9872 {
9874 }
9875 }
9876
9878 {
9879
9880 super.DeSerializeNumericalVars(floats);
9881
9882
9883 int index = 0;
9884 int mask = Math.Round(floats.Get(index));
9885
9886 index++;
9887
9889 {
9891 {
9893 }
9894 else
9895 {
9896 float quantity = floats.Get(index);
9898 }
9899 index++;
9900 }
9901
9903 {
9904 float wet = floats.Get(index);
9906 index++;
9907 }
9908
9910 {
9911 int liquidtype = Math.Round(floats.Get(index));
9913 index++;
9914 }
9915
9917 {
9919 index++;
9921 index++;
9923 index++;
9925 index++;
9926 }
9927
9929 {
9930 int cleanness = Math.Round(floats.Get(index));
9932 index++;
9933 }
9934 }
9935
9937 {
9938 super.WriteVarsToCTX(ctx);
9939
9940
9942 {
9944 }
9945
9947 {
9949 }
9950
9952 {
9954 }
9955
9957 {
9958 int r,g,b,a;
9964 }
9965
9967 {
9969 }
9970 }
9971
9973 {
9974 if (!super.ReadVarsFromCTX(ctx,version))
9975 return false;
9976
9977 int intValue;
9978 float value;
9979
9980 if (version < 140)
9981 {
9982 if (!ctx.
Read(intValue))
9983 return false;
9984
9985 m_VariablesMask = intValue;
9986 }
9987
9989 {
9990 if (!ctx.
Read(value))
9991 return false;
9992
9994 {
9996 }
9997 else
9998 {
10000 }
10001 }
10002
10003 if (version < 140)
10004 {
10006 {
10007 if (!ctx.
Read(value))
10008 return false;
10009 SetTemperatureDirect(value);
10010 }
10011 }
10012
10014 {
10015 if (!ctx.
Read(value))
10016 return false;
10018 }
10019
10021 {
10022 if (!ctx.
Read(intValue))
10023 return false;
10025 }
10026
10028 {
10029 int r,g,b,a;
10031 return false;
10033 return false;
10035 return false;
10037 return false;
10038
10040 }
10041
10043 {
10044 if (!ctx.
Read(intValue))
10045 return false;
10047 }
10048
10049 if (version >= 138 && version < 140)
10050 {
10052 {
10053 if (!ctx.
Read(intValue))
10054 return false;
10055 SetFrozen(intValue);
10056 }
10057 }
10058
10059 return true;
10060 }
10061
10062
10064 {
10067 {
10069 }
10070
10071 if (!super.OnStoreLoad(ctx, version))
10072 {
10074 return false;
10075 }
10076
10077 if (version >= 114)
10078 {
10079 bool hasQuickBarIndexSaved;
10080
10081 if (!ctx.
Read(hasQuickBarIndexSaved))
10082 {
10084 return false;
10085 }
10086
10087 if (hasQuickBarIndexSaved)
10088 {
10089 int itmQBIndex;
10090
10091
10092 if (!ctx.
Read(itmQBIndex))
10093 {
10095 return false;
10096 }
10097
10098 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10099 if (itmQBIndex != -1 && parentPlayer)
10100 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10101 }
10102 }
10103 else
10104 {
10105
10106 PlayerBase player;
10107 int itemQBIndex;
10108 if (version ==
int.
MAX)
10109 {
10110 if (!ctx.
Read(itemQBIndex))
10111 {
10113 return false;
10114 }
10115 }
10116 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10117 {
10118
10119 if (!ctx.
Read(itemQBIndex))
10120 {
10122 return false;
10123 }
10124 if (itemQBIndex != -1 && player)
10125 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10126 }
10127 }
10128
10129 if (version < 140)
10130 {
10131
10132 if (!LoadVariables(ctx, version))
10133 {
10135 return false;
10136 }
10137 }
10138
10139
10141 {
10143 return false;
10144 }
10145 if (version >= 132)
10146 {
10148 if (raib)
10149 {
10151 {
10153 return false;
10154 }
10155 }
10156 }
10157
10159 return true;
10160 }
10161
10162
10163
10165 {
10166 super.OnStoreSave(ctx);
10167
10168 PlayerBase player;
10169 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10170 {
10172
10173 int itemQBIndex = -1;
10174 itemQBIndex = player.FindQuickBarEntityIndex(this);
10175 ctx.
Write(itemQBIndex);
10176 }
10177 else
10178 {
10180 }
10181
10183
10185 if (raib)
10186 {
10188 }
10189 }
10190
10191
10193 {
10194 super.AfterStoreLoad();
10195
10197 {
10199 }
10200
10202 {
10205 }
10206 }
10207
10209 {
10210 super.EEOnAfterLoad();
10211
10213 {
10215 }
10216
10219 }
10220
10222 {
10223 return false;
10224 }
10225
10226
10227
10229 {
10231 {
10232 #ifdef PLATFORM_CONSOLE
10233
10235 {
10237 if (menu)
10238 {
10240 }
10241 }
10242 #endif
10243 }
10244
10246 {
10249 }
10250
10252 {
10253 SetWeightDirty();
10255 }
10257 {
10260 }
10261
10263 {
10266 }
10268 {
10271 }
10272
10273 super.OnVariablesSynchronized();
10274 }
10275
10276
10277
10279 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10280 {
10281 if (!IsServerCheck(allow_client))
10282 return false;
10283
10285 return false;
10286
10289
10290 if (value <= (min + 0.001))
10291 value = min;
10292
10293 if (value == min)
10294 {
10295 if (destroy_config)
10296 {
10297 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10298 if (dstr)
10299 {
10301 this.Delete();
10302 return true;
10303 }
10304 }
10305 else if (destroy_forced)
10306 {
10308 this.Delete();
10309 return true;
10310 }
10311
10313 }
10314
10317
10319 {
10321
10322 if (delta)
10324 }
10325
10327
10328 return false;
10329 }
10330
10331
10333 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10334 {
10336 }
10337
10339 {
10342 }
10343
10345 {
10348 }
10349
10352 {
10353 float value_clamped = Math.Clamp(value, 0, 1);
10355 SetQuantity(result, destroy_config, destroy_forced);
10356 }
10357
10358
10361 {
10363 }
10364
10366 {
10368 }
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10380 {
10381 int slot = -1;
10382 if (GetInventory())
10383 {
10384 InventoryLocation il = new InventoryLocation;
10385 GetInventory().GetCurrentInventoryLocation(il);
10387 }
10388
10390 }
10391
10393 {
10394 float quantity_max = 0;
10395
10397 {
10398 if (attSlotID != -1)
10399 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10400
10401 if (quantity_max <= 0)
10403 }
10404
10405 if (quantity_max <= 0)
10407
10408 return quantity_max;
10409 }
10410
10412 {
10414 }
10415
10417 {
10419 }
10420
10421
10423 {
10425 }
10426
10428 {
10430 }
10431
10433 {
10435 }
10436
10437
10439 {
10440
10441 float weightEx = GetWeightEx();
10442 float special = GetInventoryAndCargoWeight();
10443 return weightEx - special;
10444 }
10445
10446
10448 {
10450 }
10451
10453 {
10455 {
10456 #ifdef DEVELOPER
10457 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10458 {
10459 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10461 }
10462 #endif
10463
10464 return GetQuantity() * GetConfigWeightModified();
10465 }
10466 else if (HasEnergyManager())
10467 {
10468 #ifdef DEVELOPER
10469 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10470 {
10471 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10472 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10473 }
10474 #endif
10475 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10476 }
10477 else
10478 {
10479 #ifdef DEVELOPER
10480 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10481 {
10482 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10483 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10484 }
10485 #endif
10486 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10487 }
10488 }
10489
10492 {
10493 int item_count = 0;
10495
10496 if (GetInventory().GetCargo() != NULL)
10497 {
10498 item_count = GetInventory().GetCargo().GetItemCount();
10499 }
10500
10501 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10502 {
10503 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10504 if (item)
10505 item_count += item.GetNumberOfItems();
10506 }
10507 return item_count;
10508 }
10509
10512 {
10513 float weight = 0;
10514 float wetness = 1;
10515 if (include_wetness)
10518 {
10519 weight = wetness * m_ConfigWeight;
10520 }
10522 {
10523 weight = 1;
10524 }
10525 return weight;
10526 }
10527
10528
10529
10531 {
10532 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10533 {
10534 GameInventory inv = GetInventory();
10535 array<EntityAI> items = new array<EntityAI>;
10537 for (int i = 0; i < items.Count(); i++)
10538 {
10540 if (item)
10541 {
10543 }
10544 }
10545 }
10546 }
10547
10548
10549
10550
10552 {
10553 float energy = 0;
10554 if (HasEnergyManager())
10555 {
10556 energy = GetCompEM().GetEnergy();
10557 }
10558 return energy;
10559 }
10560
10561
10563 {
10564 super.OnEnergyConsumed();
10565
10567 }
10568
10570 {
10571 super.OnEnergyAdded();
10572
10574 }
10575
10576
10578 {
10579 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10580 {
10582 {
10583 float energy_0to1 = GetCompEM().GetEnergy0To1();
10585 }
10586 }
10587 }
10588
10589
10591 {
10592 return ConfigGetFloat("heatIsolation");
10593 }
10594
10596 {
10598 }
10599
10601 {
10602 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10603 if (
GetGame().ConfigIsExisting(paramPath))
10605
10606 return 0.0;
10607 }
10608
10610 {
10611 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10612 if (
GetGame().ConfigIsExisting(paramPath))
10614
10615 return 0.0;
10616 }
10617
10618 override void SetWet(
float value,
bool allow_client =
false)
10619 {
10620 if (!IsServerCheck(allow_client))
10621 return;
10622
10625
10627
10628 m_VarWet = Math.Clamp(value, min, max);
10629
10631 {
10634 }
10635 }
10636
10637 override void AddWet(
float value)
10638 {
10640 }
10641
10643 {
10645 }
10646
10648 {
10650 }
10651
10653 {
10655 }
10656
10658 {
10660 }
10661
10663 {
10665 }
10666
10667 override void OnWetChanged(
float newVal,
float oldVal)
10668 {
10671 if (newLevel != oldLevel)
10672 {
10674 }
10675 }
10676
10678 {
10679 SetWeightDirty();
10680 }
10681
10683 {
10684 return GetWetLevelInternal(
m_VarWet);
10685 }
10686
10687
10688
10690 {
10692 }
10693
10695 {
10697 }
10698
10700 {
10702 }
10703
10705 {
10707 }
10708
10709
10710
10712 {
10713 if (ConfigIsExisting("itemModelLength"))
10714 {
10715 return ConfigGetFloat("itemModelLength");
10716 }
10717 return 0;
10718 }
10719
10721 {
10722 if (ConfigIsExisting("itemAttachOffset"))
10723 {
10724 return ConfigGetFloat("itemAttachOffset");
10725 }
10726 return 0;
10727 }
10728
10729 override void SetCleanness(
int value,
bool allow_client =
false)
10730 {
10731 if (!IsServerCheck(allow_client))
10732 return;
10733
10735
10737
10740 }
10741
10743 {
10745 }
10746
10748 {
10749 return true;
10750 }
10751
10752
10753
10754
10756 {
10758 }
10759
10761 {
10763 }
10764
10765
10766
10767
10768 override void SetColor(
int r,
int g,
int b,
int a)
10769 {
10775 }
10777 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10778 {
10783 }
10784
10786 {
10788 }
10789
10792 {
10793 int r,g,b,a;
10795 r = r/255;
10796 g = g/255;
10797 b = b/255;
10798 a = a/255;
10799 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10800 }
10801
10802
10803
10804 override void SetLiquidType(
int value,
bool allow_client =
false)
10805 {
10806 if (!IsServerCheck(allow_client))
10807 return;
10808
10813 }
10814
10816 {
10817 return ConfigGetInt("varLiquidTypeInit");
10818 }
10819
10821 {
10823 }
10824
10826 {
10828 SetFrozen(false);
10829 }
10830
10833 {
10834 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10835 }
10836
10837
10840 {
10841 PlayerBase nplayer;
10842 if (PlayerBase.CastTo(nplayer, player))
10843 {
10845
10846 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10847 }
10848 }
10849
10850
10853 {
10854 PlayerBase nplayer;
10855 if (PlayerBase.CastTo(nplayer,player))
10856 {
10857
10858 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10859
10860 }
10861
10862
10863 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10864
10865
10866 if (HasEnergyManager())
10867 {
10868 GetCompEM().UpdatePlugState();
10869 }
10870 }
10871
10872
10874 {
10875 super.OnPlacementStarted(player);
10876
10878 }
10879
10880 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10881 {
10883 {
10884 m_AdminLog.OnPlacementComplete(player,
this);
10885 }
10886
10887 super.OnPlacementComplete(player, position, orientation);
10888 }
10889
10890
10891
10892
10893
10895 {
10897 {
10898 return true;
10899 }
10900 else
10901 {
10902 return false;
10903 }
10904 }
10905
10906
10908 {
10910 {
10912 }
10913 }
10914
10915
10917 {
10919 }
10920
10922 {
10924 }
10925
10926 override void InsertAgent(
int agent,
float count = 1)
10927 {
10928 if (count < 1)
10929 return;
10930
10932 }
10933
10936 {
10938 }
10939
10940
10942 {
10944 }
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10988 {
10990 return false;
10991 return true;
10992 }
10993
10995 {
10996
10998 }
10999
11000
11003 {
11004 super.CheckForRoofLimited(timeTresholdMS);
11005
11007 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11008 {
11009 m_PreviousRoofTestTime = time;
11010 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11011 }
11012 }
11013
11014
11016 {
11018 {
11019 return 0;
11020 }
11021
11022 if (GetInventory().GetAttachmentSlotsCount() != 0)
11023 {
11024 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11025 if (filter)
11026 return filter.GetProtectionLevel(type, false, system);
11027 else
11028 return 0;
11029 }
11030
11031 string subclassPath, entryName;
11032
11033 switch (type)
11034 {
11036 entryName = "biological";
11037 break;
11039 entryName = "chemical";
11040 break;
11041 default:
11042 entryName = "biological";
11043 break;
11044 }
11045
11046 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11047
11049 }
11050
11051
11052
11055 {
11056 if (!IsMagazine())
11058
11060 }
11061
11062
11063
11064
11065
11070 {
11071 return true;
11072 }
11073
11075 {
11077 }
11078
11079
11080
11081
11082
11084 {
11085 if (parent)
11086 {
11087 if (parent.IsInherited(DayZInfected))
11088 return true;
11089
11090 if (!parent.IsRuined())
11091 return true;
11092 }
11093
11094 return true;
11095 }
11096
11098 {
11099 if (!super.CanPutAsAttachment(parent))
11100 {
11101 return false;
11102 }
11103
11104 if (!IsRuined() && !parent.IsRuined())
11105 {
11106 return true;
11107 }
11108
11109 return false;
11110 }
11111
11113 {
11114
11115
11116
11117
11118 return super.CanReceiveItemIntoCargo(item);
11119 }
11120
11122 {
11123
11124
11125
11126
11127 GameInventory attachmentInv = attachment.GetInventory();
11129 {
11130 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11131 return false;
11132 }
11133
11134 InventoryLocation loc = new InventoryLocation();
11135 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11136 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11137 return false;
11138
11139 return super.CanReceiveAttachment(attachment, slotId);
11140 }
11141
11143 {
11144 if (!super.CanReleaseAttachment(attachment))
11145 return false;
11146
11147 return GetInventory().AreChildrenAccessible();
11148 }
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11171 {
11172 int id = muzzle_owner.GetMuzzleID();
11173 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11174
11175 if (WPOF_array)
11176 {
11177 for (int i = 0; i < WPOF_array.Count(); i++)
11178 {
11179 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11180
11181 if (WPOF)
11182 {
11183 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11184 }
11185 }
11186 }
11187 }
11188
11189
11191 {
11192 int id = muzzle_owner.GetMuzzleID();
11194
11195 if (WPOBE_array)
11196 {
11197 for (int i = 0; i < WPOBE_array.Count(); i++)
11198 {
11199 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11200
11201 if (WPOBE)
11202 {
11203 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11204 }
11205 }
11206 }
11207 }
11208
11209
11211 {
11212 int id = muzzle_owner.GetMuzzleID();
11213 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11214
11215 if (WPOOH_array)
11216 {
11217 for (int i = 0; i < WPOOH_array.Count(); i++)
11218 {
11219 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11220
11221 if (WPOOH)
11222 {
11223 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11224 }
11225 }
11226 }
11227 }
11228
11229
11231 {
11232 int id = muzzle_owner.GetMuzzleID();
11233 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11234
11235 if (WPOOH_array)
11236 {
11237 for (int i = 0; i < WPOOH_array.Count(); i++)
11238 {
11239 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11240
11241 if (WPOOH)
11242 {
11243 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11244 }
11245 }
11246 }
11247 }
11248
11249
11251 {
11252 int id = muzzle_owner.GetMuzzleID();
11253 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11254
11255 if (WPOOH_array)
11256 {
11257 for (int i = 0; i < WPOOH_array.Count(); i++)
11258 {
11259 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11260
11261 if (WPOOH)
11262 {
11263 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11264 }
11265 }
11266 }
11267 }
11268
11269
11270
11272 {
11274 {
11275 return true;
11276 }
11277
11278 return false;
11279 }
11280
11282 {
11284 {
11285 return true;
11286 }
11287
11288 return false;
11289 }
11290
11292 {
11294 {
11295 return true;
11296 }
11297
11298 return false;
11299 }
11300
11302 {
11303 return false;
11304 }
11305
11308 {
11309 return UATimeSpent.DEFAULT_DEPLOY;
11310 }
11311
11312
11313
11314
11316 {
11318 SetSynchDirty();
11319 }
11320
11322 {
11324 }
11325
11326
11328 {
11329 return false;
11330 }
11331
11334 {
11335 string att_type = "None";
11336
11337 if (ConfigIsExisting("soundAttType"))
11338 {
11339 att_type = ConfigGetString("soundAttType");
11340 }
11341
11343 }
11344
11346 {
11348 }
11349
11350
11351
11352
11353
11357
11359 {
11362
11364 }
11365
11366
11368 {
11370 return;
11371
11373
11376
11379
11380 SoundParameters params = new SoundParameters();
11384 }
11385
11386
11388 {
11390 return;
11391
11393 SetSynchDirty();
11394
11397 }
11398
11399
11401 {
11403 return;
11404
11406 SetSynchDirty();
11407
11410 }
11411
11413 {
11415 }
11416
11418 {
11420 }
11421
11424 {
11425 if (!
GetGame().IsDedicatedServer())
11426 {
11427 if (ConfigIsExisting("attachSoundSet"))
11428 {
11429 string cfg_path = "";
11430 string soundset = "";
11431 string type_name =
GetType();
11432
11435 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11436 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11437
11438 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11439 {
11440 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11441 {
11442 if (cfg_slot_array[i] == slot_type)
11443 {
11444 soundset = cfg_soundset_array[i];
11445 break;
11446 }
11447 }
11448 }
11449
11450 if (soundset != "")
11451 {
11452 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11454 }
11455 }
11456 }
11457 }
11458
11460 {
11461
11462 }
11463
11464 void OnApply(PlayerBase player);
11465
11467 {
11468 return 1.0;
11469 };
11470
11472 {
11474 }
11475
11477 {
11479 }
11480
11482
11484 {
11485 SetDynamicPhysicsLifeTime(0.01);
11487 }
11488
11490 {
11491 array<string> zone_names = new array<string>;
11492 GetDamageZones(zone_names);
11493 for (int i = 0; i < zone_names.Count(); i++)
11494 {
11495 SetHealthMax(zone_names.Get(i),"Health");
11496 }
11497 SetHealthMax("","Health");
11498 }
11499
11502 {
11503 float global_health = GetHealth01("","Health");
11504 array<string> zones = new array<string>;
11505 GetDamageZones(zones);
11506
11507 for (int i = 0; i < zones.Count(); i++)
11508 {
11509 SetHealth01(zones.Get(i),"Health",global_health);
11510 }
11511 }
11512
11515 {
11516 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11517 }
11518
11520 {
11521 if (!hasRootAsPlayer)
11522 {
11523 if (refParentIB)
11524 {
11525
11526 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11527 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11528
11529 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11530 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11531
11534 }
11535 else
11536 {
11537
11540 }
11541 }
11542 }
11543
11545 {
11547 {
11548 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11549 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11550 {
11551 float heatPermCoef = 1.0;
11553 while (ent)
11554 {
11555 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11556 ent = ent.GetHierarchyParent();
11557 }
11558
11559 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11560 }
11561 }
11562 }
11563
11565 {
11566
11567 EntityAI parent = GetHierarchyParent();
11568 if (!parent)
11569 {
11570 hasParent = false;
11571 hasRootAsPlayer = false;
11572 }
11573 else
11574 {
11575 hasParent = true;
11576 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11577 refParentIB =
ItemBase.Cast(parent);
11578 }
11579 }
11580
11581 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11582 {
11583
11584 }
11585
11587 {
11588
11589 return false;
11590 }
11591
11593 {
11594
11595
11596 return false;
11597 }
11598
11600 {
11601
11602 return false;
11603 }
11604
11607 {
11608 return !GetIsFrozen() &&
IsOpen();
11609 }
11610
11612 {
11613 bool hasParent = false, hasRootAsPlayer = false;
11615
11616 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11617 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11618
11619 if (wwtu || foodDecay)
11620 {
11624
11625 if (processWetness || processTemperature || processDecay)
11626 {
11628
11629 if (processWetness)
11630 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11631
11632 if (processTemperature)
11634
11635 if (processDecay)
11636 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11637 }
11638 }
11639 }
11640
11643 {
11645 }
11646
11648 {
11651
11652 return super.GetTemperatureFreezeThreshold();
11653 }
11654
11656 {
11659
11660 return super.GetTemperatureThawThreshold();
11661 }
11662
11664 {
11667
11668 return super.GetItemOverheatThreshold();
11669 }
11670
11672 {
11674 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11675
11676 return super.GetTemperatureFreezeTime();
11677 }
11678
11680 {
11682 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11683
11684 return super.GetTemperatureThawTime();
11685 }
11686
11691
11693 {
11694 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11695 }
11696
11698 {
11699 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11700 }
11701
11704 {
11706 }
11707
11709 {
11711 }
11712
11714 {
11716 }
11717
11720 {
11721 return null;
11722 }
11723
11726 {
11727 return false;
11728 }
11729
11731 {
11733 {
11736 if (!trg)
11737 {
11739 explosive = this;
11740 }
11741
11742 explosive.PairRemote(trg);
11744
11745 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11746 trg.SetPersistentPairID(persistentID);
11747 explosive.SetPersistentPairID(persistentID);
11748
11749 return true;
11750 }
11751 return false;
11752 }
11753
11756 {
11757 float ret = 1.0;
11760 ret *= GetHealth01();
11761
11762 return ret;
11763 }
11764
11765 #ifdef DEVELOPER
11766 override void SetDebugItem()
11767 {
11768 super.SetDebugItem();
11769 _itemBase = this;
11770 }
11771
11773 {
11774 string text = super.GetDebugText();
11775
11777 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11778
11779 return text;
11780 }
11781 #endif
11782
11784 {
11785 return true;
11786 }
11787
11789
11791
11793 {
11796 }
11797
11798
11806
11822}
11823
11825{
11827 if (entity)
11828 {
11829 bool is_item = entity.IsInherited(
ItemBase);
11830 if (is_item && full_quantity)
11831 {
11834 }
11835 }
11836 else
11837 {
11839 return NULL;
11840 }
11841 return entity;
11842}
11843
11845{
11846 if (item)
11847 {
11848 if (health > 0)
11849 item.SetHealth("", "", health);
11850
11851 if (item.CanHaveTemperature())
11852 {
11854 if (item.CanFreeze())
11855 item.SetFrozen(false);
11856 }
11857
11858 if (item.HasEnergyManager())
11859 {
11860 if (quantity >= 0)
11861 {
11862 item.GetCompEM().SetEnergy0To1(quantity);
11863 }
11864 else
11865 {
11867 }
11868 }
11869 else if (item.IsMagazine())
11870 {
11871 Magazine mag = Magazine.Cast(item);
11872 if (quantity >= 0)
11873 {
11874 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11875 }
11876 else
11877 {
11879 }
11880
11881 }
11882 else
11883 {
11884 if (quantity >= 0)
11885 {
11886 item.SetQuantityNormalized(quantity, false);
11887 }
11888 else
11889 {
11891 }
11892
11893 }
11894 }
11895}
11896
11897#ifdef DEVELOPER
11899#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.