6199{
6201 {
6202 return true;
6203 }
6204};
6205
6206
6207
6209{
6213
6215
6218
6219
6220
6221
6222
6231
6237
6242
6247
6268 protected bool m_IsResultOfSplit
6269
6271
6276
6277
6278
6280
6284
6285
6286
6288
6291
6292
6293
6299
6300
6308
6311
6312
6314
6315
6317
6318
6323
6324
6329
6330
6332
6333
6335 {
6340
6341 if (!
GetGame().IsDedicatedServer())
6342 {
6344 {
6346
6348 {
6350 }
6351 }
6352
6355 }
6356
6357 m_OldLocation = null;
6358
6360 {
6362 }
6363
6364 if (ConfigIsExisting("headSelectionsToHide"))
6365 {
6368 }
6369
6371 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6372 {
6374 }
6375
6377
6378 m_IsResultOfSplit = false;
6379
6381 }
6382
6384 {
6385 super.InitItemVariables();
6386
6392 m_Count = ConfigGetInt(
"count");
6393
6396
6401
6404
6409
6421
6425
6426
6429 if (ConfigIsExisting("canBeSplit"))
6430 {
6433 }
6434
6436 if (ConfigIsExisting("itemBehaviour"))
6438
6439
6442 RegisterNetSyncVariableInt("m_VarLiquidType");
6443 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6444
6445 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6446 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6447 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6448
6449 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6450 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6451 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6452 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6453
6454 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6455 RegisterNetSyncVariableBool("m_IsTakeable");
6456 RegisterNetSyncVariableBool("m_IsHologram");
6457
6460 {
6463 }
6464
6466
6468 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6470
6471 }
6472
6474 {
6476 }
6477
6479 {
6482 {
6487 }
6488 }
6489
6490 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6491 {
6493 {
6496 }
6497
6499 }
6500
6502 {
6508 }
6509
6511
6513 {
6515
6516 if (!action)
6517 {
6518 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6519 return;
6520 }
6521
6523 if (!ai)
6524 {
6526 return;
6527 }
6528
6530 if (!action_array)
6531 {
6532 action_array = new array<ActionBase_Basic>;
6534 }
6535 if (LogManager.IsActionLogEnable())
6536 {
6537 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6538 }
6539
6540 if (action_array.Find(action) != -1)
6541 {
6542 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6543 }
6544 else
6545 {
6546 action_array.Insert(action);
6547 }
6548 }
6549
6551 {
6553 ActionBase action = player.GetActionManager().GetAction(actionName);
6556
6557 if (action_array)
6558 {
6559 action_array.RemoveItem(action);
6560 }
6561 }
6562
6563
6564
6566 {
6567 ActionOverrideData overrideData = new ActionOverrideData();
6571
6573 if (!actionMap)
6574 {
6577 }
6578
6579 actionMap.Insert(this.
Type(), overrideData);
6580
6581 }
6582
6584
6586
6587
6589 {
6592
6595
6596 string config_to_search = "CfgVehicles";
6597 string muzzle_owner_config;
6598
6600 {
6601 if (IsInherited(Weapon))
6602 config_to_search = "CfgWeapons";
6603
6604 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6605
6606 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6607
6609
6610 if (config_OnFire_subclass_count > 0)
6611 {
6612 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6613
6614 for (int i = 0; i < config_OnFire_subclass_count; i++)
6615 {
6616 string particle_class = "";
6618 string config_OnFire_entry = config_OnFire_class + particle_class;
6619 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6620 WPOF_array.Insert(WPOF);
6621 }
6622
6623
6625 }
6626 }
6627
6629 {
6630 config_to_search = "CfgWeapons";
6631 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6632
6633 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6634
6636
6637 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6638 {
6639 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6640
6641 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6642 {
6643 string particle_class2 = "";
6645 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6646 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6647 WPOBE_array.Insert(WPOBE);
6648 }
6649
6650
6652 }
6653 }
6654 }
6655
6656
6658 {
6661
6663 {
6664 string config_to_search = "CfgVehicles";
6665
6666 if (IsInherited(Weapon))
6667 config_to_search = "CfgWeapons";
6668
6669 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6670 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6671
6672 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6673 {
6674
6676
6678 {
6680 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6682 return;
6683 }
6684
6687
6688
6689
6691 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6692
6693 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6694 {
6695 string particle_class = "";
6697 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6699
6700 if (entry_type == CT_CLASS)
6701 {
6702 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6703 WPOOH_array.Insert(WPOF);
6704 }
6705 }
6706
6707
6709 }
6710 }
6711 }
6712
6714 {
6716 }
6717
6719 {
6721 {
6723
6726
6729
6730 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6731 }
6732 }
6733
6735 {
6737 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6738
6740 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6741
6743 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6744
6746 {
6748 }
6749 }
6750
6752 {
6754 }
6755
6757 {
6760 else
6762
6764 {
6767 }
6768 else
6769 {
6772
6775 }
6776
6778 }
6779
6781 {
6783 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6784 }
6785
6787 {
6789 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6791 }
6792
6794 {
6796 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6797 }
6798
6800 {
6803
6804 OverheatingParticle OP = new OverheatingParticle();
6809
6811 }
6812
6814 {
6817
6818 return -1;
6819 }
6820
6822 {
6824 {
6827
6828 for (int i = count; i > 0; --i)
6829 {
6830 int id = i - 1;
6833
6836
6837 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6838 {
6839 if (p)
6840 {
6843 }
6844 }
6845 }
6846 }
6847 }
6848
6850 {
6852 {
6854 {
6855 int id = i - 1;
6857
6858 if (OP)
6859 {
6861
6862 if (p)
6863 {
6865 }
6866
6867 delete OP;
6868 }
6869 }
6870
6873 }
6874 }
6875
6878 {
6879 return 0.0;
6880 }
6881
6882
6884 {
6885 return 250;
6886 }
6887
6889 {
6890 return 0;
6891 }
6892
6895 {
6897 return true;
6898
6899 return false;
6900 }
6901
6904 {
6907
6909 {
6911 }
6912 else
6913 {
6914
6916 }
6917
6919 }
6920
6927 {
6928 return -1;
6929 }
6930
6931
6932
6933
6935 {
6937 {
6939 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6940
6941 if (r_index >= 0)
6942 {
6943 InventoryLocation r_il = new InventoryLocation;
6944 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6945
6946 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6949 {
6950 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6951 }
6953 {
6954 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6955 }
6956
6957 }
6958
6959 player.GetHumanInventory().ClearUserReservedLocation(this);
6960 }
6961
6964 }
6965
6966
6967
6968
6970 {
6971 return ItemBase.m_DebugActionsMask;
6972 }
6973
6975 {
6976 return ItemBase.m_DebugActionsMask & mask;
6977 }
6978
6980 {
6981 ItemBase.m_DebugActionsMask = mask;
6982 }
6983
6985 {
6986 ItemBase.m_DebugActionsMask |= mask;
6987 }
6988
6990 {
6991 ItemBase.m_DebugActionsMask &= ~mask;
6992 }
6993
6995 {
6997 {
6999 }
7000 else
7001 {
7003 }
7004 }
7005
7006
7008 {
7009 if (GetEconomyProfile())
7010 {
7011 float q_max = GetEconomyProfile().GetQuantityMax();
7012 if (q_max > 0)
7013 {
7014 float q_min = GetEconomyProfile().GetQuantityMin();
7015 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7016
7018 {
7019 ComponentEnergyManager comp = GetCompEM();
7021 {
7023 }
7024 }
7026 {
7028
7029 }
7030
7031 }
7032 }
7033 }
7034
7037 {
7038 EntityAI parent = GetHierarchyParent();
7039
7040 if (parent)
7041 {
7042 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7043 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7044 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7045 }
7046 }
7047
7050 {
7051 EntityAI parent = GetHierarchyParent();
7052
7053 if (parent)
7054 {
7055 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7056 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7057 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7058 }
7059 }
7060
7062 {
7063
7064
7065
7066
7068
7070 {
7071 if (ScriptInputUserData.CanStoreInputUserData())
7072 {
7073 ScriptInputUserData ctx = new ScriptInputUserData;
7079 ctx.
Write(use_stack_max);
7082
7084 {
7085 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7086 }
7087 }
7088 }
7089 else if (!
GetGame().IsMultiplayer())
7090 {
7092 }
7093 }
7094
7096 {
7098 }
7099
7101 {
7103 }
7104
7106 {
7108 }
7109
7111 {
7112
7113 return false;
7114 }
7115
7117 {
7118 return false;
7119 }
7120
7124 {
7125 return false;
7126 }
7127
7129 {
7130 return "";
7131 }
7132
7134
7136 {
7137 return false;
7138 }
7139
7141 {
7142 return true;
7143 }
7144
7145
7146
7148 {
7149 return true;
7150 }
7151
7153 {
7154 return true;
7155 }
7156
7158 {
7159 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7161 }
7162
7164 {
7166 }
7167
7169 {
7171 if (!is_being_placed)
7173 SetSynchDirty();
7174 }
7175
7176
7178
7180 {
7182 }
7183
7185 {
7187 }
7188
7190 {
7191 return 1;
7192 }
7193
7195 {
7196 return false;
7197 }
7198
7200 {
7202 SetSynchDirty();
7203 }
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7240 {
7241 super.OnMovedInsideCargo(container);
7242
7243 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7244 }
7245
7246 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7247 {
7248 super.EEItemLocationChanged(oldLoc,newLoc);
7249
7250 PlayerBase new_player = null;
7251 PlayerBase old_player = null;
7252
7253 if (newLoc.GetParent())
7254 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7255
7256 if (oldLoc.GetParent())
7257 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7258
7260 {
7261 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7262
7263 if (r_index >= 0)
7264 {
7265 InventoryLocation r_il = new InventoryLocation;
7266 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7267
7268 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7271 {
7272 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7273 }
7275 {
7276 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7277 }
7278
7279 }
7280 }
7281
7283 {
7284 if (new_player)
7285 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7286
7287 if (new_player == old_player)
7288 {
7289
7290 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7291 {
7293 {
7294 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7295 {
7296 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7297 }
7298 }
7299 else
7300 {
7301 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7302 }
7303 }
7304
7305 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7306 {
7307 int type = oldLoc.GetType();
7309 {
7310 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7311 }
7313 {
7314 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7315 }
7316 }
7317 if (!m_OldLocation)
7318 {
7319 m_OldLocation = new InventoryLocation;
7320 }
7321 m_OldLocation.Copy(oldLoc);
7322 }
7323 else
7324 {
7325 if (m_OldLocation)
7326 {
7327 m_OldLocation.Reset();
7328 }
7329 }
7330
7332 }
7333 else
7334 {
7335 if (new_player)
7336 {
7337 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7338 if (res_index >= 0)
7339 {
7340 InventoryLocation il = new InventoryLocation;
7341 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7343 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7346 {
7347 il.
GetParent().GetOnReleaseLock().Invoke(it);
7348 }
7350 {
7352 }
7353
7354 }
7355 }
7357 {
7358
7360 }
7361
7362 if (m_OldLocation)
7363 {
7364 m_OldLocation.Reset();
7365 }
7366 }
7367 }
7368
7369 override void EOnContact(IEntity other, Contact extra)
7370 {
7372 {
7373 int liquidType = -1;
7375 if (impactSpeed > 0.0)
7376 {
7378 #ifndef SERVER
7380 #else
7382 SetSynchDirty();
7383 #endif
7385 }
7386 }
7387
7388 #ifdef SERVER
7389 if (GetCompEM() && GetCompEM().IsPlugged())
7390 {
7391 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7392 GetCompEM().UnplugThis();
7393 }
7394 #endif
7395 }
7396
7398
7400 {
7402 }
7403
7405 {
7406
7407 }
7408
7410 {
7411 super.OnItemLocationChanged(old_owner, new_owner);
7412
7413 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7414 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7415
7416 if (!relatedPlayer && playerNew)
7417 relatedPlayer = playerNew;
7418
7419 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7420 {
7422 if (actionMgr)
7423 {
7424 ActionBase currentAction = actionMgr.GetRunningAction();
7425 if (currentAction)
7427 }
7428 }
7429
7430 Man ownerPlayerOld = null;
7431 Man ownerPlayerNew = null;
7432
7433 if (old_owner)
7434 {
7435 if (old_owner.
IsMan())
7436 {
7437 ownerPlayerOld = Man.Cast(old_owner);
7438 }
7439 else
7440 {
7441 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7442 }
7443 }
7444 else
7445 {
7447 {
7449
7450 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7451 {
7452 GetCompEM().UnplugThis();
7453 }
7454 }
7455 }
7456
7457 if (new_owner)
7458 {
7459 if (new_owner.
IsMan())
7460 {
7461 ownerPlayerNew = Man.Cast(new_owner);
7462 }
7463 else
7464 {
7465 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7466 }
7467 }
7468
7469 if (ownerPlayerOld != ownerPlayerNew)
7470 {
7471 if (ownerPlayerOld)
7472 {
7473 array<EntityAI> subItemsExit = new array<EntityAI>;
7475 for (int i = 0; i < subItemsExit.Count(); i++)
7476 {
7479 }
7480 }
7481
7482 if (ownerPlayerNew)
7483 {
7484 array<EntityAI> subItemsEnter = new array<EntityAI>;
7486 for (int j = 0; j < subItemsEnter.Count(); j++)
7487 {
7490 }
7491 }
7492 }
7493 else if (ownerPlayerNew != null)
7494 {
7495 PlayerBase nplayer;
7496 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7497 {
7498 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7500 for (int k = 0; k < subItemsUpdate.Count(); k++)
7501 {
7503 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7504 }
7505 }
7506 }
7507
7508 if (old_owner)
7509 old_owner.OnChildItemRemoved(this);
7510 if (new_owner)
7511 new_owner.OnChildItemReceived(this);
7512 }
7513
7514
7516 {
7517 super.EEDelete(parent);
7518 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7519 if (player)
7520 {
7522
7523 if (player.IsAlive())
7524 {
7525 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7526 if (r_index >= 0)
7527 {
7528 InventoryLocation r_il = new InventoryLocation;
7529 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7530
7531 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7534 {
7535 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7536 }
7538 {
7539 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7540 }
7541
7542 }
7543
7544 player.RemoveQuickBarEntityShortcut(this);
7545 }
7546 }
7547 }
7548
7550 {
7551 super.EEKilled(killer);
7552
7555 {
7556 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7557 {
7558 if (IsMagazine())
7559 {
7560 if (Magazine.Cast(this).GetAmmoCount() > 0)
7561 {
7563 }
7564 }
7565 else
7566 {
7568 }
7569 }
7570 }
7571 }
7572
7574 {
7575 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7576
7577 super.OnWasAttached(parent, slot_id);
7578
7581
7583 }
7584
7586 {
7587 super.OnWasDetached(parent, slot_id);
7588
7591 }
7592
7594 {
7595 int idx;
7598
7599 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7600 if (inventory_slots.Count() < 1)
7601 {
7602 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7603 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7604 }
7605 else
7606 {
7607 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7608 }
7609
7610 idx = inventory_slots.Find(slot);
7611 if (idx < 0)
7612 return "";
7613
7614 return attach_types.Get(idx);
7615 }
7616
7618 {
7619 int idx = -1;
7620 string slot;
7621
7624
7625 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7626 if (inventory_slots.Count() < 1)
7627 {
7628 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7629 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7630 }
7631 else
7632 {
7633 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7634 if (detach_types.Count() < 1)
7635 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7636 }
7637
7638 for (int i = 0; i < inventory_slots.Count(); i++)
7639 {
7640 slot = inventory_slots.Get(i);
7641 }
7642
7643 if (slot != "")
7644 {
7645 if (detach_types.Count() == 1)
7646 idx = 0;
7647 else
7648 idx = inventory_slots.Find(slot);
7649 }
7650 if (idx < 0)
7651 return "";
7652
7653 return detach_types.Get(idx);
7654 }
7655
7657 {
7658
7660
7661
7662 float min_time = 1;
7663 float max_time = 3;
7664 float delay = Math.RandomFloat(min_time, max_time);
7665
7666 explode_timer.Run(delay, this, "DoAmmoExplosion");
7667 }
7668
7670 {
7671 Magazine magazine = Magazine.Cast(this);
7672 int pop_sounds_count = 6;
7673 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7674
7675
7676 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7677 string sound_name = pop_sounds[ sound_idx ];
7679
7680
7681 magazine.ServerAddAmmoCount(-1);
7682
7683
7684 float min_temp_to_explode = 100;
7685
7686 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
7687 {
7689 }
7690 }
7691
7692
7693 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7694 {
7695 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7696
7697 const int CHANCE_DAMAGE_CARGO = 4;
7698 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7699 const int CHANCE_DAMAGE_NOTHING = 2;
7700
7702 {
7703 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7704 int chances;
7705 int rnd;
7706
7707 if (GetInventory().GetCargo())
7708 {
7709 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7710 rnd = Math.RandomInt(0,chances);
7711
7712 if (rnd < CHANCE_DAMAGE_CARGO)
7713 {
7715 }
7716 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7717 {
7719 }
7720 }
7721 else
7722 {
7723 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7724 rnd = Math.RandomInt(0,chances);
7725
7726 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7727 {
7729 }
7730 }
7731 }
7732 }
7733
7735 {
7736 if (GetInventory().GetCargo())
7737 {
7738 int item_count = GetInventory().GetCargo().GetItemCount();
7739 if (item_count > 0)
7740 {
7741 int random_pick = Math.RandomInt(0, item_count);
7743 if (!item.IsExplosive())
7744 {
7745 item.AddHealth("","",damage);
7746 return true;
7747 }
7748 }
7749 }
7750 return false;
7751 }
7752
7754 {
7755 int attachment_count = GetInventory().AttachmentCount();
7756 if (attachment_count > 0)
7757 {
7758 int random_pick = Math.RandomInt(0, attachment_count);
7759 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7760 if (!attachment.IsExplosive())
7761 {
7762 attachment.AddHealth("","",damage);
7763 return true;
7764 }
7765 }
7766 return false;
7767 }
7768
7770 {
7772 }
7773
7775 {
7777 return GetInventory().CanRemoveEntity();
7778
7779 return false;
7780 }
7781
7783 {
7784
7786 return false;
7787
7788
7790 return false;
7791
7792
7793
7795 if (delta == 0)
7796 return false;
7797
7798
7799 return true;
7800 }
7801
7803 {
7805 {
7806 if (ScriptInputUserData.CanStoreInputUserData())
7807 {
7808 ScriptInputUserData ctx = new ScriptInputUserData;
7813 ctx.
Write(destination_entity);
7817 }
7818 }
7819 else if (!
GetGame().IsMultiplayer())
7820 {
7822 }
7823 }
7824
7826 {
7827 float split_quantity_new;
7831 InventoryLocation loc = new InventoryLocation;
7832
7833 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7834 {
7836 split_quantity_new = stack_max;
7837 else
7839
7841 {
7842 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7843 if (new_item)
7844 {
7845 new_item.SetResultOfSplit(true);
7846 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7848 new_item.
SetQuantity(split_quantity_new,
false,
true);
7849 }
7850 }
7851 }
7852 else if (destination_entity && slot_id == -1)
7853 {
7854 if (quantity > stack_max)
7855 split_quantity_new = stack_max;
7856 else
7857 split_quantity_new = quantity;
7858
7860 {
7862 {
7865 }
7866
7867 if (new_item)
7868 {
7869 new_item.SetResultOfSplit(true);
7870 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7872 new_item.
SetQuantity(split_quantity_new,
false,
true);
7873 }
7874 }
7875 }
7876 else
7877 {
7878 if (stack_max != 0)
7879 {
7881 {
7883 }
7884
7885 if (split_quantity_new == 0)
7886 {
7887 if (!
GetGame().IsMultiplayer())
7888 player.PhysicalPredictiveDropItem(this);
7889 else
7890 player.ServerDropEntity(this);
7891 return;
7892 }
7893
7895 {
7897
7898 if (new_item)
7899 {
7900 new_item.SetResultOfSplit(true);
7901 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7904 new_item.PlaceOnSurface();
7905 }
7906 }
7907 }
7908 }
7909 }
7910
7912 {
7913 float split_quantity_new;
7917 InventoryLocation loc = new InventoryLocation;
7918
7919 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7920 {
7922 split_quantity_new = stack_max;
7923 else
7925
7927 {
7928 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7929 if (new_item)
7930 {
7931 new_item.SetResultOfSplit(true);
7932 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7934 new_item.
SetQuantity(split_quantity_new,
false,
true);
7935 }
7936 }
7937 }
7938 else if (destination_entity && slot_id == -1)
7939 {
7940 if (quantity > stack_max)
7941 split_quantity_new = stack_max;
7942 else
7943 split_quantity_new = quantity;
7944
7946 {
7948 {
7951 }
7952
7953 if (new_item)
7954 {
7955 new_item.SetResultOfSplit(true);
7956 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7958 new_item.
SetQuantity(split_quantity_new,
false,
true);
7959 }
7960 }
7961 }
7962 else
7963 {
7964 if (stack_max != 0)
7965 {
7967 {
7969 }
7970
7972 {
7974
7975 if (new_item)
7976 {
7977 new_item.SetResultOfSplit(true);
7978 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7981 new_item.PlaceOnSurface();
7982 }
7983 }
7984 }
7985 }
7986 }
7987
7989 {
7991 {
7992 if (ScriptInputUserData.CanStoreInputUserData())
7993 {
7994 ScriptInputUserData ctx = new ScriptInputUserData;
7999 dst.WriteToContext(ctx);
8001 }
8002 }
8003 else if (!
GetGame().IsMultiplayer())
8004 {
8006 }
8007 }
8008
8010 {
8012 {
8013 if (ScriptInputUserData.CanStoreInputUserData())
8014 {
8015 ScriptInputUserData ctx = new ScriptInputUserData;
8020 ctx.
Write(destination_entity);
8026 }
8027 }
8028 else if (!
GetGame().IsMultiplayer())
8029 {
8031 }
8032 }
8033
8035 {
8037 }
8038
8040 {
8042 float split_quantity_new;
8044 if (dst.IsValid())
8045 {
8046 int slot_id = dst.GetSlot();
8048
8049 if (quantity > stack_max)
8050 split_quantity_new = stack_max;
8051 else
8052 split_quantity_new = quantity;
8053
8055 {
8057
8058 if (new_item)
8059 {
8060 new_item.SetResultOfSplit(true);
8061 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8063 new_item.
SetQuantity(split_quantity_new,
false,
true);
8064 }
8065
8066 return new_item;
8067 }
8068 }
8069
8070 return null;
8071 }
8072
8074 {
8076 float split_quantity_new;
8078 if (destination_entity)
8079 {
8081 if (quantity > stackable)
8082 split_quantity_new = stackable;
8083 else
8084 split_quantity_new = quantity;
8085
8087 {
8088 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8089 if (new_item)
8090 {
8091 new_item.SetResultOfSplit(true);
8092 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8094 new_item.
SetQuantity(split_quantity_new,
false,
true);
8095 }
8096 }
8097 }
8098 }
8099
8101 {
8103 {
8104 if (ScriptInputUserData.CanStoreInputUserData())
8105 {
8106 ScriptInputUserData ctx = new ScriptInputUserData;
8111 ItemBase destination_entity =
this;
8112 ctx.
Write(destination_entity);
8116 }
8117 }
8118 else if (!
GetGame().IsMultiplayer())
8119 {
8121 }
8122 }
8123
8125 {
8127 float split_quantity_new;
8129 if (player)
8130 {
8132 if (quantity > stackable)
8133 split_quantity_new = stackable;
8134 else
8135 split_quantity_new = quantity;
8136
8138 {
8139 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8140 new_item =
ItemBase.Cast(in_hands);
8141 if (new_item)
8142 {
8143 new_item.SetResultOfSplit(true);
8144 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8146 new_item.SetQuantity(split_quantity_new, false, true);
8147 }
8148 }
8149 }
8150 }
8151
8153 {
8155 float split_quantity_new = Math.Floor(quantity * 0.5);
8156
8158 return;
8159
8161
8162 if (new_item)
8163 {
8164 if (new_item.GetQuantityMax() < split_quantity_new)
8165 {
8166 split_quantity_new = new_item.GetQuantityMax();
8167 }
8168
8169 new_item.SetResultOfSplit(true);
8170 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8171
8173 {
8176 }
8177 else
8178 {
8180 new_item.
SetQuantity(split_quantity_new,
false,
true);
8181 }
8182 }
8183 }
8184
8186 {
8188 float split_quantity_new = Math.Floor(quantity / 2);
8189
8191 return;
8192
8193 InventoryLocation invloc = new InventoryLocation;
8195
8197 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8198
8199 if (new_item)
8200 {
8201 if (new_item.GetQuantityMax() < split_quantity_new)
8202 {
8203 split_quantity_new = new_item.GetQuantityMax();
8204 }
8206 {
8209 }
8210 else if (split_quantity_new > 1)
8211 {
8213 new_item.
SetQuantity(split_quantity_new,
false,
true);
8214 }
8215 }
8216 }
8217
8220 {
8221 SetWeightDirty();
8223
8224 if (parent)
8225 parent.OnAttachmentQuantityChangedEx(this, delta);
8226
8228 {
8230 {
8232 }
8234 {
8235 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8237 }
8238 }
8239
8240 }
8241
8244 {
8245
8246 }
8247
8250 {
8252 }
8253
8255 {
8256 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8257
8259 {
8260 if (newLevel == GameConstants.STATE_RUINED)
8261 {
8263 EntityAI parent = GetHierarchyParent();
8264 if (parent && parent.IsFireplace())
8265 {
8266 CargoBase cargo = GetInventory().GetCargo();
8267 if (cargo)
8268 {
8270 {
8272 }
8273 }
8274 }
8275 }
8276
8278 {
8279
8281 return;
8282 }
8283
8284 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8285 {
8287 }
8288 }
8289 }
8290
8291
8293 {
8294 super.OnRightClick();
8295
8297 {
8299 {
8300 if (ScriptInputUserData.CanStoreInputUserData())
8301 {
8302 EntityAI root = GetHierarchyRoot();
8303 Man playerOwner = GetHierarchyRootPlayer();
8304 InventoryLocation dst = new InventoryLocation;
8305
8306
8307 if (!playerOwner && root && root == this)
8308 {
8310 }
8311 else
8312 {
8313
8314 GetInventory().GetCurrentInventoryLocation(dst);
8316 {
8319 {
8321 }
8322 else
8323 {
8325
8326
8327 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8328 {
8330 }
8331 else
8332 {
8333 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8334 }
8335 }
8336 }
8337 }
8338
8339 ScriptInputUserData ctx = new ScriptInputUserData;
8347 }
8348 }
8349 else if (!
GetGame().IsMultiplayer())
8350 {
8352 }
8353 }
8354 }
8355
8357 {
8358 if (root)
8359 {
8360 vector m4[4];
8361 root.GetTransform(m4);
8362 dst.SetGround(this, m4);
8363 }
8364 else
8365 {
8366 GetInventory().GetCurrentInventoryLocation(dst);
8367 }
8368 }
8369
8370 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8371 {
8372
8373 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8374 return false;
8375
8376 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8377 return false;
8378
8379
8381 return false;
8382
8383
8384 Magazine mag = Magazine.Cast(this);
8385 if (mag)
8386 {
8387 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8388 return false;
8389
8390 if (stack_max_limit)
8391 {
8392 Magazine other_mag = Magazine.Cast(other_item);
8393 if (other_item)
8394 {
8395 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8396 return false;
8397 }
8398
8399 }
8400 }
8401 else
8402 {
8403
8405 return false;
8406
8408 return false;
8409 }
8410
8411 PlayerBase player = null;
8412 if (CastTo(player, GetHierarchyRootPlayer()))
8413 {
8414 if (player.GetInventory().HasAttachment(this))
8415 return false;
8416
8417 if (player.IsItemsToDelete())
8418 return false;
8419 }
8420
8421 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8422 return false;
8423
8424 int slotID;
8426 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8427 return false;
8428
8429 return true;
8430 }
8431
8433 {
8435 }
8436
8438 {
8439 return m_IsResultOfSplit;
8440 }
8441
8443 {
8444 m_IsResultOfSplit = value;
8445 }
8446
8448 {
8450 }
8451
8453 {
8454 float other_item_quantity = other_item.GetQuantity();
8455 float this_free_space;
8456
8458
8460
8461 if (other_item_quantity > this_free_space)
8462 {
8463 return this_free_space;
8464 }
8465 else
8466 {
8467 return other_item_quantity;
8468 }
8469 }
8470
8472 {
8474 }
8475
8477 {
8479 return;
8480
8481 if (!IsMagazine() && other_item)
8482 {
8484 if (quantity_used != 0)
8485 {
8486 float hp1 = GetHealth01("","");
8487 float hp2 = other_item.GetHealth01("","");
8488 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8489 hpResult = hpResult / (
GetQuantity() + quantity_used);
8490
8491 hpResult *= GetMaxHealth();
8492 Math.Round(hpResult);
8493 SetHealth("", "Health", hpResult);
8494
8496 other_item.AddQuantity(-quantity_used);
8497 }
8498 }
8500 }
8501
8503 {
8504 #ifdef SERVER
8505 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8506 GetHierarchyParent().IncreaseLifetimeUp();
8507 #endif
8508 };
8509
8511 {
8512 PlayerBase p = PlayerBase.Cast(player);
8513
8514 array<int> recipesIds = p.m_Recipes;
8515 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8516 if (moduleRecipesManager)
8517 {
8518 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8519 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8520 }
8521
8522 for (int i = 0;i < recipesIds.Count(); i++)
8523 {
8524 int key = recipesIds.Get(i);
8525 string recipeName = moduleRecipesManager.GetRecipeName(key);
8527 }
8528 }
8529
8530
8531 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8532 {
8533 super.GetDebugActions(outputList);
8534
8535
8541
8542
8547
8552
8553
8557
8558
8560 {
8564 }
8565
8568
8569
8573
8575
8576 InventoryLocation loc = new InventoryLocation();
8577 GetInventory().GetCurrentInventoryLocation(loc);
8579 {
8580 if (Gizmo_IsSupported())
8583 }
8584
8586 }
8587
8588
8589
8590
8592 {
8593 super.OnAction(action_id, player, ctx);
8594
8596 {
8597 switch (action_id)
8598 {
8601 return true;
8604 return true;
8605 }
8606 }
8607
8609 {
8610 switch (action_id)
8611 {
8613 Delete();
8614 return true;
8615 }
8616 }
8617
8618 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8619 {
8620 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8621 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8622 PlayerBase p = PlayerBase.Cast(player);
8623 if (
EActions.RECIPES_RANGE_START < 1000)
8624 {
8625 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8626 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8627 }
8628 }
8629 #ifndef SERVER
8630 else if (action_id ==
EActions.WATCH_PLAYER)
8631 {
8632 PluginDeveloper.SetDeveloperItemClientEx(player);
8633 }
8634 #endif
8636 {
8637 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8638 {
8639 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8640 OnDebugButtonPressServer(id + 1);
8641 }
8642
8643 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8644 {
8645 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8647 }
8648
8649 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8650 {
8651 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8653 }
8654
8655 else if (action_id ==
EActions.ADD_QUANTITY)
8656 {
8657 if (IsMagazine())
8658 {
8659 Magazine mag = Magazine.Cast(this);
8660 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8661 }
8662 else
8663 {
8665 }
8666
8667 if (m_EM)
8668 {
8669 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8670 }
8671
8672 }
8673
8674 else if (action_id ==
EActions.REMOVE_QUANTITY)
8675 {
8676 if (IsMagazine())
8677 {
8678 Magazine mag2 = Magazine.Cast(this);
8679 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8680 }
8681 else
8682 {
8684 }
8685 if (m_EM)
8686 {
8687 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8688 }
8689
8690 }
8691
8692 else if (action_id ==
EActions.SET_QUANTITY_0)
8693 {
8695
8696 if (m_EM)
8697 {
8698 m_EM.SetEnergy(0);
8699 }
8700 }
8701
8702 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8703 {
8705
8706 if (m_EM)
8707 {
8708 m_EM.SetEnergy(m_EM.GetEnergyMax());
8709 }
8710 }
8711
8712 else if (action_id ==
EActions.ADD_HEALTH)
8713 {
8714 AddHealth("","",GetMaxHealth("","Health")/5);
8715 }
8716 else if (action_id ==
EActions.REMOVE_HEALTH)
8717 {
8718 AddHealth("","",-GetMaxHealth("","Health")/5);
8719 }
8720 else if (action_id ==
EActions.DESTROY_HEALTH)
8721 {
8722 SetHealth01("","",0);
8723 }
8724 else if (action_id ==
EActions.WATCH_ITEM)
8725 {
8727 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8728 #ifdef DEVELOPER
8729 SetDebugDeveloper_item(this);
8730 #endif
8731 }
8732
8733 else if (action_id ==
EActions.ADD_TEMPERATURE)
8734 {
8735 AddTemperature(20);
8736
8737 }
8738
8739 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8740 {
8741 AddTemperature(-20);
8742
8743 }
8744
8745 else if (action_id ==
EActions.FLIP_FROZEN)
8746 {
8747 SetFrozen(!GetIsFrozen());
8748
8749 }
8750
8751 else if (action_id ==
EActions.ADD_WETNESS)
8752 {
8754
8755 }
8756
8757 else if (action_id ==
EActions.REMOVE_WETNESS)
8758 {
8760
8761 }
8762
8763 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8764 {
8767
8768
8769 }
8770
8771 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8772 {
8775 }
8776
8777 else if (action_id ==
EActions.MAKE_SPECIAL)
8778 {
8779 auto debugParams = DebugSpawnParams.WithPlayer(player);
8780 OnDebugSpawnEx(debugParams);
8781 }
8782
8783 }
8784
8785
8786 return false;
8787 }
8788
8789
8790
8791
8795
8798
8799
8800
8802 {
8803 return false;
8804 }
8805
8806
8808 {
8809 return true;
8810 }
8811
8812
8814 {
8815 return true;
8816 }
8817
8818
8819
8821 {
8822 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8824 }
8825
8828 {
8829 return null;
8830 }
8831
8833 {
8834 return false;
8835 }
8836
8838 {
8839 return false;
8840 }
8841
8845
8846
8848 {
8849 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8850 return module_repairing.CanRepair(this, item_repair_kit);
8851 }
8852
8853
8854 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8855 {
8856 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8857 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8858 }
8859
8860
8862 {
8863
8864
8865
8866
8867
8868
8869
8870
8871 return 1;
8872 }
8873
8874
8875
8877 {
8879 }
8880
8881
8882
8884 {
8886 }
8887
8888
8897 {
8898 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8899
8900 if (player)
8901 {
8902 player.MessageStatus(text);
8903 }
8904 }
8905
8906
8915 {
8916 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8917
8918 if (player)
8919 {
8920 player.MessageAction(text);
8921 }
8922 }
8923
8924
8933 {
8934 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8935
8936 if (player)
8937 {
8938 player.MessageFriendly(text);
8939 }
8940 }
8941
8942
8951 {
8952 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8953
8954 if (player)
8955 {
8956 player.MessageImportant(text);
8957 }
8958 }
8959
8961 {
8962 return true;
8963 }
8964
8965
8966 override bool KindOf(
string tag)
8967 {
8968 bool found = false;
8969 string item_name = this.
GetType();
8972
8973 int array_size = item_tag_array.Count();
8974 for (int i = 0; i < array_size; i++)
8975 {
8976 if (item_tag_array.Get(i) == tag)
8977 {
8978 found = true;
8979 break;
8980 }
8981 }
8982 return found;
8983 }
8984
8985
8987 {
8988
8989 super.OnRPC(sender, rpc_type,ctx);
8990
8991
8992 switch (rpc_type)
8993 {
8994 #ifndef SERVER
8995 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8996 Param2<bool, string> p = new Param2<bool, string>(false, "");
8997
8999 return;
9000
9001 bool play = p.param1;
9002 string soundSet = p.param2;
9003
9004 if (play)
9005 {
9007 {
9009 {
9011 }
9012 }
9013 else
9014 {
9016 }
9017 }
9018 else
9019 {
9021 }
9022
9023 break;
9024 #endif
9025
9026 }
9027
9029 {
9031 }
9032 }
9033
9034
9035
9036
9038 {
9039 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9040 return plugin.GetID(
name);
9041 }
9042
9044 {
9045 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9046 return plugin.GetName(id);
9047 }
9048
9051 {
9052
9053
9054 int varFlags;
9055 if (!ctx.
Read(varFlags))
9056 return;
9057
9058 if (varFlags & ItemVariableFlags.FLOAT)
9059 {
9061 }
9062 }
9063
9065 {
9066
9067 super.SerializeNumericalVars(floats_out);
9068
9069
9070
9072 {
9074 }
9075
9077 {
9079 }
9080
9082 {
9084 }
9085
9087 {
9092 }
9093
9095 {
9097 }
9098 }
9099
9101 {
9102
9103 super.DeSerializeNumericalVars(floats);
9104
9105
9106 int index = 0;
9107 int mask = Math.Round(floats.Get(index));
9108
9109 index++;
9110
9112 {
9114 {
9116 }
9117 else
9118 {
9119 float quantity = floats.Get(index);
9121 }
9122 index++;
9123 }
9124
9126 {
9127 float wet = floats.Get(index);
9129 index++;
9130 }
9131
9133 {
9134 int liquidtype = Math.Round(floats.Get(index));
9136 index++;
9137 }
9138
9140 {
9142 index++;
9144 index++;
9146 index++;
9148 index++;
9149 }
9150
9152 {
9153 int cleanness = Math.Round(floats.Get(index));
9155 index++;
9156 }
9157 }
9158
9160 {
9161 super.WriteVarsToCTX(ctx);
9162
9163
9165 {
9167 }
9168
9170 {
9172 }
9173
9175 {
9177 }
9178
9180 {
9181 int r,g,b,a;
9187 }
9188
9190 {
9192 }
9193 }
9194
9196 {
9197 if (!super.ReadVarsFromCTX(ctx,version))
9198 return false;
9199
9200 int intValue;
9201 float value;
9202
9203 if (version < 140)
9204 {
9205 if (!ctx.
Read(intValue))
9206 return false;
9207
9208 m_VariablesMask = intValue;
9209 }
9210
9212 {
9213 if (!ctx.
Read(value))
9214 return false;
9215
9217 {
9219 }
9220 else
9221 {
9223 }
9224 }
9225
9226 if (version < 140)
9227 {
9229 {
9230 if (!ctx.
Read(value))
9231 return false;
9232 SetTemperatureDirect(value);
9233 }
9234 }
9235
9237 {
9238 if (!ctx.
Read(value))
9239 return false;
9241 }
9242
9244 {
9245 if (!ctx.
Read(intValue))
9246 return false;
9248 }
9249
9251 {
9252 int r,g,b,a;
9254 return false;
9256 return false;
9258 return false;
9260 return false;
9261
9263 }
9264
9266 {
9267 if (!ctx.
Read(intValue))
9268 return false;
9270 }
9271
9272 if (version >= 138 && version < 140)
9273 {
9275 {
9276 if (!ctx.
Read(intValue))
9277 return false;
9278 SetFrozen(intValue);
9279 }
9280 }
9281
9282 return true;
9283 }
9284
9285
9287 {
9290 {
9292 }
9293
9294 if (!super.OnStoreLoad(ctx, version))
9295 {
9297 return false;
9298 }
9299
9300 if (version >= 114)
9301 {
9302 bool hasQuickBarIndexSaved;
9303
9304 if (!ctx.
Read(hasQuickBarIndexSaved))
9305 {
9307 return false;
9308 }
9309
9310 if (hasQuickBarIndexSaved)
9311 {
9312 int itmQBIndex;
9313
9314
9315 if (!ctx.
Read(itmQBIndex))
9316 {
9318 return false;
9319 }
9320
9321 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9322 if (itmQBIndex != -1 && parentPlayer)
9323 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9324 }
9325 }
9326 else
9327 {
9328
9329 PlayerBase player;
9330 int itemQBIndex;
9331 if (version ==
int.
MAX)
9332 {
9333 if (!ctx.
Read(itemQBIndex))
9334 {
9336 return false;
9337 }
9338 }
9339 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9340 {
9341
9342 if (!ctx.
Read(itemQBIndex))
9343 {
9345 return false;
9346 }
9347 if (itemQBIndex != -1 && player)
9348 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9349 }
9350 }
9351
9352 if (version < 140)
9353 {
9354
9355 if (!LoadVariables(ctx, version))
9356 {
9358 return false;
9359 }
9360 }
9361
9362
9364 {
9366 return false;
9367 }
9368 if (version >= 132)
9369 {
9371 if (raib)
9372 {
9374 {
9376 return false;
9377 }
9378 }
9379 }
9380
9382 return true;
9383 }
9384
9385
9386
9388 {
9389 super.OnStoreSave(ctx);
9390
9391 PlayerBase player;
9392 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9393 {
9395
9396 int itemQBIndex = -1;
9397 itemQBIndex = player.FindQuickBarEntityIndex(this);
9398 ctx.
Write(itemQBIndex);
9399 }
9400 else
9401 {
9403 }
9404
9406
9408 if (raib)
9409 {
9411 }
9412 }
9413
9414
9416 {
9417 super.AfterStoreLoad();
9418
9420 {
9422 }
9423
9425 {
9428 }
9429 }
9430
9432 {
9433 super.EEOnAfterLoad();
9434
9436 {
9438 }
9439
9442 }
9443
9445 {
9446 return false;
9447 }
9448
9449
9450
9452 {
9454 {
9455 #ifdef PLATFORM_CONSOLE
9456
9458 {
9460 if (menu)
9461 {
9463 }
9464 }
9465 #endif
9466 }
9467
9469 {
9472 }
9473
9475 {
9476 SetWeightDirty();
9478 }
9480 {
9483 }
9484
9486 {
9489 }
9491 {
9494 }
9495
9496 super.OnVariablesSynchronized();
9497 }
9498
9499
9500
9502 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9503 {
9504 if (!IsServerCheck(allow_client))
9505 return false;
9506
9508 return false;
9509
9512
9513 if (value <= (min + 0.001))
9514 value = min;
9515
9516 if (value == min)
9517 {
9518 if (destroy_config)
9519 {
9520 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9521 if (dstr)
9522 {
9524 this.Delete();
9525 return true;
9526 }
9527 }
9528 else if (destroy_forced)
9529 {
9531 this.Delete();
9532 return true;
9533 }
9534
9536 }
9537
9540
9542 {
9544
9545 if (delta)
9547 }
9548
9550
9551 return false;
9552 }
9553
9554
9556 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9557 {
9559 }
9560
9562 {
9565 }
9566
9568 {
9571 }
9572
9574 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9575 {
9576 float value_clamped = Math.Clamp(value, 0, 1);
9578 SetQuantity(result, destroy_config, destroy_forced);
9579 }
9580
9581
9584 {
9586 }
9587
9589 {
9591 }
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9603 {
9604 int slot = -1;
9605 if (GetInventory())
9606 {
9607 InventoryLocation il = new InventoryLocation;
9608 GetInventory().GetCurrentInventoryLocation(il);
9610 }
9611
9613 }
9614
9616 {
9617 float quantity_max = 0;
9618
9620 {
9621 if (attSlotID != -1)
9622 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9623
9624 if (quantity_max <= 0)
9626 }
9627
9628 if (quantity_max <= 0)
9630
9631 return quantity_max;
9632 }
9633
9635 {
9637 }
9638
9640 {
9642 }
9643
9644
9646 {
9648 }
9649
9651 {
9653 }
9654
9656 {
9658 }
9659
9660
9662 {
9663
9664 float weightEx = GetWeightEx();
9665 float special = GetInventoryAndCargoWeight();
9666 return weightEx - special;
9667 }
9668
9669
9671 {
9673 }
9674
9676 {
9678 {
9679 #ifdef DEVELOPER
9680 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9681 {
9682 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9684 }
9685 #endif
9686
9688 }
9689 else if (HasEnergyManager())
9690 {
9691 #ifdef DEVELOPER
9692 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9693 {
9694 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9695 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9696 }
9697 #endif
9698 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
9699 }
9700 else
9701 {
9702 #ifdef DEVELOPER
9703 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9704 {
9705 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9706 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9707 }
9708 #endif
9709 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
9710 }
9711 }
9712
9715 {
9716 int item_count = 0;
9718
9719 if (GetInventory().GetCargo() != NULL)
9720 {
9721 item_count = GetInventory().GetCargo().GetItemCount();
9722 }
9723
9724 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9725 {
9726 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9727 if (item)
9728 item_count += item.GetNumberOfItems();
9729 }
9730 return item_count;
9731 }
9732
9735 {
9736 float weight = 0;
9737 float wetness = 1;
9738 if (include_wetness)
9741 {
9742 weight = wetness * m_ConfigWeight;
9743 }
9745 {
9746 weight = 1;
9747 }
9748 return weight;
9749 }
9750
9751
9752
9754 {
9755 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9756 {
9757 GameInventory inv = GetInventory();
9758 array<EntityAI> items = new array<EntityAI>;
9760 for (int i = 0; i < items.Count(); i++)
9761 {
9763 if (item)
9764 {
9766 }
9767 }
9768 }
9769 }
9770
9771
9772
9773
9775 {
9776 float energy = 0;
9777 if (HasEnergyManager())
9778 {
9779 energy = GetCompEM().GetEnergy();
9780 }
9781 return energy;
9782 }
9783
9784
9786 {
9787 super.OnEnergyConsumed();
9788
9790 }
9791
9793 {
9794 super.OnEnergyAdded();
9795
9797 }
9798
9799
9801 {
9802 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9803 {
9805 {
9806 float energy_0to1 = GetCompEM().GetEnergy0To1();
9808 }
9809 }
9810 }
9811
9812
9814 {
9815 return ConfigGetFloat("heatIsolation");
9816 }
9817
9819 {
9821 }
9822
9824 {
9825 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9826 if (
GetGame().ConfigIsExisting(paramPath))
9828
9829 return 0.0;
9830 }
9831
9833 {
9834 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9835 if (
GetGame().ConfigIsExisting(paramPath))
9837
9838 return 0.0;
9839 }
9840
9841 override void SetWet(
float value,
bool allow_client =
false)
9842 {
9843 if (!IsServerCheck(allow_client))
9844 return;
9845
9848
9850
9851 m_VarWet = Math.Clamp(value, min, max);
9852
9854 {
9857 }
9858 }
9859
9860 override void AddWet(
float value)
9861 {
9863 }
9864
9866 {
9868 }
9869
9871 {
9873 }
9874
9876 {
9878 }
9879
9881 {
9883 }
9884
9886 {
9888 }
9889
9891 {
9894 if (newLevel != oldLevel)
9895 {
9897 }
9898 }
9899
9901 {
9902 SetWeightDirty();
9903 }
9904
9906 {
9907 return GetWetLevelInternal(
m_VarWet);
9908 }
9909
9910
9911
9913 {
9915 }
9916
9918 {
9920 }
9921
9923 {
9925 }
9926
9928 {
9930 }
9931
9932
9933
9935 {
9936 if (ConfigIsExisting("itemModelLength"))
9937 {
9938 return ConfigGetFloat("itemModelLength");
9939 }
9940 return 0;
9941 }
9942
9944 {
9945 if (ConfigIsExisting("itemAttachOffset"))
9946 {
9947 return ConfigGetFloat("itemAttachOffset");
9948 }
9949 return 0;
9950 }
9951
9952 override void SetCleanness(
int value,
bool allow_client =
false)
9953 {
9954 if (!IsServerCheck(allow_client))
9955 return;
9956
9958
9960
9963 }
9964
9966 {
9968 }
9969
9971 {
9972 return true;
9973 }
9974
9975
9976
9977
9979 {
9981 }
9982
9984 {
9986 }
9987
9988
9989
9990
9991 override void SetColor(
int r,
int g,
int b,
int a)
9992 {
9998 }
10000 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10001 {
10006 }
10007
10009 {
10011 }
10012
10015 {
10016 int r,g,b,a;
10018 r = r/255;
10019 g = g/255;
10020 b = b/255;
10021 a = a/255;
10022 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10023 }
10024
10025
10026
10027 override void SetLiquidType(
int value,
bool allow_client =
false)
10028 {
10029 if (!IsServerCheck(allow_client))
10030 return;
10031
10036 }
10037
10039 {
10040 return ConfigGetInt("varLiquidTypeInit");
10041 }
10042
10044 {
10046 }
10047
10049 {
10051 SetFrozen(false);
10052 }
10053
10056 {
10057 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10058 }
10059
10060
10063 {
10064 PlayerBase nplayer;
10065 if (PlayerBase.CastTo(nplayer, player))
10066 {
10068
10069 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10070 }
10071 }
10072
10073
10076 {
10077 PlayerBase nplayer;
10078 if (PlayerBase.CastTo(nplayer,player))
10079 {
10080
10081 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10082
10083 }
10084
10085
10086 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10087
10088
10089 if (HasEnergyManager())
10090 {
10091 GetCompEM().UpdatePlugState();
10092 }
10093 }
10094
10095
10097 {
10098 super.OnPlacementStarted(player);
10099
10101 }
10102
10103 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10104 {
10106 {
10107 m_AdminLog.OnPlacementComplete(player,
this);
10108 }
10109
10110 super.OnPlacementComplete(player, position, orientation);
10111 }
10112
10113
10114
10115
10116
10118 {
10120 {
10121 return true;
10122 }
10123 else
10124 {
10125 return false;
10126 }
10127 }
10128
10129
10131 {
10133 {
10135 }
10136 }
10137
10138
10140 {
10142 }
10143
10145 {
10147 }
10148
10149 override void InsertAgent(
int agent,
float count = 1)
10150 {
10151 if (count < 1)
10152 return;
10153
10155 }
10156
10159 {
10161 }
10162
10163
10165 {
10167 }
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10211 {
10213 return false;
10214 return true;
10215 }
10216
10218 {
10219
10221 }
10222
10223
10226 {
10227 super.CheckForRoofLimited(timeTresholdMS);
10228
10230 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10231 {
10232 m_PreviousRoofTestTime = time;
10233 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10234 }
10235 }
10236
10237
10239 {
10241 {
10242 return 0;
10243 }
10244
10245 if (GetInventory().GetAttachmentSlotsCount() != 0)
10246 {
10247 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10248 if (filter)
10249 return filter.GetProtectionLevel(type, false, system);
10250 else
10251 return 0;
10252 }
10253
10254 string subclassPath, entryName;
10255
10256 switch (type)
10257 {
10259 entryName = "biological";
10260 break;
10262 entryName = "chemical";
10263 break;
10264 default:
10265 entryName = "biological";
10266 break;
10267 }
10268
10269 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10270
10272 }
10273
10274
10275
10278 {
10279 if (!IsMagazine())
10281
10283 }
10284
10285
10286
10287
10288
10293 {
10294 return true;
10295 }
10296
10298 {
10300 }
10301
10302
10303
10304
10305
10307 {
10308 if (parent)
10309 {
10310 if (parent.IsInherited(DayZInfected))
10311 return true;
10312
10313 if (!parent.IsRuined())
10314 return true;
10315 }
10316
10317 return true;
10318 }
10319
10321 {
10322 if (!super.CanPutAsAttachment(parent))
10323 {
10324 return false;
10325 }
10326
10327 if (!IsRuined() && !parent.IsRuined())
10328 {
10329 return true;
10330 }
10331
10332 return false;
10333 }
10334
10336 {
10337
10338
10339
10340
10341 return super.CanReceiveItemIntoCargo(item);
10342 }
10343
10345 {
10346
10347
10348
10349
10350 GameInventory attachmentInv = attachment.GetInventory();
10352 {
10353 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10354 return false;
10355 }
10356
10357 InventoryLocation loc = new InventoryLocation();
10358 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10359 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10360 return false;
10361
10362 return super.CanReceiveAttachment(attachment, slotId);
10363 }
10364
10366 {
10367 if (!super.CanReleaseAttachment(attachment))
10368 return false;
10369
10370 return GetInventory().AreChildrenAccessible();
10371 }
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10394 {
10395 int id = muzzle_owner.GetMuzzleID();
10396 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10397
10398 if (WPOF_array)
10399 {
10400 for (int i = 0; i < WPOF_array.Count(); i++)
10401 {
10402 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10403
10404 if (WPOF)
10405 {
10406 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10407 }
10408 }
10409 }
10410 }
10411
10412
10414 {
10415 int id = muzzle_owner.GetMuzzleID();
10417
10418 if (WPOBE_array)
10419 {
10420 for (int i = 0; i < WPOBE_array.Count(); i++)
10421 {
10422 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10423
10424 if (WPOBE)
10425 {
10426 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10427 }
10428 }
10429 }
10430 }
10431
10432
10434 {
10435 int id = muzzle_owner.GetMuzzleID();
10436 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10437
10438 if (WPOOH_array)
10439 {
10440 for (int i = 0; i < WPOOH_array.Count(); i++)
10441 {
10442 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10443
10444 if (WPOOH)
10445 {
10446 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10447 }
10448 }
10449 }
10450 }
10451
10452
10454 {
10455 int id = muzzle_owner.GetMuzzleID();
10456 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10457
10458 if (WPOOH_array)
10459 {
10460 for (int i = 0; i < WPOOH_array.Count(); i++)
10461 {
10462 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10463
10464 if (WPOOH)
10465 {
10466 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10467 }
10468 }
10469 }
10470 }
10471
10472
10474 {
10475 int id = muzzle_owner.GetMuzzleID();
10476 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10477
10478 if (WPOOH_array)
10479 {
10480 for (int i = 0; i < WPOOH_array.Count(); i++)
10481 {
10482 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10483
10484 if (WPOOH)
10485 {
10486 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10487 }
10488 }
10489 }
10490 }
10491
10492
10493
10495 {
10497 {
10498 return true;
10499 }
10500
10501 return false;
10502 }
10503
10505 {
10507 {
10508 return true;
10509 }
10510
10511 return false;
10512 }
10513
10515 {
10517 {
10518 return true;
10519 }
10520
10521 return false;
10522 }
10523
10525 {
10526 return false;
10527 }
10528
10531 {
10532 return UATimeSpent.DEFAULT_DEPLOY;
10533 }
10534
10535
10536
10537
10539 {
10541 SetSynchDirty();
10542 }
10543
10545 {
10547 }
10548
10549
10551 {
10552 return false;
10553 }
10554
10557 {
10558 string att_type = "None";
10559
10560 if (ConfigIsExisting("soundAttType"))
10561 {
10562 att_type = ConfigGetString("soundAttType");
10563 }
10564
10566 }
10567
10569 {
10571 }
10572
10573
10574
10575
10576
10582
10584 {
10587
10589 }
10590
10591
10593 {
10595 return;
10596
10598
10601
10604
10605 SoundParameters params = new SoundParameters();
10609 }
10610
10611
10613 {
10615 return;
10616
10618 SetSynchDirty();
10619
10622 }
10623
10624
10626 {
10628 return;
10629
10631 SetSynchDirty();
10632
10635 }
10636
10638 {
10640 }
10641
10643 {
10645 }
10646
10649 {
10650 if (!
GetGame().IsDedicatedServer())
10651 {
10652 if (ConfigIsExisting("attachSoundSet"))
10653 {
10654 string cfg_path = "";
10655 string soundset = "";
10656 string type_name =
GetType();
10657
10660 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10661 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10662
10663 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10664 {
10665 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10666 {
10667 if (cfg_slot_array[i] == slot_type)
10668 {
10669 soundset = cfg_soundset_array[i];
10670 break;
10671 }
10672 }
10673 }
10674
10675 if (soundset != "")
10676 {
10677 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10679 }
10680 }
10681 }
10682 }
10683
10685 {
10686
10687 }
10688
10689 void OnApply(PlayerBase player);
10690
10692 {
10693 return 1.0;
10694 };
10695
10697 {
10699 }
10700
10702 {
10704 }
10705
10707
10709 {
10710 SetDynamicPhysicsLifeTime(0.01);
10712 }
10713
10715 {
10716 array<string> zone_names = new array<string>;
10717 GetDamageZones(zone_names);
10718 for (int i = 0; i < zone_names.Count(); i++)
10719 {
10720 SetHealthMax(zone_names.Get(i),"Health");
10721 }
10722 SetHealthMax("","Health");
10723 }
10724
10727 {
10728 float global_health = GetHealth01("","Health");
10729 array<string> zones = new array<string>;
10730 GetDamageZones(zones);
10731
10732 for (int i = 0; i < zones.Count(); i++)
10733 {
10734 SetHealth01(zones.Get(i),"Health",global_health);
10735 }
10736 }
10737
10740 {
10741 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10742 }
10743
10745 {
10746 if (!hasRootAsPlayer)
10747 {
10748 if (refParentIB)
10749 {
10750
10751 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10752 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10753
10754 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10755 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10756
10759 }
10760 else
10761 {
10762
10765 }
10766 }
10767 }
10768
10770 {
10772 {
10773 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10774 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
10775 {
10776 float heatPermCoef = 1.0;
10778 while (ent)
10779 {
10780 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10781 ent = ent.GetHierarchyParent();
10782 }
10783
10784 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10785 }
10786 }
10787 }
10788
10790 {
10791
10792 EntityAI parent = GetHierarchyParent();
10793 if (!parent)
10794 {
10795 hasParent = false;
10796 hasRootAsPlayer = false;
10797 }
10798 else
10799 {
10800 hasParent = true;
10801 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10802 refParentIB =
ItemBase.Cast(parent);
10803 }
10804 }
10805
10806 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10807 {
10808
10809 }
10810
10812 {
10813
10814 return false;
10815 }
10816
10818 {
10819
10820
10821 return false;
10822 }
10823
10825 {
10826
10827 return false;
10828 }
10829
10832 {
10833 return !GetIsFrozen() &&
IsOpen();
10834 }
10835
10837 {
10838 bool hasParent = false, hasRootAsPlayer = false;
10840
10841 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10842 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10843
10844 if (wwtu || foodDecay)
10845 {
10849
10850 if (processWetness || processTemperature || processDecay)
10851 {
10853
10854 if (processWetness)
10855 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10856
10857 if (processTemperature)
10859
10860 if (processDecay)
10861 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10862 }
10863 }
10864 }
10865
10868 {
10870 }
10871
10873 {
10876
10877 return super.GetTemperatureFreezeThreshold();
10878 }
10879
10881 {
10884
10885 return super.GetTemperatureThawThreshold();
10886 }
10887
10889 {
10892
10893 return super.GetItemOverheatThreshold();
10894 }
10895
10897 {
10899 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10900
10901 return super.GetTemperatureFreezeTime();
10902 }
10903
10905 {
10907 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10908
10909 return super.GetTemperatureThawTime();
10910 }
10911
10916
10918 {
10919 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10920 }
10921
10923 {
10924 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10925 }
10926
10929 {
10931 }
10932
10934 {
10936 }
10937
10939 {
10941 }
10942
10945 {
10946 return null;
10947 }
10948
10951 {
10952 return false;
10953 }
10954
10956 {
10958 {
10961 if (!trg)
10962 {
10964 explosive = this;
10965 }
10966
10967 explosive.PairRemote(trg);
10969
10970 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10971 trg.SetPersistentPairID(persistentID);
10972 explosive.SetPersistentPairID(persistentID);
10973
10974 return true;
10975 }
10976 return false;
10977 }
10978
10981 {
10982 float ret = 1.0;
10985 ret *= GetHealth01();
10986
10987 return ret;
10988 }
10989
10990 #ifdef DEVELOPER
10991 override void SetDebugItem()
10992 {
10993 super.SetDebugItem();
10994 _itemBase = this;
10995 }
10996
10998 {
10999 string text = super.GetDebugText();
11000
11002 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11003
11004 return text;
11005 }
11006 #endif
11007
11009 {
11010 return true;
11011 }
11012
11014
11016
11018 {
11021 }
11022
11023
11031
11047}
11048
11050{
11052 if (entity)
11053 {
11054 bool is_item = entity.IsInherited(
ItemBase);
11055 if (is_item && full_quantity)
11056 {
11059 }
11060 }
11061 else
11062 {
11064 return NULL;
11065 }
11066 return entity;
11067}
11068
11070{
11071 if (item)
11072 {
11073 if (health > 0)
11074 item.SetHealth("", "", health);
11075
11076 if (item.CanHaveTemperature())
11077 {
11079 if (item.CanFreeze())
11080 item.SetFrozen(false);
11081 }
11082
11083 if (item.HasEnergyManager())
11084 {
11085 if (quantity >= 0)
11086 {
11087 item.GetCompEM().SetEnergy0To1(quantity);
11088 }
11089 else
11090 {
11092 }
11093 }
11094 else if (item.IsMagazine())
11095 {
11096 Magazine mag = Magazine.Cast(item);
11097 if (quantity >= 0)
11098 {
11099 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11100 }
11101 else
11102 {
11104 }
11105
11106 }
11107 else
11108 {
11109 if (quantity >= 0)
11110 {
11111 item.SetQuantityNormalized(quantity, false);
11112 }
11113 else
11114 {
11116 }
11117
11118 }
11119 }
11120}
11121
11122#ifdef DEVELOPER
11124#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.