5987{
5989 {
5990 return true;
5991 }
5992};
5993
5994
5995
5997{
6001
6003
6006
6007
6008
6009
6010
6019
6025
6030
6035
6056 protected bool m_IsResultOfSplit
6057
6059
6064
6065
6066
6068
6072
6073
6074
6076
6079
6080
6081
6087
6088
6096
6099
6100
6102
6103
6105
6106
6111
6112
6117
6118
6120
6121
6123 {
6128
6129 if (!
GetGame().IsDedicatedServer())
6130 {
6132 {
6134
6136 {
6138 }
6139 }
6140
6143 }
6144
6145 m_OldLocation = null;
6146
6148 {
6150 }
6151
6152 if (ConfigIsExisting("headSelectionsToHide"))
6153 {
6156 }
6157
6159 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6160 {
6162 }
6163
6165
6166 m_IsResultOfSplit = false;
6167
6169 }
6170
6172 {
6173 super.InitItemVariables();
6174
6180 m_Count = ConfigGetInt(
"count");
6181
6184
6189
6192
6197
6209
6213
6214
6217 if (ConfigIsExisting("canBeSplit"))
6218 {
6221 }
6222
6224 if (ConfigIsExisting("itemBehaviour"))
6226
6227
6230 RegisterNetSyncVariableInt("m_VarLiquidType");
6231 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6232
6233 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6234 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6235 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6236
6237 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6238 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6239 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6240 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6241
6242 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6243 RegisterNetSyncVariableBool("m_IsTakeable");
6244 RegisterNetSyncVariableBool("m_IsHologram");
6245
6248 {
6251 }
6252
6254
6256 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6258
6259 }
6260
6262 {
6264 }
6265
6267 {
6270 {
6275 }
6276 }
6277
6278 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6279 {
6281 {
6284 }
6285
6287 }
6288
6290 {
6296 }
6297
6299
6301 {
6303
6304 if (!action)
6305 {
6306 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6307 return;
6308 }
6309
6311 if (!ai)
6312 {
6314 return;
6315 }
6316
6318 if (!action_array)
6319 {
6320 action_array = new array<ActionBase_Basic>;
6322 }
6323 if (LogManager.IsActionLogEnable())
6324 {
6325 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6326 }
6327
6328 if (action_array.Find(action) != -1)
6329 {
6330 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6331 }
6332 else
6333 {
6334 action_array.Insert(action);
6335 }
6336 }
6337
6339 {
6341 ActionBase action = player.GetActionManager().GetAction(actionName);
6344
6345 if (action_array)
6346 {
6347 action_array.RemoveItem(action);
6348 }
6349 }
6350
6351
6352
6354 {
6355 ActionOverrideData overrideData = new ActionOverrideData();
6359
6361 if (!actionMap)
6362 {
6365 }
6366
6367 actionMap.Insert(this.
Type(), overrideData);
6368
6369 }
6370
6372
6374
6375
6377 {
6380
6383
6384 string config_to_search = "CfgVehicles";
6385 string muzzle_owner_config;
6386
6388 {
6389 if (IsInherited(Weapon))
6390 config_to_search = "CfgWeapons";
6391
6392 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6393
6394 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6395
6397
6398 if (config_OnFire_subclass_count > 0)
6399 {
6400 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6401
6402 for (int i = 0; i < config_OnFire_subclass_count; i++)
6403 {
6404 string particle_class = "";
6406 string config_OnFire_entry = config_OnFire_class + particle_class;
6407 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6408 WPOF_array.Insert(WPOF);
6409 }
6410
6411
6413 }
6414 }
6415
6417 {
6418 config_to_search = "CfgWeapons";
6419 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6420
6421 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6422
6424
6425 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6426 {
6427 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6428
6429 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6430 {
6431 string particle_class2 = "";
6433 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6434 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6435 WPOBE_array.Insert(WPOBE);
6436 }
6437
6438
6440 }
6441 }
6442 }
6443
6444
6446 {
6449
6451 {
6452 string config_to_search = "CfgVehicles";
6453
6454 if (IsInherited(Weapon))
6455 config_to_search = "CfgWeapons";
6456
6457 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6458 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6459
6460 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6461 {
6462
6464
6466 {
6468 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6470 return;
6471 }
6472
6475
6476
6477
6479 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6480
6481 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6482 {
6483 string particle_class = "";
6485 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6487
6488 if (entry_type == CT_CLASS)
6489 {
6490 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6491 WPOOH_array.Insert(WPOF);
6492 }
6493 }
6494
6495
6497 }
6498 }
6499 }
6500
6502 {
6504 }
6505
6507 {
6509 {
6511
6514
6517
6518 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6519 }
6520 }
6521
6523 {
6525 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6526
6528 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6529
6531 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6532
6534 {
6536 }
6537 }
6538
6540 {
6542 }
6543
6545 {
6548 else
6550
6552 {
6555 }
6556 else
6557 {
6560
6563 }
6564
6566 }
6567
6569 {
6571 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6572 }
6573
6575 {
6577 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6579 }
6580
6582 {
6584 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6585 }
6586
6588 {
6591
6592 OverheatingParticle OP = new OverheatingParticle();
6597
6599 }
6600
6602 {
6605
6606 return -1;
6607 }
6608
6610 {
6612 {
6615
6616 for (int i = count; i > 0; --i)
6617 {
6618 int id = i - 1;
6621
6624
6625 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6626 {
6627 if (p)
6628 {
6631 }
6632 }
6633 }
6634 }
6635 }
6636
6638 {
6640 {
6642 {
6643 int id = i - 1;
6645
6646 if (OP)
6647 {
6649
6650 if (p)
6651 {
6653 }
6654
6655 delete OP;
6656 }
6657 }
6658
6661 }
6662 }
6663
6666 {
6667 return 0.0;
6668 }
6669
6670
6672 {
6673 return 250;
6674 }
6675
6677 {
6678 return 0;
6679 }
6680
6683 {
6685 return true;
6686
6687 return false;
6688 }
6689
6692 {
6695
6697 {
6699 }
6700 else
6701 {
6702
6704 }
6705
6707 }
6708
6715 {
6716 return -1;
6717 }
6718
6719
6720
6721
6723 {
6725 {
6727 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6728
6729 if (r_index >= 0)
6730 {
6731 InventoryLocation r_il = new InventoryLocation;
6732 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6733
6734 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6737 {
6738 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6739 }
6741 {
6742 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6743 }
6744
6745 }
6746
6747 player.GetHumanInventory().ClearUserReservedLocation(this);
6748 }
6749
6752 }
6753
6754
6755
6756
6758 {
6759 return ItemBase.m_DebugActionsMask;
6760 }
6761
6763 {
6764 return ItemBase.m_DebugActionsMask & mask;
6765 }
6766
6768 {
6769 ItemBase.m_DebugActionsMask = mask;
6770 }
6771
6773 {
6774 ItemBase.m_DebugActionsMask |= mask;
6775 }
6776
6778 {
6779 ItemBase.m_DebugActionsMask &= ~mask;
6780 }
6781
6783 {
6785 {
6787 }
6788 else
6789 {
6791 }
6792 }
6793
6794
6796 {
6797 if (GetEconomyProfile())
6798 {
6799 float q_max = GetEconomyProfile().GetQuantityMax();
6800 if (q_max > 0)
6801 {
6802 float q_min = GetEconomyProfile().GetQuantityMin();
6803 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6804
6806 {
6807 ComponentEnergyManager comp = GetCompEM();
6809 {
6811 }
6812 }
6814 {
6816
6817 }
6818
6819 }
6820 }
6821 }
6822
6825 {
6826 EntityAI parent = GetHierarchyParent();
6827
6828 if (parent)
6829 {
6830 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6831 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6832 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6833 }
6834 }
6835
6838 {
6839 EntityAI parent = GetHierarchyParent();
6840
6841 if (parent)
6842 {
6843 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6844 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6845 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6846 }
6847 }
6848
6850 {
6851
6852
6853
6854
6856
6858 {
6859 if (ScriptInputUserData.CanStoreInputUserData())
6860 {
6861 ScriptInputUserData ctx = new ScriptInputUserData;
6867 ctx.
Write(use_stack_max);
6870
6872 {
6873 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6874 }
6875 }
6876 }
6877 else if (!
GetGame().IsMultiplayer())
6878 {
6880 }
6881 }
6882
6884 {
6886 }
6887
6889 {
6891 }
6892
6894 {
6896 }
6897
6899 {
6900
6901 return false;
6902 }
6903
6905 {
6906 return false;
6907 }
6908
6912 {
6913 return false;
6914 }
6915
6917 {
6918 return "";
6919 }
6920
6922
6924 {
6925 return false;
6926 }
6927
6929 {
6930 return true;
6931 }
6932
6933
6934
6936 {
6937 return true;
6938 }
6939
6941 {
6942 return true;
6943 }
6944
6946 {
6947 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
6949 }
6950
6952 {
6954 }
6955
6957 {
6959 if (!is_being_placed)
6961 SetSynchDirty();
6962 }
6963
6964
6966
6968 {
6970 }
6971
6973 {
6975 }
6976
6978 {
6979 return 1;
6980 }
6981
6983 {
6984 return false;
6985 }
6986
6988 {
6990 SetSynchDirty();
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
7022
7023
7024
7025
7026
7028 {
7029 super.OnMovedInsideCargo(container);
7030
7031 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7032 }
7033
7034 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7035 {
7036 super.EEItemLocationChanged(oldLoc,newLoc);
7037
7038 PlayerBase new_player = null;
7039 PlayerBase old_player = null;
7040
7041 if (newLoc.GetParent())
7042 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7043
7044 if (oldLoc.GetParent())
7045 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7046
7048 {
7049 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7050
7051 if (r_index >= 0)
7052 {
7053 InventoryLocation r_il = new InventoryLocation;
7054 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7055
7056 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7059 {
7060 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7061 }
7063 {
7064 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7065 }
7066
7067 }
7068 }
7069
7071 {
7072 if (new_player)
7073 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7074
7075 if (new_player == old_player)
7076 {
7077
7078 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7079 {
7081 {
7082 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7083 {
7084 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7085 }
7086 }
7087 else
7088 {
7089 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7090 }
7091 }
7092
7093 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7094 {
7095 int type = oldLoc.GetType();
7097 {
7098 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7099 }
7101 {
7102 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7103 }
7104 }
7105 if (!m_OldLocation)
7106 {
7107 m_OldLocation = new InventoryLocation;
7108 }
7109 m_OldLocation.Copy(oldLoc);
7110 }
7111 else
7112 {
7113 if (m_OldLocation)
7114 {
7115 m_OldLocation.Reset();
7116 }
7117 }
7118
7120 }
7121 else
7122 {
7123 if (new_player)
7124 {
7125 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7126 if (res_index >= 0)
7127 {
7128 InventoryLocation il = new InventoryLocation;
7129 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7131 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7134 {
7135 il.
GetParent().GetOnReleaseLock().Invoke(it);
7136 }
7138 {
7140 }
7141
7142 }
7143 }
7145 {
7146
7148 }
7149
7150 if (m_OldLocation)
7151 {
7152 m_OldLocation.Reset();
7153 }
7154 }
7155 }
7156
7157 override void EOnContact(IEntity other, Contact extra)
7158 {
7160 {
7161 int liquidType = -1;
7163 if (impactSpeed > 0.0)
7164 {
7166 #ifndef SERVER
7168 #else
7170 SetSynchDirty();
7171 #endif
7173 }
7174 }
7175
7176 #ifdef SERVER
7177 if (GetCompEM() && GetCompEM().IsPlugged())
7178 {
7179 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7180 GetCompEM().UnplugThis();
7181 }
7182 #endif
7183 }
7184
7186
7188 {
7190 }
7191
7193 {
7194
7195 }
7196
7198 {
7199 super.OnItemLocationChanged(old_owner, new_owner);
7200
7201 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7202 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7203
7204 if (!relatedPlayer && playerNew)
7205 relatedPlayer = playerNew;
7206
7207 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7208 {
7210 if (actionMgr)
7211 {
7212 ActionBase currentAction = actionMgr.GetRunningAction();
7213 if (currentAction)
7215 }
7216 }
7217
7218 Man ownerPlayerOld = null;
7219 Man ownerPlayerNew = null;
7220
7221 if (old_owner)
7222 {
7223 if (old_owner.
IsMan())
7224 {
7225 ownerPlayerOld = Man.Cast(old_owner);
7226 }
7227 else
7228 {
7229 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7230 }
7231 }
7232 else
7233 {
7235 {
7237
7238 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7239 {
7240 GetCompEM().UnplugThis();
7241 }
7242 }
7243 }
7244
7245 if (new_owner)
7246 {
7247 if (new_owner.
IsMan())
7248 {
7249 ownerPlayerNew = Man.Cast(new_owner);
7250 }
7251 else
7252 {
7253 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7254 }
7255 }
7256
7257 if (ownerPlayerOld != ownerPlayerNew)
7258 {
7259 if (ownerPlayerOld)
7260 {
7261 array<EntityAI> subItemsExit = new array<EntityAI>;
7263 for (int i = 0; i < subItemsExit.Count(); i++)
7264 {
7267 }
7268 }
7269
7270 if (ownerPlayerNew)
7271 {
7272 array<EntityAI> subItemsEnter = new array<EntityAI>;
7274 for (int j = 0; j < subItemsEnter.Count(); j++)
7275 {
7278 }
7279 }
7280 }
7281 else if (ownerPlayerNew != null)
7282 {
7283 PlayerBase nplayer;
7284 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7285 {
7286 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7288 for (int k = 0; k < subItemsUpdate.Count(); k++)
7289 {
7291 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7292 }
7293 }
7294 }
7295
7296 if (old_owner)
7297 old_owner.OnChildItemRemoved(this);
7298 if (new_owner)
7299 new_owner.OnChildItemReceived(this);
7300 }
7301
7302
7304 {
7305 super.EEDelete(parent);
7306 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7307 if (player)
7308 {
7310
7311 if (player.IsAlive())
7312 {
7313 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7314 if (r_index >= 0)
7315 {
7316 InventoryLocation r_il = new InventoryLocation;
7317 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7318
7319 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7322 {
7323 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7324 }
7326 {
7327 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7328 }
7329
7330 }
7331
7332 player.RemoveQuickBarEntityShortcut(this);
7333 }
7334 }
7335 }
7336
7338 {
7339 super.EEKilled(killer);
7340
7343 {
7344 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7345 {
7346 if (IsMagazine())
7347 {
7348 if (Magazine.Cast(this).GetAmmoCount() > 0)
7349 {
7351 }
7352 }
7353 else
7354 {
7356 }
7357 }
7358 }
7359 }
7360
7362 {
7363 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7364
7365 super.OnWasAttached(parent, slot_id);
7366
7369
7371 }
7372
7374 {
7375 super.OnWasDetached(parent, slot_id);
7376
7379 }
7380
7382 {
7383 int idx;
7386
7387 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7388 if (inventory_slots.Count() < 1)
7389 {
7390 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7391 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7392 }
7393 else
7394 {
7395 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7396 }
7397
7398 idx = inventory_slots.Find(slot);
7399 if (idx < 0)
7400 return "";
7401
7402 return attach_types.Get(idx);
7403 }
7404
7406 {
7407 int idx = -1;
7408 string slot;
7409
7412
7413 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7414 if (inventory_slots.Count() < 1)
7415 {
7416 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7417 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7418 }
7419 else
7420 {
7421 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7422 if (detach_types.Count() < 1)
7423 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7424 }
7425
7426 for (int i = 0; i < inventory_slots.Count(); i++)
7427 {
7428 slot = inventory_slots.Get(i);
7429 }
7430
7431 if (slot != "")
7432 {
7433 if (detach_types.Count() == 1)
7434 idx = 0;
7435 else
7436 idx = inventory_slots.Find(slot);
7437 }
7438 if (idx < 0)
7439 return "";
7440
7441 return detach_types.Get(idx);
7442 }
7443
7445 {
7446
7448
7449
7450 float min_time = 1;
7451 float max_time = 3;
7452 float delay = Math.RandomFloat(min_time, max_time);
7453
7454 explode_timer.Run(delay, this, "DoAmmoExplosion");
7455 }
7456
7458 {
7459 Magazine magazine = Magazine.Cast(this);
7460 int pop_sounds_count = 6;
7461 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7462
7463
7464 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7465 string sound_name = pop_sounds[ sound_idx ];
7467
7468
7469 magazine.ServerAddAmmoCount(-1);
7470
7471
7472 float min_temp_to_explode = 100;
7473
7474 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7475 {
7477 }
7478 }
7479
7480
7481 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7482 {
7483 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7484
7485 const int CHANCE_DAMAGE_CARGO = 4;
7486 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7487 const int CHANCE_DAMAGE_NOTHING = 2;
7488
7490 {
7491 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7492 int chances;
7493 int rnd;
7494
7495 if (GetInventory().GetCargo())
7496 {
7497 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7498 rnd = Math.RandomInt(0,chances);
7499
7500 if (rnd < CHANCE_DAMAGE_CARGO)
7501 {
7503 }
7504 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7505 {
7507 }
7508 }
7509 else
7510 {
7511 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7512 rnd = Math.RandomInt(0,chances);
7513
7514 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7515 {
7517 }
7518 }
7519 }
7520 }
7521
7523 {
7524 if (GetInventory().GetCargo())
7525 {
7526 int item_count = GetInventory().GetCargo().GetItemCount();
7527 if (item_count > 0)
7528 {
7529 int random_pick = Math.RandomInt(0, item_count);
7531 if (!item.IsExplosive())
7532 {
7533 item.AddHealth("","",damage);
7534 return true;
7535 }
7536 }
7537 }
7538 return false;
7539 }
7540
7542 {
7543 int attachment_count = GetInventory().AttachmentCount();
7544 if (attachment_count > 0)
7545 {
7546 int random_pick = Math.RandomInt(0, attachment_count);
7547 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7548 if (!attachment.IsExplosive())
7549 {
7550 attachment.AddHealth("","",damage);
7551 return true;
7552 }
7553 }
7554 return false;
7555 }
7556
7558 {
7560 }
7561
7563 {
7565 return GetInventory().CanRemoveEntity();
7566
7567 return false;
7568 }
7569
7571 {
7573 return;
7574
7576 {
7577 if (ScriptInputUserData.CanStoreInputUserData())
7578 {
7579 ScriptInputUserData ctx = new ScriptInputUserData;
7584 ctx.
Write(destination_entity);
7588 }
7589 }
7590 else if (!
GetGame().IsMultiplayer())
7591 {
7593 }
7594 }
7595
7597 {
7599 return;
7600
7601 float split_quantity_new;
7605 InventoryLocation loc = new InventoryLocation;
7606
7607 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7608 {
7610 split_quantity_new = stack_max;
7611 else
7613
7614 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7615 if (new_item)
7616 {
7617 new_item.SetResultOfSplit(true);
7618 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7620 new_item.SetQuantity(split_quantity_new);
7621 }
7622 }
7623 else if (destination_entity && slot_id == -1)
7624 {
7625 if (quantity > stack_max)
7626 split_quantity_new = stack_max;
7627 else
7628 split_quantity_new = quantity;
7629
7631 {
7634 }
7635
7636 if (new_item)
7637 {
7638 new_item.SetResultOfSplit(true);
7639 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7641 new_item.SetQuantity(split_quantity_new);
7642 }
7643 }
7644 else
7645 {
7646 if (stack_max != 0)
7647 {
7649 {
7651 }
7652
7653 if (split_quantity_new == 0)
7654 {
7655 if (!
GetGame().IsMultiplayer())
7656 player.PhysicalPredictiveDropItem(this);
7657 else
7658 player.ServerDropEntity(this);
7659 return;
7660 }
7661
7663
7664 if (new_item)
7665 {
7666 new_item.SetResultOfSplit(true);
7667 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7669 new_item.SetQuantity(stack_max);
7670 new_item.PlaceOnSurface();
7671 }
7672 }
7673 }
7674 }
7675
7677 {
7679 return;
7680
7681 float split_quantity_new;
7685 InventoryLocation loc = new InventoryLocation;
7686
7687 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7688 {
7690 split_quantity_new = stack_max;
7691 else
7693
7694 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7695 if (new_item)
7696 {
7697 new_item.SetResultOfSplit(true);
7698 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7700 new_item.SetQuantity(split_quantity_new);
7701 }
7702 }
7703 else if (destination_entity && slot_id == -1)
7704 {
7705 if (quantity > stack_max)
7706 split_quantity_new = stack_max;
7707 else
7708 split_quantity_new = quantity;
7709
7711 {
7714 }
7715
7716 if (new_item)
7717 {
7718 new_item.SetResultOfSplit(true);
7719 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7721 new_item.SetQuantity(split_quantity_new);
7722 }
7723 }
7724 else
7725 {
7726 if (stack_max != 0)
7727 {
7729 {
7731 }
7732
7734
7735 if (new_item)
7736 {
7737 new_item.SetResultOfSplit(true);
7738 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7740 new_item.SetQuantity(stack_max);
7741 new_item.PlaceOnSurface();
7742 }
7743 }
7744 }
7745 }
7746
7748 {
7750 return;
7751
7753 {
7754 if (ScriptInputUserData.CanStoreInputUserData())
7755 {
7756 ScriptInputUserData ctx = new ScriptInputUserData;
7761 dst.WriteToContext(ctx);
7763 }
7764 }
7765 else if (!
GetGame().IsMultiplayer())
7766 {
7768 }
7769 }
7770
7772 {
7774 return;
7775
7777 {
7778 if (ScriptInputUserData.CanStoreInputUserData())
7779 {
7780 ScriptInputUserData ctx = new ScriptInputUserData;
7785 ctx.
Write(destination_entity);
7791 }
7792 }
7793 else if (!
GetGame().IsMultiplayer())
7794 {
7796 }
7797 }
7798
7800 {
7802 }
7803
7805 {
7807 return this;
7808
7810 float split_quantity_new;
7812 if (dst.IsValid())
7813 {
7814 int slot_id = dst.GetSlot();
7816
7817 if (quantity > stack_max)
7818 split_quantity_new = stack_max;
7819 else
7820 split_quantity_new = quantity;
7821
7823
7824 if (new_item)
7825 {
7826 new_item.SetResultOfSplit(true);
7827 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7830 }
7831
7832 return new_item;
7833 }
7834
7835 return null;
7836 }
7837
7839 {
7841 return;
7842
7844 float split_quantity_new;
7846 if (destination_entity)
7847 {
7849 if (quantity > stackable)
7850 split_quantity_new = stackable;
7851 else
7852 split_quantity_new = quantity;
7853
7854 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7855 if (new_item)
7856 {
7857 new_item.SetResultOfSplit(true);
7858 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7860 new_item.SetQuantity(split_quantity_new);
7861 }
7862 }
7863 }
7864
7866 {
7868 return;
7869
7871 {
7872 if (ScriptInputUserData.CanStoreInputUserData())
7873 {
7874 ScriptInputUserData ctx = new ScriptInputUserData;
7879 ItemBase destination_entity =
this;
7880 ctx.
Write(destination_entity);
7884 }
7885 }
7886 else if (!
GetGame().IsMultiplayer())
7887 {
7889 }
7890 }
7891
7893 {
7895 return;
7896
7898 float split_quantity_new;
7900 if (player)
7901 {
7903 if (quantity > stackable)
7904 split_quantity_new = stackable;
7905 else
7906 split_quantity_new = quantity;
7907
7908 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
7909 new_item =
ItemBase.Cast(in_hands);
7910 if (new_item)
7911 {
7912 new_item.SetResultOfSplit(true);
7913 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7915 new_item.SetQuantity(split_quantity_new);
7916 }
7917 }
7918 }
7919
7921 {
7923 return;
7924
7926 float split_quantity_new = Math.Floor(quantity * 0.5);
7927
7929
7930 if (new_item)
7931 {
7932 if (new_item.GetQuantityMax() < split_quantity_new)
7933 {
7934 split_quantity_new = new_item.GetQuantityMax();
7935 }
7936
7937 new_item.SetResultOfSplit(true);
7938 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7939
7941 {
7944 }
7945 else
7946 {
7949 }
7950 }
7951 }
7952
7954 {
7956 return;
7957
7959 float split_quantity_new = Math.Floor(quantity / 2);
7960
7961 InventoryLocation invloc = new InventoryLocation;
7963
7965 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
7966
7967 if (new_item)
7968 {
7969 if (new_item.GetQuantityMax() < split_quantity_new)
7970 {
7971 split_quantity_new = new_item.GetQuantityMax();
7972 }
7974 {
7977 }
7978 else
7979 {
7982 }
7983 }
7984 }
7985
7988 {
7989 SetWeightDirty();
7991
7992 if (parent)
7993 parent.OnAttachmentQuantityChangedEx(this, delta);
7994
7996 {
7998 {
8000 }
8002 {
8003 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8005 }
8006 }
8007
8008 }
8009
8012 {
8013
8014 }
8015
8018 {
8020 }
8021
8023 {
8024 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8025
8027 {
8028 if (newLevel == GameConstants.STATE_RUINED)
8029 {
8031 EntityAI parent = GetHierarchyParent();
8032 if (parent && parent.IsFireplace())
8033 {
8034 CargoBase cargo = GetInventory().GetCargo();
8035 if (cargo)
8036 {
8038 {
8040 }
8041 }
8042 }
8043 }
8044
8046 {
8047
8049 return;
8050 }
8051
8052 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8053 {
8055 }
8056 }
8057 }
8058
8059
8061 {
8062 super.OnRightClick();
8063
8065 {
8067 {
8068 if (ScriptInputUserData.CanStoreInputUserData())
8069 {
8070 vector m4[4];
8072
8073 EntityAI root = GetHierarchyRoot();
8074
8075 InventoryLocation dst = new InventoryLocation;
8077 {
8078 if (root)
8079 {
8080 root.GetTransform(m4);
8082 }
8083 else
8084 GetInventory().GetCurrentInventoryLocation(dst);
8085 }
8086 else
8087 {
8089
8090
8091 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8092 {
8093 if (root)
8094 {
8095 root.GetTransform(m4);
8097 }
8098 else
8099 GetInventory().GetCurrentInventoryLocation(dst);
8100 }
8101 else
8102 {
8103 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8104 }
8105 }
8106
8107 ScriptInputUserData ctx = new ScriptInputUserData;
8115 }
8116 }
8117 else if (!
GetGame().IsMultiplayer())
8118 {
8120 }
8121 }
8122 }
8123
8124 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8125 {
8126
8127 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8128 return false;
8129
8130 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8131 return false;
8132
8133
8135 return false;
8136
8137
8138 Magazine mag = Magazine.Cast(this);
8139 if (mag)
8140 {
8141 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8142 return false;
8143
8144 if (stack_max_limit)
8145 {
8146 Magazine other_mag = Magazine.Cast(other_item);
8147 if (other_item)
8148 {
8149 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8150 return false;
8151 }
8152
8153 }
8154 }
8155 else
8156 {
8157
8159 return false;
8160
8162 return false;
8163 }
8164
8165 PlayerBase player = null;
8166 if (CastTo(player, GetHierarchyRootPlayer()))
8167 {
8168 if (player.GetInventory().HasAttachment(this))
8169 return false;
8170
8171 if (player.IsItemsToDelete())
8172 return false;
8173 }
8174
8175 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8176 return false;
8177
8178 int slotID;
8180 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8181 return false;
8182
8183 return true;
8184 }
8185
8187 {
8189 }
8190
8192 {
8193 return m_IsResultOfSplit;
8194 }
8195
8197 {
8198 m_IsResultOfSplit = value;
8199 }
8200
8202 {
8204 }
8205
8207 {
8208 float other_item_quantity = other_item.GetQuantity();
8209 float this_free_space;
8210
8212
8214
8215 if (other_item_quantity > this_free_space)
8216 {
8217 return this_free_space;
8218 }
8219 else
8220 {
8221 return other_item_quantity;
8222 }
8223 }
8224
8226 {
8228 }
8229
8231 {
8233 return;
8234
8235 if (!IsMagazine() && other_item)
8236 {
8238 if (quantity_used != 0)
8239 {
8240 float hp1 = GetHealth01("","");
8241 float hp2 = other_item.GetHealth01("","");
8242 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8243 hpResult = hpResult / (
GetQuantity() + quantity_used);
8244
8245 hpResult *= GetMaxHealth();
8246 Math.Round(hpResult);
8247 SetHealth("", "Health", hpResult);
8248
8250 other_item.AddQuantity(-quantity_used);
8251 }
8252 }
8254 }
8255
8257 {
8258 #ifdef SERVER
8259 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8260 GetHierarchyParent().IncreaseLifetimeUp();
8261 #endif
8262 };
8263
8265 {
8266 PlayerBase p = PlayerBase.Cast(player);
8267
8268 array<int> recipesIds = p.m_Recipes;
8269 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8270 if (moduleRecipesManager)
8271 {
8272 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8273 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8274 }
8275
8276 for (int i = 0;i < recipesIds.Count(); i++)
8277 {
8278 int key = recipesIds.Get(i);
8279 string recipeName = moduleRecipesManager.GetRecipeName(key);
8281 }
8282 }
8283
8284
8285 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8286 {
8287 super.GetDebugActions(outputList);
8288
8289
8294
8295
8299
8303
8304
8307
8308
8310 {
8313 }
8314
8316
8319
8323 }
8324
8325
8326
8327
8329 {
8330 super.OnAction(action_id, player, ctx);
8331 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8332 {
8333 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8334 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8335 PlayerBase p = PlayerBase.Cast(player);
8336 if (
EActions.RECIPES_RANGE_START < 1000)
8337 {
8338 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8339 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8340 }
8341 }
8342 #ifndef SERVER
8343 else if (action_id ==
EActions.WATCH_PLAYER)
8344 {
8345 PluginDeveloper.SetDeveloperItemClientEx(player);
8346 }
8347 #endif
8349 {
8350 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8351 {
8352 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8353 OnDebugButtonPressServer(id + 1);
8354 }
8355
8356 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8357 {
8358 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8360 }
8361
8362 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8363 {
8364 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8366 }
8367
8368 else if (action_id ==
EActions.ADD_QUANTITY)
8369 {
8370 if (IsMagazine())
8371 {
8372 Magazine mag = Magazine.Cast(this);
8373 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8374 }
8375 else
8376 {
8378 }
8379
8380 if (m_EM)
8381 {
8382 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8383 }
8384
8385 }
8386
8387 else if (action_id ==
EActions.REMOVE_QUANTITY)
8388 {
8389 if (IsMagazine())
8390 {
8391 Magazine mag2 = Magazine.Cast(this);
8392 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8393 }
8394 else
8395 {
8397 }
8398 if (m_EM)
8399 {
8400 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8401 }
8402
8403 }
8404
8405 else if (action_id ==
EActions.SET_QUANTITY_0)
8406 {
8408
8409 if (m_EM)
8410 {
8411 m_EM.SetEnergy(0);
8412 }
8413 }
8414
8415 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8416 {
8418
8419 if (m_EM)
8420 {
8421 m_EM.SetEnergy(m_EM.GetEnergyMax());
8422 }
8423 }
8424
8425 else if (action_id ==
EActions.ADD_HEALTH)
8426 {
8427 AddHealth("","",GetMaxHealth("","Health")/5);
8428 }
8429 else if (action_id ==
EActions.REMOVE_HEALTH)
8430 {
8431 AddHealth("","",-GetMaxHealth("","Health")/5);
8432 }
8433 else if (action_id ==
EActions.DESTROY_HEALTH)
8434 {
8435 SetHealth01("","",0);
8436 }
8437 else if (action_id ==
EActions.WATCH_ITEM)
8438 {
8440 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8441 #ifdef DEVELOPER
8442 SetDebugDeveloper_item(this);
8443 #endif
8444 }
8445
8446 else if (action_id ==
EActions.ADD_TEMPERATURE)
8447 {
8448 AddTemperature(20);
8449
8450 }
8451
8452 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8453 {
8454 AddTemperature(-20);
8455
8456 }
8457
8458 else if (action_id ==
EActions.FLIP_FROZEN)
8459 {
8460 SetFrozen(!GetIsFrozen());
8461
8462 }
8463
8464 else if (action_id ==
EActions.ADD_WETNESS)
8465 {
8467
8468 }
8469
8470 else if (action_id ==
EActions.REMOVE_WETNESS)
8471 {
8473
8474 }
8475
8476 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8477 {
8480
8481
8482 }
8483
8484 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8485 {
8488 }
8489
8490 else if (action_id ==
EActions.MAKE_SPECIAL)
8491 {
8492 auto debugParams = DebugSpawnParams.WithPlayer(player);
8493 OnDebugSpawnEx(debugParams);
8494 }
8495
8496 else if (action_id ==
EActions.DELETE)
8497 {
8498 Delete();
8499 }
8500
8501 }
8502
8503
8504 return false;
8505 }
8506
8507
8508
8509
8513
8516
8517
8518
8520 {
8521 return false;
8522 }
8523
8524
8526 {
8527 return true;
8528 }
8529
8530
8532 {
8533 return true;
8534 }
8535
8536
8537
8539 {
8540 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8542 }
8543
8546 {
8547 return null;
8548 }
8549
8551 {
8552 return false;
8553 }
8554
8556 {
8557 return false;
8558 }
8559
8563
8564
8566 {
8567 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8568 return module_repairing.CanRepair(this, item_repair_kit);
8569 }
8570
8571
8572 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8573 {
8574 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8575 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8576 }
8577
8578
8580 {
8581
8582
8583
8584
8585
8586
8587
8588
8589 return 1;
8590 }
8591
8592
8593
8595 {
8597 }
8598
8599
8600
8602 {
8604 }
8605
8606
8615 {
8616 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8617
8618 if (player)
8619 {
8620 player.MessageStatus(text);
8621 }
8622 }
8623
8624
8633 {
8634 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8635
8636 if (player)
8637 {
8638 player.MessageAction(text);
8639 }
8640 }
8641
8642
8651 {
8652 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8653
8654 if (player)
8655 {
8656 player.MessageFriendly(text);
8657 }
8658 }
8659
8660
8669 {
8670 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8671
8672 if (player)
8673 {
8674 player.MessageImportant(text);
8675 }
8676 }
8677
8679 {
8680 return true;
8681 }
8682
8683
8684 override bool KindOf(
string tag)
8685 {
8686 bool found = false;
8687 string item_name = this.
GetType();
8690
8691 int array_size = item_tag_array.Count();
8692 for (int i = 0; i < array_size; i++)
8693 {
8694 if (item_tag_array.Get(i) == tag)
8695 {
8696 found = true;
8697 break;
8698 }
8699 }
8700 return found;
8701 }
8702
8703
8705 {
8706
8707 super.OnRPC(sender, rpc_type,ctx);
8708
8709
8710 switch (rpc_type)
8711 {
8712 #ifndef SERVER
8713 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8714 Param2<bool, string> p = new Param2<bool, string>(false, "");
8715
8717 return;
8718
8719 bool play = p.param1;
8720 string soundSet = p.param2;
8721
8722 if (play)
8723 {
8725 {
8727 {
8729 }
8730 }
8731 else
8732 {
8734 }
8735 }
8736 else
8737 {
8739 }
8740
8741 break;
8742 #endif
8743
8744 }
8745
8747 {
8749 }
8750 }
8751
8752
8753
8754
8756 {
8757 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8758 return plugin.GetID(
name);
8759 }
8760
8762 {
8763 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8764 return plugin.GetName(id);
8765 }
8766
8769 {
8770
8771
8772 int varFlags;
8773 if (!ctx.
Read(varFlags))
8774 return;
8775
8776 if (varFlags & ItemVariableFlags.FLOAT)
8777 {
8779 }
8780 }
8781
8783 {
8784
8785 super.SerializeNumericalVars(floats_out);
8786
8787
8788
8790 {
8792 }
8793
8795 {
8797 }
8798
8800 {
8802 }
8803
8805 {
8810 }
8811
8813 {
8815 }
8816 }
8817
8819 {
8820
8821 super.DeSerializeNumericalVars(floats);
8822
8823
8824 int index = 0;
8825 int mask = Math.Round(floats.Get(index));
8826
8827 index++;
8828
8830 {
8832 {
8834 }
8835 else
8836 {
8837 float quantity = floats.Get(index);
8839 }
8840 index++;
8841 }
8842
8844 {
8845 float wet = floats.Get(index);
8847 index++;
8848 }
8849
8851 {
8852 int liquidtype = Math.Round(floats.Get(index));
8854 index++;
8855 }
8856
8858 {
8860 index++;
8862 index++;
8864 index++;
8866 index++;
8867 }
8868
8870 {
8871 int cleanness = Math.Round(floats.Get(index));
8873 index++;
8874 }
8875 }
8876
8878 {
8879 super.WriteVarsToCTX(ctx);
8880
8881
8883 {
8885 }
8886
8888 {
8890 }
8891
8893 {
8895 }
8896
8898 {
8899 int r,g,b,a;
8905 }
8906
8908 {
8910 }
8911 }
8912
8914 {
8915 if (!super.ReadVarsFromCTX(ctx,version))
8916 return false;
8917
8918 int intValue;
8919 float value;
8920
8921 if (version < 140)
8922 {
8923 if (!ctx.
Read(intValue))
8924 return false;
8925
8926 m_VariablesMask = intValue;
8927 }
8928
8930 {
8931 if (!ctx.
Read(value))
8932 return false;
8933
8935 {
8937 }
8938 else
8939 {
8941 }
8942 }
8943
8944 if (version < 140)
8945 {
8947 {
8948 if (!ctx.
Read(value))
8949 return false;
8950 SetTemperatureDirect(value);
8951 }
8952 }
8953
8955 {
8956 if (!ctx.
Read(value))
8957 return false;
8959 }
8960
8962 {
8963 if (!ctx.
Read(intValue))
8964 return false;
8966 }
8967
8969 {
8970 int r,g,b,a;
8972 return false;
8974 return false;
8976 return false;
8978 return false;
8979
8981 }
8982
8984 {
8985 if (!ctx.
Read(intValue))
8986 return false;
8988 }
8989
8990 if (version >= 138 && version < 140)
8991 {
8993 {
8994 if (!ctx.
Read(intValue))
8995 return false;
8996 SetFrozen(intValue);
8997 }
8998 }
8999
9000 return true;
9001 }
9002
9003
9005 {
9008 {
9010 }
9011
9012 if (!super.OnStoreLoad(ctx, version))
9013 {
9015 return false;
9016 }
9017
9018 if (version >= 114)
9019 {
9020 bool hasQuickBarIndexSaved;
9021
9022 if (!ctx.
Read(hasQuickBarIndexSaved))
9023 {
9025 return false;
9026 }
9027
9028 if (hasQuickBarIndexSaved)
9029 {
9030 int itmQBIndex;
9031
9032
9033 if (!ctx.
Read(itmQBIndex))
9034 {
9036 return false;
9037 }
9038
9039 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9040 if (itmQBIndex != -1 && parentPlayer)
9041 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9042 }
9043 }
9044 else
9045 {
9046
9047 PlayerBase player;
9048 int itemQBIndex;
9049 if (version ==
int.
MAX)
9050 {
9051 if (!ctx.
Read(itemQBIndex))
9052 {
9054 return false;
9055 }
9056 }
9057 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9058 {
9059
9060 if (!ctx.
Read(itemQBIndex))
9061 {
9063 return false;
9064 }
9065 if (itemQBIndex != -1 && player)
9066 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9067 }
9068 }
9069
9070 if (version < 140)
9071 {
9072
9073 if (!LoadVariables(ctx, version))
9074 {
9076 return false;
9077 }
9078 }
9079
9080
9082 {
9084 return false;
9085 }
9086 if (version >= 132)
9087 {
9089 if (raib)
9090 {
9092 {
9094 return false;
9095 }
9096 }
9097 }
9098
9100 return true;
9101 }
9102
9103
9104
9106 {
9107 super.OnStoreSave(ctx);
9108
9109 PlayerBase player;
9110 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9111 {
9113
9114 int itemQBIndex = -1;
9115 itemQBIndex = player.FindQuickBarEntityIndex(this);
9116 ctx.
Write(itemQBIndex);
9117 }
9118 else
9119 {
9121 }
9122
9124
9126 if (raib)
9127 {
9129 }
9130 }
9131
9132
9134 {
9135 super.AfterStoreLoad();
9136
9138 {
9140 }
9141
9143 {
9146 }
9147 }
9148
9150 {
9151 super.EEOnAfterLoad();
9152
9154 {
9156 }
9157
9160 }
9161
9163 {
9164 return false;
9165 }
9166
9167
9168
9170 {
9172 {
9173 #ifdef PLATFORM_CONSOLE
9174
9176 {
9178 if (menu)
9179 {
9181 }
9182 }
9183 #endif
9184 }
9185
9187 {
9190 }
9191
9193 {
9194 SetWeightDirty();
9196 }
9198 {
9201 }
9202
9204 {
9207 }
9209 {
9212 }
9213
9214 super.OnVariablesSynchronized();
9215 }
9216
9217
9218
9220 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9221 {
9222 if (!IsServerCheck(allow_client))
9223 return false;
9224
9226 return false;
9227
9230
9231 if (value <= (min + 0.001))
9232 value = min;
9233
9234 if (value == min)
9235 {
9236 if (destroy_config)
9237 {
9238 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9239 if (dstr)
9240 {
9242 this.Delete();
9243 return true;
9244 }
9245 }
9246 else if (destroy_forced)
9247 {
9249 this.Delete();
9250 return true;
9251 }
9252
9254 }
9255
9258
9260 {
9262
9263 if (delta)
9265 }
9266
9268
9269 return false;
9270 }
9271
9272
9274 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9275 {
9277 }
9278
9280 {
9283 }
9284
9286 {
9289 }
9290
9293 {
9294 float value_clamped = Math.Clamp(value, 0, 1);
9296 SetQuantity(result, destroy_config, destroy_forced);
9297 }
9298
9299
9302 {
9304 }
9305
9307 {
9309 }
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9321 {
9322 int slot = -1;
9323 if (GetInventory())
9324 {
9325 InventoryLocation il = new InventoryLocation;
9326 GetInventory().GetCurrentInventoryLocation(il);
9328 }
9329
9331 }
9332
9334 {
9335 float quantity_max = 0;
9336
9338 {
9339 if (attSlotID != -1)
9340 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9341
9342 if (quantity_max <= 0)
9344 }
9345
9346 if (quantity_max <= 0)
9348
9349 return quantity_max;
9350 }
9351
9353 {
9355 }
9356
9358 {
9360 }
9361
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9374 {
9376 }
9377
9378
9380 {
9381
9382 float weightEx = GetWeightEx();
9383 float special = GetInventoryAndCargoWeight();
9384 return weightEx - special;
9385 }
9386
9387
9389 {
9391 }
9392
9394 {
9396 {
9397 #ifdef DEVELOPER
9398 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9399 {
9400 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9402 }
9403 #endif
9404
9406 }
9407 else if (HasEnergyManager())
9408 {
9409 #ifdef DEVELOPER
9410 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9411 {
9412 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9413 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9414 }
9415 #endif
9416 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9417 }
9418 else
9419 {
9420 #ifdef DEVELOPER
9421 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9422 {
9423 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9424 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9425 }
9426 #endif
9427 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9428 }
9429 }
9430
9433 {
9434 int item_count = 0;
9436
9437 if (GetInventory().GetCargo() != NULL)
9438 {
9439 item_count = GetInventory().GetCargo().GetItemCount();
9440 }
9441
9442 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9443 {
9444 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9445 if (item)
9446 item_count += item.GetNumberOfItems();
9447 }
9448 return item_count;
9449 }
9450
9453 {
9454 float weight = 0;
9455 float wetness = 1;
9456 if (include_wetness)
9459 {
9460 weight = wetness * m_ConfigWeight;
9461 }
9463 {
9464 weight = 1;
9465 }
9466 return weight;
9467 }
9468
9469
9470
9472 {
9473 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9474 {
9475 GameInventory inv = GetInventory();
9476 array<EntityAI> items = new array<EntityAI>;
9478 for (int i = 0; i < items.Count(); i++)
9479 {
9481 if (item)
9482 {
9484 }
9485 }
9486 }
9487 }
9488
9489
9490
9491
9493 {
9494 float energy = 0;
9495 if (HasEnergyManager())
9496 {
9497 energy = GetCompEM().GetEnergy();
9498 }
9499 return energy;
9500 }
9501
9502
9504 {
9505 super.OnEnergyConsumed();
9506
9508 }
9509
9511 {
9512 super.OnEnergyAdded();
9513
9515 }
9516
9517
9519 {
9520 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9521 {
9523 {
9524 float energy_0to1 = GetCompEM().GetEnergy0To1();
9526 }
9527 }
9528 }
9529
9530
9532 {
9533 return ConfigGetFloat("heatIsolation");
9534 }
9535
9537 {
9539 }
9540
9542 {
9543 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9544 if (
GetGame().ConfigIsExisting(paramPath))
9546
9547 return 0.0;
9548 }
9549
9551 {
9552 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9553 if (
GetGame().ConfigIsExisting(paramPath))
9555
9556 return 0.0;
9557 }
9558
9559 override void SetWet(
float value,
bool allow_client =
false)
9560 {
9561 if (!IsServerCheck(allow_client))
9562 return;
9563
9566
9568
9569 m_VarWet = Math.Clamp(value, min, max);
9570
9572 {
9575 }
9576 }
9577
9578 override void AddWet(
float value)
9579 {
9581 }
9582
9584 {
9586 }
9587
9589 {
9591 }
9592
9594 {
9596 }
9597
9599 {
9601 }
9602
9604 {
9606 }
9607
9609 {
9612 if (newLevel != oldLevel)
9613 {
9615 }
9616 }
9617
9619 {
9620 SetWeightDirty();
9621 }
9622
9624 {
9625 return GetWetLevelInternal(
m_VarWet);
9626 }
9627
9628
9629
9631 {
9633 }
9634
9636 {
9638 }
9639
9641 {
9643 }
9644
9646 {
9648 }
9649
9650
9651
9653 {
9654 if (ConfigIsExisting("itemModelLength"))
9655 {
9656 return ConfigGetFloat("itemModelLength");
9657 }
9658 return 0;
9659 }
9660
9662 {
9663 if (ConfigIsExisting("itemAttachOffset"))
9664 {
9665 return ConfigGetFloat("itemAttachOffset");
9666 }
9667 return 0;
9668 }
9669
9670 override void SetCleanness(
int value,
bool allow_client =
false)
9671 {
9672 if (!IsServerCheck(allow_client))
9673 return;
9674
9676
9678
9681 }
9682
9684 {
9686 }
9687
9689 {
9690 return true;
9691 }
9692
9693
9694
9695
9697 {
9699 }
9700
9702 {
9704 }
9705
9706
9707
9708
9709 override void SetColor(
int r,
int g,
int b,
int a)
9710 {
9716 }
9718 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9719 {
9724 }
9725
9727 {
9729 }
9730
9733 {
9734 int r,g,b,a;
9736 r = r/255;
9737 g = g/255;
9738 b = b/255;
9739 a = a/255;
9740 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9741 }
9742
9743
9744
9745 override void SetLiquidType(
int value,
bool allow_client =
false)
9746 {
9747 if (!IsServerCheck(allow_client))
9748 return;
9749
9754 }
9755
9757 {
9758 return ConfigGetInt("varLiquidTypeInit");
9759 }
9760
9762 {
9764 }
9765
9767 {
9769 SetFrozen(false);
9770 }
9771
9774 {
9775 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9776 }
9777
9778
9781 {
9782 PlayerBase nplayer;
9783 if (PlayerBase.CastTo(nplayer, player))
9784 {
9786
9787 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9788 }
9789 }
9790
9791
9794 {
9795 PlayerBase nplayer;
9796 if (PlayerBase.CastTo(nplayer,player))
9797 {
9798
9799 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9800
9801 }
9802
9803
9804 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9805
9806
9807 if (HasEnergyManager())
9808 {
9809 GetCompEM().UpdatePlugState();
9810 }
9811 }
9812
9813
9815 {
9816 super.OnPlacementStarted(player);
9817
9819 }
9820
9821 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9822 {
9824 {
9825 m_AdminLog.OnPlacementComplete(player,
this);
9826 }
9827
9828 super.OnPlacementComplete(player, position, orientation);
9829 }
9830
9831
9832
9833
9834
9836 {
9838 {
9839 return true;
9840 }
9841 else
9842 {
9843 return false;
9844 }
9845 }
9846
9847
9849 {
9851 {
9853 }
9854 }
9855
9856
9858 {
9860 }
9861
9863 {
9865 }
9866
9867 override void InsertAgent(
int agent,
float count = 1)
9868 {
9869 if (count < 1)
9870 return;
9871
9873 }
9874
9877 {
9879 }
9880
9881
9883 {
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
9923
9924
9925
9926
9927
9929 {
9931 return false;
9932 return true;
9933 }
9934
9936 {
9937
9939 }
9940
9941
9944 {
9945 super.CheckForRoofLimited(timeTresholdMS);
9946
9948 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
9949 {
9950 m_PreviousRoofTestTime = time;
9951 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
9952 }
9953 }
9954
9955
9957 {
9959 {
9960 return 0;
9961 }
9962
9963 if (GetInventory().GetAttachmentSlotsCount() != 0)
9964 {
9965 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
9966 if (filter)
9967 return filter.GetProtectionLevel(type, false, system);
9968 else
9969 return 0;
9970 }
9971
9972 string subclassPath, entryName;
9973
9974 switch (type)
9975 {
9977 entryName = "biological";
9978 break;
9980 entryName = "chemical";
9981 break;
9982 default:
9983 entryName = "biological";
9984 break;
9985 }
9986
9987 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
9988
9990 }
9991
9992
9993
9996 {
9997 if (!IsMagazine())
9999
10001 }
10002
10003
10004
10005
10006
10011 {
10012 return true;
10013 }
10014
10016 {
10018 }
10019
10020
10021
10022
10023
10025 {
10026 if (parent)
10027 {
10028 if (parent.IsInherited(DayZInfected))
10029 return true;
10030
10031 if (!parent.IsRuined())
10032 return true;
10033 }
10034
10035 return true;
10036 }
10037
10039 {
10040 if (!super.CanPutAsAttachment(parent))
10041 {
10042 return false;
10043 }
10044
10045 if (!IsRuined() && !parent.IsRuined())
10046 {
10047 return true;
10048 }
10049
10050 return false;
10051 }
10052
10054 {
10055
10056
10057
10058
10059 return super.CanReceiveItemIntoCargo(item);
10060 }
10061
10063 {
10064
10065
10066
10067
10068 GameInventory attachmentInv = attachment.GetInventory();
10070 {
10071 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10072 return false;
10073 }
10074
10075 InventoryLocation loc = new InventoryLocation();
10076 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10077 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10078 return false;
10079
10080 return super.CanReceiveAttachment(attachment, slotId);
10081 }
10082
10084 {
10085 if (!super.CanReleaseAttachment(attachment))
10086 return false;
10087
10088 return GetInventory().AreChildrenAccessible();
10089 }
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10112 {
10113 int id = muzzle_owner.GetMuzzleID();
10114 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10115
10116 if (WPOF_array)
10117 {
10118 for (int i = 0; i < WPOF_array.Count(); i++)
10119 {
10120 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10121
10122 if (WPOF)
10123 {
10124 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10125 }
10126 }
10127 }
10128 }
10129
10130
10132 {
10133 int id = muzzle_owner.GetMuzzleID();
10135
10136 if (WPOBE_array)
10137 {
10138 for (int i = 0; i < WPOBE_array.Count(); i++)
10139 {
10140 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10141
10142 if (WPOBE)
10143 {
10144 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10145 }
10146 }
10147 }
10148 }
10149
10150
10152 {
10153 int id = muzzle_owner.GetMuzzleID();
10154 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10155
10156 if (WPOOH_array)
10157 {
10158 for (int i = 0; i < WPOOH_array.Count(); i++)
10159 {
10160 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10161
10162 if (WPOOH)
10163 {
10164 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10165 }
10166 }
10167 }
10168 }
10169
10170
10172 {
10173 int id = muzzle_owner.GetMuzzleID();
10174 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10175
10176 if (WPOOH_array)
10177 {
10178 for (int i = 0; i < WPOOH_array.Count(); i++)
10179 {
10180 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10181
10182 if (WPOOH)
10183 {
10184 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10185 }
10186 }
10187 }
10188 }
10189
10190
10192 {
10193 int id = muzzle_owner.GetMuzzleID();
10194 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10195
10196 if (WPOOH_array)
10197 {
10198 for (int i = 0; i < WPOOH_array.Count(); i++)
10199 {
10200 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10201
10202 if (WPOOH)
10203 {
10204 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10205 }
10206 }
10207 }
10208 }
10209
10210
10211
10213 {
10215 {
10216 return true;
10217 }
10218
10219 return false;
10220 }
10221
10223 {
10225 {
10226 return true;
10227 }
10228
10229 return false;
10230 }
10231
10233 {
10235 {
10236 return true;
10237 }
10238
10239 return false;
10240 }
10241
10243 {
10244 return false;
10245 }
10246
10249 {
10250 return UATimeSpent.DEFAULT_DEPLOY;
10251 }
10252
10253
10254
10255
10257 {
10259 SetSynchDirty();
10260 }
10261
10263 {
10265 }
10266
10267
10269 {
10270 return false;
10271 }
10272
10275 {
10276 string att_type = "None";
10277
10278 if (ConfigIsExisting("soundAttType"))
10279 {
10280 att_type = ConfigGetString("soundAttType");
10281 }
10282
10284 }
10285
10287 {
10289 }
10290
10291
10292
10293
10294
10298
10300 {
10303
10305 }
10306
10307
10309 {
10311 return;
10312
10314
10317
10320
10321 SoundParameters params = new SoundParameters();
10325 }
10326
10327
10329 {
10331 return;
10332
10334 SetSynchDirty();
10335
10338 }
10339
10340
10342 {
10344 return;
10345
10347 SetSynchDirty();
10348
10351 }
10352
10354 {
10356 }
10357
10359 {
10361 }
10362
10365 {
10366 if (!
GetGame().IsDedicatedServer())
10367 {
10368 if (ConfigIsExisting("attachSoundSet"))
10369 {
10370 string cfg_path = "";
10371 string soundset = "";
10372 string type_name =
GetType();
10373
10376 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10377 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10378
10379 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10380 {
10381 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10382 {
10383 if (cfg_slot_array[i] == slot_type)
10384 {
10385 soundset = cfg_soundset_array[i];
10386 break;
10387 }
10388 }
10389 }
10390
10391 if (soundset != "")
10392 {
10393 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10395 }
10396 }
10397 }
10398 }
10399
10401 {
10402
10403 }
10404
10405 void OnApply(PlayerBase player);
10406
10408 {
10409 return 1.0;
10410 };
10411
10413 {
10415 }
10416
10418 {
10420 }
10421
10423
10425 {
10426 SetDynamicPhysicsLifeTime(0.01);
10428 }
10429
10431 {
10432 array<string> zone_names = new array<string>;
10433 GetDamageZones(zone_names);
10434 for (int i = 0; i < zone_names.Count(); i++)
10435 {
10436 SetHealthMax(zone_names.Get(i),"Health");
10437 }
10438 SetHealthMax("","Health");
10439 }
10440
10443 {
10444 float global_health = GetHealth01("","Health");
10445 array<string> zones = new array<string>;
10446 GetDamageZones(zones);
10447
10448 for (int i = 0; i < zones.Count(); i++)
10449 {
10450 SetHealth01(zones.Get(i),"Health",global_health);
10451 }
10452 }
10453
10456 {
10457 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10458 }
10459
10461 {
10462 if (!hasRootAsPlayer)
10463 {
10464 if (refParentIB)
10465 {
10466
10467 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10468 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10469
10470 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10471 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10472
10475 }
10476 else
10477 {
10478
10481 }
10482 }
10483 }
10484
10486 {
10488 {
10489 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10490 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10491 {
10492 float heatPermCoef = 1.0;
10494 while (ent)
10495 {
10496 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10497 ent = ent.GetHierarchyParent();
10498 }
10499
10500 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10501 }
10502 }
10503 }
10504
10506 {
10507
10508 EntityAI parent = GetHierarchyParent();
10509 if (!parent)
10510 {
10511 hasParent = false;
10512 hasRootAsPlayer = false;
10513 }
10514 else
10515 {
10516 hasParent = true;
10517 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10518 refParentIB =
ItemBase.Cast(parent);
10519 }
10520 }
10521
10522 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10523 {
10524
10525 }
10526
10528 {
10529
10530 return false;
10531 }
10532
10534 {
10535
10536
10537 return false;
10538 }
10539
10541 {
10542
10543 return false;
10544 }
10545
10548 {
10549 return !GetIsFrozen() &&
IsOpen();
10550 }
10551
10553 {
10554 bool hasParent = false, hasRootAsPlayer = false;
10556
10557 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10558 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10559
10560 if (wwtu || foodDecay)
10561 {
10565
10566 if (processWetness || processTemperature || processDecay)
10567 {
10569
10570 if (processWetness)
10571 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10572
10573 if (processTemperature)
10575
10576 if (processDecay)
10577 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10578 }
10579 }
10580 }
10581
10584 {
10586 }
10587
10589 {
10592
10593 return super.GetTemperatureFreezeThreshold();
10594 }
10595
10597 {
10600
10601 return super.GetTemperatureThawThreshold();
10602 }
10603
10605 {
10608
10609 return super.GetItemOverheatThreshold();
10610 }
10611
10613 {
10615 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10616
10617 return super.GetTemperatureFreezeTime();
10618 }
10619
10621 {
10623 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10624
10625 return super.GetTemperatureThawTime();
10626 }
10627
10632
10634 {
10635 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10636 }
10637
10639 {
10640 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10641 }
10642
10645 {
10647 }
10648
10650 {
10652 }
10653
10655 {
10657 }
10658
10661 {
10662 return null;
10663 }
10664
10667 {
10668 return false;
10669 }
10670
10672 {
10674 {
10677 if (!trg)
10678 {
10680 explosive = this;
10681 }
10682
10683 explosive.PairRemote(trg);
10685
10686 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10687 trg.SetPersistentPairID(persistentID);
10688 explosive.SetPersistentPairID(persistentID);
10689
10690 return true;
10691 }
10692 return false;
10693 }
10694
10697 {
10698 float ret = 1.0;
10701 ret *= GetHealth01();
10702
10703 return ret;
10704 }
10705
10706 #ifdef DEVELOPER
10707 override void SetDebugItem()
10708 {
10709 super.SetDebugItem();
10710 _itemBase = this;
10711 }
10712
10714 {
10715 string text = super.GetDebugText();
10716
10718 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10719
10720 return text;
10721 }
10722 #endif
10723
10725 {
10726 return true;
10727 }
10728
10730
10732
10734 {
10737 }
10738
10739
10747
10763}
10764
10766{
10768 if (entity)
10769 {
10770 bool is_item = entity.IsInherited(
ItemBase);
10771 if (is_item && full_quantity)
10772 {
10775 }
10776 }
10777 else
10778 {
10780 return NULL;
10781 }
10782 return entity;
10783}
10784
10786{
10787 if (item)
10788 {
10789 if (health > 0)
10790 item.SetHealth("", "", health);
10791
10792 if (item.CanHaveTemperature())
10793 {
10795 if (item.CanFreeze())
10796 item.SetFrozen(false);
10797 }
10798
10799 if (item.HasEnergyManager())
10800 {
10801 if (quantity >= 0)
10802 {
10803 item.GetCompEM().SetEnergy0To1(quantity);
10804 }
10805 else
10806 {
10808 }
10809 }
10810 else if (item.IsMagazine())
10811 {
10812 Magazine mag = Magazine.Cast(item);
10813 if (quantity >= 0)
10814 {
10815 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10816 }
10817 else
10818 {
10820 }
10821
10822 }
10823 else
10824 {
10825 if (quantity >= 0)
10826 {
10827 item.SetQuantityNormalized(quantity, false);
10828 }
10829 else
10830 {
10832 }
10833
10834 }
10835 }
10836}
10837
10838#ifdef DEVELOPER
10840#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.