6019{
6021 {
6022 return true;
6023 }
6024};
6025
6026
6027
6029{
6033
6035
6038
6039
6040
6041
6042
6051
6057
6062
6067
6088 protected bool m_IsResultOfSplit
6089
6091
6096
6097
6098
6100
6104
6105
6106
6108
6111
6112
6113
6119
6120
6128
6131
6132
6134
6135
6137
6138
6143
6144
6149
6150
6152
6153
6155 {
6160
6161 if (!
GetGame().IsDedicatedServer())
6162 {
6164 {
6166
6168 {
6170 }
6171 }
6172
6175 }
6176
6177 m_OldLocation = null;
6178
6180 {
6182 }
6183
6184 if (ConfigIsExisting("headSelectionsToHide"))
6185 {
6188 }
6189
6191 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6192 {
6194 }
6195
6197
6198 m_IsResultOfSplit = false;
6199
6201 }
6202
6204 {
6205 super.InitItemVariables();
6206
6212 m_Count = ConfigGetInt(
"count");
6213
6216
6221
6224
6229
6241
6245
6246
6249 if (ConfigIsExisting("canBeSplit"))
6250 {
6253 }
6254
6256 if (ConfigIsExisting("itemBehaviour"))
6258
6259
6262 RegisterNetSyncVariableInt("m_VarLiquidType");
6263 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6264
6265 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6266 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6267 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6268
6269 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6270 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6271 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6272 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6273
6274 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6275 RegisterNetSyncVariableBool("m_IsTakeable");
6276 RegisterNetSyncVariableBool("m_IsHologram");
6277
6280 {
6283 }
6284
6286
6288 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6290
6291 }
6292
6294 {
6296 }
6297
6299 {
6302 {
6307 }
6308 }
6309
6310 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6311 {
6313 {
6316 }
6317
6319 }
6320
6322 {
6328 }
6329
6331
6333 {
6335
6336 if (!action)
6337 {
6338 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6339 return;
6340 }
6341
6343 if (!ai)
6344 {
6346 return;
6347 }
6348
6350 if (!action_array)
6351 {
6352 action_array = new array<ActionBase_Basic>;
6354 }
6355 if (LogManager.IsActionLogEnable())
6356 {
6357 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6358 }
6359
6360 if (action_array.Find(action) != -1)
6361 {
6362 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6363 }
6364 else
6365 {
6366 action_array.Insert(action);
6367 }
6368 }
6369
6371 {
6373 ActionBase action = player.GetActionManager().GetAction(actionName);
6376
6377 if (action_array)
6378 {
6379 action_array.RemoveItem(action);
6380 }
6381 }
6382
6383
6384
6386 {
6387 ActionOverrideData overrideData = new ActionOverrideData();
6391
6393 if (!actionMap)
6394 {
6397 }
6398
6399 actionMap.Insert(this.
Type(), overrideData);
6400
6401 }
6402
6404
6406
6407
6409 {
6412
6415
6416 string config_to_search = "CfgVehicles";
6417 string muzzle_owner_config;
6418
6420 {
6421 if (IsInherited(Weapon))
6422 config_to_search = "CfgWeapons";
6423
6424 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6425
6426 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6427
6429
6430 if (config_OnFire_subclass_count > 0)
6431 {
6432 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6433
6434 for (int i = 0; i < config_OnFire_subclass_count; i++)
6435 {
6436 string particle_class = "";
6438 string config_OnFire_entry = config_OnFire_class + particle_class;
6439 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6440 WPOF_array.Insert(WPOF);
6441 }
6442
6443
6445 }
6446 }
6447
6449 {
6450 config_to_search = "CfgWeapons";
6451 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6452
6453 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6454
6456
6457 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6458 {
6459 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6460
6461 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6462 {
6463 string particle_class2 = "";
6465 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6466 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6467 WPOBE_array.Insert(WPOBE);
6468 }
6469
6470
6472 }
6473 }
6474 }
6475
6476
6478 {
6481
6483 {
6484 string config_to_search = "CfgVehicles";
6485
6486 if (IsInherited(Weapon))
6487 config_to_search = "CfgWeapons";
6488
6489 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6490 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6491
6492 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6493 {
6494
6496
6498 {
6500 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6502 return;
6503 }
6504
6507
6508
6509
6511 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6512
6513 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6514 {
6515 string particle_class = "";
6517 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6519
6520 if (entry_type == CT_CLASS)
6521 {
6522 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6523 WPOOH_array.Insert(WPOF);
6524 }
6525 }
6526
6527
6529 }
6530 }
6531 }
6532
6534 {
6536 }
6537
6539 {
6541 {
6543
6546
6549
6550 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6551 }
6552 }
6553
6555 {
6557 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6558
6560 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6561
6563 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6564
6566 {
6568 }
6569 }
6570
6572 {
6574 }
6575
6577 {
6580 else
6582
6584 {
6587 }
6588 else
6589 {
6592
6595 }
6596
6598 }
6599
6601 {
6603 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6604 }
6605
6607 {
6609 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6611 }
6612
6614 {
6616 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6617 }
6618
6620 {
6623
6624 OverheatingParticle OP = new OverheatingParticle();
6629
6631 }
6632
6634 {
6637
6638 return -1;
6639 }
6640
6642 {
6644 {
6647
6648 for (int i = count; i > 0; --i)
6649 {
6650 int id = i - 1;
6653
6656
6657 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6658 {
6659 if (p)
6660 {
6663 }
6664 }
6665 }
6666 }
6667 }
6668
6670 {
6672 {
6674 {
6675 int id = i - 1;
6677
6678 if (OP)
6679 {
6681
6682 if (p)
6683 {
6685 }
6686
6687 delete OP;
6688 }
6689 }
6690
6693 }
6694 }
6695
6698 {
6699 return 0.0;
6700 }
6701
6702
6704 {
6705 return 250;
6706 }
6707
6709 {
6710 return 0;
6711 }
6712
6715 {
6717 return true;
6718
6719 return false;
6720 }
6721
6724 {
6727
6729 {
6731 }
6732 else
6733 {
6734
6736 }
6737
6739 }
6740
6747 {
6748 return -1;
6749 }
6750
6751
6752
6753
6755 {
6757 {
6759 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6760
6761 if (r_index >= 0)
6762 {
6763 InventoryLocation r_il = new InventoryLocation;
6764 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6765
6766 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6769 {
6770 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6771 }
6773 {
6774 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6775 }
6776
6777 }
6778
6779 player.GetHumanInventory().ClearUserReservedLocation(this);
6780 }
6781
6784 }
6785
6786
6787
6788
6790 {
6791 return ItemBase.m_DebugActionsMask;
6792 }
6793
6795 {
6796 return ItemBase.m_DebugActionsMask & mask;
6797 }
6798
6800 {
6801 ItemBase.m_DebugActionsMask = mask;
6802 }
6803
6805 {
6806 ItemBase.m_DebugActionsMask |= mask;
6807 }
6808
6810 {
6811 ItemBase.m_DebugActionsMask &= ~mask;
6812 }
6813
6815 {
6817 {
6819 }
6820 else
6821 {
6823 }
6824 }
6825
6826
6828 {
6829 if (GetEconomyProfile())
6830 {
6831 float q_max = GetEconomyProfile().GetQuantityMax();
6832 if (q_max > 0)
6833 {
6834 float q_min = GetEconomyProfile().GetQuantityMin();
6835 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6836
6838 {
6839 ComponentEnergyManager comp = GetCompEM();
6841 {
6843 }
6844 }
6846 {
6848
6849 }
6850
6851 }
6852 }
6853 }
6854
6857 {
6858 EntityAI parent = GetHierarchyParent();
6859
6860 if (parent)
6861 {
6862 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6863 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6864 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6865 }
6866 }
6867
6870 {
6871 EntityAI parent = GetHierarchyParent();
6872
6873 if (parent)
6874 {
6875 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6876 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6877 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6878 }
6879 }
6880
6882 {
6883
6884
6885
6886
6888
6890 {
6891 if (ScriptInputUserData.CanStoreInputUserData())
6892 {
6893 ScriptInputUserData ctx = new ScriptInputUserData;
6899 ctx.
Write(use_stack_max);
6902
6904 {
6905 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6906 }
6907 }
6908 }
6909 else if (!
GetGame().IsMultiplayer())
6910 {
6912 }
6913 }
6914
6916 {
6918 }
6919
6921 {
6923 }
6924
6926 {
6928 }
6929
6931 {
6932
6933 return false;
6934 }
6935
6937 {
6938 return false;
6939 }
6940
6944 {
6945 return false;
6946 }
6947
6949 {
6950 return "";
6951 }
6952
6954
6956 {
6957 return false;
6958 }
6959
6961 {
6962 return true;
6963 }
6964
6965
6966
6968 {
6969 return true;
6970 }
6971
6973 {
6974 return true;
6975 }
6976
6978 {
6979 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6981 }
6982
6984 {
6986 }
6987
6989 {
6991 if (!is_being_placed)
6993 SetSynchDirty();
6994 }
6995
6996
6998
7000 {
7002 }
7003
7005 {
7007 }
7008
7010 {
7011 return 1;
7012 }
7013
7015 {
7016 return false;
7017 }
7018
7020 {
7022 SetSynchDirty();
7023 }
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7060 {
7061 super.OnMovedInsideCargo(container);
7062
7063 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7064 }
7065
7066 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7067 {
7068 super.EEItemLocationChanged(oldLoc,newLoc);
7069
7070 PlayerBase new_player = null;
7071 PlayerBase old_player = null;
7072
7073 if (newLoc.GetParent())
7074 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7075
7076 if (oldLoc.GetParent())
7077 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7078
7080 {
7081 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7082
7083 if (r_index >= 0)
7084 {
7085 InventoryLocation r_il = new InventoryLocation;
7086 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7087
7088 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7091 {
7092 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7093 }
7095 {
7096 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7097 }
7098
7099 }
7100 }
7101
7103 {
7104 if (new_player)
7105 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7106
7107 if (new_player == old_player)
7108 {
7109
7110 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7111 {
7113 {
7114 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7115 {
7116 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7117 }
7118 }
7119 else
7120 {
7121 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7122 }
7123 }
7124
7125 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7126 {
7127 int type = oldLoc.GetType();
7129 {
7130 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7131 }
7133 {
7134 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7135 }
7136 }
7137 if (!m_OldLocation)
7138 {
7139 m_OldLocation = new InventoryLocation;
7140 }
7141 m_OldLocation.Copy(oldLoc);
7142 }
7143 else
7144 {
7145 if (m_OldLocation)
7146 {
7147 m_OldLocation.Reset();
7148 }
7149 }
7150
7152 }
7153 else
7154 {
7155 if (new_player)
7156 {
7157 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7158 if (res_index >= 0)
7159 {
7160 InventoryLocation il = new InventoryLocation;
7161 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7163 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7166 {
7167 il.
GetParent().GetOnReleaseLock().Invoke(it);
7168 }
7170 {
7172 }
7173
7174 }
7175 }
7177 {
7178
7180 }
7181
7182 if (m_OldLocation)
7183 {
7184 m_OldLocation.Reset();
7185 }
7186 }
7187 }
7188
7189 override void EOnContact(IEntity other, Contact extra)
7190 {
7192 {
7193 int liquidType = -1;
7195 if (impactSpeed > 0.0)
7196 {
7198 #ifndef SERVER
7200 #else
7202 SetSynchDirty();
7203 #endif
7205 }
7206 }
7207
7208 #ifdef SERVER
7209 if (GetCompEM() && GetCompEM().IsPlugged())
7210 {
7211 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7212 GetCompEM().UnplugThis();
7213 }
7214 #endif
7215 }
7216
7218
7220 {
7222 }
7223
7225 {
7226
7227 }
7228
7230 {
7231 super.OnItemLocationChanged(old_owner, new_owner);
7232
7233 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7234 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7235
7236 if (!relatedPlayer && playerNew)
7237 relatedPlayer = playerNew;
7238
7239 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7240 {
7242 if (actionMgr)
7243 {
7244 ActionBase currentAction = actionMgr.GetRunningAction();
7245 if (currentAction)
7247 }
7248 }
7249
7250 Man ownerPlayerOld = null;
7251 Man ownerPlayerNew = null;
7252
7253 if (old_owner)
7254 {
7255 if (old_owner.
IsMan())
7256 {
7257 ownerPlayerOld = Man.Cast(old_owner);
7258 }
7259 else
7260 {
7261 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7262 }
7263 }
7264 else
7265 {
7267 {
7269
7270 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7271 {
7272 GetCompEM().UnplugThis();
7273 }
7274 }
7275 }
7276
7277 if (new_owner)
7278 {
7279 if (new_owner.
IsMan())
7280 {
7281 ownerPlayerNew = Man.Cast(new_owner);
7282 }
7283 else
7284 {
7285 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7286 }
7287 }
7288
7289 if (ownerPlayerOld != ownerPlayerNew)
7290 {
7291 if (ownerPlayerOld)
7292 {
7293 array<EntityAI> subItemsExit = new array<EntityAI>;
7295 for (int i = 0; i < subItemsExit.Count(); i++)
7296 {
7299 }
7300 }
7301
7302 if (ownerPlayerNew)
7303 {
7304 array<EntityAI> subItemsEnter = new array<EntityAI>;
7306 for (int j = 0; j < subItemsEnter.Count(); j++)
7307 {
7310 }
7311 }
7312 }
7313 else if (ownerPlayerNew != null)
7314 {
7315 PlayerBase nplayer;
7316 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7317 {
7318 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7320 for (int k = 0; k < subItemsUpdate.Count(); k++)
7321 {
7323 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7324 }
7325 }
7326 }
7327
7328 if (old_owner)
7329 old_owner.OnChildItemRemoved(this);
7330 if (new_owner)
7331 new_owner.OnChildItemReceived(this);
7332 }
7333
7334
7336 {
7337 super.EEDelete(parent);
7338 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7339 if (player)
7340 {
7342
7343 if (player.IsAlive())
7344 {
7345 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7346 if (r_index >= 0)
7347 {
7348 InventoryLocation r_il = new InventoryLocation;
7349 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7350
7351 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7354 {
7355 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7356 }
7358 {
7359 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7360 }
7361
7362 }
7363
7364 player.RemoveQuickBarEntityShortcut(this);
7365 }
7366 }
7367 }
7368
7370 {
7371 super.EEKilled(killer);
7372
7375 {
7376 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7377 {
7378 if (IsMagazine())
7379 {
7380 if (Magazine.Cast(this).GetAmmoCount() > 0)
7381 {
7383 }
7384 }
7385 else
7386 {
7388 }
7389 }
7390 }
7391 }
7392
7394 {
7395 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7396
7397 super.OnWasAttached(parent, slot_id);
7398
7401
7403 }
7404
7406 {
7407 super.OnWasDetached(parent, slot_id);
7408
7411 }
7412
7414 {
7415 int idx;
7418
7419 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7420 if (inventory_slots.Count() < 1)
7421 {
7422 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7423 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7424 }
7425 else
7426 {
7427 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7428 }
7429
7430 idx = inventory_slots.Find(slot);
7431 if (idx < 0)
7432 return "";
7433
7434 return attach_types.Get(idx);
7435 }
7436
7438 {
7439 int idx = -1;
7440 string slot;
7441
7444
7445 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7446 if (inventory_slots.Count() < 1)
7447 {
7448 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7449 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7450 }
7451 else
7452 {
7453 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7454 if (detach_types.Count() < 1)
7455 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7456 }
7457
7458 for (int i = 0; i < inventory_slots.Count(); i++)
7459 {
7460 slot = inventory_slots.Get(i);
7461 }
7462
7463 if (slot != "")
7464 {
7465 if (detach_types.Count() == 1)
7466 idx = 0;
7467 else
7468 idx = inventory_slots.Find(slot);
7469 }
7470 if (idx < 0)
7471 return "";
7472
7473 return detach_types.Get(idx);
7474 }
7475
7477 {
7478
7480
7481
7482 float min_time = 1;
7483 float max_time = 3;
7484 float delay = Math.RandomFloat(min_time, max_time);
7485
7486 explode_timer.Run(delay, this, "DoAmmoExplosion");
7487 }
7488
7490 {
7491 Magazine magazine = Magazine.Cast(this);
7492 int pop_sounds_count = 6;
7493 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7494
7495
7496 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7497 string sound_name = pop_sounds[ sound_idx ];
7499
7500
7501 magazine.ServerAddAmmoCount(-1);
7502
7503
7504 float min_temp_to_explode = 100;
7505
7506 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7507 {
7509 }
7510 }
7511
7512
7513 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7514 {
7515 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7516
7517 const int CHANCE_DAMAGE_CARGO = 4;
7518 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7519 const int CHANCE_DAMAGE_NOTHING = 2;
7520
7522 {
7523 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7524 int chances;
7525 int rnd;
7526
7527 if (GetInventory().GetCargo())
7528 {
7529 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7530 rnd = Math.RandomInt(0,chances);
7531
7532 if (rnd < CHANCE_DAMAGE_CARGO)
7533 {
7535 }
7536 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7537 {
7539 }
7540 }
7541 else
7542 {
7543 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7544 rnd = Math.RandomInt(0,chances);
7545
7546 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7547 {
7549 }
7550 }
7551 }
7552 }
7553
7555 {
7556 if (GetInventory().GetCargo())
7557 {
7558 int item_count = GetInventory().GetCargo().GetItemCount();
7559 if (item_count > 0)
7560 {
7561 int random_pick = Math.RandomInt(0, item_count);
7563 if (!item.IsExplosive())
7564 {
7565 item.AddHealth("","",damage);
7566 return true;
7567 }
7568 }
7569 }
7570 return false;
7571 }
7572
7574 {
7575 int attachment_count = GetInventory().AttachmentCount();
7576 if (attachment_count > 0)
7577 {
7578 int random_pick = Math.RandomInt(0, attachment_count);
7579 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7580 if (!attachment.IsExplosive())
7581 {
7582 attachment.AddHealth("","",damage);
7583 return true;
7584 }
7585 }
7586 return false;
7587 }
7588
7590 {
7592 }
7593
7595 {
7597 return GetInventory().CanRemoveEntity();
7598
7599 return false;
7600 }
7601
7603 {
7604
7606 return false;
7607
7608
7610 return false;
7611
7612
7613
7615 if (delta == 0)
7616 return false;
7617
7618
7619 return true;
7620 }
7621
7623 {
7625 {
7626 if (ScriptInputUserData.CanStoreInputUserData())
7627 {
7628 ScriptInputUserData ctx = new ScriptInputUserData;
7633 ctx.
Write(destination_entity);
7637 }
7638 }
7639 else if (!
GetGame().IsMultiplayer())
7640 {
7642 }
7643 }
7644
7646 {
7647 float split_quantity_new;
7651 InventoryLocation loc = new InventoryLocation;
7652
7653 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7654 {
7656 split_quantity_new = stack_max;
7657 else
7659
7661 {
7662 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7663 if (new_item)
7664 {
7665 new_item.SetResultOfSplit(true);
7666 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7668 new_item.
SetQuantity(split_quantity_new,
false,
true);
7669 }
7670 }
7671 }
7672 else if (destination_entity && slot_id == -1)
7673 {
7674 if (quantity > stack_max)
7675 split_quantity_new = stack_max;
7676 else
7677 split_quantity_new = quantity;
7678
7680 {
7682 {
7685 }
7686
7687 if (new_item)
7688 {
7689 new_item.SetResultOfSplit(true);
7690 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7692 new_item.
SetQuantity(split_quantity_new,
false,
true);
7693 }
7694 }
7695 }
7696 else
7697 {
7698 if (stack_max != 0)
7699 {
7701 {
7703 }
7704
7705 if (split_quantity_new == 0)
7706 {
7707 if (!
GetGame().IsMultiplayer())
7708 player.PhysicalPredictiveDropItem(this);
7709 else
7710 player.ServerDropEntity(this);
7711 return;
7712 }
7713
7715 {
7717
7718 if (new_item)
7719 {
7720 new_item.SetResultOfSplit(true);
7721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7724 new_item.PlaceOnSurface();
7725 }
7726 }
7727 }
7728 }
7729 }
7730
7732 {
7733 float split_quantity_new;
7737 InventoryLocation loc = new InventoryLocation;
7738
7739 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7740 {
7742 split_quantity_new = stack_max;
7743 else
7745
7747 {
7748 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7749 if (new_item)
7750 {
7751 new_item.SetResultOfSplit(true);
7752 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7754 new_item.
SetQuantity(split_quantity_new,
false,
true);
7755 }
7756 }
7757 }
7758 else if (destination_entity && slot_id == -1)
7759 {
7760 if (quantity > stack_max)
7761 split_quantity_new = stack_max;
7762 else
7763 split_quantity_new = quantity;
7764
7766 {
7768 {
7771 }
7772
7773 if (new_item)
7774 {
7775 new_item.SetResultOfSplit(true);
7776 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7778 new_item.
SetQuantity(split_quantity_new,
false,
true);
7779 }
7780 }
7781 }
7782 else
7783 {
7784 if (stack_max != 0)
7785 {
7787 {
7789 }
7790
7792 {
7794
7795 if (new_item)
7796 {
7797 new_item.SetResultOfSplit(true);
7798 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7801 new_item.PlaceOnSurface();
7802 }
7803 }
7804 }
7805 }
7806 }
7807
7809 {
7811 {
7812 if (ScriptInputUserData.CanStoreInputUserData())
7813 {
7814 ScriptInputUserData ctx = new ScriptInputUserData;
7819 dst.WriteToContext(ctx);
7821 }
7822 }
7823 else if (!
GetGame().IsMultiplayer())
7824 {
7826 }
7827 }
7828
7830 {
7832 {
7833 if (ScriptInputUserData.CanStoreInputUserData())
7834 {
7835 ScriptInputUserData ctx = new ScriptInputUserData;
7840 ctx.
Write(destination_entity);
7846 }
7847 }
7848 else if (!
GetGame().IsMultiplayer())
7849 {
7851 }
7852 }
7853
7855 {
7857 }
7858
7860 {
7862 float split_quantity_new;
7864 if (dst.IsValid())
7865 {
7866 int slot_id = dst.GetSlot();
7868
7869 if (quantity > stack_max)
7870 split_quantity_new = stack_max;
7871 else
7872 split_quantity_new = quantity;
7873
7875 {
7877
7878 if (new_item)
7879 {
7880 new_item.SetResultOfSplit(true);
7881 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7883 new_item.
SetQuantity(split_quantity_new,
false,
true);
7884 }
7885
7886 return new_item;
7887 }
7888 }
7889
7890 return null;
7891 }
7892
7894 {
7896 float split_quantity_new;
7898 if (destination_entity)
7899 {
7901 if (quantity > stackable)
7902 split_quantity_new = stackable;
7903 else
7904 split_quantity_new = quantity;
7905
7907 {
7908 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7909 if (new_item)
7910 {
7911 new_item.SetResultOfSplit(true);
7912 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7914 new_item.
SetQuantity(split_quantity_new,
false,
true);
7915 }
7916 }
7917 }
7918 }
7919
7921 {
7923 {
7924 if (ScriptInputUserData.CanStoreInputUserData())
7925 {
7926 ScriptInputUserData ctx = new ScriptInputUserData;
7931 ItemBase destination_entity =
this;
7932 ctx.
Write(destination_entity);
7936 }
7937 }
7938 else if (!
GetGame().IsMultiplayer())
7939 {
7941 }
7942 }
7943
7945 {
7947 float split_quantity_new;
7949 if (player)
7950 {
7952 if (quantity > stackable)
7953 split_quantity_new = stackable;
7954 else
7955 split_quantity_new = quantity;
7956
7958 {
7959 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7960 new_item =
ItemBase.Cast(in_hands);
7961 if (new_item)
7962 {
7963 new_item.SetResultOfSplit(true);
7964 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7966 new_item.SetQuantity(split_quantity_new, false, true);
7967 }
7968 }
7969 }
7970 }
7971
7973 {
7975 float split_quantity_new = Math.Floor(quantity * 0.5);
7976
7978 return;
7979
7981
7982 if (new_item)
7983 {
7984 if (new_item.GetQuantityMax() < split_quantity_new)
7985 {
7986 split_quantity_new = new_item.GetQuantityMax();
7987 }
7988
7989 new_item.SetResultOfSplit(true);
7990 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7991
7993 {
7996 }
7997 else
7998 {
8000 new_item.
SetQuantity(split_quantity_new,
false,
true);
8001 }
8002 }
8003 }
8004
8006 {
8008 float split_quantity_new = Math.Floor(quantity / 2);
8009
8011 return;
8012
8013 InventoryLocation invloc = new InventoryLocation;
8015
8017 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8018
8019 if (new_item)
8020 {
8021 if (new_item.GetQuantityMax() < split_quantity_new)
8022 {
8023 split_quantity_new = new_item.GetQuantityMax();
8024 }
8026 {
8029 }
8030 else if (split_quantity_new > 1)
8031 {
8033 new_item.
SetQuantity(split_quantity_new,
false,
true);
8034 }
8035 }
8036 }
8037
8040 {
8041 SetWeightDirty();
8043
8044 if (parent)
8045 parent.OnAttachmentQuantityChangedEx(this, delta);
8046
8048 {
8050 {
8052 }
8054 {
8055 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8057 }
8058 }
8059
8060 }
8061
8064 {
8065
8066 }
8067
8070 {
8072 }
8073
8075 {
8076 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8077
8079 {
8080 if (newLevel == GameConstants.STATE_RUINED)
8081 {
8083 EntityAI parent = GetHierarchyParent();
8084 if (parent && parent.IsFireplace())
8085 {
8086 CargoBase cargo = GetInventory().GetCargo();
8087 if (cargo)
8088 {
8090 {
8092 }
8093 }
8094 }
8095 }
8096
8098 {
8099
8101 return;
8102 }
8103
8104 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8105 {
8107 }
8108 }
8109 }
8110
8111
8113 {
8114 super.OnRightClick();
8115
8117 {
8119 {
8120 if (ScriptInputUserData.CanStoreInputUserData())
8121 {
8122 EntityAI root = GetHierarchyRoot();
8123 Man playerOwner = GetHierarchyRootPlayer();
8124 InventoryLocation dst = new InventoryLocation;
8125
8126
8127 if (!playerOwner && root && root == this)
8128 {
8130 }
8131 else
8132 {
8133
8134 GetInventory().GetCurrentInventoryLocation(dst);
8136 {
8139 {
8141 }
8142 else
8143 {
8145
8146
8147 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8148 {
8150 }
8151 else
8152 {
8153 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8154 }
8155 }
8156 }
8157 }
8158
8159 ScriptInputUserData ctx = new ScriptInputUserData;
8167 }
8168 }
8169 else if (!
GetGame().IsMultiplayer())
8170 {
8172 }
8173 }
8174 }
8175
8177 {
8178 if (root)
8179 {
8180 vector m4[4];
8181 root.GetTransform(m4);
8182 dst.SetGround(this, m4);
8183 }
8184 else
8185 {
8186 GetInventory().GetCurrentInventoryLocation(dst);
8187 }
8188 }
8189
8190 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8191 {
8192
8193 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8194 return false;
8195
8196 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8197 return false;
8198
8199
8201 return false;
8202
8203
8204 Magazine mag = Magazine.Cast(this);
8205 if (mag)
8206 {
8207 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8208 return false;
8209
8210 if (stack_max_limit)
8211 {
8212 Magazine other_mag = Magazine.Cast(other_item);
8213 if (other_item)
8214 {
8215 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8216 return false;
8217 }
8218
8219 }
8220 }
8221 else
8222 {
8223
8225 return false;
8226
8228 return false;
8229 }
8230
8231 PlayerBase player = null;
8232 if (CastTo(player, GetHierarchyRootPlayer()))
8233 {
8234 if (player.GetInventory().HasAttachment(this))
8235 return false;
8236
8237 if (player.IsItemsToDelete())
8238 return false;
8239 }
8240
8241 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8242 return false;
8243
8244 int slotID;
8246 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8247 return false;
8248
8249 return true;
8250 }
8251
8253 {
8255 }
8256
8258 {
8259 return m_IsResultOfSplit;
8260 }
8261
8263 {
8264 m_IsResultOfSplit = value;
8265 }
8266
8268 {
8270 }
8271
8273 {
8274 float other_item_quantity = other_item.GetQuantity();
8275 float this_free_space;
8276
8278
8280
8281 if (other_item_quantity > this_free_space)
8282 {
8283 return this_free_space;
8284 }
8285 else
8286 {
8287 return other_item_quantity;
8288 }
8289 }
8290
8292 {
8294 }
8295
8297 {
8299 return;
8300
8301 if (!IsMagazine() && other_item)
8302 {
8304 if (quantity_used != 0)
8305 {
8306 float hp1 = GetHealth01("","");
8307 float hp2 = other_item.GetHealth01("","");
8308 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8309 hpResult = hpResult / (
GetQuantity() + quantity_used);
8310
8311 hpResult *= GetMaxHealth();
8312 Math.Round(hpResult);
8313 SetHealth("", "Health", hpResult);
8314
8316 other_item.AddQuantity(-quantity_used);
8317 }
8318 }
8320 }
8321
8323 {
8324 #ifdef SERVER
8325 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8326 GetHierarchyParent().IncreaseLifetimeUp();
8327 #endif
8328 };
8329
8331 {
8332 PlayerBase p = PlayerBase.Cast(player);
8333
8334 array<int> recipesIds = p.m_Recipes;
8335 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8336 if (moduleRecipesManager)
8337 {
8338 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8339 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8340 }
8341
8342 for (int i = 0;i < recipesIds.Count(); i++)
8343 {
8344 int key = recipesIds.Get(i);
8345 string recipeName = moduleRecipesManager.GetRecipeName(key);
8347 }
8348 }
8349
8350
8351 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8352 {
8353 super.GetDebugActions(outputList);
8354
8355
8361
8362
8367
8372
8373
8377
8378
8380 {
8384 }
8385
8388
8389
8393
8395
8396 InventoryLocation loc = new InventoryLocation();
8397 GetInventory().GetCurrentInventoryLocation(loc);
8399 {
8400 if (Gizmo_IsSupported())
8403 }
8404
8406 }
8407
8408
8409
8410
8412 {
8413 super.OnAction(action_id, player, ctx);
8414
8416 {
8417 switch (action_id)
8418 {
8421 return true;
8424 return true;
8425 }
8426 }
8427
8429 {
8430 switch (action_id)
8431 {
8433 Delete();
8434 return true;
8435 }
8436 }
8437
8438 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8439 {
8440 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8441 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8442 PlayerBase p = PlayerBase.Cast(player);
8443 if (
EActions.RECIPES_RANGE_START < 1000)
8444 {
8445 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8446 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8447 }
8448 }
8449 #ifndef SERVER
8450 else if (action_id ==
EActions.WATCH_PLAYER)
8451 {
8452 PluginDeveloper.SetDeveloperItemClientEx(player);
8453 }
8454 #endif
8456 {
8457 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8458 {
8459 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8460 OnDebugButtonPressServer(id + 1);
8461 }
8462
8463 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8464 {
8465 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8467 }
8468
8469 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8470 {
8471 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8473 }
8474
8475 else if (action_id ==
EActions.ADD_QUANTITY)
8476 {
8477 if (IsMagazine())
8478 {
8479 Magazine mag = Magazine.Cast(this);
8480 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8481 }
8482 else
8483 {
8485 }
8486
8487 if (m_EM)
8488 {
8489 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8490 }
8491
8492 }
8493
8494 else if (action_id ==
EActions.REMOVE_QUANTITY)
8495 {
8496 if (IsMagazine())
8497 {
8498 Magazine mag2 = Magazine.Cast(this);
8499 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8500 }
8501 else
8502 {
8504 }
8505 if (m_EM)
8506 {
8507 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8508 }
8509
8510 }
8511
8512 else if (action_id ==
EActions.SET_QUANTITY_0)
8513 {
8515
8516 if (m_EM)
8517 {
8518 m_EM.SetEnergy(0);
8519 }
8520 }
8521
8522 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8523 {
8525
8526 if (m_EM)
8527 {
8528 m_EM.SetEnergy(m_EM.GetEnergyMax());
8529 }
8530 }
8531
8532 else if (action_id ==
EActions.ADD_HEALTH)
8533 {
8534 AddHealth("","",GetMaxHealth("","Health")/5);
8535 }
8536 else if (action_id ==
EActions.REMOVE_HEALTH)
8537 {
8538 AddHealth("","",-GetMaxHealth("","Health")/5);
8539 }
8540 else if (action_id ==
EActions.DESTROY_HEALTH)
8541 {
8542 SetHealth01("","",0);
8543 }
8544 else if (action_id ==
EActions.WATCH_ITEM)
8545 {
8547 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8548 #ifdef DEVELOPER
8549 SetDebugDeveloper_item(this);
8550 #endif
8551 }
8552
8553 else if (action_id ==
EActions.ADD_TEMPERATURE)
8554 {
8555 AddTemperature(20);
8556
8557 }
8558
8559 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8560 {
8561 AddTemperature(-20);
8562
8563 }
8564
8565 else if (action_id ==
EActions.FLIP_FROZEN)
8566 {
8567 SetFrozen(!GetIsFrozen());
8568
8569 }
8570
8571 else if (action_id ==
EActions.ADD_WETNESS)
8572 {
8574
8575 }
8576
8577 else if (action_id ==
EActions.REMOVE_WETNESS)
8578 {
8580
8581 }
8582
8583 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8584 {
8587
8588
8589 }
8590
8591 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8592 {
8595 }
8596
8597 else if (action_id ==
EActions.MAKE_SPECIAL)
8598 {
8599 auto debugParams = DebugSpawnParams.WithPlayer(player);
8600 OnDebugSpawnEx(debugParams);
8601 }
8602
8603 }
8604
8605
8606 return false;
8607 }
8608
8609
8610
8611
8615
8618
8619
8620
8622 {
8623 return false;
8624 }
8625
8626
8628 {
8629 return true;
8630 }
8631
8632
8634 {
8635 return true;
8636 }
8637
8638
8639
8641 {
8642 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8644 }
8645
8648 {
8649 return null;
8650 }
8651
8653 {
8654 return false;
8655 }
8656
8658 {
8659 return false;
8660 }
8661
8665
8666
8668 {
8669 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8670 return module_repairing.CanRepair(this, item_repair_kit);
8671 }
8672
8673
8674 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8675 {
8676 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8677 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8678 }
8679
8680
8682 {
8683
8684
8685
8686
8687
8688
8689
8690
8691 return 1;
8692 }
8693
8694
8695
8697 {
8699 }
8700
8701
8702
8704 {
8706 }
8707
8708
8717 {
8718 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8719
8720 if (player)
8721 {
8722 player.MessageStatus(text);
8723 }
8724 }
8725
8726
8735 {
8736 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8737
8738 if (player)
8739 {
8740 player.MessageAction(text);
8741 }
8742 }
8743
8744
8753 {
8754 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8755
8756 if (player)
8757 {
8758 player.MessageFriendly(text);
8759 }
8760 }
8761
8762
8771 {
8772 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8773
8774 if (player)
8775 {
8776 player.MessageImportant(text);
8777 }
8778 }
8779
8781 {
8782 return true;
8783 }
8784
8785
8786 override bool KindOf(
string tag)
8787 {
8788 bool found = false;
8789 string item_name = this.
GetType();
8792
8793 int array_size = item_tag_array.Count();
8794 for (int i = 0; i < array_size; i++)
8795 {
8796 if (item_tag_array.Get(i) == tag)
8797 {
8798 found = true;
8799 break;
8800 }
8801 }
8802 return found;
8803 }
8804
8805
8807 {
8808
8809 super.OnRPC(sender, rpc_type,ctx);
8810
8811
8812 switch (rpc_type)
8813 {
8814 #ifndef SERVER
8815 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8816 Param2<bool, string> p = new Param2<bool, string>(false, "");
8817
8819 return;
8820
8821 bool play = p.param1;
8822 string soundSet = p.param2;
8823
8824 if (play)
8825 {
8827 {
8829 {
8831 }
8832 }
8833 else
8834 {
8836 }
8837 }
8838 else
8839 {
8841 }
8842
8843 break;
8844 #endif
8845
8846 }
8847
8849 {
8851 }
8852 }
8853
8854
8855
8856
8858 {
8859 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8860 return plugin.GetID(
name);
8861 }
8862
8864 {
8865 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8866 return plugin.GetName(id);
8867 }
8868
8871 {
8872
8873
8874 int varFlags;
8875 if (!ctx.
Read(varFlags))
8876 return;
8877
8878 if (varFlags & ItemVariableFlags.FLOAT)
8879 {
8881 }
8882 }
8883
8885 {
8886
8887 super.SerializeNumericalVars(floats_out);
8888
8889
8890
8892 {
8894 }
8895
8897 {
8899 }
8900
8902 {
8904 }
8905
8907 {
8912 }
8913
8915 {
8917 }
8918 }
8919
8921 {
8922
8923 super.DeSerializeNumericalVars(floats);
8924
8925
8926 int index = 0;
8927 int mask = Math.Round(floats.Get(index));
8928
8929 index++;
8930
8932 {
8934 {
8936 }
8937 else
8938 {
8939 float quantity = floats.Get(index);
8941 }
8942 index++;
8943 }
8944
8946 {
8947 float wet = floats.Get(index);
8949 index++;
8950 }
8951
8953 {
8954 int liquidtype = Math.Round(floats.Get(index));
8956 index++;
8957 }
8958
8960 {
8962 index++;
8964 index++;
8966 index++;
8968 index++;
8969 }
8970
8972 {
8973 int cleanness = Math.Round(floats.Get(index));
8975 index++;
8976 }
8977 }
8978
8980 {
8981 super.WriteVarsToCTX(ctx);
8982
8983
8985 {
8987 }
8988
8990 {
8992 }
8993
8995 {
8997 }
8998
9000 {
9001 int r,g,b,a;
9007 }
9008
9010 {
9012 }
9013 }
9014
9016 {
9017 if (!super.ReadVarsFromCTX(ctx,version))
9018 return false;
9019
9020 int intValue;
9021 float value;
9022
9023 if (version < 140)
9024 {
9025 if (!ctx.
Read(intValue))
9026 return false;
9027
9028 m_VariablesMask = intValue;
9029 }
9030
9032 {
9033 if (!ctx.
Read(value))
9034 return false;
9035
9037 {
9039 }
9040 else
9041 {
9043 }
9044 }
9045
9046 if (version < 140)
9047 {
9049 {
9050 if (!ctx.
Read(value))
9051 return false;
9052 SetTemperatureDirect(value);
9053 }
9054 }
9055
9057 {
9058 if (!ctx.
Read(value))
9059 return false;
9061 }
9062
9064 {
9065 if (!ctx.
Read(intValue))
9066 return false;
9068 }
9069
9071 {
9072 int r,g,b,a;
9074 return false;
9076 return false;
9078 return false;
9080 return false;
9081
9083 }
9084
9086 {
9087 if (!ctx.
Read(intValue))
9088 return false;
9090 }
9091
9092 if (version >= 138 && version < 140)
9093 {
9095 {
9096 if (!ctx.
Read(intValue))
9097 return false;
9098 SetFrozen(intValue);
9099 }
9100 }
9101
9102 return true;
9103 }
9104
9105
9107 {
9110 {
9112 }
9113
9114 if (!super.OnStoreLoad(ctx, version))
9115 {
9117 return false;
9118 }
9119
9120 if (version >= 114)
9121 {
9122 bool hasQuickBarIndexSaved;
9123
9124 if (!ctx.
Read(hasQuickBarIndexSaved))
9125 {
9127 return false;
9128 }
9129
9130 if (hasQuickBarIndexSaved)
9131 {
9132 int itmQBIndex;
9133
9134
9135 if (!ctx.
Read(itmQBIndex))
9136 {
9138 return false;
9139 }
9140
9141 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9142 if (itmQBIndex != -1 && parentPlayer)
9143 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9144 }
9145 }
9146 else
9147 {
9148
9149 PlayerBase player;
9150 int itemQBIndex;
9151 if (version ==
int.
MAX)
9152 {
9153 if (!ctx.
Read(itemQBIndex))
9154 {
9156 return false;
9157 }
9158 }
9159 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9160 {
9161
9162 if (!ctx.
Read(itemQBIndex))
9163 {
9165 return false;
9166 }
9167 if (itemQBIndex != -1 && player)
9168 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9169 }
9170 }
9171
9172 if (version < 140)
9173 {
9174
9175 if (!LoadVariables(ctx, version))
9176 {
9178 return false;
9179 }
9180 }
9181
9182
9184 {
9186 return false;
9187 }
9188 if (version >= 132)
9189 {
9191 if (raib)
9192 {
9194 {
9196 return false;
9197 }
9198 }
9199 }
9200
9202 return true;
9203 }
9204
9205
9206
9208 {
9209 super.OnStoreSave(ctx);
9210
9211 PlayerBase player;
9212 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9213 {
9215
9216 int itemQBIndex = -1;
9217 itemQBIndex = player.FindQuickBarEntityIndex(this);
9218 ctx.
Write(itemQBIndex);
9219 }
9220 else
9221 {
9223 }
9224
9226
9228 if (raib)
9229 {
9231 }
9232 }
9233
9234
9236 {
9237 super.AfterStoreLoad();
9238
9240 {
9242 }
9243
9245 {
9248 }
9249 }
9250
9252 {
9253 super.EEOnAfterLoad();
9254
9256 {
9258 }
9259
9262 }
9263
9265 {
9266 return false;
9267 }
9268
9269
9270
9272 {
9274 {
9275 #ifdef PLATFORM_CONSOLE
9276
9278 {
9280 if (menu)
9281 {
9283 }
9284 }
9285 #endif
9286 }
9287
9289 {
9292 }
9293
9295 {
9296 SetWeightDirty();
9298 }
9300 {
9303 }
9304
9306 {
9309 }
9311 {
9314 }
9315
9316 super.OnVariablesSynchronized();
9317 }
9318
9319
9320
9322 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9323 {
9324 if (!IsServerCheck(allow_client))
9325 return false;
9326
9328 return false;
9329
9332
9333 if (value <= (min + 0.001))
9334 value = min;
9335
9336 if (value == min)
9337 {
9338 if (destroy_config)
9339 {
9340 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9341 if (dstr)
9342 {
9344 this.Delete();
9345 return true;
9346 }
9347 }
9348 else if (destroy_forced)
9349 {
9351 this.Delete();
9352 return true;
9353 }
9354
9356 }
9357
9360
9362 {
9364
9365 if (delta)
9367 }
9368
9370
9371 return false;
9372 }
9373
9374
9376 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9377 {
9379 }
9380
9382 {
9385 }
9386
9388 {
9391 }
9392
9394 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9395 {
9396 float value_clamped = Math.Clamp(value, 0, 1);
9398 SetQuantity(result, destroy_config, destroy_forced);
9399 }
9400
9401
9404 {
9406 }
9407
9409 {
9411 }
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9423 {
9424 int slot = -1;
9425 if (GetInventory())
9426 {
9427 InventoryLocation il = new InventoryLocation;
9428 GetInventory().GetCurrentInventoryLocation(il);
9430 }
9431
9433 }
9434
9436 {
9437 float quantity_max = 0;
9438
9440 {
9441 if (attSlotID != -1)
9442 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9443
9444 if (quantity_max <= 0)
9446 }
9447
9448 if (quantity_max <= 0)
9450
9451 return quantity_max;
9452 }
9453
9455 {
9457 }
9458
9460 {
9462 }
9463
9464
9466 {
9468 }
9469
9471 {
9473 }
9474
9476 {
9478 }
9479
9480
9482 {
9483
9484 float weightEx = GetWeightEx();
9485 float special = GetInventoryAndCargoWeight();
9486 return weightEx - special;
9487 }
9488
9489
9491 {
9493 }
9494
9496 {
9498 {
9499 #ifdef DEVELOPER
9500 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9501 {
9502 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9504 }
9505 #endif
9506
9508 }
9509 else if (HasEnergyManager())
9510 {
9511 #ifdef DEVELOPER
9512 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9513 {
9514 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9515 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9516 }
9517 #endif
9518 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9519 }
9520 else
9521 {
9522 #ifdef DEVELOPER
9523 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9524 {
9525 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9526 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9527 }
9528 #endif
9529 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9530 }
9531 }
9532
9535 {
9536 int item_count = 0;
9538
9539 if (GetInventory().GetCargo() != NULL)
9540 {
9541 item_count = GetInventory().GetCargo().GetItemCount();
9542 }
9543
9544 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9545 {
9546 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9547 if (item)
9548 item_count += item.GetNumberOfItems();
9549 }
9550 return item_count;
9551 }
9552
9555 {
9556 float weight = 0;
9557 float wetness = 1;
9558 if (include_wetness)
9561 {
9562 weight = wetness * m_ConfigWeight;
9563 }
9565 {
9566 weight = 1;
9567 }
9568 return weight;
9569 }
9570
9571
9572
9574 {
9575 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9576 {
9577 GameInventory inv = GetInventory();
9578 array<EntityAI> items = new array<EntityAI>;
9580 for (int i = 0; i < items.Count(); i++)
9581 {
9583 if (item)
9584 {
9586 }
9587 }
9588 }
9589 }
9590
9591
9592
9593
9595 {
9596 float energy = 0;
9597 if (HasEnergyManager())
9598 {
9599 energy = GetCompEM().GetEnergy();
9600 }
9601 return energy;
9602 }
9603
9604
9606 {
9607 super.OnEnergyConsumed();
9608
9610 }
9611
9613 {
9614 super.OnEnergyAdded();
9615
9617 }
9618
9619
9621 {
9622 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9623 {
9625 {
9626 float energy_0to1 = GetCompEM().GetEnergy0To1();
9628 }
9629 }
9630 }
9631
9632
9634 {
9635 return ConfigGetFloat("heatIsolation");
9636 }
9637
9639 {
9641 }
9642
9644 {
9645 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9646 if (
GetGame().ConfigIsExisting(paramPath))
9648
9649 return 0.0;
9650 }
9651
9653 {
9654 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9655 if (
GetGame().ConfigIsExisting(paramPath))
9657
9658 return 0.0;
9659 }
9660
9661 override void SetWet(
float value,
bool allow_client =
false)
9662 {
9663 if (!IsServerCheck(allow_client))
9664 return;
9665
9668
9670
9671 m_VarWet = Math.Clamp(value, min, max);
9672
9674 {
9677 }
9678 }
9679
9680 override void AddWet(
float value)
9681 {
9683 }
9684
9686 {
9688 }
9689
9691 {
9693 }
9694
9696 {
9698 }
9699
9701 {
9703 }
9704
9706 {
9708 }
9709
9711 {
9714 if (newLevel != oldLevel)
9715 {
9717 }
9718 }
9719
9721 {
9722 SetWeightDirty();
9723 }
9724
9726 {
9727 return GetWetLevelInternal(
m_VarWet);
9728 }
9729
9730
9731
9733 {
9735 }
9736
9738 {
9740 }
9741
9743 {
9745 }
9746
9748 {
9750 }
9751
9752
9753
9755 {
9756 if (ConfigIsExisting("itemModelLength"))
9757 {
9758 return ConfigGetFloat("itemModelLength");
9759 }
9760 return 0;
9761 }
9762
9764 {
9765 if (ConfigIsExisting("itemAttachOffset"))
9766 {
9767 return ConfigGetFloat("itemAttachOffset");
9768 }
9769 return 0;
9770 }
9771
9772 override void SetCleanness(
int value,
bool allow_client =
false)
9773 {
9774 if (!IsServerCheck(allow_client))
9775 return;
9776
9778
9780
9783 }
9784
9786 {
9788 }
9789
9791 {
9792 return true;
9793 }
9794
9795
9796
9797
9799 {
9801 }
9802
9804 {
9806 }
9807
9808
9809
9810
9811 override void SetColor(
int r,
int g,
int b,
int a)
9812 {
9818 }
9820 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9821 {
9826 }
9827
9829 {
9831 }
9832
9835 {
9836 int r,g,b,a;
9838 r = r/255;
9839 g = g/255;
9840 b = b/255;
9841 a = a/255;
9842 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9843 }
9844
9845
9846
9847 override void SetLiquidType(
int value,
bool allow_client =
false)
9848 {
9849 if (!IsServerCheck(allow_client))
9850 return;
9851
9856 }
9857
9859 {
9860 return ConfigGetInt("varLiquidTypeInit");
9861 }
9862
9864 {
9866 }
9867
9869 {
9871 SetFrozen(false);
9872 }
9873
9876 {
9877 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9878 }
9879
9880
9883 {
9884 PlayerBase nplayer;
9885 if (PlayerBase.CastTo(nplayer, player))
9886 {
9888
9889 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9890 }
9891 }
9892
9893
9896 {
9897 PlayerBase nplayer;
9898 if (PlayerBase.CastTo(nplayer,player))
9899 {
9900
9901 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9902
9903 }
9904
9905
9906 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9907
9908
9909 if (HasEnergyManager())
9910 {
9911 GetCompEM().UpdatePlugState();
9912 }
9913 }
9914
9915
9917 {
9918 super.OnPlacementStarted(player);
9919
9921 }
9922
9923 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9924 {
9926 {
9927 m_AdminLog.OnPlacementComplete(player,
this);
9928 }
9929
9930 super.OnPlacementComplete(player, position, orientation);
9931 }
9932
9933
9934
9935
9936
9938 {
9940 {
9941 return true;
9942 }
9943 else
9944 {
9945 return false;
9946 }
9947 }
9948
9949
9951 {
9953 {
9955 }
9956 }
9957
9958
9960 {
9962 }
9963
9965 {
9967 }
9968
9969 override void InsertAgent(
int agent,
float count = 1)
9970 {
9971 if (count < 1)
9972 return;
9973
9975 }
9976
9979 {
9981 }
9982
9983
9985 {
9987 }
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10031 {
10033 return false;
10034 return true;
10035 }
10036
10038 {
10039
10041 }
10042
10043
10046 {
10047 super.CheckForRoofLimited(timeTresholdMS);
10048
10050 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10051 {
10052 m_PreviousRoofTestTime = time;
10053 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10054 }
10055 }
10056
10057
10059 {
10061 {
10062 return 0;
10063 }
10064
10065 if (GetInventory().GetAttachmentSlotsCount() != 0)
10066 {
10067 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10068 if (filter)
10069 return filter.GetProtectionLevel(type, false, system);
10070 else
10071 return 0;
10072 }
10073
10074 string subclassPath, entryName;
10075
10076 switch (type)
10077 {
10079 entryName = "biological";
10080 break;
10082 entryName = "chemical";
10083 break;
10084 default:
10085 entryName = "biological";
10086 break;
10087 }
10088
10089 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10090
10092 }
10093
10094
10095
10098 {
10099 if (!IsMagazine())
10101
10103 }
10104
10105
10106
10107
10108
10113 {
10114 return true;
10115 }
10116
10118 {
10120 }
10121
10122
10123
10124
10125
10127 {
10128 if (parent)
10129 {
10130 if (parent.IsInherited(DayZInfected))
10131 return true;
10132
10133 if (!parent.IsRuined())
10134 return true;
10135 }
10136
10137 return true;
10138 }
10139
10141 {
10142 if (!super.CanPutAsAttachment(parent))
10143 {
10144 return false;
10145 }
10146
10147 if (!IsRuined() && !parent.IsRuined())
10148 {
10149 return true;
10150 }
10151
10152 return false;
10153 }
10154
10156 {
10157
10158
10159
10160
10161 return super.CanReceiveItemIntoCargo(item);
10162 }
10163
10165 {
10166
10167
10168
10169
10170 GameInventory attachmentInv = attachment.GetInventory();
10172 {
10173 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10174 return false;
10175 }
10176
10177 InventoryLocation loc = new InventoryLocation();
10178 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10179 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10180 return false;
10181
10182 return super.CanReceiveAttachment(attachment, slotId);
10183 }
10184
10186 {
10187 if (!super.CanReleaseAttachment(attachment))
10188 return false;
10189
10190 return GetInventory().AreChildrenAccessible();
10191 }
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10214 {
10215 int id = muzzle_owner.GetMuzzleID();
10216 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10217
10218 if (WPOF_array)
10219 {
10220 for (int i = 0; i < WPOF_array.Count(); i++)
10221 {
10222 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10223
10224 if (WPOF)
10225 {
10226 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10227 }
10228 }
10229 }
10230 }
10231
10232
10234 {
10235 int id = muzzle_owner.GetMuzzleID();
10237
10238 if (WPOBE_array)
10239 {
10240 for (int i = 0; i < WPOBE_array.Count(); i++)
10241 {
10242 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10243
10244 if (WPOBE)
10245 {
10246 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10247 }
10248 }
10249 }
10250 }
10251
10252
10254 {
10255 int id = muzzle_owner.GetMuzzleID();
10256 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10257
10258 if (WPOOH_array)
10259 {
10260 for (int i = 0; i < WPOOH_array.Count(); i++)
10261 {
10262 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10263
10264 if (WPOOH)
10265 {
10266 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10267 }
10268 }
10269 }
10270 }
10271
10272
10274 {
10275 int id = muzzle_owner.GetMuzzleID();
10276 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10277
10278 if (WPOOH_array)
10279 {
10280 for (int i = 0; i < WPOOH_array.Count(); i++)
10281 {
10282 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10283
10284 if (WPOOH)
10285 {
10286 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10287 }
10288 }
10289 }
10290 }
10291
10292
10294 {
10295 int id = muzzle_owner.GetMuzzleID();
10296 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10297
10298 if (WPOOH_array)
10299 {
10300 for (int i = 0; i < WPOOH_array.Count(); i++)
10301 {
10302 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10303
10304 if (WPOOH)
10305 {
10306 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10307 }
10308 }
10309 }
10310 }
10311
10312
10313
10315 {
10317 {
10318 return true;
10319 }
10320
10321 return false;
10322 }
10323
10325 {
10327 {
10328 return true;
10329 }
10330
10331 return false;
10332 }
10333
10335 {
10337 {
10338 return true;
10339 }
10340
10341 return false;
10342 }
10343
10345 {
10346 return false;
10347 }
10348
10351 {
10352 return UATimeSpent.DEFAULT_DEPLOY;
10353 }
10354
10355
10356
10357
10359 {
10361 SetSynchDirty();
10362 }
10363
10365 {
10367 }
10368
10369
10371 {
10372 return false;
10373 }
10374
10377 {
10378 string att_type = "None";
10379
10380 if (ConfigIsExisting("soundAttType"))
10381 {
10382 att_type = ConfigGetString("soundAttType");
10383 }
10384
10386 }
10387
10389 {
10391 }
10392
10393
10394
10395
10396
10402
10404 {
10407
10409 }
10410
10411
10413 {
10415 return;
10416
10418
10421
10424
10425 SoundParameters params = new SoundParameters();
10429 }
10430
10431
10433 {
10435 return;
10436
10438 SetSynchDirty();
10439
10442 }
10443
10444
10446 {
10448 return;
10449
10451 SetSynchDirty();
10452
10455 }
10456
10458 {
10460 }
10461
10463 {
10465 }
10466
10469 {
10470 if (!
GetGame().IsDedicatedServer())
10471 {
10472 if (ConfigIsExisting("attachSoundSet"))
10473 {
10474 string cfg_path = "";
10475 string soundset = "";
10476 string type_name =
GetType();
10477
10480 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10481 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10482
10483 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10484 {
10485 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10486 {
10487 if (cfg_slot_array[i] == slot_type)
10488 {
10489 soundset = cfg_soundset_array[i];
10490 break;
10491 }
10492 }
10493 }
10494
10495 if (soundset != "")
10496 {
10497 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10499 }
10500 }
10501 }
10502 }
10503
10505 {
10506
10507 }
10508
10509 void OnApply(PlayerBase player);
10510
10512 {
10513 return 1.0;
10514 };
10515
10517 {
10519 }
10520
10522 {
10524 }
10525
10527
10529 {
10530 SetDynamicPhysicsLifeTime(0.01);
10532 }
10533
10535 {
10536 array<string> zone_names = new array<string>;
10537 GetDamageZones(zone_names);
10538 for (int i = 0; i < zone_names.Count(); i++)
10539 {
10540 SetHealthMax(zone_names.Get(i),"Health");
10541 }
10542 SetHealthMax("","Health");
10543 }
10544
10547 {
10548 float global_health = GetHealth01("","Health");
10549 array<string> zones = new array<string>;
10550 GetDamageZones(zones);
10551
10552 for (int i = 0; i < zones.Count(); i++)
10553 {
10554 SetHealth01(zones.Get(i),"Health",global_health);
10555 }
10556 }
10557
10560 {
10561 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10562 }
10563
10565 {
10566 if (!hasRootAsPlayer)
10567 {
10568 if (refParentIB)
10569 {
10570
10571 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10572 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10573
10574 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10575 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10576
10579 }
10580 else
10581 {
10582
10585 }
10586 }
10587 }
10588
10590 {
10592 {
10593 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10594 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10595 {
10596 float heatPermCoef = 1.0;
10598 while (ent)
10599 {
10600 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10601 ent = ent.GetHierarchyParent();
10602 }
10603
10604 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10605 }
10606 }
10607 }
10608
10610 {
10611
10612 EntityAI parent = GetHierarchyParent();
10613 if (!parent)
10614 {
10615 hasParent = false;
10616 hasRootAsPlayer = false;
10617 }
10618 else
10619 {
10620 hasParent = true;
10621 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10622 refParentIB =
ItemBase.Cast(parent);
10623 }
10624 }
10625
10626 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10627 {
10628
10629 }
10630
10632 {
10633
10634 return false;
10635 }
10636
10638 {
10639
10640
10641 return false;
10642 }
10643
10645 {
10646
10647 return false;
10648 }
10649
10652 {
10653 return !GetIsFrozen() &&
IsOpen();
10654 }
10655
10657 {
10658 bool hasParent = false, hasRootAsPlayer = false;
10660
10661 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10662 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10663
10664 if (wwtu || foodDecay)
10665 {
10669
10670 if (processWetness || processTemperature || processDecay)
10671 {
10673
10674 if (processWetness)
10675 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10676
10677 if (processTemperature)
10679
10680 if (processDecay)
10681 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10682 }
10683 }
10684 }
10685
10688 {
10690 }
10691
10693 {
10696
10697 return super.GetTemperatureFreezeThreshold();
10698 }
10699
10701 {
10704
10705 return super.GetTemperatureThawThreshold();
10706 }
10707
10709 {
10712
10713 return super.GetItemOverheatThreshold();
10714 }
10715
10717 {
10719 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10720
10721 return super.GetTemperatureFreezeTime();
10722 }
10723
10725 {
10727 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10728
10729 return super.GetTemperatureThawTime();
10730 }
10731
10736
10738 {
10739 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10740 }
10741
10743 {
10744 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10745 }
10746
10749 {
10751 }
10752
10754 {
10756 }
10757
10759 {
10761 }
10762
10765 {
10766 return null;
10767 }
10768
10771 {
10772 return false;
10773 }
10774
10776 {
10778 {
10781 if (!trg)
10782 {
10784 explosive = this;
10785 }
10786
10787 explosive.PairRemote(trg);
10789
10790 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10791 trg.SetPersistentPairID(persistentID);
10792 explosive.SetPersistentPairID(persistentID);
10793
10794 return true;
10795 }
10796 return false;
10797 }
10798
10801 {
10802 float ret = 1.0;
10805 ret *= GetHealth01();
10806
10807 return ret;
10808 }
10809
10810 #ifdef DEVELOPER
10811 override void SetDebugItem()
10812 {
10813 super.SetDebugItem();
10814 _itemBase = this;
10815 }
10816
10818 {
10819 string text = super.GetDebugText();
10820
10822 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10823
10824 return text;
10825 }
10826 #endif
10827
10829 {
10830 return true;
10831 }
10832
10834
10836
10838 {
10841 }
10842
10843
10851
10867}
10868
10870{
10872 if (entity)
10873 {
10874 bool is_item = entity.IsInherited(
ItemBase);
10875 if (is_item && full_quantity)
10876 {
10879 }
10880 }
10881 else
10882 {
10884 return NULL;
10885 }
10886 return entity;
10887}
10888
10890{
10891 if (item)
10892 {
10893 if (health > 0)
10894 item.SetHealth("", "", health);
10895
10896 if (item.CanHaveTemperature())
10897 {
10899 if (item.CanFreeze())
10900 item.SetFrozen(false);
10901 }
10902
10903 if (item.HasEnergyManager())
10904 {
10905 if (quantity >= 0)
10906 {
10907 item.GetCompEM().SetEnergy0To1(quantity);
10908 }
10909 else
10910 {
10912 }
10913 }
10914 else if (item.IsMagazine())
10915 {
10916 Magazine mag = Magazine.Cast(item);
10917 if (quantity >= 0)
10918 {
10919 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10920 }
10921 else
10922 {
10924 }
10925
10926 }
10927 else
10928 {
10929 if (quantity >= 0)
10930 {
10931 item.SetQuantityNormalized(quantity, false);
10932 }
10933 else
10934 {
10936 }
10937
10938 }
10939 }
10940}
10941
10942#ifdef DEVELOPER
10944#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.