5982{
5984 {
5985 return true;
5986 }
5987};
5988
5989
5990
5992{
5996
5998
6001
6002
6003
6004
6005
6014
6020
6025
6030
6051 protected bool m_IsResultOfSplit
6052
6054
6059
6060
6061
6063
6067
6068
6069
6071
6074
6075
6076
6082
6083
6091
6094
6095
6097
6098
6100
6101
6106
6107
6112
6113
6115
6116
6118 {
6123
6124 if (!
GetGame().IsDedicatedServer())
6125 {
6127 {
6129
6131 {
6133 }
6134 }
6135
6138 }
6139
6140 m_OldLocation = null;
6141
6143 {
6145 }
6146
6147 if (ConfigIsExisting("headSelectionsToHide"))
6148 {
6151 }
6152
6154 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6155 {
6157 }
6158
6160
6161 m_IsResultOfSplit = false;
6162
6164 }
6165
6167 {
6168 super.InitItemVariables();
6169
6175 m_Count = ConfigGetInt(
"count");
6176
6179
6184
6187
6192
6204
6208
6209
6212 if (ConfigIsExisting("canBeSplit"))
6213 {
6216 }
6217
6219 if (ConfigIsExisting("itemBehaviour"))
6221
6222
6225 RegisterNetSyncVariableInt("m_VarLiquidType");
6226 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6227
6228 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6229 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6230 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6231
6232 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6233 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6234 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6235 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6236
6237 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6238 RegisterNetSyncVariableBool("m_IsTakeable");
6239 RegisterNetSyncVariableBool("m_IsHologram");
6240
6243 {
6246 }
6247
6249
6251 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6253
6254 }
6255
6257 {
6259 }
6260
6262 {
6265 {
6270 }
6271 }
6272
6273 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6274 {
6276 {
6279 }
6280
6282 }
6283
6285 {
6291 }
6292
6294
6296 {
6298
6299 if (!action)
6300 {
6301 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6302 return;
6303 }
6304
6306 if (!ai)
6307 {
6309 return;
6310 }
6311
6313 if (!action_array)
6314 {
6315 action_array = new array<ActionBase_Basic>;
6317 }
6318 if (LogManager.IsActionLogEnable())
6319 {
6320 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6321 }
6322
6323 if (action_array.Find(action) != -1)
6324 {
6325 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6326 }
6327 else
6328 {
6329 action_array.Insert(action);
6330 }
6331 }
6332
6334 {
6336 ActionBase action = player.GetActionManager().GetAction(actionName);
6339
6340 if (action_array)
6341 {
6342 action_array.RemoveItem(action);
6343 }
6344 }
6345
6346
6347
6349 {
6350 ActionOverrideData overrideData = new ActionOverrideData();
6354
6356 if (!actionMap)
6357 {
6360 }
6361
6362 actionMap.Insert(this.
Type(), overrideData);
6363
6364 }
6365
6367
6369
6370
6372 {
6375
6378
6379 string config_to_search = "CfgVehicles";
6380 string muzzle_owner_config;
6381
6383 {
6384 if (IsInherited(Weapon))
6385 config_to_search = "CfgWeapons";
6386
6387 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6388
6389 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6390
6392
6393 if (config_OnFire_subclass_count > 0)
6394 {
6395 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6396
6397 for (int i = 0; i < config_OnFire_subclass_count; i++)
6398 {
6399 string particle_class = "";
6401 string config_OnFire_entry = config_OnFire_class + particle_class;
6402 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6403 WPOF_array.Insert(WPOF);
6404 }
6405
6406
6408 }
6409 }
6410
6412 {
6413 config_to_search = "CfgWeapons";
6414 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6415
6416 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6417
6419
6420 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6421 {
6422 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6423
6424 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6425 {
6426 string particle_class2 = "";
6428 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6429 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6430 WPOBE_array.Insert(WPOBE);
6431 }
6432
6433
6435 }
6436 }
6437 }
6438
6439
6441 {
6444
6446 {
6447 string config_to_search = "CfgVehicles";
6448
6449 if (IsInherited(Weapon))
6450 config_to_search = "CfgWeapons";
6451
6452 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6453 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6454
6455 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6456 {
6457
6459
6461 {
6463 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6465 return;
6466 }
6467
6470
6471
6472
6474 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6475
6476 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6477 {
6478 string particle_class = "";
6480 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6482
6483 if (entry_type == CT_CLASS)
6484 {
6485 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6486 WPOOH_array.Insert(WPOF);
6487 }
6488 }
6489
6490
6492 }
6493 }
6494 }
6495
6497 {
6499 }
6500
6502 {
6504 {
6506
6509
6512
6513 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6514 }
6515 }
6516
6518 {
6520 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6521
6523 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6524
6526 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6527
6529 {
6531 }
6532 }
6533
6535 {
6537 }
6538
6540 {
6543 else
6545
6547 {
6550 }
6551 else
6552 {
6555
6558 }
6559
6561 }
6562
6564 {
6566 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6567 }
6568
6570 {
6572 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6574 }
6575
6577 {
6579 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6580 }
6581
6583 {
6586
6587 OverheatingParticle OP = new OverheatingParticle();
6592
6594 }
6595
6597 {
6600
6601 return -1;
6602 }
6603
6605 {
6607 {
6610
6611 for (int i = count; i > 0; --i)
6612 {
6613 int id = i - 1;
6616
6619
6620 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6621 {
6622 if (p)
6623 {
6626 }
6627 }
6628 }
6629 }
6630 }
6631
6633 {
6635 {
6637 {
6638 int id = i - 1;
6640
6641 if (OP)
6642 {
6644
6645 if (p)
6646 {
6648 }
6649
6650 delete OP;
6651 }
6652 }
6653
6656 }
6657 }
6658
6661 {
6662 return 0.0;
6663 }
6664
6665
6667 {
6668 return 250;
6669 }
6670
6672 {
6673 return 0;
6674 }
6675
6678 {
6680 return true;
6681
6682 return false;
6683 }
6684
6687 {
6690
6692 {
6694 }
6695 else
6696 {
6697
6699 }
6700
6702 }
6703
6710 {
6711 return -1;
6712 }
6713
6714
6715
6716
6718 {
6720 {
6722 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6723
6724 if (r_index >= 0)
6725 {
6726 InventoryLocation r_il = new InventoryLocation;
6727 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6728
6729 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6732 {
6733 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6734 }
6736 {
6737 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6738 }
6739
6740 }
6741
6742 player.GetHumanInventory().ClearUserReservedLocation(this);
6743 }
6744
6747 }
6748
6749
6750
6751
6753 {
6754 return ItemBase.m_DebugActionsMask;
6755 }
6756
6758 {
6759 return ItemBase.m_DebugActionsMask & mask;
6760 }
6761
6763 {
6764 ItemBase.m_DebugActionsMask = mask;
6765 }
6766
6768 {
6769 ItemBase.m_DebugActionsMask |= mask;
6770 }
6771
6773 {
6774 ItemBase.m_DebugActionsMask &= ~mask;
6775 }
6776
6778 {
6780 {
6782 }
6783 else
6784 {
6786 }
6787 }
6788
6789
6791 {
6792 if (GetEconomyProfile())
6793 {
6794 float q_max = GetEconomyProfile().GetQuantityMax();
6795 if (q_max > 0)
6796 {
6797 float q_min = GetEconomyProfile().GetQuantityMin();
6798 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6799
6801 {
6802 ComponentEnergyManager comp = GetCompEM();
6804 {
6806 }
6807 }
6809 {
6811
6812 }
6813
6814 }
6815 }
6816 }
6817
6820 {
6821 EntityAI parent = GetHierarchyParent();
6822
6823 if (parent)
6824 {
6825 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6826 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6827 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6828 }
6829 }
6830
6833 {
6834 EntityAI parent = GetHierarchyParent();
6835
6836 if (parent)
6837 {
6838 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6839 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6840 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6841 }
6842 }
6843
6845 {
6846
6847
6848
6849
6851
6853 {
6854 if (ScriptInputUserData.CanStoreInputUserData())
6855 {
6856 ScriptInputUserData ctx = new ScriptInputUserData;
6862 ctx.
Write(use_stack_max);
6865
6867 {
6868 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6869 }
6870 }
6871 }
6872 else if (!
GetGame().IsMultiplayer())
6873 {
6875 }
6876 }
6877
6879 {
6881 }
6882
6884 {
6886 }
6887
6889 {
6891 }
6892
6894 {
6895
6896 return false;
6897 }
6898
6900 {
6901 return false;
6902 }
6903
6907 {
6908 return false;
6909 }
6910
6912 {
6913 return "";
6914 }
6915
6917
6919 {
6920 return false;
6921 }
6922
6924 {
6925 return true;
6926 }
6927
6928
6929
6931 {
6932 return true;
6933 }
6934
6936 {
6937 return true;
6938 }
6939
6941 {
6942 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6944 }
6945
6947 {
6949 }
6950
6952 {
6954 if (!is_being_placed)
6956 SetSynchDirty();
6957 }
6958
6959
6961
6963 {
6965 }
6966
6968 {
6970 }
6971
6973 {
6974 return 1;
6975 }
6976
6978 {
6979 return false;
6980 }
6981
6983 {
6985 SetSynchDirty();
6986 }
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7023 {
7024 super.OnMovedInsideCargo(container);
7025
7026 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7027 }
7028
7029 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7030 {
7031 super.EEItemLocationChanged(oldLoc,newLoc);
7032
7033 PlayerBase new_player = null;
7034 PlayerBase old_player = null;
7035
7036 if (newLoc.GetParent())
7037 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7038
7039 if (oldLoc.GetParent())
7040 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7041
7043 {
7044 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7045
7046 if (r_index >= 0)
7047 {
7048 InventoryLocation r_il = new InventoryLocation;
7049 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7050
7051 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7054 {
7055 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7056 }
7058 {
7059 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7060 }
7061
7062 }
7063 }
7064
7066 {
7067 if (new_player)
7068 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7069
7070 if (new_player == old_player)
7071 {
7072
7073 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7074 {
7076 {
7077 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7078 {
7079 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7080 }
7081 }
7082 else
7083 {
7084 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7085 }
7086 }
7087
7088 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7089 {
7090 int type = oldLoc.GetType();
7092 {
7093 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7094 }
7096 {
7097 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7098 }
7099 }
7100 if (!m_OldLocation)
7101 {
7102 m_OldLocation = new InventoryLocation;
7103 }
7104 m_OldLocation.Copy(oldLoc);
7105 }
7106 else
7107 {
7108 if (m_OldLocation)
7109 {
7110 m_OldLocation.Reset();
7111 }
7112 }
7113
7115 }
7116 else
7117 {
7118 if (new_player)
7119 {
7120 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7121 if (res_index >= 0)
7122 {
7123 InventoryLocation il = new InventoryLocation;
7124 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7126 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7129 {
7130 il.
GetParent().GetOnReleaseLock().Invoke(it);
7131 }
7133 {
7135 }
7136
7137 }
7138 }
7140 {
7141
7143 }
7144
7145 if (m_OldLocation)
7146 {
7147 m_OldLocation.Reset();
7148 }
7149 }
7150 }
7151
7152 override void EOnContact(IEntity other, Contact extra)
7153 {
7155 {
7156 int liquidType = -1;
7158 if (impactSpeed > 0.0)
7159 {
7161 #ifndef SERVER
7163 #else
7165 SetSynchDirty();
7166 #endif
7168 }
7169 }
7170
7171 #ifdef SERVER
7172 if (GetCompEM() && GetCompEM().IsPlugged())
7173 {
7174 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7175 GetCompEM().UnplugThis();
7176 }
7177 #endif
7178 }
7179
7181
7183 {
7185 }
7186
7188 {
7189
7190 }
7191
7193 {
7194 super.OnItemLocationChanged(old_owner, new_owner);
7195
7196 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7197 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7198
7199 if (!relatedPlayer && playerNew)
7200 relatedPlayer = playerNew;
7201
7202 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7203 {
7205 if (actionMgr)
7206 {
7207 ActionBase currentAction = actionMgr.GetRunningAction();
7208 if (currentAction)
7210 }
7211 }
7212
7213 Man ownerPlayerOld = null;
7214 Man ownerPlayerNew = null;
7215
7216 if (old_owner)
7217 {
7218 if (old_owner.
IsMan())
7219 {
7220 ownerPlayerOld = Man.Cast(old_owner);
7221 }
7222 else
7223 {
7224 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7225 }
7226 }
7227 else
7228 {
7230 {
7232
7233 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7234 {
7235 GetCompEM().UnplugThis();
7236 }
7237 }
7238 }
7239
7240 if (new_owner)
7241 {
7242 if (new_owner.
IsMan())
7243 {
7244 ownerPlayerNew = Man.Cast(new_owner);
7245 }
7246 else
7247 {
7248 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7249 }
7250 }
7251
7252 if (ownerPlayerOld != ownerPlayerNew)
7253 {
7254 if (ownerPlayerOld)
7255 {
7256 array<EntityAI> subItemsExit = new array<EntityAI>;
7258 for (int i = 0; i < subItemsExit.Count(); i++)
7259 {
7262 }
7263 }
7264
7265 if (ownerPlayerNew)
7266 {
7267 array<EntityAI> subItemsEnter = new array<EntityAI>;
7269 for (int j = 0; j < subItemsEnter.Count(); j++)
7270 {
7273 }
7274 }
7275 }
7276 else if (ownerPlayerNew != null)
7277 {
7278 PlayerBase nplayer;
7279 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7280 {
7281 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7283 for (int k = 0; k < subItemsUpdate.Count(); k++)
7284 {
7286 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7287 }
7288 }
7289 }
7290
7291 if (old_owner)
7292 old_owner.OnChildItemRemoved(this);
7293 if (new_owner)
7294 new_owner.OnChildItemReceived(this);
7295 }
7296
7297
7299 {
7300 super.EEDelete(parent);
7301 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7302 if (player)
7303 {
7305
7306 if (player.IsAlive())
7307 {
7308 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7309 if (r_index >= 0)
7310 {
7311 InventoryLocation r_il = new InventoryLocation;
7312 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7313
7314 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7317 {
7318 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7319 }
7321 {
7322 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7323 }
7324
7325 }
7326
7327 player.RemoveQuickBarEntityShortcut(this);
7328 }
7329 }
7330 }
7331
7333 {
7334 super.EEKilled(killer);
7335
7338 {
7339 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7340 {
7341 if (IsMagazine())
7342 {
7343 if (Magazine.Cast(this).GetAmmoCount() > 0)
7344 {
7346 }
7347 }
7348 else
7349 {
7351 }
7352 }
7353 }
7354 }
7355
7357 {
7358 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7359
7360 super.OnWasAttached(parent, slot_id);
7361
7364
7366 }
7367
7369 {
7370 super.OnWasDetached(parent, slot_id);
7371
7374 }
7375
7377 {
7378 int idx;
7381
7382 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7383 if (inventory_slots.Count() < 1)
7384 {
7385 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7386 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7387 }
7388 else
7389 {
7390 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7391 }
7392
7393 idx = inventory_slots.Find(slot);
7394 if (idx < 0)
7395 return "";
7396
7397 return attach_types.Get(idx);
7398 }
7399
7401 {
7402 int idx = -1;
7403 string slot;
7404
7407
7408 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7409 if (inventory_slots.Count() < 1)
7410 {
7411 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7412 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7413 }
7414 else
7415 {
7416 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7417 if (detach_types.Count() < 1)
7418 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7419 }
7420
7421 for (int i = 0; i < inventory_slots.Count(); i++)
7422 {
7423 slot = inventory_slots.Get(i);
7424 }
7425
7426 if (slot != "")
7427 {
7428 if (detach_types.Count() == 1)
7429 idx = 0;
7430 else
7431 idx = inventory_slots.Find(slot);
7432 }
7433 if (idx < 0)
7434 return "";
7435
7436 return detach_types.Get(idx);
7437 }
7438
7440 {
7441
7443
7444
7445 float min_time = 1;
7446 float max_time = 3;
7447 float delay = Math.RandomFloat(min_time, max_time);
7448
7449 explode_timer.Run(delay, this, "DoAmmoExplosion");
7450 }
7451
7453 {
7454 Magazine magazine = Magazine.Cast(this);
7455 int pop_sounds_count = 6;
7456 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7457
7458
7459 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7460 string sound_name = pop_sounds[ sound_idx ];
7462
7463
7464 magazine.ServerAddAmmoCount(-1);
7465
7466
7467 float min_temp_to_explode = 100;
7468
7469 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7470 {
7472 }
7473 }
7474
7475
7476 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7477 {
7478 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7479
7480 const int CHANCE_DAMAGE_CARGO = 4;
7481 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7482 const int CHANCE_DAMAGE_NOTHING = 2;
7483
7485 {
7486 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7487 int chances;
7488 int rnd;
7489
7490 if (GetInventory().GetCargo())
7491 {
7492 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7493 rnd = Math.RandomInt(0,chances);
7494
7495 if (rnd < CHANCE_DAMAGE_CARGO)
7496 {
7498 }
7499 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7500 {
7502 }
7503 }
7504 else
7505 {
7506 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7507 rnd = Math.RandomInt(0,chances);
7508
7509 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7510 {
7512 }
7513 }
7514 }
7515 }
7516
7518 {
7519 if (GetInventory().GetCargo())
7520 {
7521 int item_count = GetInventory().GetCargo().GetItemCount();
7522 if (item_count > 0)
7523 {
7524 int random_pick = Math.RandomInt(0, item_count);
7526 if (!item.IsExplosive())
7527 {
7528 item.AddHealth("","",damage);
7529 return true;
7530 }
7531 }
7532 }
7533 return false;
7534 }
7535
7537 {
7538 int attachment_count = GetInventory().AttachmentCount();
7539 if (attachment_count > 0)
7540 {
7541 int random_pick = Math.RandomInt(0, attachment_count);
7542 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7543 if (!attachment.IsExplosive())
7544 {
7545 attachment.AddHealth("","",damage);
7546 return true;
7547 }
7548 }
7549 return false;
7550 }
7551
7553 {
7555 }
7556
7558 {
7560 return GetInventory().CanRemoveEntity();
7561
7562 return false;
7563 }
7564
7566 {
7568 return;
7569
7571 {
7572 if (ScriptInputUserData.CanStoreInputUserData())
7573 {
7574 ScriptInputUserData ctx = new ScriptInputUserData;
7579 ctx.
Write(destination_entity);
7583 }
7584 }
7585 else if (!
GetGame().IsMultiplayer())
7586 {
7588 }
7589 }
7590
7592 {
7594 return;
7595
7596 float split_quantity_new;
7600 InventoryLocation loc = new InventoryLocation;
7601
7602 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7603 {
7605 split_quantity_new = stack_max;
7606 else
7608
7609 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7610 if (new_item)
7611 {
7612 new_item.SetResultOfSplit(true);
7613 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7615 new_item.SetQuantity(split_quantity_new);
7616 }
7617 }
7618 else if (destination_entity && slot_id == -1)
7619 {
7620 if (quantity > stack_max)
7621 split_quantity_new = stack_max;
7622 else
7623 split_quantity_new = quantity;
7624
7626 {
7629 }
7630
7631 if (new_item)
7632 {
7633 new_item.SetResultOfSplit(true);
7634 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7636 new_item.SetQuantity(split_quantity_new);
7637 }
7638 }
7639 else
7640 {
7641 if (stack_max != 0)
7642 {
7644 {
7646 }
7647
7648 if (split_quantity_new == 0)
7649 {
7650 if (!
GetGame().IsMultiplayer())
7651 player.PhysicalPredictiveDropItem(this);
7652 else
7653 player.ServerDropEntity(this);
7654 return;
7655 }
7656
7658
7659 if (new_item)
7660 {
7661 new_item.SetResultOfSplit(true);
7662 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7664 new_item.SetQuantity(stack_max);
7665 new_item.PlaceOnSurface();
7666 }
7667 }
7668 }
7669 }
7670
7672 {
7674 return;
7675
7676 float split_quantity_new;
7680 InventoryLocation loc = new InventoryLocation;
7681
7682 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7683 {
7685 split_quantity_new = stack_max;
7686 else
7688
7689 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7690 if (new_item)
7691 {
7692 new_item.SetResultOfSplit(true);
7693 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7695 new_item.SetQuantity(split_quantity_new);
7696 }
7697 }
7698 else if (destination_entity && slot_id == -1)
7699 {
7700 if (quantity > stack_max)
7701 split_quantity_new = stack_max;
7702 else
7703 split_quantity_new = quantity;
7704
7706 {
7709 }
7710
7711 if (new_item)
7712 {
7713 new_item.SetResultOfSplit(true);
7714 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7716 new_item.SetQuantity(split_quantity_new);
7717 }
7718 }
7719 else
7720 {
7721 if (stack_max != 0)
7722 {
7724 {
7726 }
7727
7729
7730 if (new_item)
7731 {
7732 new_item.SetResultOfSplit(true);
7733 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7735 new_item.SetQuantity(stack_max);
7736 new_item.PlaceOnSurface();
7737 }
7738 }
7739 }
7740 }
7741
7743 {
7745 return;
7746
7748 {
7749 if (ScriptInputUserData.CanStoreInputUserData())
7750 {
7751 ScriptInputUserData ctx = new ScriptInputUserData;
7756 dst.WriteToContext(ctx);
7758 }
7759 }
7760 else if (!
GetGame().IsMultiplayer())
7761 {
7763 }
7764 }
7765
7767 {
7769 return;
7770
7772 {
7773 if (ScriptInputUserData.CanStoreInputUserData())
7774 {
7775 ScriptInputUserData ctx = new ScriptInputUserData;
7780 ctx.
Write(destination_entity);
7786 }
7787 }
7788 else if (!
GetGame().IsMultiplayer())
7789 {
7791 }
7792 }
7793
7795 {
7797 }
7798
7800 {
7802 return this;
7803
7805 float split_quantity_new;
7807 if (dst.IsValid())
7808 {
7809 int slot_id = dst.GetSlot();
7811
7812 if (quantity > stack_max)
7813 split_quantity_new = stack_max;
7814 else
7815 split_quantity_new = quantity;
7816
7818
7819 if (new_item)
7820 {
7821 new_item.SetResultOfSplit(true);
7822 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7825 }
7826
7827 return new_item;
7828 }
7829
7830 return null;
7831 }
7832
7834 {
7836 return;
7837
7839 float split_quantity_new;
7841 if (destination_entity)
7842 {
7844 if (quantity > stackable)
7845 split_quantity_new = stackable;
7846 else
7847 split_quantity_new = quantity;
7848
7849 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7850 if (new_item)
7851 {
7852 new_item.SetResultOfSplit(true);
7853 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7855 new_item.SetQuantity(split_quantity_new);
7856 }
7857 }
7858 }
7859
7861 {
7863 return;
7864
7866 {
7867 if (ScriptInputUserData.CanStoreInputUserData())
7868 {
7869 ScriptInputUserData ctx = new ScriptInputUserData;
7874 ItemBase destination_entity =
this;
7875 ctx.
Write(destination_entity);
7879 }
7880 }
7881 else if (!
GetGame().IsMultiplayer())
7882 {
7884 }
7885 }
7886
7888 {
7890 return;
7891
7893 float split_quantity_new;
7895 if (player)
7896 {
7898 if (quantity > stackable)
7899 split_quantity_new = stackable;
7900 else
7901 split_quantity_new = quantity;
7902
7903 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7904 new_item =
ItemBase.Cast(in_hands);
7905 if (new_item)
7906 {
7907 new_item.SetResultOfSplit(true);
7908 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7910 new_item.SetQuantity(split_quantity_new);
7911 }
7912 }
7913 }
7914
7916 {
7918 return;
7919
7921 float split_quantity_new = Math.Floor(quantity * 0.5);
7922
7924
7925 if (new_item)
7926 {
7927 if (new_item.GetQuantityMax() < split_quantity_new)
7928 {
7929 split_quantity_new = new_item.GetQuantityMax();
7930 }
7931
7932 new_item.SetResultOfSplit(true);
7933 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7934
7936 {
7939 }
7940 else
7941 {
7944 }
7945 }
7946 }
7947
7949 {
7951 return;
7952
7954 float split_quantity_new = Math.Floor(quantity / 2);
7955
7956 InventoryLocation invloc = new InventoryLocation;
7958
7960 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7961
7962 if (new_item)
7963 {
7964 if (new_item.GetQuantityMax() < split_quantity_new)
7965 {
7966 split_quantity_new = new_item.GetQuantityMax();
7967 }
7969 {
7972 }
7973 else
7974 {
7977 }
7978 }
7979 }
7980
7983 {
7984 SetWeightDirty();
7986
7987 if (parent)
7988 parent.OnAttachmentQuantityChangedEx(this, delta);
7989
7991 {
7993 {
7995 }
7997 {
7998 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8000 }
8001 }
8002
8003 }
8004
8007 {
8008
8009 }
8010
8013 {
8015 }
8016
8018 {
8019 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8020
8022 {
8023 if (newLevel == GameConstants.STATE_RUINED)
8024 {
8026 EntityAI parent = GetHierarchyParent();
8027 if (parent && parent.IsFireplace())
8028 {
8029 CargoBase cargo = GetInventory().GetCargo();
8030 if (cargo)
8031 {
8033 {
8035 }
8036 }
8037 }
8038 }
8039
8041 {
8042
8044 return;
8045 }
8046
8047 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8048 {
8050 }
8051 }
8052 }
8053
8054
8056 {
8057 super.OnRightClick();
8058
8060 {
8062 {
8063 if (ScriptInputUserData.CanStoreInputUserData())
8064 {
8065 vector m4[4];
8067
8068 EntityAI root = GetHierarchyRoot();
8069
8070 InventoryLocation dst = new InventoryLocation;
8072 {
8073 if (root)
8074 {
8075 root.GetTransform(m4);
8077 }
8078 else
8079 GetInventory().GetCurrentInventoryLocation(dst);
8080 }
8081 else
8082 {
8084
8085
8086 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8087 {
8088 if (root)
8089 {
8090 root.GetTransform(m4);
8092 }
8093 else
8094 GetInventory().GetCurrentInventoryLocation(dst);
8095 }
8096 else
8097 {
8098 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8099 }
8100 }
8101
8102 ScriptInputUserData ctx = new ScriptInputUserData;
8110 }
8111 }
8112 else if (!
GetGame().IsMultiplayer())
8113 {
8115 }
8116 }
8117 }
8118
8119 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8120 {
8121
8122 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8123 return false;
8124
8125 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8126 return false;
8127
8128
8130 return false;
8131
8132
8133 Magazine mag = Magazine.Cast(this);
8134 if (mag)
8135 {
8136 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8137 return false;
8138
8139 if (stack_max_limit)
8140 {
8141 Magazine other_mag = Magazine.Cast(other_item);
8142 if (other_item)
8143 {
8144 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8145 return false;
8146 }
8147
8148 }
8149 }
8150 else
8151 {
8152
8154 return false;
8155
8157 return false;
8158 }
8159
8160 PlayerBase player = null;
8161 if (CastTo(player, GetHierarchyRootPlayer()))
8162 {
8163 if (player.GetInventory().HasAttachment(this))
8164 return false;
8165
8166 if (player.IsItemsToDelete())
8167 return false;
8168 }
8169
8170 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8171 return false;
8172
8173 int slotID;
8175 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8176 return false;
8177
8178 return true;
8179 }
8180
8182 {
8184 }
8185
8187 {
8188 return m_IsResultOfSplit;
8189 }
8190
8192 {
8193 m_IsResultOfSplit = value;
8194 }
8195
8197 {
8199 }
8200
8202 {
8203 float other_item_quantity = other_item.GetQuantity();
8204 float this_free_space;
8205
8207
8209
8210 if (other_item_quantity > this_free_space)
8211 {
8212 return this_free_space;
8213 }
8214 else
8215 {
8216 return other_item_quantity;
8217 }
8218 }
8219
8221 {
8223 }
8224
8226 {
8228 return;
8229
8230 if (!IsMagazine() && other_item)
8231 {
8233 if (quantity_used != 0)
8234 {
8235 float hp1 = GetHealth01("","");
8236 float hp2 = other_item.GetHealth01("","");
8237 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8238 hpResult = hpResult / (
GetQuantity() + quantity_used);
8239
8240 hpResult *= GetMaxHealth();
8241 Math.Round(hpResult);
8242 SetHealth("", "Health", hpResult);
8243
8245 other_item.AddQuantity(-quantity_used);
8246 }
8247 }
8249 }
8250
8252 {
8253 #ifdef SERVER
8254 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8255 GetHierarchyParent().IncreaseLifetimeUp();
8256 #endif
8257 };
8258
8260 {
8261 PlayerBase p = PlayerBase.Cast(player);
8262
8263 array<int> recipesIds = p.m_Recipes;
8264 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8265 if (moduleRecipesManager)
8266 {
8267 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8268 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8269 }
8270
8271 for (int i = 0;i < recipesIds.Count(); i++)
8272 {
8273 int key = recipesIds.Get(i);
8274 string recipeName = moduleRecipesManager.GetRecipeName(key);
8276 }
8277 }
8278
8279
8280 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8281 {
8282 super.GetDebugActions(outputList);
8283
8284
8289
8290
8294
8298
8299
8302
8303
8305 {
8308 }
8309
8311
8314
8318 }
8319
8320
8321
8322
8324 {
8325 super.OnAction(action_id, player, ctx);
8326 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8327 {
8328 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8329 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8330 PlayerBase p = PlayerBase.Cast(player);
8331 if (
EActions.RECIPES_RANGE_START < 1000)
8332 {
8333 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8334 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8335 }
8336 }
8337 #ifndef SERVER
8338 else if (action_id ==
EActions.WATCH_PLAYER)
8339 {
8340 PluginDeveloper.SetDeveloperItemClientEx(player);
8341 }
8342 #endif
8344 {
8345 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8346 {
8347 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8348 OnDebugButtonPressServer(id + 1);
8349 }
8350
8351 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8352 {
8353 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8355 }
8356
8357 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8358 {
8359 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8361 }
8362
8363 else if (action_id ==
EActions.ADD_QUANTITY)
8364 {
8365 if (IsMagazine())
8366 {
8367 Magazine mag = Magazine.Cast(this);
8368 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8369 }
8370 else
8371 {
8373 }
8374
8375 if (m_EM)
8376 {
8377 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8378 }
8379
8380 }
8381
8382 else if (action_id ==
EActions.REMOVE_QUANTITY)
8383 {
8384 if (IsMagazine())
8385 {
8386 Magazine mag2 = Magazine.Cast(this);
8387 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8388 }
8389 else
8390 {
8392 }
8393 if (m_EM)
8394 {
8395 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8396 }
8397
8398 }
8399
8400 else if (action_id ==
EActions.SET_QUANTITY_0)
8401 {
8403
8404 if (m_EM)
8405 {
8406 m_EM.SetEnergy(0);
8407 }
8408 }
8409
8410 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8411 {
8413
8414 if (m_EM)
8415 {
8416 m_EM.SetEnergy(m_EM.GetEnergyMax());
8417 }
8418 }
8419
8420 else if (action_id ==
EActions.ADD_HEALTH)
8421 {
8422 AddHealth("","",GetMaxHealth("","Health")/5);
8423 }
8424 else if (action_id ==
EActions.REMOVE_HEALTH)
8425 {
8426 AddHealth("","",-GetMaxHealth("","Health")/5);
8427 }
8428 else if (action_id ==
EActions.DESTROY_HEALTH)
8429 {
8430 SetHealth01("","",0);
8431 }
8432 else if (action_id ==
EActions.WATCH_ITEM)
8433 {
8435 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8436 #ifdef DEVELOPER
8437 SetDebugDeveloper_item(this);
8438 #endif
8439 }
8440
8441 else if (action_id ==
EActions.ADD_TEMPERATURE)
8442 {
8443 AddTemperature(20);
8444
8445 }
8446
8447 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8448 {
8449 AddTemperature(-20);
8450
8451 }
8452
8453 else if (action_id ==
EActions.FLIP_FROZEN)
8454 {
8455 SetFrozen(!GetIsFrozen());
8456
8457 }
8458
8459 else if (action_id ==
EActions.ADD_WETNESS)
8460 {
8462
8463 }
8464
8465 else if (action_id ==
EActions.REMOVE_WETNESS)
8466 {
8468
8469 }
8470
8471 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8472 {
8475
8476
8477 }
8478
8479 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8480 {
8483 }
8484
8485 else if (action_id ==
EActions.MAKE_SPECIAL)
8486 {
8487 auto debugParams = DebugSpawnParams.WithPlayer(player);
8488 OnDebugSpawnEx(debugParams);
8489 }
8490
8491 else if (action_id ==
EActions.DELETE)
8492 {
8493 Delete();
8494 }
8495
8496 }
8497
8498
8499 return false;
8500 }
8501
8502
8503
8504
8508
8511
8512
8513
8515 {
8516 return false;
8517 }
8518
8519
8521 {
8522 return true;
8523 }
8524
8525
8527 {
8528 return true;
8529 }
8530
8531
8532
8534 {
8535 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8537 }
8538
8541 {
8542 return null;
8543 }
8544
8546 {
8547 return false;
8548 }
8549
8551 {
8552 return false;
8553 }
8554
8558
8559
8561 {
8562 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8563 return module_repairing.CanRepair(this, item_repair_kit);
8564 }
8565
8566
8567 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8568 {
8569 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8570 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8571 }
8572
8573
8575 {
8576
8577
8578
8579
8580
8581
8582
8583
8584 return 1;
8585 }
8586
8587
8588
8590 {
8592 }
8593
8594
8595
8597 {
8599 }
8600
8601
8610 {
8611 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8612
8613 if (player)
8614 {
8615 player.MessageStatus(text);
8616 }
8617 }
8618
8619
8628 {
8629 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8630
8631 if (player)
8632 {
8633 player.MessageAction(text);
8634 }
8635 }
8636
8637
8646 {
8647 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8648
8649 if (player)
8650 {
8651 player.MessageFriendly(text);
8652 }
8653 }
8654
8655
8664 {
8665 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8666
8667 if (player)
8668 {
8669 player.MessageImportant(text);
8670 }
8671 }
8672
8674 {
8675 return true;
8676 }
8677
8678
8679 override bool KindOf(
string tag)
8680 {
8681 bool found = false;
8682 string item_name = this.
GetType();
8685
8686 int array_size = item_tag_array.Count();
8687 for (int i = 0; i < array_size; i++)
8688 {
8689 if (item_tag_array.Get(i) == tag)
8690 {
8691 found = true;
8692 break;
8693 }
8694 }
8695 return found;
8696 }
8697
8698
8700 {
8701
8702 super.OnRPC(sender, rpc_type,ctx);
8703
8704
8705 switch (rpc_type)
8706 {
8707 #ifndef SERVER
8708 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8709 Param2<bool, string> p = new Param2<bool, string>(false, "");
8710
8712 return;
8713
8714 bool play = p.param1;
8715 string soundSet = p.param2;
8716
8717 if (play)
8718 {
8720 {
8722 {
8724 }
8725 }
8726 else
8727 {
8729 }
8730 }
8731 else
8732 {
8734 }
8735
8736 break;
8737 #endif
8738
8739 }
8740
8742 {
8744 }
8745 }
8746
8747
8748
8749
8751 {
8752 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8753 return plugin.GetID(
name);
8754 }
8755
8757 {
8758 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8759 return plugin.GetName(id);
8760 }
8761
8764 {
8765
8766
8767 int varFlags;
8768 if (!ctx.
Read(varFlags))
8769 return;
8770
8771 if (varFlags & ItemVariableFlags.FLOAT)
8772 {
8774 }
8775 }
8776
8778 {
8779
8780 super.SerializeNumericalVars(floats_out);
8781
8782
8783
8785 {
8787 }
8788
8790 {
8792 }
8793
8795 {
8797 }
8798
8800 {
8805 }
8806
8808 {
8810 }
8811 }
8812
8814 {
8815
8816 super.DeSerializeNumericalVars(floats);
8817
8818
8819 int index = 0;
8820 int mask = Math.Round(floats.Get(index));
8821
8822 index++;
8823
8825 {
8827 {
8829 }
8830 else
8831 {
8832 float quantity = floats.Get(index);
8834 }
8835 index++;
8836 }
8837
8839 {
8840 float wet = floats.Get(index);
8842 index++;
8843 }
8844
8846 {
8847 int liquidtype = Math.Round(floats.Get(index));
8849 index++;
8850 }
8851
8853 {
8855 index++;
8857 index++;
8859 index++;
8861 index++;
8862 }
8863
8865 {
8866 int cleanness = Math.Round(floats.Get(index));
8868 index++;
8869 }
8870 }
8871
8873 {
8874 super.WriteVarsToCTX(ctx);
8875
8876
8878 {
8880 }
8881
8883 {
8885 }
8886
8888 {
8890 }
8891
8893 {
8894 int r,g,b,a;
8900 }
8901
8903 {
8905 }
8906 }
8907
8909 {
8910 if (!super.ReadVarsFromCTX(ctx,version))
8911 return false;
8912
8913 int intValue;
8914 float value;
8915
8916 if (version < 140)
8917 {
8918 if (!ctx.
Read(intValue))
8919 return false;
8920
8921 m_VariablesMask = intValue;
8922 }
8923
8925 {
8926 if (!ctx.
Read(value))
8927 return false;
8928
8930 {
8932 }
8933 else
8934 {
8936 }
8937 }
8938
8939 if (version < 140)
8940 {
8942 {
8943 if (!ctx.
Read(value))
8944 return false;
8945 SetTemperatureDirect(value);
8946 }
8947 }
8948
8950 {
8951 if (!ctx.
Read(value))
8952 return false;
8954 }
8955
8957 {
8958 if (!ctx.
Read(intValue))
8959 return false;
8961 }
8962
8964 {
8965 int r,g,b,a;
8967 return false;
8969 return false;
8971 return false;
8973 return false;
8974
8976 }
8977
8979 {
8980 if (!ctx.
Read(intValue))
8981 return false;
8983 }
8984
8985 if (version >= 138 && version < 140)
8986 {
8988 {
8989 if (!ctx.
Read(intValue))
8990 return false;
8991 SetFrozen(intValue);
8992 }
8993 }
8994
8995 return true;
8996 }
8997
8998
9000 {
9003 {
9005 }
9006
9007 if (!super.OnStoreLoad(ctx, version))
9008 {
9010 return false;
9011 }
9012
9013 if (version >= 114)
9014 {
9015 bool hasQuickBarIndexSaved;
9016
9017 if (!ctx.
Read(hasQuickBarIndexSaved))
9018 {
9020 return false;
9021 }
9022
9023 if (hasQuickBarIndexSaved)
9024 {
9025 int itmQBIndex;
9026
9027
9028 if (!ctx.
Read(itmQBIndex))
9029 {
9031 return false;
9032 }
9033
9034 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9035 if (itmQBIndex != -1 && parentPlayer)
9036 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9037 }
9038 }
9039 else
9040 {
9041
9042 PlayerBase player;
9043 int itemQBIndex;
9044 if (version ==
int.
MAX)
9045 {
9046 if (!ctx.
Read(itemQBIndex))
9047 {
9049 return false;
9050 }
9051 }
9052 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9053 {
9054
9055 if (!ctx.
Read(itemQBIndex))
9056 {
9058 return false;
9059 }
9060 if (itemQBIndex != -1 && player)
9061 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9062 }
9063 }
9064
9065 if (version < 140)
9066 {
9067
9068 if (!LoadVariables(ctx, version))
9069 {
9071 return false;
9072 }
9073 }
9074
9075
9077 {
9079 return false;
9080 }
9081 if (version >= 132)
9082 {
9084 if (raib)
9085 {
9087 {
9089 return false;
9090 }
9091 }
9092 }
9093
9095 return true;
9096 }
9097
9098
9099
9101 {
9102 super.OnStoreSave(ctx);
9103
9104 PlayerBase player;
9105 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9106 {
9108
9109 int itemQBIndex = -1;
9110 itemQBIndex = player.FindQuickBarEntityIndex(this);
9111 ctx.
Write(itemQBIndex);
9112 }
9113 else
9114 {
9116 }
9117
9119
9121 if (raib)
9122 {
9124 }
9125 }
9126
9127
9129 {
9130 super.AfterStoreLoad();
9131
9133 {
9135 }
9136
9138 {
9141 }
9142 }
9143
9145 {
9146 super.EEOnAfterLoad();
9147
9149 {
9151 }
9152
9155 }
9156
9158 {
9159 return false;
9160 }
9161
9162
9163
9165 {
9167 {
9168 #ifdef PLATFORM_CONSOLE
9169
9171 {
9173 if (menu)
9174 {
9176 }
9177 }
9178 #endif
9179 }
9180
9182 {
9185 }
9186
9188 {
9189 SetWeightDirty();
9191 }
9193 {
9196 }
9197
9199 {
9202 }
9204 {
9207 }
9208
9209 super.OnVariablesSynchronized();
9210 }
9211
9212
9213
9215 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9216 {
9217 if (!IsServerCheck(allow_client))
9218 return false;
9219
9221 return false;
9222
9225
9226 if (value <= (min + 0.001))
9227 value = min;
9228
9229 if (value == min)
9230 {
9231 if (destroy_config)
9232 {
9233 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9234 if (dstr)
9235 {
9237 this.Delete();
9238 return true;
9239 }
9240 }
9241 else if (destroy_forced)
9242 {
9244 this.Delete();
9245 return true;
9246 }
9247
9249 }
9250
9253
9255 {
9257
9258 if (delta)
9260 }
9261
9263
9264 return false;
9265 }
9266
9267
9269 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9270 {
9272 }
9273
9275 {
9278 }
9279
9281 {
9284 }
9285
9288 {
9289 float value_clamped = Math.Clamp(value, 0, 1);
9291 SetQuantity(result, destroy_config, destroy_forced);
9292 }
9293
9294
9297 {
9299 }
9300
9302 {
9304 }
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9316 {
9317 int slot = -1;
9318 if (GetInventory())
9319 {
9320 InventoryLocation il = new InventoryLocation;
9321 GetInventory().GetCurrentInventoryLocation(il);
9323 }
9324
9326 }
9327
9329 {
9330 float quantity_max = 0;
9331
9333 {
9334 if (attSlotID != -1)
9335 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9336
9337 if (quantity_max <= 0)
9339 }
9340
9341 if (quantity_max <= 0)
9343
9344 return quantity_max;
9345 }
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9357
9359 {
9361 }
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9373
9375 {
9376
9377 float weightEx = GetWeightEx();
9378 float special = GetInventoryAndCargoWeight();
9379 return weightEx - special;
9380 }
9381
9382
9384 {
9386 }
9387
9389 {
9391 {
9392 #ifdef DEVELOPER
9393 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9394 {
9395 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9397 }
9398 #endif
9399
9401 }
9402 else if (HasEnergyManager())
9403 {
9404 #ifdef DEVELOPER
9405 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9406 {
9407 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9408 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9409 }
9410 #endif
9411 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9412 }
9413 else
9414 {
9415 #ifdef DEVELOPER
9416 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9417 {
9418 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9419 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9420 }
9421 #endif
9422 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9423 }
9424 }
9425
9428 {
9429 int item_count = 0;
9431
9432 if (GetInventory().GetCargo() != NULL)
9433 {
9434 item_count = GetInventory().GetCargo().GetItemCount();
9435 }
9436
9437 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9438 {
9439 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9440 if (item)
9441 item_count += item.GetNumberOfItems();
9442 }
9443 return item_count;
9444 }
9445
9448 {
9449 float weight = 0;
9450 float wetness = 1;
9451 if (include_wetness)
9454 {
9455 weight = wetness * m_ConfigWeight;
9456 }
9458 {
9459 weight = 1;
9460 }
9461 return weight;
9462 }
9463
9464
9465
9467 {
9468 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9469 {
9470 GameInventory inv = GetInventory();
9471 array<EntityAI> items = new array<EntityAI>;
9473 for (int i = 0; i < items.Count(); i++)
9474 {
9476 if (item)
9477 {
9479 }
9480 }
9481 }
9482 }
9483
9484
9485
9486
9488 {
9489 float energy = 0;
9490 if (HasEnergyManager())
9491 {
9492 energy = GetCompEM().GetEnergy();
9493 }
9494 return energy;
9495 }
9496
9497
9499 {
9500 super.OnEnergyConsumed();
9501
9503 }
9504
9506 {
9507 super.OnEnergyAdded();
9508
9510 }
9511
9512
9514 {
9515 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9516 {
9518 {
9519 float energy_0to1 = GetCompEM().GetEnergy0To1();
9521 }
9522 }
9523 }
9524
9525
9527 {
9528 return ConfigGetFloat("heatIsolation");
9529 }
9530
9532 {
9534 }
9535
9537 {
9538 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9539 if (
GetGame().ConfigIsExisting(paramPath))
9541
9542 return 0.0;
9543 }
9544
9546 {
9547 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9548 if (
GetGame().ConfigIsExisting(paramPath))
9550
9551 return 0.0;
9552 }
9553
9554 override void SetWet(
float value,
bool allow_client =
false)
9555 {
9556 if (!IsServerCheck(allow_client))
9557 return;
9558
9561
9563
9564 m_VarWet = Math.Clamp(value, min, max);
9565
9567 {
9570 }
9571 }
9572
9573 override void AddWet(
float value)
9574 {
9576 }
9577
9579 {
9581 }
9582
9584 {
9586 }
9587
9589 {
9591 }
9592
9594 {
9596 }
9597
9599 {
9601 }
9602
9604 {
9607 if (newLevel != oldLevel)
9608 {
9610 }
9611 }
9612
9614 {
9615 SetWeightDirty();
9616 }
9617
9619 {
9620 return GetWetLevelInternal(
m_VarWet);
9621 }
9622
9623
9624
9626 {
9628 }
9629
9631 {
9633 }
9634
9636 {
9638 }
9639
9641 {
9643 }
9644
9645
9646
9648 {
9649 if (ConfigIsExisting("itemModelLength"))
9650 {
9651 return ConfigGetFloat("itemModelLength");
9652 }
9653 return 0;
9654 }
9655
9657 {
9658 if (ConfigIsExisting("itemAttachOffset"))
9659 {
9660 return ConfigGetFloat("itemAttachOffset");
9661 }
9662 return 0;
9663 }
9664
9665 override void SetCleanness(
int value,
bool allow_client =
false)
9666 {
9667 if (!IsServerCheck(allow_client))
9668 return;
9669
9671
9673
9676 }
9677
9679 {
9681 }
9682
9684 {
9685 return true;
9686 }
9687
9688
9689
9690
9692 {
9694 }
9695
9697 {
9699 }
9700
9701
9702
9703
9704 override void SetColor(
int r,
int g,
int b,
int a)
9705 {
9711 }
9713 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9714 {
9719 }
9720
9722 {
9724 }
9725
9728 {
9729 int r,g,b,a;
9731 r = r/255;
9732 g = g/255;
9733 b = b/255;
9734 a = a/255;
9735 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9736 }
9737
9738
9739
9740 override void SetLiquidType(
int value,
bool allow_client =
false)
9741 {
9742 if (!IsServerCheck(allow_client))
9743 return;
9744
9749 }
9750
9752 {
9753 return ConfigGetInt("varLiquidTypeInit");
9754 }
9755
9757 {
9759 }
9760
9762 {
9764 SetFrozen(false);
9765 }
9766
9769 {
9770 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9771 }
9772
9773
9776 {
9777 PlayerBase nplayer;
9778 if (PlayerBase.CastTo(nplayer, player))
9779 {
9781
9782 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9783 }
9784 }
9785
9786
9789 {
9790 PlayerBase nplayer;
9791 if (PlayerBase.CastTo(nplayer,player))
9792 {
9793
9794 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9795
9796 }
9797
9798
9799 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9800
9801
9802 if (HasEnergyManager())
9803 {
9804 GetCompEM().UpdatePlugState();
9805 }
9806 }
9807
9808
9810 {
9811 super.OnPlacementStarted(player);
9812
9814 }
9815
9816 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9817 {
9819 {
9820 m_AdminLog.OnPlacementComplete(player,
this);
9821 }
9822
9823 super.OnPlacementComplete(player, position, orientation);
9824 }
9825
9826
9827
9828
9829
9831 {
9833 {
9834 return true;
9835 }
9836 else
9837 {
9838 return false;
9839 }
9840 }
9841
9842
9844 {
9846 {
9848 }
9849 }
9850
9851
9853 {
9855 }
9856
9858 {
9860 }
9861
9862 override void InsertAgent(
int agent,
float count = 1)
9863 {
9864 if (count < 1)
9865 return;
9866
9868 }
9869
9872 {
9874 }
9875
9876
9878 {
9880 }
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9924 {
9926 return false;
9927 return true;
9928 }
9929
9931 {
9932
9934 }
9935
9936
9939 {
9940 super.CheckForRoofLimited(timeTresholdMS);
9941
9943 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9944 {
9945 m_PreviousRoofTestTime = time;
9946 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9947 }
9948 }
9949
9950
9952 {
9954 {
9955 return 0;
9956 }
9957
9958 if (GetInventory().GetAttachmentSlotsCount() != 0)
9959 {
9960 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9961 if (filter)
9962 return filter.GetProtectionLevel(type, false, system);
9963 else
9964 return 0;
9965 }
9966
9967 string subclassPath, entryName;
9968
9969 switch (type)
9970 {
9972 entryName = "biological";
9973 break;
9975 entryName = "chemical";
9976 break;
9977 default:
9978 entryName = "biological";
9979 break;
9980 }
9981
9982 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9983
9985 }
9986
9987
9988
9991 {
9992 if (!IsMagazine())
9994
9996 }
9997
9998
9999
10000
10001
10006 {
10007 return true;
10008 }
10009
10011 {
10013 }
10014
10015
10016
10017
10018
10020 {
10021 if (parent)
10022 {
10023 if (parent.IsInherited(DayZInfected))
10024 return true;
10025
10026 if (!parent.IsRuined())
10027 return true;
10028 }
10029
10030 return true;
10031 }
10032
10034 {
10035 if (!super.CanPutAsAttachment(parent))
10036 {
10037 return false;
10038 }
10039
10040 if (!IsRuined() && !parent.IsRuined())
10041 {
10042 return true;
10043 }
10044
10045 return false;
10046 }
10047
10049 {
10050
10051
10052
10053
10054 return super.CanReceiveItemIntoCargo(item);
10055 }
10056
10058 {
10059
10060
10061
10062
10063 GameInventory attachmentInv = attachment.GetInventory();
10065 {
10066 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10067 return false;
10068 }
10069
10070 InventoryLocation loc = new InventoryLocation();
10071 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10072 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10073 return false;
10074
10075 return super.CanReceiveAttachment(attachment, slotId);
10076 }
10077
10079 {
10080 if (!super.CanReleaseAttachment(attachment))
10081 return false;
10082
10083 return GetInventory().AreChildrenAccessible();
10084 }
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10107 {
10108 int id = muzzle_owner.GetMuzzleID();
10109 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10110
10111 if (WPOF_array)
10112 {
10113 for (int i = 0; i < WPOF_array.Count(); i++)
10114 {
10115 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10116
10117 if (WPOF)
10118 {
10119 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10120 }
10121 }
10122 }
10123 }
10124
10125
10127 {
10128 int id = muzzle_owner.GetMuzzleID();
10130
10131 if (WPOBE_array)
10132 {
10133 for (int i = 0; i < WPOBE_array.Count(); i++)
10134 {
10135 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10136
10137 if (WPOBE)
10138 {
10139 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10140 }
10141 }
10142 }
10143 }
10144
10145
10147 {
10148 int id = muzzle_owner.GetMuzzleID();
10149 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10150
10151 if (WPOOH_array)
10152 {
10153 for (int i = 0; i < WPOOH_array.Count(); i++)
10154 {
10155 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10156
10157 if (WPOOH)
10158 {
10159 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10160 }
10161 }
10162 }
10163 }
10164
10165
10167 {
10168 int id = muzzle_owner.GetMuzzleID();
10169 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10170
10171 if (WPOOH_array)
10172 {
10173 for (int i = 0; i < WPOOH_array.Count(); i++)
10174 {
10175 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10176
10177 if (WPOOH)
10178 {
10179 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10180 }
10181 }
10182 }
10183 }
10184
10185
10187 {
10188 int id = muzzle_owner.GetMuzzleID();
10189 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10190
10191 if (WPOOH_array)
10192 {
10193 for (int i = 0; i < WPOOH_array.Count(); i++)
10194 {
10195 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10196
10197 if (WPOOH)
10198 {
10199 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10200 }
10201 }
10202 }
10203 }
10204
10205
10206
10208 {
10210 {
10211 return true;
10212 }
10213
10214 return false;
10215 }
10216
10218 {
10220 {
10221 return true;
10222 }
10223
10224 return false;
10225 }
10226
10228 {
10230 {
10231 return true;
10232 }
10233
10234 return false;
10235 }
10236
10238 {
10239 return false;
10240 }
10241
10244 {
10245 return UATimeSpent.DEFAULT_DEPLOY;
10246 }
10247
10248
10249
10250
10252 {
10254 SetSynchDirty();
10255 }
10256
10258 {
10260 }
10261
10262
10264 {
10265 return false;
10266 }
10267
10270 {
10271 string att_type = "None";
10272
10273 if (ConfigIsExisting("soundAttType"))
10274 {
10275 att_type = ConfigGetString("soundAttType");
10276 }
10277
10279 }
10280
10282 {
10284 }
10285
10286
10287
10288
10289
10293
10295 {
10298
10300 }
10301
10302
10304 {
10306 return;
10307
10309
10312
10315
10316 SoundParameters params = new SoundParameters();
10320 }
10321
10322
10324 {
10326 return;
10327
10329 SetSynchDirty();
10330
10333 }
10334
10335
10337 {
10339 return;
10340
10342 SetSynchDirty();
10343
10346 }
10347
10349 {
10351 }
10352
10354 {
10356 }
10357
10360 {
10361 if (!
GetGame().IsDedicatedServer())
10362 {
10363 if (ConfigIsExisting("attachSoundSet"))
10364 {
10365 string cfg_path = "";
10366 string soundset = "";
10367 string type_name =
GetType();
10368
10371 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10372 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10373
10374 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10375 {
10376 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10377 {
10378 if (cfg_slot_array[i] == slot_type)
10379 {
10380 soundset = cfg_soundset_array[i];
10381 break;
10382 }
10383 }
10384 }
10385
10386 if (soundset != "")
10387 {
10388 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10390 }
10391 }
10392 }
10393 }
10394
10396 {
10397
10398 }
10399
10400 void OnApply(PlayerBase player);
10401
10403 {
10404 return 1.0;
10405 };
10406
10408 {
10410 }
10411
10413 {
10415 }
10416
10418
10420 {
10421 SetDynamicPhysicsLifeTime(0.01);
10423 }
10424
10426 {
10427 array<string> zone_names = new array<string>;
10428 GetDamageZones(zone_names);
10429 for (int i = 0; i < zone_names.Count(); i++)
10430 {
10431 SetHealthMax(zone_names.Get(i),"Health");
10432 }
10433 SetHealthMax("","Health");
10434 }
10435
10438 {
10439 float global_health = GetHealth01("","Health");
10440 array<string> zones = new array<string>;
10441 GetDamageZones(zones);
10442
10443 for (int i = 0; i < zones.Count(); i++)
10444 {
10445 SetHealth01(zones.Get(i),"Health",global_health);
10446 }
10447 }
10448
10451 {
10452 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10453 }
10454
10456 {
10457 if (!hasRootAsPlayer)
10458 {
10459 if (refParentIB)
10460 {
10461
10462 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10463 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10464
10465 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10466 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10467
10470 }
10471 else
10472 {
10473
10476 }
10477 }
10478 }
10479
10481 {
10483 {
10484 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10485 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10486 {
10487 float heatPermCoef = 1.0;
10489 while (ent)
10490 {
10491 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10492 ent = ent.GetHierarchyParent();
10493 }
10494
10495 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10496 }
10497 }
10498 }
10499
10501 {
10502
10503 EntityAI parent = GetHierarchyParent();
10504 if (!parent)
10505 {
10506 hasParent = false;
10507 hasRootAsPlayer = false;
10508 }
10509 else
10510 {
10511 hasParent = true;
10512 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10513 refParentIB =
ItemBase.Cast(parent);
10514 }
10515 }
10516
10517 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10518 {
10519
10520 }
10521
10523 {
10524
10525 return false;
10526 }
10527
10529 {
10530
10531
10532 return false;
10533 }
10534
10536 {
10537
10538 return false;
10539 }
10540
10543 {
10544 return !GetIsFrozen() &&
IsOpen();
10545 }
10546
10548 {
10549 bool hasParent = false, hasRootAsPlayer = false;
10551
10552 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10553 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10554
10555 if (wwtu || foodDecay)
10556 {
10560
10561 if (processWetness || processTemperature || processDecay)
10562 {
10564
10565 if (processWetness)
10566 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10567
10568 if (processTemperature)
10570
10571 if (processDecay)
10572 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10573 }
10574 }
10575 }
10576
10579 {
10581 }
10582
10584 {
10587
10588 return super.GetTemperatureFreezeThreshold();
10589 }
10590
10592 {
10595
10596 return super.GetTemperatureThawThreshold();
10597 }
10598
10600 {
10603
10604 return super.GetItemOverheatThreshold();
10605 }
10606
10608 {
10610 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10611
10612 return super.GetTemperatureFreezeTime();
10613 }
10614
10616 {
10618 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10619
10620 return super.GetTemperatureThawTime();
10621 }
10622
10627
10629 {
10630 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10631 }
10632
10634 {
10635 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10636 }
10637
10640 {
10642 }
10643
10645 {
10647 }
10648
10650 {
10652 }
10653
10656 {
10657 return null;
10658 }
10659
10662 {
10663 return false;
10664 }
10665
10667 {
10669 {
10672 if (!trg)
10673 {
10675 explosive = this;
10676 }
10677
10678 explosive.PairRemote(trg);
10680
10681 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10682 trg.SetPersistentPairID(persistentID);
10683 explosive.SetPersistentPairID(persistentID);
10684
10685 return true;
10686 }
10687 return false;
10688 }
10689
10692 {
10693 float ret = 1.0;
10696 ret *= GetHealth01();
10697
10698 return ret;
10699 }
10700
10701 #ifdef DEVELOPER
10702 override void SetDebugItem()
10703 {
10704 super.SetDebugItem();
10705 _itemBase = this;
10706 }
10707
10709 {
10710 string text = super.GetDebugText();
10711
10713 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10714
10715 return text;
10716 }
10717 #endif
10718
10720 {
10721 return true;
10722 }
10723
10725
10727
10729 {
10732 }
10733
10734
10742
10758}
10759
10761{
10763 if (entity)
10764 {
10765 bool is_item = entity.IsInherited(
ItemBase);
10766 if (is_item && full_quantity)
10767 {
10770 }
10771 }
10772 else
10773 {
10775 return NULL;
10776 }
10777 return entity;
10778}
10779
10781{
10782 if (item)
10783 {
10784 if (health > 0)
10785 item.SetHealth("", "", health);
10786
10787 if (item.CanHaveTemperature())
10788 {
10790 if (item.CanFreeze())
10791 item.SetFrozen(false);
10792 }
10793
10794 if (item.HasEnergyManager())
10795 {
10796 if (quantity >= 0)
10797 {
10798 item.GetCompEM().SetEnergy0To1(quantity);
10799 }
10800 else
10801 {
10803 }
10804 }
10805 else if (item.IsMagazine())
10806 {
10807 Magazine mag = Magazine.Cast(item);
10808 if (quantity >= 0)
10809 {
10810 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10811 }
10812 else
10813 {
10815 }
10816
10817 }
10818 else
10819 {
10820 if (quantity >= 0)
10821 {
10822 item.SetQuantityNormalized(quantity, false);
10823 }
10824 else
10825 {
10827 }
10828
10829 }
10830 }
10831}
10832
10833#ifdef DEVELOPER
10835#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.