6171{
6173 {
6174 return true;
6175 }
6176};
6177
6178
6179
6181{
6185
6187
6190
6191
6192
6193
6194
6203
6209
6214
6219
6240 protected bool m_IsResultOfSplit
6241
6243
6248
6249
6250
6252
6256
6257
6258
6260
6263
6264
6265
6271
6272
6280
6283
6284
6286
6287
6289
6290
6295
6296
6301
6302
6304
6305
6307 {
6312
6313 if (!
GetGame().IsDedicatedServer())
6314 {
6316 {
6318
6320 {
6322 }
6323 }
6324
6327 }
6328
6329 m_OldLocation = null;
6330
6332 {
6334 }
6335
6336 if (ConfigIsExisting("headSelectionsToHide"))
6337 {
6340 }
6341
6343 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6344 {
6346 }
6347
6349
6350 m_IsResultOfSplit = false;
6351
6353 }
6354
6356 {
6357 super.InitItemVariables();
6358
6364 m_Count = ConfigGetInt(
"count");
6365
6368
6373
6376
6381
6393
6397
6398
6401 if (ConfigIsExisting("canBeSplit"))
6402 {
6405 }
6406
6408 if (ConfigIsExisting("itemBehaviour"))
6410
6411
6414 RegisterNetSyncVariableInt("m_VarLiquidType");
6415 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6416
6417 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6418 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6419 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6420
6421 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6422 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6423 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6424 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6425
6426 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6427 RegisterNetSyncVariableBool("m_IsTakeable");
6428 RegisterNetSyncVariableBool("m_IsHologram");
6429
6432 {
6435 }
6436
6438
6440 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6442
6443 }
6444
6446 {
6448 }
6449
6451 {
6454 {
6459 }
6460 }
6461
6462 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6463 {
6465 {
6468 }
6469
6471 }
6472
6474 {
6480 }
6481
6483
6485 {
6487
6488 if (!action)
6489 {
6490 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6491 return;
6492 }
6493
6495 if (!ai)
6496 {
6498 return;
6499 }
6500
6502 if (!action_array)
6503 {
6504 action_array = new array<ActionBase_Basic>;
6506 }
6507 if (LogManager.IsActionLogEnable())
6508 {
6509 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6510 }
6511
6512 if (action_array.Find(action) != -1)
6513 {
6514 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6515 }
6516 else
6517 {
6518 action_array.Insert(action);
6519 }
6520 }
6521
6523 {
6525 ActionBase action = player.GetActionManager().GetAction(actionName);
6528
6529 if (action_array)
6530 {
6531 action_array.RemoveItem(action);
6532 }
6533 }
6534
6535
6536
6538 {
6539 ActionOverrideData overrideData = new ActionOverrideData();
6543
6545 if (!actionMap)
6546 {
6549 }
6550
6551 actionMap.Insert(this.
Type(), overrideData);
6552
6553 }
6554
6556
6558
6559
6561 {
6564
6567
6568 string config_to_search = "CfgVehicles";
6569 string muzzle_owner_config;
6570
6572 {
6573 if (IsInherited(Weapon))
6574 config_to_search = "CfgWeapons";
6575
6576 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6577
6578 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6579
6581
6582 if (config_OnFire_subclass_count > 0)
6583 {
6584 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6585
6586 for (int i = 0; i < config_OnFire_subclass_count; i++)
6587 {
6588 string particle_class = "";
6590 string config_OnFire_entry = config_OnFire_class + particle_class;
6591 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6592 WPOF_array.Insert(WPOF);
6593 }
6594
6595
6597 }
6598 }
6599
6601 {
6602 config_to_search = "CfgWeapons";
6603 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6604
6605 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6606
6608
6609 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6610 {
6611 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6612
6613 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6614 {
6615 string particle_class2 = "";
6617 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6618 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6619 WPOBE_array.Insert(WPOBE);
6620 }
6621
6622
6624 }
6625 }
6626 }
6627
6628
6630 {
6633
6635 {
6636 string config_to_search = "CfgVehicles";
6637
6638 if (IsInherited(Weapon))
6639 config_to_search = "CfgWeapons";
6640
6641 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6642 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6643
6644 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6645 {
6646
6648
6650 {
6652 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6654 return;
6655 }
6656
6659
6660
6661
6663 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6664
6665 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6666 {
6667 string particle_class = "";
6669 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6671
6672 if (entry_type == CT_CLASS)
6673 {
6674 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6675 WPOOH_array.Insert(WPOF);
6676 }
6677 }
6678
6679
6681 }
6682 }
6683 }
6684
6686 {
6688 }
6689
6691 {
6693 {
6695
6698
6701
6702 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6703 }
6704 }
6705
6707 {
6709 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6710
6712 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6713
6715 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6716
6718 {
6720 }
6721 }
6722
6724 {
6726 }
6727
6729 {
6732 else
6734
6736 {
6739 }
6740 else
6741 {
6744
6747 }
6748
6750 }
6751
6753 {
6755 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6756 }
6757
6759 {
6761 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6763 }
6764
6766 {
6768 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6769 }
6770
6772 {
6775
6776 OverheatingParticle OP = new OverheatingParticle();
6781
6783 }
6784
6786 {
6789
6790 return -1;
6791 }
6792
6794 {
6796 {
6799
6800 for (int i = count; i > 0; --i)
6801 {
6802 int id = i - 1;
6805
6808
6809 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6810 {
6811 if (p)
6812 {
6815 }
6816 }
6817 }
6818 }
6819 }
6820
6822 {
6824 {
6826 {
6827 int id = i - 1;
6829
6830 if (OP)
6831 {
6833
6834 if (p)
6835 {
6837 }
6838
6839 delete OP;
6840 }
6841 }
6842
6845 }
6846 }
6847
6850 {
6851 return 0.0;
6852 }
6853
6854
6856 {
6857 return 250;
6858 }
6859
6861 {
6862 return 0;
6863 }
6864
6867 {
6869 return true;
6870
6871 return false;
6872 }
6873
6876 {
6879
6881 {
6883 }
6884 else
6885 {
6886
6888 }
6889
6891 }
6892
6899 {
6900 return -1;
6901 }
6902
6903
6904
6905
6907 {
6909 {
6911 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6912
6913 if (r_index >= 0)
6914 {
6915 InventoryLocation r_il = new InventoryLocation;
6916 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6917
6918 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6921 {
6922 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6923 }
6925 {
6926 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6927 }
6928
6929 }
6930
6931 player.GetHumanInventory().ClearUserReservedLocation(this);
6932 }
6933
6936 }
6937
6938
6939
6940
6942 {
6943 return ItemBase.m_DebugActionsMask;
6944 }
6945
6947 {
6948 return ItemBase.m_DebugActionsMask & mask;
6949 }
6950
6952 {
6953 ItemBase.m_DebugActionsMask = mask;
6954 }
6955
6957 {
6958 ItemBase.m_DebugActionsMask |= mask;
6959 }
6960
6962 {
6963 ItemBase.m_DebugActionsMask &= ~mask;
6964 }
6965
6967 {
6969 {
6971 }
6972 else
6973 {
6975 }
6976 }
6977
6978
6980 {
6981 if (GetEconomyProfile())
6982 {
6983 float q_max = GetEconomyProfile().GetQuantityMax();
6984 if (q_max > 0)
6985 {
6986 float q_min = GetEconomyProfile().GetQuantityMin();
6987 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6988
6990 {
6991 ComponentEnergyManager comp = GetCompEM();
6993 {
6995 }
6996 }
6998 {
7000
7001 }
7002
7003 }
7004 }
7005 }
7006
7009 {
7010 EntityAI parent = GetHierarchyParent();
7011
7012 if (parent)
7013 {
7014 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7015 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7016 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7017 }
7018 }
7019
7022 {
7023 EntityAI parent = GetHierarchyParent();
7024
7025 if (parent)
7026 {
7027 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7028 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7029 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7030 }
7031 }
7032
7034 {
7035
7036
7037
7038
7040
7042 {
7043 if (ScriptInputUserData.CanStoreInputUserData())
7044 {
7045 ScriptInputUserData ctx = new ScriptInputUserData;
7051 ctx.
Write(use_stack_max);
7054
7056 {
7057 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7058 }
7059 }
7060 }
7061 else if (!
GetGame().IsMultiplayer())
7062 {
7064 }
7065 }
7066
7068 {
7070 }
7071
7073 {
7075 }
7076
7078 {
7080 }
7081
7083 {
7084
7085 return false;
7086 }
7087
7089 {
7090 return false;
7091 }
7092
7096 {
7097 return false;
7098 }
7099
7101 {
7102 return "";
7103 }
7104
7106
7108 {
7109 return false;
7110 }
7111
7113 {
7114 return true;
7115 }
7116
7117
7118
7120 {
7121 return true;
7122 }
7123
7125 {
7126 return true;
7127 }
7128
7130 {
7131 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7133 }
7134
7136 {
7138 }
7139
7141 {
7143 if (!is_being_placed)
7145 SetSynchDirty();
7146 }
7147
7148
7150
7152 {
7154 }
7155
7157 {
7159 }
7160
7162 {
7163 return 1;
7164 }
7165
7167 {
7168 return false;
7169 }
7170
7172 {
7174 SetSynchDirty();
7175 }
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7212 {
7213 super.OnMovedInsideCargo(container);
7214
7215 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7216 }
7217
7218 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7219 {
7220 super.EEItemLocationChanged(oldLoc,newLoc);
7221
7222 PlayerBase new_player = null;
7223 PlayerBase old_player = null;
7224
7225 if (newLoc.GetParent())
7226 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7227
7228 if (oldLoc.GetParent())
7229 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7230
7232 {
7233 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7234
7235 if (r_index >= 0)
7236 {
7237 InventoryLocation r_il = new InventoryLocation;
7238 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7239
7240 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7243 {
7244 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7245 }
7247 {
7248 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7249 }
7250
7251 }
7252 }
7253
7255 {
7256 if (new_player)
7257 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7258
7259 if (new_player == old_player)
7260 {
7261
7262 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7263 {
7265 {
7266 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7267 {
7268 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7269 }
7270 }
7271 else
7272 {
7273 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7274 }
7275 }
7276
7277 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7278 {
7279 int type = oldLoc.GetType();
7281 {
7282 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7283 }
7285 {
7286 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7287 }
7288 }
7289 if (!m_OldLocation)
7290 {
7291 m_OldLocation = new InventoryLocation;
7292 }
7293 m_OldLocation.Copy(oldLoc);
7294 }
7295 else
7296 {
7297 if (m_OldLocation)
7298 {
7299 m_OldLocation.Reset();
7300 }
7301 }
7302
7304 }
7305 else
7306 {
7307 if (new_player)
7308 {
7309 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7310 if (res_index >= 0)
7311 {
7312 InventoryLocation il = new InventoryLocation;
7313 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7315 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7318 {
7319 il.
GetParent().GetOnReleaseLock().Invoke(it);
7320 }
7322 {
7324 }
7325
7326 }
7327 }
7329 {
7330
7332 }
7333
7334 if (m_OldLocation)
7335 {
7336 m_OldLocation.Reset();
7337 }
7338 }
7339 }
7340
7341 override void EOnContact(IEntity other, Contact extra)
7342 {
7344 {
7345 int liquidType = -1;
7347 if (impactSpeed > 0.0)
7348 {
7350 #ifndef SERVER
7352 #else
7354 SetSynchDirty();
7355 #endif
7357 }
7358 }
7359
7360 #ifdef SERVER
7361 if (GetCompEM() && GetCompEM().IsPlugged())
7362 {
7363 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7364 GetCompEM().UnplugThis();
7365 }
7366 #endif
7367 }
7368
7370
7372 {
7374 }
7375
7377 {
7378
7379 }
7380
7382 {
7383 super.OnItemLocationChanged(old_owner, new_owner);
7384
7385 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7386 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7387
7388 if (!relatedPlayer && playerNew)
7389 relatedPlayer = playerNew;
7390
7391 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7392 {
7394 if (actionMgr)
7395 {
7396 ActionBase currentAction = actionMgr.GetRunningAction();
7397 if (currentAction)
7399 }
7400 }
7401
7402 Man ownerPlayerOld = null;
7403 Man ownerPlayerNew = null;
7404
7405 if (old_owner)
7406 {
7407 if (old_owner.
IsMan())
7408 {
7409 ownerPlayerOld = Man.Cast(old_owner);
7410 }
7411 else
7412 {
7413 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7414 }
7415 }
7416 else
7417 {
7419 {
7421
7422 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7423 {
7424 GetCompEM().UnplugThis();
7425 }
7426 }
7427 }
7428
7429 if (new_owner)
7430 {
7431 if (new_owner.
IsMan())
7432 {
7433 ownerPlayerNew = Man.Cast(new_owner);
7434 }
7435 else
7436 {
7437 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7438 }
7439 }
7440
7441 if (ownerPlayerOld != ownerPlayerNew)
7442 {
7443 if (ownerPlayerOld)
7444 {
7445 array<EntityAI> subItemsExit = new array<EntityAI>;
7447 for (int i = 0; i < subItemsExit.Count(); i++)
7448 {
7451 }
7452 }
7453
7454 if (ownerPlayerNew)
7455 {
7456 array<EntityAI> subItemsEnter = new array<EntityAI>;
7458 for (int j = 0; j < subItemsEnter.Count(); j++)
7459 {
7462 }
7463 }
7464 }
7465 else if (ownerPlayerNew != null)
7466 {
7467 PlayerBase nplayer;
7468 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7469 {
7470 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7472 for (int k = 0; k < subItemsUpdate.Count(); k++)
7473 {
7475 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7476 }
7477 }
7478 }
7479
7480 if (old_owner)
7481 old_owner.OnChildItemRemoved(this);
7482 if (new_owner)
7483 new_owner.OnChildItemReceived(this);
7484 }
7485
7486
7488 {
7489 super.EEDelete(parent);
7490 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7491 if (player)
7492 {
7494
7495 if (player.IsAlive())
7496 {
7497 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7498 if (r_index >= 0)
7499 {
7500 InventoryLocation r_il = new InventoryLocation;
7501 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7502
7503 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7506 {
7507 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7508 }
7510 {
7511 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7512 }
7513
7514 }
7515
7516 player.RemoveQuickBarEntityShortcut(this);
7517 }
7518 }
7519 }
7520
7522 {
7523 super.EEKilled(killer);
7524
7527 {
7528 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7529 {
7530 if (IsMagazine())
7531 {
7532 if (Magazine.Cast(this).GetAmmoCount() > 0)
7533 {
7535 }
7536 }
7537 else
7538 {
7540 }
7541 }
7542 }
7543 }
7544
7546 {
7547 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7548
7549 super.OnWasAttached(parent, slot_id);
7550
7553
7555 }
7556
7558 {
7559 super.OnWasDetached(parent, slot_id);
7560
7563 }
7564
7566 {
7567 int idx;
7570
7571 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7572 if (inventory_slots.Count() < 1)
7573 {
7574 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7575 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7576 }
7577 else
7578 {
7579 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7580 }
7581
7582 idx = inventory_slots.Find(slot);
7583 if (idx < 0)
7584 return "";
7585
7586 return attach_types.Get(idx);
7587 }
7588
7590 {
7591 int idx = -1;
7592 string slot;
7593
7596
7597 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7598 if (inventory_slots.Count() < 1)
7599 {
7600 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7601 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7602 }
7603 else
7604 {
7605 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7606 if (detach_types.Count() < 1)
7607 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7608 }
7609
7610 for (int i = 0; i < inventory_slots.Count(); i++)
7611 {
7612 slot = inventory_slots.Get(i);
7613 }
7614
7615 if (slot != "")
7616 {
7617 if (detach_types.Count() == 1)
7618 idx = 0;
7619 else
7620 idx = inventory_slots.Find(slot);
7621 }
7622 if (idx < 0)
7623 return "";
7624
7625 return detach_types.Get(idx);
7626 }
7627
7629 {
7630
7632
7633
7634 float min_time = 1;
7635 float max_time = 3;
7636 float delay = Math.RandomFloat(min_time, max_time);
7637
7638 explode_timer.Run(delay, this, "DoAmmoExplosion");
7639 }
7640
7642 {
7643 Magazine magazine = Magazine.Cast(this);
7644 int pop_sounds_count = 6;
7645 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7646
7647
7648 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7649 string sound_name = pop_sounds[ sound_idx ];
7651
7652
7653 magazine.ServerAddAmmoCount(-1);
7654
7655
7656 float min_temp_to_explode = 100;
7657
7658 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7659 {
7661 }
7662 }
7663
7664
7665 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7666 {
7667 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7668
7669 const int CHANCE_DAMAGE_CARGO = 4;
7670 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7671 const int CHANCE_DAMAGE_NOTHING = 2;
7672
7674 {
7675 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7676 int chances;
7677 int rnd;
7678
7679 if (GetInventory().GetCargo())
7680 {
7681 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7682 rnd = Math.RandomInt(0,chances);
7683
7684 if (rnd < CHANCE_DAMAGE_CARGO)
7685 {
7687 }
7688 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7689 {
7691 }
7692 }
7693 else
7694 {
7695 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7696 rnd = Math.RandomInt(0,chances);
7697
7698 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7699 {
7701 }
7702 }
7703 }
7704 }
7705
7707 {
7708 if (GetInventory().GetCargo())
7709 {
7710 int item_count = GetInventory().GetCargo().GetItemCount();
7711 if (item_count > 0)
7712 {
7713 int random_pick = Math.RandomInt(0, item_count);
7715 if (!item.IsExplosive())
7716 {
7717 item.AddHealth("","",damage);
7718 return true;
7719 }
7720 }
7721 }
7722 return false;
7723 }
7724
7726 {
7727 int attachment_count = GetInventory().AttachmentCount();
7728 if (attachment_count > 0)
7729 {
7730 int random_pick = Math.RandomInt(0, attachment_count);
7731 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7732 if (!attachment.IsExplosive())
7733 {
7734 attachment.AddHealth("","",damage);
7735 return true;
7736 }
7737 }
7738 return false;
7739 }
7740
7742 {
7744 }
7745
7747 {
7749 return GetInventory().CanRemoveEntity();
7750
7751 return false;
7752 }
7753
7755 {
7757 return;
7758
7760 {
7761 if (ScriptInputUserData.CanStoreInputUserData())
7762 {
7763 ScriptInputUserData ctx = new ScriptInputUserData;
7768 ctx.
Write(destination_entity);
7772 }
7773 }
7774 else if (!
GetGame().IsMultiplayer())
7775 {
7777 }
7778 }
7779
7781 {
7783 return;
7784
7785 float split_quantity_new;
7789 InventoryLocation loc = new InventoryLocation;
7790
7791 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7792 {
7794 split_quantity_new = stack_max;
7795 else
7797
7798 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7799 if (new_item)
7800 {
7801 new_item.SetResultOfSplit(true);
7802 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7804 new_item.SetQuantity(split_quantity_new);
7805 }
7806 }
7807 else if (destination_entity && slot_id == -1)
7808 {
7809 if (quantity > stack_max)
7810 split_quantity_new = stack_max;
7811 else
7812 split_quantity_new = quantity;
7813
7815 {
7818 }
7819
7820 if (new_item)
7821 {
7822 new_item.SetResultOfSplit(true);
7823 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7825 new_item.SetQuantity(split_quantity_new);
7826 }
7827 }
7828 else
7829 {
7830 if (stack_max != 0)
7831 {
7833 {
7835 }
7836
7837 if (split_quantity_new == 0)
7838 {
7839 if (!
GetGame().IsMultiplayer())
7840 player.PhysicalPredictiveDropItem(this);
7841 else
7842 player.ServerDropEntity(this);
7843 return;
7844 }
7845
7847
7848 if (new_item)
7849 {
7850 new_item.SetResultOfSplit(true);
7851 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7853 new_item.SetQuantity(stack_max);
7854 new_item.PlaceOnSurface();
7855 }
7856 }
7857 }
7858 }
7859
7861 {
7863 return;
7864
7865 float split_quantity_new;
7869 InventoryLocation loc = new InventoryLocation;
7870
7871 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7872 {
7874 split_quantity_new = stack_max;
7875 else
7877
7878 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7879 if (new_item)
7880 {
7881 new_item.SetResultOfSplit(true);
7882 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7884 new_item.SetQuantity(split_quantity_new);
7885 }
7886 }
7887 else if (destination_entity && slot_id == -1)
7888 {
7889 if (quantity > stack_max)
7890 split_quantity_new = stack_max;
7891 else
7892 split_quantity_new = quantity;
7893
7895 {
7898 }
7899
7900 if (new_item)
7901 {
7902 new_item.SetResultOfSplit(true);
7903 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7905 new_item.SetQuantity(split_quantity_new);
7906 }
7907 }
7908 else
7909 {
7910 if (stack_max != 0)
7911 {
7913 {
7915 }
7916
7918
7919 if (new_item)
7920 {
7921 new_item.SetResultOfSplit(true);
7922 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7924 new_item.SetQuantity(stack_max);
7925 new_item.PlaceOnSurface();
7926 }
7927 }
7928 }
7929 }
7930
7932 {
7934 return;
7935
7937 {
7938 if (ScriptInputUserData.CanStoreInputUserData())
7939 {
7940 ScriptInputUserData ctx = new ScriptInputUserData;
7945 dst.WriteToContext(ctx);
7947 }
7948 }
7949 else if (!
GetGame().IsMultiplayer())
7950 {
7952 }
7953 }
7954
7956 {
7958 return;
7959
7961 {
7962 if (ScriptInputUserData.CanStoreInputUserData())
7963 {
7964 ScriptInputUserData ctx = new ScriptInputUserData;
7969 ctx.
Write(destination_entity);
7975 }
7976 }
7977 else if (!
GetGame().IsMultiplayer())
7978 {
7980 }
7981 }
7982
7984 {
7986 }
7987
7989 {
7991 return this;
7992
7994 float split_quantity_new;
7996 if (dst.IsValid())
7997 {
7998 int slot_id = dst.GetSlot();
8000
8001 if (quantity > stack_max)
8002 split_quantity_new = stack_max;
8003 else
8004 split_quantity_new = quantity;
8005
8007
8008 if (new_item)
8009 {
8010 new_item.SetResultOfSplit(true);
8011 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8014 }
8015
8016 return new_item;
8017 }
8018
8019 return null;
8020 }
8021
8023 {
8025 return;
8026
8028 float split_quantity_new;
8030 if (destination_entity)
8031 {
8033 if (quantity > stackable)
8034 split_quantity_new = stackable;
8035 else
8036 split_quantity_new = quantity;
8037
8038 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8039 if (new_item)
8040 {
8041 new_item.SetResultOfSplit(true);
8042 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8044 new_item.SetQuantity(split_quantity_new);
8045 }
8046 }
8047 }
8048
8050 {
8052 return;
8053
8055 {
8056 if (ScriptInputUserData.CanStoreInputUserData())
8057 {
8058 ScriptInputUserData ctx = new ScriptInputUserData;
8063 ItemBase destination_entity =
this;
8064 ctx.
Write(destination_entity);
8068 }
8069 }
8070 else if (!
GetGame().IsMultiplayer())
8071 {
8073 }
8074 }
8075
8077 {
8079 return;
8080
8082 float split_quantity_new;
8084 if (player)
8085 {
8087 if (quantity > stackable)
8088 split_quantity_new = stackable;
8089 else
8090 split_quantity_new = quantity;
8091
8092 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8093 new_item =
ItemBase.Cast(in_hands);
8094 if (new_item)
8095 {
8096 new_item.SetResultOfSplit(true);
8097 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8099 new_item.SetQuantity(split_quantity_new);
8100 }
8101 }
8102 }
8103
8105 {
8107 return;
8108
8110 float split_quantity_new = Math.Floor(quantity * 0.5);
8111
8113
8114 if (new_item)
8115 {
8116 if (new_item.GetQuantityMax() < split_quantity_new)
8117 {
8118 split_quantity_new = new_item.GetQuantityMax();
8119 }
8120
8121 new_item.SetResultOfSplit(true);
8122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8123
8125 {
8128 }
8129 else
8130 {
8133 }
8134 }
8135 }
8136
8138 {
8140 return;
8141
8143 float split_quantity_new = Math.Floor(quantity / 2);
8144
8145 InventoryLocation invloc = new InventoryLocation;
8147
8149 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8150
8151 if (new_item)
8152 {
8153 if (new_item.GetQuantityMax() < split_quantity_new)
8154 {
8155 split_quantity_new = new_item.GetQuantityMax();
8156 }
8158 {
8161 }
8162 else
8163 {
8166 }
8167 }
8168 }
8169
8172 {
8173 SetWeightDirty();
8175
8176 if (parent)
8177 parent.OnAttachmentQuantityChangedEx(this, delta);
8178
8180 {
8182 {
8184 }
8186 {
8187 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8189 }
8190 }
8191
8192 }
8193
8196 {
8197
8198 }
8199
8202 {
8204 }
8205
8207 {
8208 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8209
8211 {
8212 if (newLevel == GameConstants.STATE_RUINED)
8213 {
8215 EntityAI parent = GetHierarchyParent();
8216 if (parent && parent.IsFireplace())
8217 {
8218 CargoBase cargo = GetInventory().GetCargo();
8219 if (cargo)
8220 {
8222 {
8224 }
8225 }
8226 }
8227 }
8228
8230 {
8231
8233 return;
8234 }
8235
8236 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8237 {
8239 }
8240 }
8241 }
8242
8243
8245 {
8246 super.OnRightClick();
8247
8249 {
8251 {
8252 if (ScriptInputUserData.CanStoreInputUserData())
8253 {
8254 vector m4[4];
8256
8257 EntityAI root = GetHierarchyRoot();
8258
8259 InventoryLocation dst = new InventoryLocation;
8261 {
8262 if (root)
8263 {
8264 root.GetTransform(m4);
8266 }
8267 else
8268 GetInventory().GetCurrentInventoryLocation(dst);
8269 }
8270 else
8271 {
8273
8274
8275 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8276 {
8277 if (root)
8278 {
8279 root.GetTransform(m4);
8281 }
8282 else
8283 GetInventory().GetCurrentInventoryLocation(dst);
8284 }
8285 else
8286 {
8287 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8288 }
8289 }
8290
8291 ScriptInputUserData ctx = new ScriptInputUserData;
8299 }
8300 }
8301 else if (!
GetGame().IsMultiplayer())
8302 {
8304 }
8305 }
8306 }
8307
8308 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8309 {
8310
8311 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8312 return false;
8313
8314 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8315 return false;
8316
8317
8319 return false;
8320
8321
8322 Magazine mag = Magazine.Cast(this);
8323 if (mag)
8324 {
8325 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8326 return false;
8327
8328 if (stack_max_limit)
8329 {
8330 Magazine other_mag = Magazine.Cast(other_item);
8331 if (other_item)
8332 {
8333 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8334 return false;
8335 }
8336
8337 }
8338 }
8339 else
8340 {
8341
8343 return false;
8344
8346 return false;
8347 }
8348
8349 PlayerBase player = null;
8350 if (CastTo(player, GetHierarchyRootPlayer()))
8351 {
8352 if (player.GetInventory().HasAttachment(this))
8353 return false;
8354
8355 if (player.IsItemsToDelete())
8356 return false;
8357 }
8358
8359 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8360 return false;
8361
8362 int slotID;
8364 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8365 return false;
8366
8367 return true;
8368 }
8369
8371 {
8373 }
8374
8376 {
8377 return m_IsResultOfSplit;
8378 }
8379
8381 {
8382 m_IsResultOfSplit = value;
8383 }
8384
8386 {
8388 }
8389
8391 {
8392 float other_item_quantity = other_item.GetQuantity();
8393 float this_free_space;
8394
8396
8398
8399 if (other_item_quantity > this_free_space)
8400 {
8401 return this_free_space;
8402 }
8403 else
8404 {
8405 return other_item_quantity;
8406 }
8407 }
8408
8410 {
8412 }
8413
8415 {
8417 return;
8418
8419 if (!IsMagazine() && other_item)
8420 {
8422 if (quantity_used != 0)
8423 {
8424 float hp1 = GetHealth01("","");
8425 float hp2 = other_item.GetHealth01("","");
8426 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8427 hpResult = hpResult / (
GetQuantity() + quantity_used);
8428
8429 hpResult *= GetMaxHealth();
8430 Math.Round(hpResult);
8431 SetHealth("", "Health", hpResult);
8432
8434 other_item.AddQuantity(-quantity_used);
8435 }
8436 }
8438 }
8439
8441 {
8442 #ifdef SERVER
8443 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8444 GetHierarchyParent().IncreaseLifetimeUp();
8445 #endif
8446 };
8447
8449 {
8450 PlayerBase p = PlayerBase.Cast(player);
8451
8452 array<int> recipesIds = p.m_Recipes;
8453 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8454 if (moduleRecipesManager)
8455 {
8456 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8457 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8458 }
8459
8460 for (int i = 0;i < recipesIds.Count(); i++)
8461 {
8462 int key = recipesIds.Get(i);
8463 string recipeName = moduleRecipesManager.GetRecipeName(key);
8465 }
8466 }
8467
8468
8469 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8470 {
8471 super.GetDebugActions(outputList);
8472
8473
8478
8479
8483
8487
8488
8491
8492
8494 {
8497 }
8498
8500
8503
8507 }
8508
8509
8510
8511
8513 {
8514 super.OnAction(action_id, player, ctx);
8515 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8516 {
8517 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8518 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8519 PlayerBase p = PlayerBase.Cast(player);
8520 if (
EActions.RECIPES_RANGE_START < 1000)
8521 {
8522 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8523 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8524 }
8525 }
8526 #ifndef SERVER
8527 else if (action_id ==
EActions.WATCH_PLAYER)
8528 {
8529 PluginDeveloper.SetDeveloperItemClientEx(player);
8530 }
8531 #endif
8533 {
8534 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8535 {
8536 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8537 OnDebugButtonPressServer(id + 1);
8538 }
8539
8540 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8541 {
8542 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8544 }
8545
8546 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8547 {
8548 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8550 }
8551
8552 else if (action_id ==
EActions.ADD_QUANTITY)
8553 {
8554 if (IsMagazine())
8555 {
8556 Magazine mag = Magazine.Cast(this);
8557 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8558 }
8559 else
8560 {
8562 }
8563
8564 if (m_EM)
8565 {
8566 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8567 }
8568
8569 }
8570
8571 else if (action_id ==
EActions.REMOVE_QUANTITY)
8572 {
8573 if (IsMagazine())
8574 {
8575 Magazine mag2 = Magazine.Cast(this);
8576 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8577 }
8578 else
8579 {
8581 }
8582 if (m_EM)
8583 {
8584 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8585 }
8586
8587 }
8588
8589 else if (action_id ==
EActions.SET_QUANTITY_0)
8590 {
8592
8593 if (m_EM)
8594 {
8595 m_EM.SetEnergy(0);
8596 }
8597 }
8598
8599 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8600 {
8602
8603 if (m_EM)
8604 {
8605 m_EM.SetEnergy(m_EM.GetEnergyMax());
8606 }
8607 }
8608
8609 else if (action_id ==
EActions.ADD_HEALTH)
8610 {
8611 AddHealth("","",GetMaxHealth("","Health")/5);
8612 }
8613 else if (action_id ==
EActions.REMOVE_HEALTH)
8614 {
8615 AddHealth("","",-GetMaxHealth("","Health")/5);
8616 }
8617 else if (action_id ==
EActions.DESTROY_HEALTH)
8618 {
8619 SetHealth01("","",0);
8620 }
8621 else if (action_id ==
EActions.WATCH_ITEM)
8622 {
8624 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8625 #ifdef DEVELOPER
8626 SetDebugDeveloper_item(this);
8627 #endif
8628 }
8629
8630 else if (action_id ==
EActions.ADD_TEMPERATURE)
8631 {
8632 AddTemperature(20);
8633
8634 }
8635
8636 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8637 {
8638 AddTemperature(-20);
8639
8640 }
8641
8642 else if (action_id ==
EActions.FLIP_FROZEN)
8643 {
8644 SetFrozen(!GetIsFrozen());
8645
8646 }
8647
8648 else if (action_id ==
EActions.ADD_WETNESS)
8649 {
8651
8652 }
8653
8654 else if (action_id ==
EActions.REMOVE_WETNESS)
8655 {
8657
8658 }
8659
8660 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8661 {
8664
8665
8666 }
8667
8668 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8669 {
8672 }
8673
8674 else if (action_id ==
EActions.MAKE_SPECIAL)
8675 {
8676 auto debugParams = DebugSpawnParams.WithPlayer(player);
8677 OnDebugSpawnEx(debugParams);
8678 }
8679
8680 else if (action_id ==
EActions.DELETE)
8681 {
8682 Delete();
8683 }
8684
8685 }
8686
8687
8688 return false;
8689 }
8690
8691
8692
8693
8697
8700
8701
8702
8704 {
8705 return false;
8706 }
8707
8708
8710 {
8711 return true;
8712 }
8713
8714
8716 {
8717 return true;
8718 }
8719
8720
8721
8723 {
8724 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8726 }
8727
8730 {
8731 return null;
8732 }
8733
8735 {
8736 return false;
8737 }
8738
8740 {
8741 return false;
8742 }
8743
8747
8748
8750 {
8751 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8752 return module_repairing.CanRepair(this, item_repair_kit);
8753 }
8754
8755
8756 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8757 {
8758 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8759 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8760 }
8761
8762
8764 {
8765
8766
8767
8768
8769
8770
8771
8772
8773 return 1;
8774 }
8775
8776
8777
8779 {
8781 }
8782
8783
8784
8786 {
8788 }
8789
8790
8799 {
8800 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8801
8802 if (player)
8803 {
8804 player.MessageStatus(text);
8805 }
8806 }
8807
8808
8817 {
8818 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8819
8820 if (player)
8821 {
8822 player.MessageAction(text);
8823 }
8824 }
8825
8826
8835 {
8836 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8837
8838 if (player)
8839 {
8840 player.MessageFriendly(text);
8841 }
8842 }
8843
8844
8853 {
8854 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8855
8856 if (player)
8857 {
8858 player.MessageImportant(text);
8859 }
8860 }
8861
8863 {
8864 return true;
8865 }
8866
8867
8868 override bool KindOf(
string tag)
8869 {
8870 bool found = false;
8871 string item_name = this.
GetType();
8874
8875 int array_size = item_tag_array.Count();
8876 for (int i = 0; i < array_size; i++)
8877 {
8878 if (item_tag_array.Get(i) == tag)
8879 {
8880 found = true;
8881 break;
8882 }
8883 }
8884 return found;
8885 }
8886
8887
8889 {
8890
8891 super.OnRPC(sender, rpc_type,ctx);
8892
8893
8894 switch (rpc_type)
8895 {
8896 #ifndef SERVER
8897 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8898 Param2<bool, string> p = new Param2<bool, string>(false, "");
8899
8901 return;
8902
8903 bool play = p.param1;
8904 string soundSet = p.param2;
8905
8906 if (play)
8907 {
8909 {
8911 {
8913 }
8914 }
8915 else
8916 {
8918 }
8919 }
8920 else
8921 {
8923 }
8924
8925 break;
8926 #endif
8927
8928 }
8929
8931 {
8933 }
8934 }
8935
8936
8937
8938
8940 {
8941 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8942 return plugin.GetID(
name);
8943 }
8944
8946 {
8947 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8948 return plugin.GetName(id);
8949 }
8950
8953 {
8954
8955
8956 int varFlags;
8957 if (!ctx.
Read(varFlags))
8958 return;
8959
8960 if (varFlags & ItemVariableFlags.FLOAT)
8961 {
8963 }
8964 }
8965
8967 {
8968
8969 super.SerializeNumericalVars(floats_out);
8970
8971
8972
8974 {
8976 }
8977
8979 {
8981 }
8982
8984 {
8986 }
8987
8989 {
8994 }
8995
8997 {
8999 }
9000 }
9001
9003 {
9004
9005 super.DeSerializeNumericalVars(floats);
9006
9007
9008 int index = 0;
9009 int mask = Math.Round(floats.Get(index));
9010
9011 index++;
9012
9014 {
9016 {
9018 }
9019 else
9020 {
9021 float quantity = floats.Get(index);
9023 }
9024 index++;
9025 }
9026
9028 {
9029 float wet = floats.Get(index);
9031 index++;
9032 }
9033
9035 {
9036 int liquidtype = Math.Round(floats.Get(index));
9038 index++;
9039 }
9040
9042 {
9044 index++;
9046 index++;
9048 index++;
9050 index++;
9051 }
9052
9054 {
9055 int cleanness = Math.Round(floats.Get(index));
9057 index++;
9058 }
9059 }
9060
9062 {
9063 super.WriteVarsToCTX(ctx);
9064
9065
9067 {
9069 }
9070
9072 {
9074 }
9075
9077 {
9079 }
9080
9082 {
9083 int r,g,b,a;
9089 }
9090
9092 {
9094 }
9095 }
9096
9098 {
9099 if (!super.ReadVarsFromCTX(ctx,version))
9100 return false;
9101
9102 int intValue;
9103 float value;
9104
9105 if (version < 140)
9106 {
9107 if (!ctx.
Read(intValue))
9108 return false;
9109
9110 m_VariablesMask = intValue;
9111 }
9112
9114 {
9115 if (!ctx.
Read(value))
9116 return false;
9117
9119 {
9121 }
9122 else
9123 {
9125 }
9126 }
9127
9128 if (version < 140)
9129 {
9131 {
9132 if (!ctx.
Read(value))
9133 return false;
9134 SetTemperatureDirect(value);
9135 }
9136 }
9137
9139 {
9140 if (!ctx.
Read(value))
9141 return false;
9143 }
9144
9146 {
9147 if (!ctx.
Read(intValue))
9148 return false;
9150 }
9151
9153 {
9154 int r,g,b,a;
9156 return false;
9158 return false;
9160 return false;
9162 return false;
9163
9165 }
9166
9168 {
9169 if (!ctx.
Read(intValue))
9170 return false;
9172 }
9173
9174 if (version >= 138 && version < 140)
9175 {
9177 {
9178 if (!ctx.
Read(intValue))
9179 return false;
9180 SetFrozen(intValue);
9181 }
9182 }
9183
9184 return true;
9185 }
9186
9187
9189 {
9192 {
9194 }
9195
9196 if (!super.OnStoreLoad(ctx, version))
9197 {
9199 return false;
9200 }
9201
9202 if (version >= 114)
9203 {
9204 bool hasQuickBarIndexSaved;
9205
9206 if (!ctx.
Read(hasQuickBarIndexSaved))
9207 {
9209 return false;
9210 }
9211
9212 if (hasQuickBarIndexSaved)
9213 {
9214 int itmQBIndex;
9215
9216
9217 if (!ctx.
Read(itmQBIndex))
9218 {
9220 return false;
9221 }
9222
9223 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9224 if (itmQBIndex != -1 && parentPlayer)
9225 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9226 }
9227 }
9228 else
9229 {
9230
9231 PlayerBase player;
9232 int itemQBIndex;
9233 if (version ==
int.
MAX)
9234 {
9235 if (!ctx.
Read(itemQBIndex))
9236 {
9238 return false;
9239 }
9240 }
9241 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9242 {
9243
9244 if (!ctx.
Read(itemQBIndex))
9245 {
9247 return false;
9248 }
9249 if (itemQBIndex != -1 && player)
9250 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9251 }
9252 }
9253
9254 if (version < 140)
9255 {
9256
9257 if (!LoadVariables(ctx, version))
9258 {
9260 return false;
9261 }
9262 }
9263
9264
9266 {
9268 return false;
9269 }
9270 if (version >= 132)
9271 {
9273 if (raib)
9274 {
9276 {
9278 return false;
9279 }
9280 }
9281 }
9282
9284 return true;
9285 }
9286
9287
9288
9290 {
9291 super.OnStoreSave(ctx);
9292
9293 PlayerBase player;
9294 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9295 {
9297
9298 int itemQBIndex = -1;
9299 itemQBIndex = player.FindQuickBarEntityIndex(this);
9300 ctx.
Write(itemQBIndex);
9301 }
9302 else
9303 {
9305 }
9306
9308
9310 if (raib)
9311 {
9313 }
9314 }
9315
9316
9318 {
9319 super.AfterStoreLoad();
9320
9322 {
9324 }
9325
9327 {
9330 }
9331 }
9332
9334 {
9335 super.EEOnAfterLoad();
9336
9338 {
9340 }
9341
9344 }
9345
9347 {
9348 return false;
9349 }
9350
9351
9352
9354 {
9356 {
9357 #ifdef PLATFORM_CONSOLE
9358
9360 {
9362 if (menu)
9363 {
9365 }
9366 }
9367 #endif
9368 }
9369
9371 {
9374 }
9375
9377 {
9378 SetWeightDirty();
9380 }
9382 {
9385 }
9386
9388 {
9391 }
9393 {
9396 }
9397
9398 super.OnVariablesSynchronized();
9399 }
9400
9401
9402
9404 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9405 {
9406 if (!IsServerCheck(allow_client))
9407 return false;
9408
9410 return false;
9411
9414
9415 if (value <= (min + 0.001))
9416 value = min;
9417
9418 if (value == min)
9419 {
9420 if (destroy_config)
9421 {
9422 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9423 if (dstr)
9424 {
9426 this.Delete();
9427 return true;
9428 }
9429 }
9430 else if (destroy_forced)
9431 {
9433 this.Delete();
9434 return true;
9435 }
9436
9438 }
9439
9442
9444 {
9446
9447 if (delta)
9449 }
9450
9452
9453 return false;
9454 }
9455
9456
9458 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9459 {
9461 }
9462
9464 {
9467 }
9468
9470 {
9473 }
9474
9477 {
9478 float value_clamped = Math.Clamp(value, 0, 1);
9480 SetQuantity(result, destroy_config, destroy_forced);
9481 }
9482
9483
9486 {
9488 }
9489
9491 {
9493 }
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9505 {
9506 int slot = -1;
9507 if (GetInventory())
9508 {
9509 InventoryLocation il = new InventoryLocation;
9510 GetInventory().GetCurrentInventoryLocation(il);
9512 }
9513
9515 }
9516
9518 {
9519 float quantity_max = 0;
9520
9522 {
9523 if (attSlotID != -1)
9524 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9525
9526 if (quantity_max <= 0)
9528 }
9529
9530 if (quantity_max <= 0)
9532
9533 return quantity_max;
9534 }
9535
9537 {
9539 }
9540
9542 {
9544 }
9545
9546
9548 {
9550 }
9551
9553 {
9555 }
9556
9558 {
9560 }
9561
9562
9564 {
9565
9566 float weightEx = GetWeightEx();
9567 float special = GetInventoryAndCargoWeight();
9568 return weightEx - special;
9569 }
9570
9571
9573 {
9575 }
9576
9578 {
9580 {
9581 #ifdef DEVELOPER
9582 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9583 {
9584 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9586 }
9587 #endif
9588
9590 }
9591 else if (HasEnergyManager())
9592 {
9593 #ifdef DEVELOPER
9594 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9595 {
9596 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9597 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9598 }
9599 #endif
9600 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9601 }
9602 else
9603 {
9604 #ifdef DEVELOPER
9605 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9606 {
9607 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9608 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9609 }
9610 #endif
9611 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9612 }
9613 }
9614
9617 {
9618 int item_count = 0;
9620
9621 if (GetInventory().GetCargo() != NULL)
9622 {
9623 item_count = GetInventory().GetCargo().GetItemCount();
9624 }
9625
9626 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9627 {
9628 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9629 if (item)
9630 item_count += item.GetNumberOfItems();
9631 }
9632 return item_count;
9633 }
9634
9637 {
9638 float weight = 0;
9639 float wetness = 1;
9640 if (include_wetness)
9643 {
9644 weight = wetness * m_ConfigWeight;
9645 }
9647 {
9648 weight = 1;
9649 }
9650 return weight;
9651 }
9652
9653
9654
9656 {
9657 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9658 {
9659 GameInventory inv = GetInventory();
9660 array<EntityAI> items = new array<EntityAI>;
9662 for (int i = 0; i < items.Count(); i++)
9663 {
9665 if (item)
9666 {
9668 }
9669 }
9670 }
9671 }
9672
9673
9674
9675
9677 {
9678 float energy = 0;
9679 if (HasEnergyManager())
9680 {
9681 energy = GetCompEM().GetEnergy();
9682 }
9683 return energy;
9684 }
9685
9686
9688 {
9689 super.OnEnergyConsumed();
9690
9692 }
9693
9695 {
9696 super.OnEnergyAdded();
9697
9699 }
9700
9701
9703 {
9704 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9705 {
9707 {
9708 float energy_0to1 = GetCompEM().GetEnergy0To1();
9710 }
9711 }
9712 }
9713
9714
9716 {
9717 return ConfigGetFloat("heatIsolation");
9718 }
9719
9721 {
9723 }
9724
9726 {
9727 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9728 if (
GetGame().ConfigIsExisting(paramPath))
9730
9731 return 0.0;
9732 }
9733
9735 {
9736 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9737 if (
GetGame().ConfigIsExisting(paramPath))
9739
9740 return 0.0;
9741 }
9742
9743 override void SetWet(
float value,
bool allow_client =
false)
9744 {
9745 if (!IsServerCheck(allow_client))
9746 return;
9747
9750
9752
9753 m_VarWet = Math.Clamp(value, min, max);
9754
9756 {
9759 }
9760 }
9761
9762 override void AddWet(
float value)
9763 {
9765 }
9766
9768 {
9770 }
9771
9773 {
9775 }
9776
9778 {
9780 }
9781
9783 {
9785 }
9786
9788 {
9790 }
9791
9793 {
9796 if (newLevel != oldLevel)
9797 {
9799 }
9800 }
9801
9803 {
9804 SetWeightDirty();
9805 }
9806
9808 {
9809 return GetWetLevelInternal(
m_VarWet);
9810 }
9811
9812
9813
9815 {
9817 }
9818
9820 {
9822 }
9823
9825 {
9827 }
9828
9830 {
9832 }
9833
9834
9835
9837 {
9838 if (ConfigIsExisting("itemModelLength"))
9839 {
9840 return ConfigGetFloat("itemModelLength");
9841 }
9842 return 0;
9843 }
9844
9846 {
9847 if (ConfigIsExisting("itemAttachOffset"))
9848 {
9849 return ConfigGetFloat("itemAttachOffset");
9850 }
9851 return 0;
9852 }
9853
9854 override void SetCleanness(
int value,
bool allow_client =
false)
9855 {
9856 if (!IsServerCheck(allow_client))
9857 return;
9858
9860
9862
9865 }
9866
9868 {
9870 }
9871
9873 {
9874 return true;
9875 }
9876
9877
9878
9879
9881 {
9883 }
9884
9886 {
9888 }
9889
9890
9891
9892
9893 override void SetColor(
int r,
int g,
int b,
int a)
9894 {
9900 }
9902 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9903 {
9908 }
9909
9911 {
9913 }
9914
9917 {
9918 int r,g,b,a;
9920 r = r/255;
9921 g = g/255;
9922 b = b/255;
9923 a = a/255;
9924 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9925 }
9926
9927
9928
9929 override void SetLiquidType(
int value,
bool allow_client =
false)
9930 {
9931 if (!IsServerCheck(allow_client))
9932 return;
9933
9938 }
9939
9941 {
9942 return ConfigGetInt("varLiquidTypeInit");
9943 }
9944
9946 {
9948 }
9949
9951 {
9953 SetFrozen(false);
9954 }
9955
9958 {
9959 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9960 }
9961
9962
9965 {
9966 PlayerBase nplayer;
9967 if (PlayerBase.CastTo(nplayer, player))
9968 {
9970
9971 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9972 }
9973 }
9974
9975
9978 {
9979 PlayerBase nplayer;
9980 if (PlayerBase.CastTo(nplayer,player))
9981 {
9982
9983 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9984
9985 }
9986
9987
9988 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9989
9990
9991 if (HasEnergyManager())
9992 {
9993 GetCompEM().UpdatePlugState();
9994 }
9995 }
9996
9997
9999 {
10000 super.OnPlacementStarted(player);
10001
10003 }
10004
10005 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10006 {
10008 {
10009 m_AdminLog.OnPlacementComplete(player,
this);
10010 }
10011
10012 super.OnPlacementComplete(player, position, orientation);
10013 }
10014
10015
10016
10017
10018
10020 {
10022 {
10023 return true;
10024 }
10025 else
10026 {
10027 return false;
10028 }
10029 }
10030
10031
10033 {
10035 {
10037 }
10038 }
10039
10040
10042 {
10044 }
10045
10047 {
10049 }
10050
10051 override void InsertAgent(
int agent,
float count = 1)
10052 {
10053 if (count < 1)
10054 return;
10055
10057 }
10058
10061 {
10063 }
10064
10065
10067 {
10069 }
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10113 {
10115 return false;
10116 return true;
10117 }
10118
10120 {
10121
10123 }
10124
10125
10128 {
10129 super.CheckForRoofLimited(timeTresholdMS);
10130
10132 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10133 {
10134 m_PreviousRoofTestTime = time;
10135 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10136 }
10137 }
10138
10139
10141 {
10143 {
10144 return 0;
10145 }
10146
10147 if (GetInventory().GetAttachmentSlotsCount() != 0)
10148 {
10149 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10150 if (filter)
10151 return filter.GetProtectionLevel(type, false, system);
10152 else
10153 return 0;
10154 }
10155
10156 string subclassPath, entryName;
10157
10158 switch (type)
10159 {
10161 entryName = "biological";
10162 break;
10164 entryName = "chemical";
10165 break;
10166 default:
10167 entryName = "biological";
10168 break;
10169 }
10170
10171 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10172
10174 }
10175
10176
10177
10180 {
10181 if (!IsMagazine())
10183
10185 }
10186
10187
10188
10189
10190
10195 {
10196 return true;
10197 }
10198
10200 {
10202 }
10203
10204
10205
10206
10207
10209 {
10210 if (parent)
10211 {
10212 if (parent.IsInherited(DayZInfected))
10213 return true;
10214
10215 if (!parent.IsRuined())
10216 return true;
10217 }
10218
10219 return true;
10220 }
10221
10223 {
10224 if (!super.CanPutAsAttachment(parent))
10225 {
10226 return false;
10227 }
10228
10229 if (!IsRuined() && !parent.IsRuined())
10230 {
10231 return true;
10232 }
10233
10234 return false;
10235 }
10236
10238 {
10239
10240
10241
10242
10243 return super.CanReceiveItemIntoCargo(item);
10244 }
10245
10247 {
10248
10249
10250
10251
10252 GameInventory attachmentInv = attachment.GetInventory();
10254 {
10255 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10256 return false;
10257 }
10258
10259 InventoryLocation loc = new InventoryLocation();
10260 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10261 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10262 return false;
10263
10264 return super.CanReceiveAttachment(attachment, slotId);
10265 }
10266
10268 {
10269 if (!super.CanReleaseAttachment(attachment))
10270 return false;
10271
10272 return GetInventory().AreChildrenAccessible();
10273 }
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10296 {
10297 int id = muzzle_owner.GetMuzzleID();
10298 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10299
10300 if (WPOF_array)
10301 {
10302 for (int i = 0; i < WPOF_array.Count(); i++)
10303 {
10304 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10305
10306 if (WPOF)
10307 {
10308 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10309 }
10310 }
10311 }
10312 }
10313
10314
10316 {
10317 int id = muzzle_owner.GetMuzzleID();
10319
10320 if (WPOBE_array)
10321 {
10322 for (int i = 0; i < WPOBE_array.Count(); i++)
10323 {
10324 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10325
10326 if (WPOBE)
10327 {
10328 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10329 }
10330 }
10331 }
10332 }
10333
10334
10336 {
10337 int id = muzzle_owner.GetMuzzleID();
10338 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10339
10340 if (WPOOH_array)
10341 {
10342 for (int i = 0; i < WPOOH_array.Count(); i++)
10343 {
10344 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10345
10346 if (WPOOH)
10347 {
10348 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10349 }
10350 }
10351 }
10352 }
10353
10354
10356 {
10357 int id = muzzle_owner.GetMuzzleID();
10358 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10359
10360 if (WPOOH_array)
10361 {
10362 for (int i = 0; i < WPOOH_array.Count(); i++)
10363 {
10364 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10365
10366 if (WPOOH)
10367 {
10368 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10369 }
10370 }
10371 }
10372 }
10373
10374
10376 {
10377 int id = muzzle_owner.GetMuzzleID();
10378 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10379
10380 if (WPOOH_array)
10381 {
10382 for (int i = 0; i < WPOOH_array.Count(); i++)
10383 {
10384 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10385
10386 if (WPOOH)
10387 {
10388 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10389 }
10390 }
10391 }
10392 }
10393
10394
10395
10397 {
10399 {
10400 return true;
10401 }
10402
10403 return false;
10404 }
10405
10407 {
10409 {
10410 return true;
10411 }
10412
10413 return false;
10414 }
10415
10417 {
10419 {
10420 return true;
10421 }
10422
10423 return false;
10424 }
10425
10427 {
10428 return false;
10429 }
10430
10433 {
10434 return UATimeSpent.DEFAULT_DEPLOY;
10435 }
10436
10437
10438
10439
10441 {
10443 SetSynchDirty();
10444 }
10445
10447 {
10449 }
10450
10451
10453 {
10454 return false;
10455 }
10456
10459 {
10460 string att_type = "None";
10461
10462 if (ConfigIsExisting("soundAttType"))
10463 {
10464 att_type = ConfigGetString("soundAttType");
10465 }
10466
10468 }
10469
10471 {
10473 }
10474
10475
10476
10477
10478
10482
10484 {
10487
10489 }
10490
10491
10493 {
10495 return;
10496
10498
10501
10504
10505 SoundParameters params = new SoundParameters();
10509 }
10510
10511
10513 {
10515 return;
10516
10518 SetSynchDirty();
10519
10522 }
10523
10524
10526 {
10528 return;
10529
10531 SetSynchDirty();
10532
10535 }
10536
10538 {
10540 }
10541
10543 {
10545 }
10546
10549 {
10550 if (!
GetGame().IsDedicatedServer())
10551 {
10552 if (ConfigIsExisting("attachSoundSet"))
10553 {
10554 string cfg_path = "";
10555 string soundset = "";
10556 string type_name =
GetType();
10557
10560 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10561 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10562
10563 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10564 {
10565 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10566 {
10567 if (cfg_slot_array[i] == slot_type)
10568 {
10569 soundset = cfg_soundset_array[i];
10570 break;
10571 }
10572 }
10573 }
10574
10575 if (soundset != "")
10576 {
10577 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10579 }
10580 }
10581 }
10582 }
10583
10585 {
10586
10587 }
10588
10589 void OnApply(PlayerBase player);
10590
10592 {
10593 return 1.0;
10594 };
10595
10597 {
10599 }
10600
10602 {
10604 }
10605
10607
10609 {
10610 SetDynamicPhysicsLifeTime(0.01);
10612 }
10613
10615 {
10616 array<string> zone_names = new array<string>;
10617 GetDamageZones(zone_names);
10618 for (int i = 0; i < zone_names.Count(); i++)
10619 {
10620 SetHealthMax(zone_names.Get(i),"Health");
10621 }
10622 SetHealthMax("","Health");
10623 }
10624
10627 {
10628 float global_health = GetHealth01("","Health");
10629 array<string> zones = new array<string>;
10630 GetDamageZones(zones);
10631
10632 for (int i = 0; i < zones.Count(); i++)
10633 {
10634 SetHealth01(zones.Get(i),"Health",global_health);
10635 }
10636 }
10637
10640 {
10641 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10642 }
10643
10645 {
10646 if (!hasRootAsPlayer)
10647 {
10648 if (refParentIB)
10649 {
10650
10651 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10652 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10653
10654 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10655 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10656
10659 }
10660 else
10661 {
10662
10665 }
10666 }
10667 }
10668
10670 {
10672 {
10673 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10674 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10675 {
10676 float heatPermCoef = 1.0;
10678 while (ent)
10679 {
10680 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10681 ent = ent.GetHierarchyParent();
10682 }
10683
10684 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10685 }
10686 }
10687 }
10688
10690 {
10691
10692 EntityAI parent = GetHierarchyParent();
10693 if (!parent)
10694 {
10695 hasParent = false;
10696 hasRootAsPlayer = false;
10697 }
10698 else
10699 {
10700 hasParent = true;
10701 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10702 refParentIB =
ItemBase.Cast(parent);
10703 }
10704 }
10705
10706 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10707 {
10708
10709 }
10710
10712 {
10713
10714 return false;
10715 }
10716
10718 {
10719
10720
10721 return false;
10722 }
10723
10725 {
10726
10727 return false;
10728 }
10729
10732 {
10733 return !GetIsFrozen() &&
IsOpen();
10734 }
10735
10737 {
10738 bool hasParent = false, hasRootAsPlayer = false;
10740
10741 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10742 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10743
10744 if (wwtu || foodDecay)
10745 {
10749
10750 if (processWetness || processTemperature || processDecay)
10751 {
10753
10754 if (processWetness)
10755 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10756
10757 if (processTemperature)
10759
10760 if (processDecay)
10761 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10762 }
10763 }
10764 }
10765
10768 {
10770 }
10771
10773 {
10776
10777 return super.GetTemperatureFreezeThreshold();
10778 }
10779
10781 {
10784
10785 return super.GetTemperatureThawThreshold();
10786 }
10787
10789 {
10792
10793 return super.GetItemOverheatThreshold();
10794 }
10795
10797 {
10799 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10800
10801 return super.GetTemperatureFreezeTime();
10802 }
10803
10805 {
10807 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10808
10809 return super.GetTemperatureThawTime();
10810 }
10811
10816
10818 {
10819 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10820 }
10821
10823 {
10824 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10825 }
10826
10829 {
10831 }
10832
10834 {
10836 }
10837
10839 {
10841 }
10842
10845 {
10846 return null;
10847 }
10848
10851 {
10852 return false;
10853 }
10854
10856 {
10858 {
10861 if (!trg)
10862 {
10864 explosive = this;
10865 }
10866
10867 explosive.PairRemote(trg);
10869
10870 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10871 trg.SetPersistentPairID(persistentID);
10872 explosive.SetPersistentPairID(persistentID);
10873
10874 return true;
10875 }
10876 return false;
10877 }
10878
10881 {
10882 float ret = 1.0;
10885 ret *= GetHealth01();
10886
10887 return ret;
10888 }
10889
10890 #ifdef DEVELOPER
10891 override void SetDebugItem()
10892 {
10893 super.SetDebugItem();
10894 _itemBase = this;
10895 }
10896
10898 {
10899 string text = super.GetDebugText();
10900
10902 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10903
10904 return text;
10905 }
10906 #endif
10907
10909 {
10910 return true;
10911 }
10912
10914
10916
10918 {
10921 }
10922
10923
10931
10947}
10948
10950{
10952 if (entity)
10953 {
10954 bool is_item = entity.IsInherited(
ItemBase);
10955 if (is_item && full_quantity)
10956 {
10959 }
10960 }
10961 else
10962 {
10964 return NULL;
10965 }
10966 return entity;
10967}
10968
10970{
10971 if (item)
10972 {
10973 if (health > 0)
10974 item.SetHealth("", "", health);
10975
10976 if (item.CanHaveTemperature())
10977 {
10979 if (item.CanFreeze())
10980 item.SetFrozen(false);
10981 }
10982
10983 if (item.HasEnergyManager())
10984 {
10985 if (quantity >= 0)
10986 {
10987 item.GetCompEM().SetEnergy0To1(quantity);
10988 }
10989 else
10990 {
10992 }
10993 }
10994 else if (item.IsMagazine())
10995 {
10996 Magazine mag = Magazine.Cast(item);
10997 if (quantity >= 0)
10998 {
10999 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11000 }
11001 else
11002 {
11004 }
11005
11006 }
11007 else
11008 {
11009 if (quantity >= 0)
11010 {
11011 item.SetQuantityNormalized(quantity, false);
11012 }
11013 else
11014 {
11016 }
11017
11018 }
11019 }
11020}
11021
11022#ifdef DEVELOPER
11024#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.