6127{
6129 {
6130 return true;
6131 }
6132};
6133
6134
6135
6137{
6141
6143
6146
6147
6148
6149
6150
6159
6165
6170
6175
6196 protected bool m_IsResultOfSplit
6197
6199
6204
6205
6206
6208
6212
6213
6214
6216
6219
6220
6221
6227
6228
6236
6239
6240
6242
6243
6245
6246
6251
6252
6257
6258
6260
6261
6263 {
6268
6269 if (!
GetGame().IsDedicatedServer())
6270 {
6272 {
6274
6276 {
6278 }
6279 }
6280
6283 }
6284
6285 m_OldLocation = null;
6286
6288 {
6290 }
6291
6292 if (ConfigIsExisting("headSelectionsToHide"))
6293 {
6296 }
6297
6299 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6300 {
6302 }
6303
6305
6306 m_IsResultOfSplit = false;
6307
6309 }
6310
6312 {
6313 super.InitItemVariables();
6314
6320 m_Count = ConfigGetInt(
"count");
6321
6324
6329
6332
6337
6349
6353
6354
6357 if (ConfigIsExisting("canBeSplit"))
6358 {
6361 }
6362
6364 if (ConfigIsExisting("itemBehaviour"))
6366
6367
6370 RegisterNetSyncVariableInt("m_VarLiquidType");
6371 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6372
6373 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6374 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6375 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6376
6377 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6378 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6379 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6380 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6381
6382 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6383 RegisterNetSyncVariableBool("m_IsTakeable");
6384 RegisterNetSyncVariableBool("m_IsHologram");
6385
6388 {
6391 }
6392
6394
6396 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6398
6399 }
6400
6402 {
6404 }
6405
6407 {
6410 {
6415 }
6416 }
6417
6418 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6419 {
6421 {
6424 }
6425
6427 }
6428
6430 {
6436 }
6437
6439
6441 {
6443
6444 if (!action)
6445 {
6446 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6447 return;
6448 }
6449
6451 if (!ai)
6452 {
6454 return;
6455 }
6456
6458 if (!action_array)
6459 {
6460 action_array = new array<ActionBase_Basic>;
6462 }
6463 if (LogManager.IsActionLogEnable())
6464 {
6465 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6466 }
6467
6468 if (action_array.Find(action) != -1)
6469 {
6470 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6471 }
6472 else
6473 {
6474 action_array.Insert(action);
6475 }
6476 }
6477
6479 {
6481 ActionBase action = player.GetActionManager().GetAction(actionName);
6484
6485 if (action_array)
6486 {
6487 action_array.RemoveItem(action);
6488 }
6489 }
6490
6491
6492
6494 {
6495 ActionOverrideData overrideData = new ActionOverrideData();
6499
6501 if (!actionMap)
6502 {
6505 }
6506
6507 actionMap.Insert(this.
Type(), overrideData);
6508
6509 }
6510
6512
6514
6515
6517 {
6520
6523
6524 string config_to_search = "CfgVehicles";
6525 string muzzle_owner_config;
6526
6528 {
6529 if (IsInherited(Weapon))
6530 config_to_search = "CfgWeapons";
6531
6532 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6533
6534 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6535
6537
6538 if (config_OnFire_subclass_count > 0)
6539 {
6540 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6541
6542 for (int i = 0; i < config_OnFire_subclass_count; i++)
6543 {
6544 string particle_class = "";
6546 string config_OnFire_entry = config_OnFire_class + particle_class;
6547 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6548 WPOF_array.Insert(WPOF);
6549 }
6550
6551
6553 }
6554 }
6555
6557 {
6558 config_to_search = "CfgWeapons";
6559 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6560
6561 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6562
6564
6565 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6566 {
6567 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6568
6569 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6570 {
6571 string particle_class2 = "";
6573 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6574 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6575 WPOBE_array.Insert(WPOBE);
6576 }
6577
6578
6580 }
6581 }
6582 }
6583
6584
6586 {
6589
6591 {
6592 string config_to_search = "CfgVehicles";
6593
6594 if (IsInherited(Weapon))
6595 config_to_search = "CfgWeapons";
6596
6597 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6598 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6599
6600 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6601 {
6602
6604
6606 {
6608 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6610 return;
6611 }
6612
6615
6616
6617
6619 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6620
6621 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6622 {
6623 string particle_class = "";
6625 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6627
6628 if (entry_type == CT_CLASS)
6629 {
6630 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6631 WPOOH_array.Insert(WPOF);
6632 }
6633 }
6634
6635
6637 }
6638 }
6639 }
6640
6642 {
6644 }
6645
6647 {
6649 {
6651
6654
6657
6658 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6659 }
6660 }
6661
6663 {
6665 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6666
6668 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6669
6671 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6672
6674 {
6676 }
6677 }
6678
6680 {
6682 }
6683
6685 {
6688 else
6690
6692 {
6695 }
6696 else
6697 {
6700
6703 }
6704
6706 }
6707
6709 {
6711 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6712 }
6713
6715 {
6717 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6719 }
6720
6722 {
6724 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6725 }
6726
6728 {
6731
6732 OverheatingParticle OP = new OverheatingParticle();
6737
6739 }
6740
6742 {
6745
6746 return -1;
6747 }
6748
6750 {
6752 {
6755
6756 for (int i = count; i > 0; --i)
6757 {
6758 int id = i - 1;
6761
6764
6765 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6766 {
6767 if (p)
6768 {
6771 }
6772 }
6773 }
6774 }
6775 }
6776
6778 {
6780 {
6782 {
6783 int id = i - 1;
6785
6786 if (OP)
6787 {
6789
6790 if (p)
6791 {
6793 }
6794
6795 delete OP;
6796 }
6797 }
6798
6801 }
6802 }
6803
6806 {
6807 return 0.0;
6808 }
6809
6810
6812 {
6813 return 250;
6814 }
6815
6817 {
6818 return 0;
6819 }
6820
6823 {
6825 return true;
6826
6827 return false;
6828 }
6829
6832 {
6835
6837 {
6839 }
6840 else
6841 {
6842
6844 }
6845
6847 }
6848
6855 {
6856 return -1;
6857 }
6858
6859
6860
6861
6863 {
6865 {
6867 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6868
6869 if (r_index >= 0)
6870 {
6871 InventoryLocation r_il = new InventoryLocation;
6872 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6873
6874 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6877 {
6878 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6879 }
6881 {
6882 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6883 }
6884
6885 }
6886
6887 player.GetHumanInventory().ClearUserReservedLocation(this);
6888 }
6889
6892 }
6893
6894
6895
6896
6898 {
6899 return ItemBase.m_DebugActionsMask;
6900 }
6901
6903 {
6904 return ItemBase.m_DebugActionsMask & mask;
6905 }
6906
6908 {
6909 ItemBase.m_DebugActionsMask = mask;
6910 }
6911
6913 {
6914 ItemBase.m_DebugActionsMask |= mask;
6915 }
6916
6918 {
6919 ItemBase.m_DebugActionsMask &= ~mask;
6920 }
6921
6923 {
6925 {
6927 }
6928 else
6929 {
6931 }
6932 }
6933
6934
6936 {
6937 if (GetEconomyProfile())
6938 {
6939 float q_max = GetEconomyProfile().GetQuantityMax();
6940 if (q_max > 0)
6941 {
6942 float q_min = GetEconomyProfile().GetQuantityMin();
6943 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6944
6946 {
6947 ComponentEnergyManager comp = GetCompEM();
6949 {
6951 }
6952 }
6954 {
6956
6957 }
6958
6959 }
6960 }
6961 }
6962
6965 {
6966 EntityAI parent = GetHierarchyParent();
6967
6968 if (parent)
6969 {
6970 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6971 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6972 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6973 }
6974 }
6975
6978 {
6979 EntityAI parent = GetHierarchyParent();
6980
6981 if (parent)
6982 {
6983 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6984 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6985 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6986 }
6987 }
6988
6990 {
6991
6992
6993
6994
6996
6998 {
6999 if (ScriptInputUserData.CanStoreInputUserData())
7000 {
7001 ScriptInputUserData ctx = new ScriptInputUserData;
7007 ctx.
Write(use_stack_max);
7010
7012 {
7013 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7014 }
7015 }
7016 }
7017 else if (!
GetGame().IsMultiplayer())
7018 {
7020 }
7021 }
7022
7024 {
7026 }
7027
7029 {
7031 }
7032
7034 {
7036 }
7037
7039 {
7040
7041 return false;
7042 }
7043
7045 {
7046 return false;
7047 }
7048
7052 {
7053 return false;
7054 }
7055
7057 {
7058 return "";
7059 }
7060
7062
7064 {
7065 return false;
7066 }
7067
7069 {
7070 return true;
7071 }
7072
7073
7074
7076 {
7077 return true;
7078 }
7079
7081 {
7082 return true;
7083 }
7084
7086 {
7087 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7089 }
7090
7092 {
7094 }
7095
7097 {
7099 if (!is_being_placed)
7101 SetSynchDirty();
7102 }
7103
7104
7106
7108 {
7110 }
7111
7113 {
7115 }
7116
7118 {
7119 return 1;
7120 }
7121
7123 {
7124 return false;
7125 }
7126
7128 {
7130 SetSynchDirty();
7131 }
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7168 {
7169 super.OnMovedInsideCargo(container);
7170
7171 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7172 }
7173
7174 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7175 {
7176 super.EEItemLocationChanged(oldLoc,newLoc);
7177
7178 PlayerBase new_player = null;
7179 PlayerBase old_player = null;
7180
7181 if (newLoc.GetParent())
7182 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7183
7184 if (oldLoc.GetParent())
7185 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7186
7188 {
7189 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7190
7191 if (r_index >= 0)
7192 {
7193 InventoryLocation r_il = new InventoryLocation;
7194 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7195
7196 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7199 {
7200 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7201 }
7203 {
7204 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7205 }
7206
7207 }
7208 }
7209
7211 {
7212 if (new_player)
7213 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7214
7215 if (new_player == old_player)
7216 {
7217
7218 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7219 {
7221 {
7222 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7223 {
7224 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7225 }
7226 }
7227 else
7228 {
7229 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7230 }
7231 }
7232
7233 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7234 {
7235 int type = oldLoc.GetType();
7237 {
7238 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7239 }
7241 {
7242 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7243 }
7244 }
7245 if (!m_OldLocation)
7246 {
7247 m_OldLocation = new InventoryLocation;
7248 }
7249 m_OldLocation.Copy(oldLoc);
7250 }
7251 else
7252 {
7253 if (m_OldLocation)
7254 {
7255 m_OldLocation.Reset();
7256 }
7257 }
7258
7260 }
7261 else
7262 {
7263 if (new_player)
7264 {
7265 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7266 if (res_index >= 0)
7267 {
7268 InventoryLocation il = new InventoryLocation;
7269 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7271 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7274 {
7275 il.
GetParent().GetOnReleaseLock().Invoke(it);
7276 }
7278 {
7280 }
7281
7282 }
7283 }
7285 {
7286
7288 }
7289
7290 if (m_OldLocation)
7291 {
7292 m_OldLocation.Reset();
7293 }
7294 }
7295 }
7296
7297 override void EOnContact(IEntity other, Contact extra)
7298 {
7300 {
7301 int liquidType = -1;
7303 if (impactSpeed > 0.0)
7304 {
7306 #ifndef SERVER
7308 #else
7310 SetSynchDirty();
7311 #endif
7313 }
7314 }
7315
7316 #ifdef SERVER
7317 if (GetCompEM() && GetCompEM().IsPlugged())
7318 {
7319 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7320 GetCompEM().UnplugThis();
7321 }
7322 #endif
7323 }
7324
7326
7328 {
7330 }
7331
7333 {
7334
7335 }
7336
7338 {
7339 super.OnItemLocationChanged(old_owner, new_owner);
7340
7341 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7342 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7343
7344 if (!relatedPlayer && playerNew)
7345 relatedPlayer = playerNew;
7346
7347 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7348 {
7350 if (actionMgr)
7351 {
7352 ActionBase currentAction = actionMgr.GetRunningAction();
7353 if (currentAction)
7355 }
7356 }
7357
7358 Man ownerPlayerOld = null;
7359 Man ownerPlayerNew = null;
7360
7361 if (old_owner)
7362 {
7363 if (old_owner.
IsMan())
7364 {
7365 ownerPlayerOld = Man.Cast(old_owner);
7366 }
7367 else
7368 {
7369 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7370 }
7371 }
7372 else
7373 {
7375 {
7377
7378 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7379 {
7380 GetCompEM().UnplugThis();
7381 }
7382 }
7383 }
7384
7385 if (new_owner)
7386 {
7387 if (new_owner.
IsMan())
7388 {
7389 ownerPlayerNew = Man.Cast(new_owner);
7390 }
7391 else
7392 {
7393 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7394 }
7395 }
7396
7397 if (ownerPlayerOld != ownerPlayerNew)
7398 {
7399 if (ownerPlayerOld)
7400 {
7401 array<EntityAI> subItemsExit = new array<EntityAI>;
7403 for (int i = 0; i < subItemsExit.Count(); i++)
7404 {
7407 }
7408 }
7409
7410 if (ownerPlayerNew)
7411 {
7412 array<EntityAI> subItemsEnter = new array<EntityAI>;
7414 for (int j = 0; j < subItemsEnter.Count(); j++)
7415 {
7418 }
7419 }
7420 }
7421 else if (ownerPlayerNew != null)
7422 {
7423 PlayerBase nplayer;
7424 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7425 {
7426 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7428 for (int k = 0; k < subItemsUpdate.Count(); k++)
7429 {
7431 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7432 }
7433 }
7434 }
7435
7436 if (old_owner)
7437 old_owner.OnChildItemRemoved(this);
7438 if (new_owner)
7439 new_owner.OnChildItemReceived(this);
7440 }
7441
7442
7444 {
7445 super.EEDelete(parent);
7446 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7447 if (player)
7448 {
7450
7451 if (player.IsAlive())
7452 {
7453 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7454 if (r_index >= 0)
7455 {
7456 InventoryLocation r_il = new InventoryLocation;
7457 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7458
7459 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7462 {
7463 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7464 }
7466 {
7467 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7468 }
7469
7470 }
7471
7472 player.RemoveQuickBarEntityShortcut(this);
7473 }
7474 }
7475 }
7476
7478 {
7479 super.EEKilled(killer);
7480
7483 {
7484 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7485 {
7486 if (IsMagazine())
7487 {
7488 if (Magazine.Cast(this).GetAmmoCount() > 0)
7489 {
7491 }
7492 }
7493 else
7494 {
7496 }
7497 }
7498 }
7499 }
7500
7502 {
7503 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7504
7505 super.OnWasAttached(parent, slot_id);
7506
7509
7511 }
7512
7514 {
7515 super.OnWasDetached(parent, slot_id);
7516
7519 }
7520
7522 {
7523 int idx;
7526
7527 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7528 if (inventory_slots.Count() < 1)
7529 {
7530 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7531 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7532 }
7533 else
7534 {
7535 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7536 }
7537
7538 idx = inventory_slots.Find(slot);
7539 if (idx < 0)
7540 return "";
7541
7542 return attach_types.Get(idx);
7543 }
7544
7546 {
7547 int idx = -1;
7548 string slot;
7549
7552
7553 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7554 if (inventory_slots.Count() < 1)
7555 {
7556 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7557 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7558 }
7559 else
7560 {
7561 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7562 if (detach_types.Count() < 1)
7563 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7564 }
7565
7566 for (int i = 0; i < inventory_slots.Count(); i++)
7567 {
7568 slot = inventory_slots.Get(i);
7569 }
7570
7571 if (slot != "")
7572 {
7573 if (detach_types.Count() == 1)
7574 idx = 0;
7575 else
7576 idx = inventory_slots.Find(slot);
7577 }
7578 if (idx < 0)
7579 return "";
7580
7581 return detach_types.Get(idx);
7582 }
7583
7585 {
7586
7588
7589
7590 float min_time = 1;
7591 float max_time = 3;
7592 float delay = Math.RandomFloat(min_time, max_time);
7593
7594 explode_timer.Run(delay, this, "DoAmmoExplosion");
7595 }
7596
7598 {
7599 Magazine magazine = Magazine.Cast(this);
7600 int pop_sounds_count = 6;
7601 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7602
7603
7604 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7605 string sound_name = pop_sounds[ sound_idx ];
7607
7608
7609 magazine.ServerAddAmmoCount(-1);
7610
7611
7612 float min_temp_to_explode = 100;
7613
7614 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7615 {
7617 }
7618 }
7619
7620
7621 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7622 {
7623 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7624
7625 const int CHANCE_DAMAGE_CARGO = 4;
7626 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7627 const int CHANCE_DAMAGE_NOTHING = 2;
7628
7630 {
7631 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7632 int chances;
7633 int rnd;
7634
7635 if (GetInventory().GetCargo())
7636 {
7637 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7638 rnd = Math.RandomInt(0,chances);
7639
7640 if (rnd < CHANCE_DAMAGE_CARGO)
7641 {
7643 }
7644 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7645 {
7647 }
7648 }
7649 else
7650 {
7651 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7652 rnd = Math.RandomInt(0,chances);
7653
7654 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7655 {
7657 }
7658 }
7659 }
7660 }
7661
7663 {
7664 if (GetInventory().GetCargo())
7665 {
7666 int item_count = GetInventory().GetCargo().GetItemCount();
7667 if (item_count > 0)
7668 {
7669 int random_pick = Math.RandomInt(0, item_count);
7671 if (!item.IsExplosive())
7672 {
7673 item.AddHealth("","",damage);
7674 return true;
7675 }
7676 }
7677 }
7678 return false;
7679 }
7680
7682 {
7683 int attachment_count = GetInventory().AttachmentCount();
7684 if (attachment_count > 0)
7685 {
7686 int random_pick = Math.RandomInt(0, attachment_count);
7687 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7688 if (!attachment.IsExplosive())
7689 {
7690 attachment.AddHealth("","",damage);
7691 return true;
7692 }
7693 }
7694 return false;
7695 }
7696
7698 {
7700 }
7701
7703 {
7705 return GetInventory().CanRemoveEntity();
7706
7707 return false;
7708 }
7709
7711 {
7713 return;
7714
7716 {
7717 if (ScriptInputUserData.CanStoreInputUserData())
7718 {
7719 ScriptInputUserData ctx = new ScriptInputUserData;
7724 ctx.
Write(destination_entity);
7728 }
7729 }
7730 else if (!
GetGame().IsMultiplayer())
7731 {
7733 }
7734 }
7735
7737 {
7739 return;
7740
7741 float split_quantity_new;
7745 InventoryLocation loc = new InventoryLocation;
7746
7747 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7748 {
7750 split_quantity_new = stack_max;
7751 else
7753
7754 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7755 if (new_item)
7756 {
7757 new_item.SetResultOfSplit(true);
7758 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7760 new_item.SetQuantity(split_quantity_new);
7761 }
7762 }
7763 else if (destination_entity && slot_id == -1)
7764 {
7765 if (quantity > stack_max)
7766 split_quantity_new = stack_max;
7767 else
7768 split_quantity_new = quantity;
7769
7771 {
7774 }
7775
7776 if (new_item)
7777 {
7778 new_item.SetResultOfSplit(true);
7779 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7781 new_item.SetQuantity(split_quantity_new);
7782 }
7783 }
7784 else
7785 {
7786 if (stack_max != 0)
7787 {
7789 {
7791 }
7792
7793 if (split_quantity_new == 0)
7794 {
7795 if (!
GetGame().IsMultiplayer())
7796 player.PhysicalPredictiveDropItem(this);
7797 else
7798 player.ServerDropEntity(this);
7799 return;
7800 }
7801
7803
7804 if (new_item)
7805 {
7806 new_item.SetResultOfSplit(true);
7807 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7809 new_item.SetQuantity(stack_max);
7810 new_item.PlaceOnSurface();
7811 }
7812 }
7813 }
7814 }
7815
7817 {
7819 return;
7820
7821 float split_quantity_new;
7825 InventoryLocation loc = new InventoryLocation;
7826
7827 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7828 {
7830 split_quantity_new = stack_max;
7831 else
7833
7834 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7835 if (new_item)
7836 {
7837 new_item.SetResultOfSplit(true);
7838 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7840 new_item.SetQuantity(split_quantity_new);
7841 }
7842 }
7843 else if (destination_entity && slot_id == -1)
7844 {
7845 if (quantity > stack_max)
7846 split_quantity_new = stack_max;
7847 else
7848 split_quantity_new = quantity;
7849
7851 {
7854 }
7855
7856 if (new_item)
7857 {
7858 new_item.SetResultOfSplit(true);
7859 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7861 new_item.SetQuantity(split_quantity_new);
7862 }
7863 }
7864 else
7865 {
7866 if (stack_max != 0)
7867 {
7869 {
7871 }
7872
7874
7875 if (new_item)
7876 {
7877 new_item.SetResultOfSplit(true);
7878 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7880 new_item.SetQuantity(stack_max);
7881 new_item.PlaceOnSurface();
7882 }
7883 }
7884 }
7885 }
7886
7888 {
7890 return;
7891
7893 {
7894 if (ScriptInputUserData.CanStoreInputUserData())
7895 {
7896 ScriptInputUserData ctx = new ScriptInputUserData;
7901 dst.WriteToContext(ctx);
7903 }
7904 }
7905 else if (!
GetGame().IsMultiplayer())
7906 {
7908 }
7909 }
7910
7912 {
7914 return;
7915
7917 {
7918 if (ScriptInputUserData.CanStoreInputUserData())
7919 {
7920 ScriptInputUserData ctx = new ScriptInputUserData;
7925 ctx.
Write(destination_entity);
7931 }
7932 }
7933 else if (!
GetGame().IsMultiplayer())
7934 {
7936 }
7937 }
7938
7940 {
7942 }
7943
7945 {
7947 return this;
7948
7950 float split_quantity_new;
7952 if (dst.IsValid())
7953 {
7954 int slot_id = dst.GetSlot();
7956
7957 if (quantity > stack_max)
7958 split_quantity_new = stack_max;
7959 else
7960 split_quantity_new = quantity;
7961
7963
7964 if (new_item)
7965 {
7966 new_item.SetResultOfSplit(true);
7967 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7970 }
7971
7972 return new_item;
7973 }
7974
7975 return null;
7976 }
7977
7979 {
7981 return;
7982
7984 float split_quantity_new;
7986 if (destination_entity)
7987 {
7989 if (quantity > stackable)
7990 split_quantity_new = stackable;
7991 else
7992 split_quantity_new = quantity;
7993
7994 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7995 if (new_item)
7996 {
7997 new_item.SetResultOfSplit(true);
7998 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8000 new_item.SetQuantity(split_quantity_new);
8001 }
8002 }
8003 }
8004
8006 {
8008 return;
8009
8011 {
8012 if (ScriptInputUserData.CanStoreInputUserData())
8013 {
8014 ScriptInputUserData ctx = new ScriptInputUserData;
8019 ItemBase destination_entity =
this;
8020 ctx.
Write(destination_entity);
8024 }
8025 }
8026 else if (!
GetGame().IsMultiplayer())
8027 {
8029 }
8030 }
8031
8033 {
8035 return;
8036
8038 float split_quantity_new;
8040 if (player)
8041 {
8043 if (quantity > stackable)
8044 split_quantity_new = stackable;
8045 else
8046 split_quantity_new = quantity;
8047
8048 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8049 new_item =
ItemBase.Cast(in_hands);
8050 if (new_item)
8051 {
8052 new_item.SetResultOfSplit(true);
8053 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8055 new_item.SetQuantity(split_quantity_new);
8056 }
8057 }
8058 }
8059
8061 {
8063 return;
8064
8066 float split_quantity_new = Math.Floor(quantity * 0.5);
8067
8069
8070 if (new_item)
8071 {
8072 if (new_item.GetQuantityMax() < split_quantity_new)
8073 {
8074 split_quantity_new = new_item.GetQuantityMax();
8075 }
8076
8077 new_item.SetResultOfSplit(true);
8078 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8079
8081 {
8084 }
8085 else
8086 {
8089 }
8090 }
8091 }
8092
8094 {
8096 return;
8097
8099 float split_quantity_new = Math.Floor(quantity / 2);
8100
8101 InventoryLocation invloc = new InventoryLocation;
8103
8105 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8106
8107 if (new_item)
8108 {
8109 if (new_item.GetQuantityMax() < split_quantity_new)
8110 {
8111 split_quantity_new = new_item.GetQuantityMax();
8112 }
8114 {
8117 }
8118 else
8119 {
8122 }
8123 }
8124 }
8125
8128 {
8129 SetWeightDirty();
8131
8132 if (parent)
8133 parent.OnAttachmentQuantityChangedEx(this, delta);
8134
8136 {
8138 {
8140 }
8142 {
8143 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8145 }
8146 }
8147
8148 }
8149
8152 {
8153
8154 }
8155
8158 {
8160 }
8161
8163 {
8164 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8165
8167 {
8168 if (newLevel == GameConstants.STATE_RUINED)
8169 {
8171 EntityAI parent = GetHierarchyParent();
8172 if (parent && parent.IsFireplace())
8173 {
8174 CargoBase cargo = GetInventory().GetCargo();
8175 if (cargo)
8176 {
8178 {
8180 }
8181 }
8182 }
8183 }
8184
8186 {
8187
8189 return;
8190 }
8191
8192 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8193 {
8195 }
8196 }
8197 }
8198
8199
8201 {
8202 super.OnRightClick();
8203
8205 {
8207 {
8208 if (ScriptInputUserData.CanStoreInputUserData())
8209 {
8210 vector m4[4];
8212
8213 EntityAI root = GetHierarchyRoot();
8214
8215 InventoryLocation dst = new InventoryLocation;
8217 {
8218 if (root)
8219 {
8220 root.GetTransform(m4);
8222 }
8223 else
8224 GetInventory().GetCurrentInventoryLocation(dst);
8225 }
8226 else
8227 {
8229
8230
8231 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8232 {
8233 if (root)
8234 {
8235 root.GetTransform(m4);
8237 }
8238 else
8239 GetInventory().GetCurrentInventoryLocation(dst);
8240 }
8241 else
8242 {
8243 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8244 }
8245 }
8246
8247 ScriptInputUserData ctx = new ScriptInputUserData;
8255 }
8256 }
8257 else if (!
GetGame().IsMultiplayer())
8258 {
8260 }
8261 }
8262 }
8263
8264 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8265 {
8266
8267 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8268 return false;
8269
8270 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8271 return false;
8272
8273
8275 return false;
8276
8277
8278 Magazine mag = Magazine.Cast(this);
8279 if (mag)
8280 {
8281 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8282 return false;
8283
8284 if (stack_max_limit)
8285 {
8286 Magazine other_mag = Magazine.Cast(other_item);
8287 if (other_item)
8288 {
8289 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8290 return false;
8291 }
8292
8293 }
8294 }
8295 else
8296 {
8297
8299 return false;
8300
8302 return false;
8303 }
8304
8305 PlayerBase player = null;
8306 if (CastTo(player, GetHierarchyRootPlayer()))
8307 {
8308 if (player.GetInventory().HasAttachment(this))
8309 return false;
8310
8311 if (player.IsItemsToDelete())
8312 return false;
8313 }
8314
8315 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8316 return false;
8317
8318 int slotID;
8320 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8321 return false;
8322
8323 return true;
8324 }
8325
8327 {
8329 }
8330
8332 {
8333 return m_IsResultOfSplit;
8334 }
8335
8337 {
8338 m_IsResultOfSplit = value;
8339 }
8340
8342 {
8344 }
8345
8347 {
8348 float other_item_quantity = other_item.GetQuantity();
8349 float this_free_space;
8350
8352
8354
8355 if (other_item_quantity > this_free_space)
8356 {
8357 return this_free_space;
8358 }
8359 else
8360 {
8361 return other_item_quantity;
8362 }
8363 }
8364
8366 {
8368 }
8369
8371 {
8373 return;
8374
8375 if (!IsMagazine() && other_item)
8376 {
8378 if (quantity_used != 0)
8379 {
8380 float hp1 = GetHealth01("","");
8381 float hp2 = other_item.GetHealth01("","");
8382 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8383 hpResult = hpResult / (
GetQuantity() + quantity_used);
8384
8385 hpResult *= GetMaxHealth();
8386 Math.Round(hpResult);
8387 SetHealth("", "Health", hpResult);
8388
8390 other_item.AddQuantity(-quantity_used);
8391 }
8392 }
8394 }
8395
8397 {
8398 #ifdef SERVER
8399 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8400 GetHierarchyParent().IncreaseLifetimeUp();
8401 #endif
8402 };
8403
8405 {
8406 PlayerBase p = PlayerBase.Cast(player);
8407
8408 array<int> recipesIds = p.m_Recipes;
8409 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8410 if (moduleRecipesManager)
8411 {
8412 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8413 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8414 }
8415
8416 for (int i = 0;i < recipesIds.Count(); i++)
8417 {
8418 int key = recipesIds.Get(i);
8419 string recipeName = moduleRecipesManager.GetRecipeName(key);
8421 }
8422 }
8423
8424
8425 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8426 {
8427 super.GetDebugActions(outputList);
8428
8429
8434
8435
8439
8443
8444
8447
8448
8450 {
8453 }
8454
8456
8459
8463 }
8464
8465
8466
8467
8469 {
8470 super.OnAction(action_id, player, ctx);
8471 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8472 {
8473 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8474 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8475 PlayerBase p = PlayerBase.Cast(player);
8476 if (
EActions.RECIPES_RANGE_START < 1000)
8477 {
8478 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8479 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8480 }
8481 }
8482 #ifndef SERVER
8483 else if (action_id ==
EActions.WATCH_PLAYER)
8484 {
8485 PluginDeveloper.SetDeveloperItemClientEx(player);
8486 }
8487 #endif
8489 {
8490 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8491 {
8492 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8493 OnDebugButtonPressServer(id + 1);
8494 }
8495
8496 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8497 {
8498 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8500 }
8501
8502 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8503 {
8504 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8506 }
8507
8508 else if (action_id ==
EActions.ADD_QUANTITY)
8509 {
8510 if (IsMagazine())
8511 {
8512 Magazine mag = Magazine.Cast(this);
8513 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8514 }
8515 else
8516 {
8518 }
8519
8520 if (m_EM)
8521 {
8522 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8523 }
8524
8525 }
8526
8527 else if (action_id ==
EActions.REMOVE_QUANTITY)
8528 {
8529 if (IsMagazine())
8530 {
8531 Magazine mag2 = Magazine.Cast(this);
8532 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8533 }
8534 else
8535 {
8537 }
8538 if (m_EM)
8539 {
8540 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8541 }
8542
8543 }
8544
8545 else if (action_id ==
EActions.SET_QUANTITY_0)
8546 {
8548
8549 if (m_EM)
8550 {
8551 m_EM.SetEnergy(0);
8552 }
8553 }
8554
8555 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8556 {
8558
8559 if (m_EM)
8560 {
8561 m_EM.SetEnergy(m_EM.GetEnergyMax());
8562 }
8563 }
8564
8565 else if (action_id ==
EActions.ADD_HEALTH)
8566 {
8567 AddHealth("","",GetMaxHealth("","Health")/5);
8568 }
8569 else if (action_id ==
EActions.REMOVE_HEALTH)
8570 {
8571 AddHealth("","",-GetMaxHealth("","Health")/5);
8572 }
8573 else if (action_id ==
EActions.DESTROY_HEALTH)
8574 {
8575 SetHealth01("","",0);
8576 }
8577 else if (action_id ==
EActions.WATCH_ITEM)
8578 {
8580 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8581 #ifdef DEVELOPER
8582 SetDebugDeveloper_item(this);
8583 #endif
8584 }
8585
8586 else if (action_id ==
EActions.ADD_TEMPERATURE)
8587 {
8588 AddTemperature(20);
8589
8590 }
8591
8592 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8593 {
8594 AddTemperature(-20);
8595
8596 }
8597
8598 else if (action_id ==
EActions.FLIP_FROZEN)
8599 {
8600 SetFrozen(!GetIsFrozen());
8601
8602 }
8603
8604 else if (action_id ==
EActions.ADD_WETNESS)
8605 {
8607
8608 }
8609
8610 else if (action_id ==
EActions.REMOVE_WETNESS)
8611 {
8613
8614 }
8615
8616 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8617 {
8620
8621
8622 }
8623
8624 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8625 {
8628 }
8629
8630 else if (action_id ==
EActions.MAKE_SPECIAL)
8631 {
8632 auto debugParams = DebugSpawnParams.WithPlayer(player);
8633 OnDebugSpawnEx(debugParams);
8634 }
8635
8636 else if (action_id ==
EActions.DELETE)
8637 {
8638 Delete();
8639 }
8640
8641 }
8642
8643
8644 return false;
8645 }
8646
8647
8648
8649
8653
8656
8657
8658
8660 {
8661 return false;
8662 }
8663
8664
8666 {
8667 return true;
8668 }
8669
8670
8672 {
8673 return true;
8674 }
8675
8676
8677
8679 {
8680 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8682 }
8683
8686 {
8687 return null;
8688 }
8689
8691 {
8692 return false;
8693 }
8694
8696 {
8697 return false;
8698 }
8699
8703
8704
8706 {
8707 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8708 return module_repairing.CanRepair(this, item_repair_kit);
8709 }
8710
8711
8712 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8713 {
8714 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8715 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8716 }
8717
8718
8720 {
8721
8722
8723
8724
8725
8726
8727
8728
8729 return 1;
8730 }
8731
8732
8733
8735 {
8737 }
8738
8739
8740
8742 {
8744 }
8745
8746
8755 {
8756 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8757
8758 if (player)
8759 {
8760 player.MessageStatus(text);
8761 }
8762 }
8763
8764
8773 {
8774 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8775
8776 if (player)
8777 {
8778 player.MessageAction(text);
8779 }
8780 }
8781
8782
8791 {
8792 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8793
8794 if (player)
8795 {
8796 player.MessageFriendly(text);
8797 }
8798 }
8799
8800
8809 {
8810 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8811
8812 if (player)
8813 {
8814 player.MessageImportant(text);
8815 }
8816 }
8817
8819 {
8820 return true;
8821 }
8822
8823
8824 override bool KindOf(
string tag)
8825 {
8826 bool found = false;
8827 string item_name = this.
GetType();
8830
8831 int array_size = item_tag_array.Count();
8832 for (int i = 0; i < array_size; i++)
8833 {
8834 if (item_tag_array.Get(i) == tag)
8835 {
8836 found = true;
8837 break;
8838 }
8839 }
8840 return found;
8841 }
8842
8843
8845 {
8846
8847 super.OnRPC(sender, rpc_type,ctx);
8848
8849
8850 switch (rpc_type)
8851 {
8852 #ifndef SERVER
8853 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8854 Param2<bool, string> p = new Param2<bool, string>(false, "");
8855
8857 return;
8858
8859 bool play = p.param1;
8860 string soundSet = p.param2;
8861
8862 if (play)
8863 {
8865 {
8867 {
8869 }
8870 }
8871 else
8872 {
8874 }
8875 }
8876 else
8877 {
8879 }
8880
8881 break;
8882 #endif
8883
8884 }
8885
8887 {
8889 }
8890 }
8891
8892
8893
8894
8896 {
8897 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8898 return plugin.GetID(
name);
8899 }
8900
8902 {
8903 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8904 return plugin.GetName(id);
8905 }
8906
8909 {
8910
8911
8912 int varFlags;
8913 if (!ctx.
Read(varFlags))
8914 return;
8915
8916 if (varFlags & ItemVariableFlags.FLOAT)
8917 {
8919 }
8920 }
8921
8923 {
8924
8925 super.SerializeNumericalVars(floats_out);
8926
8927
8928
8930 {
8932 }
8933
8935 {
8937 }
8938
8940 {
8942 }
8943
8945 {
8950 }
8951
8953 {
8955 }
8956 }
8957
8959 {
8960
8961 super.DeSerializeNumericalVars(floats);
8962
8963
8964 int index = 0;
8965 int mask = Math.Round(floats.Get(index));
8966
8967 index++;
8968
8970 {
8972 {
8974 }
8975 else
8976 {
8977 float quantity = floats.Get(index);
8979 }
8980 index++;
8981 }
8982
8984 {
8985 float wet = floats.Get(index);
8987 index++;
8988 }
8989
8991 {
8992 int liquidtype = Math.Round(floats.Get(index));
8994 index++;
8995 }
8996
8998 {
9000 index++;
9002 index++;
9004 index++;
9006 index++;
9007 }
9008
9010 {
9011 int cleanness = Math.Round(floats.Get(index));
9013 index++;
9014 }
9015 }
9016
9018 {
9019 super.WriteVarsToCTX(ctx);
9020
9021
9023 {
9025 }
9026
9028 {
9030 }
9031
9033 {
9035 }
9036
9038 {
9039 int r,g,b,a;
9045 }
9046
9048 {
9050 }
9051 }
9052
9054 {
9055 if (!super.ReadVarsFromCTX(ctx,version))
9056 return false;
9057
9058 int intValue;
9059 float value;
9060
9061 if (version < 140)
9062 {
9063 if (!ctx.
Read(intValue))
9064 return false;
9065
9066 m_VariablesMask = intValue;
9067 }
9068
9070 {
9071 if (!ctx.
Read(value))
9072 return false;
9073
9075 {
9077 }
9078 else
9079 {
9081 }
9082 }
9083
9084 if (version < 140)
9085 {
9087 {
9088 if (!ctx.
Read(value))
9089 return false;
9090 SetTemperatureDirect(value);
9091 }
9092 }
9093
9095 {
9096 if (!ctx.
Read(value))
9097 return false;
9099 }
9100
9102 {
9103 if (!ctx.
Read(intValue))
9104 return false;
9106 }
9107
9109 {
9110 int r,g,b,a;
9112 return false;
9114 return false;
9116 return false;
9118 return false;
9119
9121 }
9122
9124 {
9125 if (!ctx.
Read(intValue))
9126 return false;
9128 }
9129
9130 if (version >= 138 && version < 140)
9131 {
9133 {
9134 if (!ctx.
Read(intValue))
9135 return false;
9136 SetFrozen(intValue);
9137 }
9138 }
9139
9140 return true;
9141 }
9142
9143
9145 {
9148 {
9150 }
9151
9152 if (!super.OnStoreLoad(ctx, version))
9153 {
9155 return false;
9156 }
9157
9158 if (version >= 114)
9159 {
9160 bool hasQuickBarIndexSaved;
9161
9162 if (!ctx.
Read(hasQuickBarIndexSaved))
9163 {
9165 return false;
9166 }
9167
9168 if (hasQuickBarIndexSaved)
9169 {
9170 int itmQBIndex;
9171
9172
9173 if (!ctx.
Read(itmQBIndex))
9174 {
9176 return false;
9177 }
9178
9179 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9180 if (itmQBIndex != -1 && parentPlayer)
9181 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9182 }
9183 }
9184 else
9185 {
9186
9187 PlayerBase player;
9188 int itemQBIndex;
9189 if (version ==
int.
MAX)
9190 {
9191 if (!ctx.
Read(itemQBIndex))
9192 {
9194 return false;
9195 }
9196 }
9197 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9198 {
9199
9200 if (!ctx.
Read(itemQBIndex))
9201 {
9203 return false;
9204 }
9205 if (itemQBIndex != -1 && player)
9206 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9207 }
9208 }
9209
9210 if (version < 140)
9211 {
9212
9213 if (!LoadVariables(ctx, version))
9214 {
9216 return false;
9217 }
9218 }
9219
9220
9222 {
9224 return false;
9225 }
9226 if (version >= 132)
9227 {
9229 if (raib)
9230 {
9232 {
9234 return false;
9235 }
9236 }
9237 }
9238
9240 return true;
9241 }
9242
9243
9244
9246 {
9247 super.OnStoreSave(ctx);
9248
9249 PlayerBase player;
9250 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9251 {
9253
9254 int itemQBIndex = -1;
9255 itemQBIndex = player.FindQuickBarEntityIndex(this);
9256 ctx.
Write(itemQBIndex);
9257 }
9258 else
9259 {
9261 }
9262
9264
9266 if (raib)
9267 {
9269 }
9270 }
9271
9272
9274 {
9275 super.AfterStoreLoad();
9276
9278 {
9280 }
9281
9283 {
9286 }
9287 }
9288
9290 {
9291 super.EEOnAfterLoad();
9292
9294 {
9296 }
9297
9300 }
9301
9303 {
9304 return false;
9305 }
9306
9307
9308
9310 {
9312 {
9313 #ifdef PLATFORM_CONSOLE
9314
9316 {
9318 if (menu)
9319 {
9321 }
9322 }
9323 #endif
9324 }
9325
9327 {
9330 }
9331
9333 {
9334 SetWeightDirty();
9336 }
9338 {
9341 }
9342
9344 {
9347 }
9349 {
9352 }
9353
9354 super.OnVariablesSynchronized();
9355 }
9356
9357
9358
9360 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9361 {
9362 if (!IsServerCheck(allow_client))
9363 return false;
9364
9366 return false;
9367
9370
9371 if (value <= (min + 0.001))
9372 value = min;
9373
9374 if (value == min)
9375 {
9376 if (destroy_config)
9377 {
9378 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9379 if (dstr)
9380 {
9382 this.Delete();
9383 return true;
9384 }
9385 }
9386 else if (destroy_forced)
9387 {
9389 this.Delete();
9390 return true;
9391 }
9392
9394 }
9395
9398
9400 {
9402
9403 if (delta)
9405 }
9406
9408
9409 return false;
9410 }
9411
9412
9414 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9415 {
9417 }
9418
9420 {
9423 }
9424
9426 {
9429 }
9430
9433 {
9434 float value_clamped = Math.Clamp(value, 0, 1);
9436 SetQuantity(result, destroy_config, destroy_forced);
9437 }
9438
9439
9442 {
9444 }
9445
9447 {
9449 }
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9461 {
9462 int slot = -1;
9463 if (GetInventory())
9464 {
9465 InventoryLocation il = new InventoryLocation;
9466 GetInventory().GetCurrentInventoryLocation(il);
9468 }
9469
9471 }
9472
9474 {
9475 float quantity_max = 0;
9476
9478 {
9479 if (attSlotID != -1)
9480 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9481
9482 if (quantity_max <= 0)
9484 }
9485
9486 if (quantity_max <= 0)
9488
9489 return quantity_max;
9490 }
9491
9493 {
9495 }
9496
9498 {
9500 }
9501
9502
9504 {
9506 }
9507
9509 {
9511 }
9512
9514 {
9516 }
9517
9518
9520 {
9521
9522 float weightEx = GetWeightEx();
9523 float special = GetInventoryAndCargoWeight();
9524 return weightEx - special;
9525 }
9526
9527
9529 {
9531 }
9532
9534 {
9536 {
9537 #ifdef DEVELOPER
9538 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9539 {
9540 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9542 }
9543 #endif
9544
9546 }
9547 else if (HasEnergyManager())
9548 {
9549 #ifdef DEVELOPER
9550 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9551 {
9552 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9553 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9554 }
9555 #endif
9556 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9557 }
9558 else
9559 {
9560 #ifdef DEVELOPER
9561 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9562 {
9563 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9564 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9565 }
9566 #endif
9567 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9568 }
9569 }
9570
9573 {
9574 int item_count = 0;
9576
9577 if (GetInventory().GetCargo() != NULL)
9578 {
9579 item_count = GetInventory().GetCargo().GetItemCount();
9580 }
9581
9582 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9583 {
9584 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9585 if (item)
9586 item_count += item.GetNumberOfItems();
9587 }
9588 return item_count;
9589 }
9590
9593 {
9594 float weight = 0;
9595 float wetness = 1;
9596 if (include_wetness)
9599 {
9600 weight = wetness * m_ConfigWeight;
9601 }
9603 {
9604 weight = 1;
9605 }
9606 return weight;
9607 }
9608
9609
9610
9612 {
9613 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9614 {
9615 GameInventory inv = GetInventory();
9616 array<EntityAI> items = new array<EntityAI>;
9618 for (int i = 0; i < items.Count(); i++)
9619 {
9621 if (item)
9622 {
9624 }
9625 }
9626 }
9627 }
9628
9629
9630
9631
9633 {
9634 float energy = 0;
9635 if (HasEnergyManager())
9636 {
9637 energy = GetCompEM().GetEnergy();
9638 }
9639 return energy;
9640 }
9641
9642
9644 {
9645 super.OnEnergyConsumed();
9646
9648 }
9649
9651 {
9652 super.OnEnergyAdded();
9653
9655 }
9656
9657
9659 {
9660 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9661 {
9663 {
9664 float energy_0to1 = GetCompEM().GetEnergy0To1();
9666 }
9667 }
9668 }
9669
9670
9672 {
9673 return ConfigGetFloat("heatIsolation");
9674 }
9675
9677 {
9679 }
9680
9682 {
9683 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9684 if (
GetGame().ConfigIsExisting(paramPath))
9686
9687 return 0.0;
9688 }
9689
9691 {
9692 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9693 if (
GetGame().ConfigIsExisting(paramPath))
9695
9696 return 0.0;
9697 }
9698
9699 override void SetWet(
float value,
bool allow_client =
false)
9700 {
9701 if (!IsServerCheck(allow_client))
9702 return;
9703
9706
9708
9709 m_VarWet = Math.Clamp(value, min, max);
9710
9712 {
9715 }
9716 }
9717
9718 override void AddWet(
float value)
9719 {
9721 }
9722
9724 {
9726 }
9727
9729 {
9731 }
9732
9734 {
9736 }
9737
9739 {
9741 }
9742
9744 {
9746 }
9747
9749 {
9752 if (newLevel != oldLevel)
9753 {
9755 }
9756 }
9757
9759 {
9760 SetWeightDirty();
9761 }
9762
9764 {
9765 return GetWetLevelInternal(
m_VarWet);
9766 }
9767
9768
9769
9771 {
9773 }
9774
9776 {
9778 }
9779
9781 {
9783 }
9784
9786 {
9788 }
9789
9790
9791
9793 {
9794 if (ConfigIsExisting("itemModelLength"))
9795 {
9796 return ConfigGetFloat("itemModelLength");
9797 }
9798 return 0;
9799 }
9800
9802 {
9803 if (ConfigIsExisting("itemAttachOffset"))
9804 {
9805 return ConfigGetFloat("itemAttachOffset");
9806 }
9807 return 0;
9808 }
9809
9810 override void SetCleanness(
int value,
bool allow_client =
false)
9811 {
9812 if (!IsServerCheck(allow_client))
9813 return;
9814
9816
9818
9821 }
9822
9824 {
9826 }
9827
9829 {
9830 return true;
9831 }
9832
9833
9834
9835
9837 {
9839 }
9840
9842 {
9844 }
9845
9846
9847
9848
9849 override void SetColor(
int r,
int g,
int b,
int a)
9850 {
9856 }
9858 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9859 {
9864 }
9865
9867 {
9869 }
9870
9873 {
9874 int r,g,b,a;
9876 r = r/255;
9877 g = g/255;
9878 b = b/255;
9879 a = a/255;
9880 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9881 }
9882
9883
9884
9885 override void SetLiquidType(
int value,
bool allow_client =
false)
9886 {
9887 if (!IsServerCheck(allow_client))
9888 return;
9889
9894 }
9895
9897 {
9898 return ConfigGetInt("varLiquidTypeInit");
9899 }
9900
9902 {
9904 }
9905
9907 {
9909 SetFrozen(false);
9910 }
9911
9914 {
9915 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9916 }
9917
9918
9921 {
9922 PlayerBase nplayer;
9923 if (PlayerBase.CastTo(nplayer, player))
9924 {
9926
9927 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9928 }
9929 }
9930
9931
9934 {
9935 PlayerBase nplayer;
9936 if (PlayerBase.CastTo(nplayer,player))
9937 {
9938
9939 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9940
9941 }
9942
9943
9944 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9945
9946
9947 if (HasEnergyManager())
9948 {
9949 GetCompEM().UpdatePlugState();
9950 }
9951 }
9952
9953
9955 {
9956 super.OnPlacementStarted(player);
9957
9959 }
9960
9961 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9962 {
9964 {
9965 m_AdminLog.OnPlacementComplete(player,
this);
9966 }
9967
9968 super.OnPlacementComplete(player, position, orientation);
9969 }
9970
9971
9972
9973
9974
9976 {
9978 {
9979 return true;
9980 }
9981 else
9982 {
9983 return false;
9984 }
9985 }
9986
9987
9989 {
9991 {
9993 }
9994 }
9995
9996
9998 {
10000 }
10001
10003 {
10005 }
10006
10007 override void InsertAgent(
int agent,
float count = 1)
10008 {
10009 if (count < 1)
10010 return;
10011
10013 }
10014
10017 {
10019 }
10020
10021
10023 {
10025 }
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10069 {
10071 return false;
10072 return true;
10073 }
10074
10076 {
10077
10079 }
10080
10081
10084 {
10085 super.CheckForRoofLimited(timeTresholdMS);
10086
10088 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10089 {
10090 m_PreviousRoofTestTime = time;
10091 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10092 }
10093 }
10094
10095
10097 {
10099 {
10100 return 0;
10101 }
10102
10103 if (GetInventory().GetAttachmentSlotsCount() != 0)
10104 {
10105 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10106 if (filter)
10107 return filter.GetProtectionLevel(type, false, system);
10108 else
10109 return 0;
10110 }
10111
10112 string subclassPath, entryName;
10113
10114 switch (type)
10115 {
10117 entryName = "biological";
10118 break;
10120 entryName = "chemical";
10121 break;
10122 default:
10123 entryName = "biological";
10124 break;
10125 }
10126
10127 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10128
10130 }
10131
10132
10133
10136 {
10137 if (!IsMagazine())
10139
10141 }
10142
10143
10144
10145
10146
10151 {
10152 return true;
10153 }
10154
10156 {
10158 }
10159
10160
10161
10162
10163
10165 {
10166 if (parent)
10167 {
10168 if (parent.IsInherited(DayZInfected))
10169 return true;
10170
10171 if (!parent.IsRuined())
10172 return true;
10173 }
10174
10175 return true;
10176 }
10177
10179 {
10180 if (!super.CanPutAsAttachment(parent))
10181 {
10182 return false;
10183 }
10184
10185 if (!IsRuined() && !parent.IsRuined())
10186 {
10187 return true;
10188 }
10189
10190 return false;
10191 }
10192
10194 {
10195
10196
10197
10198
10199 return super.CanReceiveItemIntoCargo(item);
10200 }
10201
10203 {
10204
10205
10206
10207
10208 GameInventory attachmentInv = attachment.GetInventory();
10210 {
10211 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10212 return false;
10213 }
10214
10215 InventoryLocation loc = new InventoryLocation();
10216 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10217 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10218 return false;
10219
10220 return super.CanReceiveAttachment(attachment, slotId);
10221 }
10222
10224 {
10225 if (!super.CanReleaseAttachment(attachment))
10226 return false;
10227
10228 return GetInventory().AreChildrenAccessible();
10229 }
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10252 {
10253 int id = muzzle_owner.GetMuzzleID();
10254 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10255
10256 if (WPOF_array)
10257 {
10258 for (int i = 0; i < WPOF_array.Count(); i++)
10259 {
10260 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10261
10262 if (WPOF)
10263 {
10264 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10265 }
10266 }
10267 }
10268 }
10269
10270
10272 {
10273 int id = muzzle_owner.GetMuzzleID();
10275
10276 if (WPOBE_array)
10277 {
10278 for (int i = 0; i < WPOBE_array.Count(); i++)
10279 {
10280 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10281
10282 if (WPOBE)
10283 {
10284 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10285 }
10286 }
10287 }
10288 }
10289
10290
10292 {
10293 int id = muzzle_owner.GetMuzzleID();
10294 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10295
10296 if (WPOOH_array)
10297 {
10298 for (int i = 0; i < WPOOH_array.Count(); i++)
10299 {
10300 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10301
10302 if (WPOOH)
10303 {
10304 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10305 }
10306 }
10307 }
10308 }
10309
10310
10312 {
10313 int id = muzzle_owner.GetMuzzleID();
10314 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10315
10316 if (WPOOH_array)
10317 {
10318 for (int i = 0; i < WPOOH_array.Count(); i++)
10319 {
10320 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10321
10322 if (WPOOH)
10323 {
10324 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10325 }
10326 }
10327 }
10328 }
10329
10330
10332 {
10333 int id = muzzle_owner.GetMuzzleID();
10334 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10335
10336 if (WPOOH_array)
10337 {
10338 for (int i = 0; i < WPOOH_array.Count(); i++)
10339 {
10340 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10341
10342 if (WPOOH)
10343 {
10344 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10345 }
10346 }
10347 }
10348 }
10349
10350
10351
10353 {
10355 {
10356 return true;
10357 }
10358
10359 return false;
10360 }
10361
10363 {
10365 {
10366 return true;
10367 }
10368
10369 return false;
10370 }
10371
10373 {
10375 {
10376 return true;
10377 }
10378
10379 return false;
10380 }
10381
10383 {
10384 return false;
10385 }
10386
10389 {
10390 return UATimeSpent.DEFAULT_DEPLOY;
10391 }
10392
10393
10394
10395
10397 {
10399 SetSynchDirty();
10400 }
10401
10403 {
10405 }
10406
10407
10409 {
10410 return false;
10411 }
10412
10415 {
10416 string att_type = "None";
10417
10418 if (ConfigIsExisting("soundAttType"))
10419 {
10420 att_type = ConfigGetString("soundAttType");
10421 }
10422
10424 }
10425
10427 {
10429 }
10430
10431
10432
10433
10434
10438
10440 {
10443
10445 }
10446
10447
10449 {
10451 return;
10452
10454
10457
10460
10461 SoundParameters params = new SoundParameters();
10465 }
10466
10467
10469 {
10471 return;
10472
10474 SetSynchDirty();
10475
10478 }
10479
10480
10482 {
10484 return;
10485
10487 SetSynchDirty();
10488
10491 }
10492
10494 {
10496 }
10497
10499 {
10501 }
10502
10505 {
10506 if (!
GetGame().IsDedicatedServer())
10507 {
10508 if (ConfigIsExisting("attachSoundSet"))
10509 {
10510 string cfg_path = "";
10511 string soundset = "";
10512 string type_name =
GetType();
10513
10516 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10517 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10518
10519 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10520 {
10521 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10522 {
10523 if (cfg_slot_array[i] == slot_type)
10524 {
10525 soundset = cfg_soundset_array[i];
10526 break;
10527 }
10528 }
10529 }
10530
10531 if (soundset != "")
10532 {
10533 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10535 }
10536 }
10537 }
10538 }
10539
10541 {
10542
10543 }
10544
10545 void OnApply(PlayerBase player);
10546
10548 {
10549 return 1.0;
10550 };
10551
10553 {
10555 }
10556
10558 {
10560 }
10561
10563
10565 {
10566 SetDynamicPhysicsLifeTime(0.01);
10568 }
10569
10571 {
10572 array<string> zone_names = new array<string>;
10573 GetDamageZones(zone_names);
10574 for (int i = 0; i < zone_names.Count(); i++)
10575 {
10576 SetHealthMax(zone_names.Get(i),"Health");
10577 }
10578 SetHealthMax("","Health");
10579 }
10580
10583 {
10584 float global_health = GetHealth01("","Health");
10585 array<string> zones = new array<string>;
10586 GetDamageZones(zones);
10587
10588 for (int i = 0; i < zones.Count(); i++)
10589 {
10590 SetHealth01(zones.Get(i),"Health",global_health);
10591 }
10592 }
10593
10596 {
10597 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10598 }
10599
10601 {
10602 if (!hasRootAsPlayer)
10603 {
10604 if (refParentIB)
10605 {
10606
10607 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10608 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10609
10610 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10611 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10612
10615 }
10616 else
10617 {
10618
10621 }
10622 }
10623 }
10624
10626 {
10628 {
10629 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10630 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10631 {
10632 float heatPermCoef = 1.0;
10634 while (ent)
10635 {
10636 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10637 ent = ent.GetHierarchyParent();
10638 }
10639
10640 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10641 }
10642 }
10643 }
10644
10646 {
10647
10648 EntityAI parent = GetHierarchyParent();
10649 if (!parent)
10650 {
10651 hasParent = false;
10652 hasRootAsPlayer = false;
10653 }
10654 else
10655 {
10656 hasParent = true;
10657 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10658 refParentIB =
ItemBase.Cast(parent);
10659 }
10660 }
10661
10662 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10663 {
10664
10665 }
10666
10668 {
10669
10670 return false;
10671 }
10672
10674 {
10675
10676
10677 return false;
10678 }
10679
10681 {
10682
10683 return false;
10684 }
10685
10688 {
10689 return !GetIsFrozen() &&
IsOpen();
10690 }
10691
10693 {
10694 bool hasParent = false, hasRootAsPlayer = false;
10696
10697 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10698 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10699
10700 if (wwtu || foodDecay)
10701 {
10705
10706 if (processWetness || processTemperature || processDecay)
10707 {
10709
10710 if (processWetness)
10711 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10712
10713 if (processTemperature)
10715
10716 if (processDecay)
10717 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10718 }
10719 }
10720 }
10721
10724 {
10726 }
10727
10729 {
10732
10733 return super.GetTemperatureFreezeThreshold();
10734 }
10735
10737 {
10740
10741 return super.GetTemperatureThawThreshold();
10742 }
10743
10745 {
10748
10749 return super.GetItemOverheatThreshold();
10750 }
10751
10753 {
10755 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10756
10757 return super.GetTemperatureFreezeTime();
10758 }
10759
10761 {
10763 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10764
10765 return super.GetTemperatureThawTime();
10766 }
10767
10772
10774 {
10775 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10776 }
10777
10779 {
10780 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10781 }
10782
10785 {
10787 }
10788
10790 {
10792 }
10793
10795 {
10797 }
10798
10801 {
10802 return null;
10803 }
10804
10807 {
10808 return false;
10809 }
10810
10812 {
10814 {
10817 if (!trg)
10818 {
10820 explosive = this;
10821 }
10822
10823 explosive.PairRemote(trg);
10825
10826 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10827 trg.SetPersistentPairID(persistentID);
10828 explosive.SetPersistentPairID(persistentID);
10829
10830 return true;
10831 }
10832 return false;
10833 }
10834
10837 {
10838 float ret = 1.0;
10841 ret *= GetHealth01();
10842
10843 return ret;
10844 }
10845
10846 #ifdef DEVELOPER
10847 override void SetDebugItem()
10848 {
10849 super.SetDebugItem();
10850 _itemBase = this;
10851 }
10852
10854 {
10855 string text = super.GetDebugText();
10856
10858 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10859
10860 return text;
10861 }
10862 #endif
10863
10865 {
10866 return true;
10867 }
10868
10870
10872
10874 {
10877 }
10878
10879
10887
10903}
10904
10906{
10908 if (entity)
10909 {
10910 bool is_item = entity.IsInherited(
ItemBase);
10911 if (is_item && full_quantity)
10912 {
10915 }
10916 }
10917 else
10918 {
10920 return NULL;
10921 }
10922 return entity;
10923}
10924
10926{
10927 if (item)
10928 {
10929 if (health > 0)
10930 item.SetHealth("", "", health);
10931
10932 if (item.CanHaveTemperature())
10933 {
10935 if (item.CanFreeze())
10936 item.SetFrozen(false);
10937 }
10938
10939 if (item.HasEnergyManager())
10940 {
10941 if (quantity >= 0)
10942 {
10943 item.GetCompEM().SetEnergy0To1(quantity);
10944 }
10945 else
10946 {
10948 }
10949 }
10950 else if (item.IsMagazine())
10951 {
10952 Magazine mag = Magazine.Cast(item);
10953 if (quantity >= 0)
10954 {
10955 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10956 }
10957 else
10958 {
10960 }
10961
10962 }
10963 else
10964 {
10965 if (quantity >= 0)
10966 {
10967 item.SetQuantityNormalized(quantity, false);
10968 }
10969 else
10970 {
10972 }
10973
10974 }
10975 }
10976}
10977
10978#ifdef DEVELOPER
10980#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.