6195{
6197 {
6198 return true;
6199 }
6200};
6201
6202
6203
6205{
6209
6211
6214
6215
6216
6217
6218
6227
6233
6238
6243
6264 protected bool m_IsResultOfSplit
6265
6267
6272
6273
6274
6276
6280
6281
6282
6284
6287
6288
6289
6295
6296
6304
6307
6308
6310
6311
6313
6314
6319
6320
6325
6326
6328
6329
6331 {
6336
6337 if (!
GetGame().IsDedicatedServer())
6338 {
6340 {
6342
6344 {
6346 }
6347 }
6348
6351 }
6352
6353 m_OldLocation = null;
6354
6356 {
6358 }
6359
6360 if (ConfigIsExisting("headSelectionsToHide"))
6361 {
6364 }
6365
6367 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6368 {
6370 }
6371
6373
6374 m_IsResultOfSplit = false;
6375
6377 }
6378
6380 {
6381 super.InitItemVariables();
6382
6388 m_Count = ConfigGetInt(
"count");
6389
6392
6397
6400
6405
6417
6421
6422
6425 if (ConfigIsExisting("canBeSplit"))
6426 {
6429 }
6430
6432 if (ConfigIsExisting("itemBehaviour"))
6434
6435
6438 RegisterNetSyncVariableInt("m_VarLiquidType");
6439 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6440
6441 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6442 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6443 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6444
6445 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6446 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6447 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6448 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6449
6450 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6451 RegisterNetSyncVariableBool("m_IsTakeable");
6452 RegisterNetSyncVariableBool("m_IsHologram");
6453
6456 {
6459 }
6460
6462
6464 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6466
6467 }
6468
6470 {
6472 }
6473
6475 {
6478 {
6483 }
6484 }
6485
6486 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6487 {
6489 {
6492 }
6493
6495 }
6496
6498 {
6504 }
6505
6507
6509 {
6511
6512 if (!action)
6513 {
6514 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6515 return;
6516 }
6517
6519 if (!ai)
6520 {
6522 return;
6523 }
6524
6526 if (!action_array)
6527 {
6528 action_array = new array<ActionBase_Basic>;
6530 }
6531 if (LogManager.IsActionLogEnable())
6532 {
6533 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6534 }
6535
6536 if (action_array.Find(action) != -1)
6537 {
6538 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6539 }
6540 else
6541 {
6542 action_array.Insert(action);
6543 }
6544 }
6545
6547 {
6549 ActionBase action = player.GetActionManager().GetAction(actionName);
6552
6553 if (action_array)
6554 {
6555 action_array.RemoveItem(action);
6556 }
6557 }
6558
6559
6560
6562 {
6563 ActionOverrideData overrideData = new ActionOverrideData();
6567
6569 if (!actionMap)
6570 {
6573 }
6574
6575 actionMap.Insert(this.
Type(), overrideData);
6576
6577 }
6578
6580
6582
6583
6585 {
6588
6591
6592 string config_to_search = "CfgVehicles";
6593 string muzzle_owner_config;
6594
6596 {
6597 if (IsInherited(Weapon))
6598 config_to_search = "CfgWeapons";
6599
6600 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6601
6602 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6603
6605
6606 if (config_OnFire_subclass_count > 0)
6607 {
6608 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6609
6610 for (int i = 0; i < config_OnFire_subclass_count; i++)
6611 {
6612 string particle_class = "";
6614 string config_OnFire_entry = config_OnFire_class + particle_class;
6615 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6616 WPOF_array.Insert(WPOF);
6617 }
6618
6619
6621 }
6622 }
6623
6625 {
6626 config_to_search = "CfgWeapons";
6627 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6628
6629 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6630
6632
6633 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6634 {
6635 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6636
6637 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6638 {
6639 string particle_class2 = "";
6641 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6642 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6643 WPOBE_array.Insert(WPOBE);
6644 }
6645
6646
6648 }
6649 }
6650 }
6651
6652
6654 {
6657
6659 {
6660 string config_to_search = "CfgVehicles";
6661
6662 if (IsInherited(Weapon))
6663 config_to_search = "CfgWeapons";
6664
6665 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6666 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6667
6668 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6669 {
6670
6672
6674 {
6676 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6678 return;
6679 }
6680
6683
6684
6685
6687 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6688
6689 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6690 {
6691 string particle_class = "";
6693 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6695
6696 if (entry_type == CT_CLASS)
6697 {
6698 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6699 WPOOH_array.Insert(WPOF);
6700 }
6701 }
6702
6703
6705 }
6706 }
6707 }
6708
6710 {
6712 }
6713
6715 {
6717 {
6719
6722
6725
6726 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6727 }
6728 }
6729
6731 {
6733 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6734
6736 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6737
6739 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6740
6742 {
6744 }
6745 }
6746
6748 {
6750 }
6751
6753 {
6756 else
6758
6760 {
6763 }
6764 else
6765 {
6768
6771 }
6772
6774 }
6775
6777 {
6779 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6780 }
6781
6783 {
6785 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6787 }
6788
6790 {
6792 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6793 }
6794
6796 {
6799
6800 OverheatingParticle OP = new OverheatingParticle();
6805
6807 }
6808
6810 {
6813
6814 return -1;
6815 }
6816
6818 {
6820 {
6823
6824 for (int i = count; i > 0; --i)
6825 {
6826 int id = i - 1;
6829
6832
6833 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6834 {
6835 if (p)
6836 {
6839 }
6840 }
6841 }
6842 }
6843 }
6844
6846 {
6848 {
6850 {
6851 int id = i - 1;
6853
6854 if (OP)
6855 {
6857
6858 if (p)
6859 {
6861 }
6862
6863 delete OP;
6864 }
6865 }
6866
6869 }
6870 }
6871
6874 {
6875 return 0.0;
6876 }
6877
6878
6880 {
6881 return 250;
6882 }
6883
6885 {
6886 return 0;
6887 }
6888
6891 {
6893 return true;
6894
6895 return false;
6896 }
6897
6900 {
6903
6905 {
6907 }
6908 else
6909 {
6910
6912 }
6913
6915 }
6916
6923 {
6924 return -1;
6925 }
6926
6927
6928
6929
6931 {
6933 {
6935 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6936
6937 if (r_index >= 0)
6938 {
6939 InventoryLocation r_il = new InventoryLocation;
6940 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6941
6942 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6945 {
6946 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6947 }
6949 {
6950 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6951 }
6952
6953 }
6954
6955 player.GetHumanInventory().ClearUserReservedLocation(this);
6956 }
6957
6960 }
6961
6962
6963
6964
6966 {
6967 return ItemBase.m_DebugActionsMask;
6968 }
6969
6971 {
6972 return ItemBase.m_DebugActionsMask & mask;
6973 }
6974
6976 {
6977 ItemBase.m_DebugActionsMask = mask;
6978 }
6979
6981 {
6982 ItemBase.m_DebugActionsMask |= mask;
6983 }
6984
6986 {
6987 ItemBase.m_DebugActionsMask &= ~mask;
6988 }
6989
6991 {
6993 {
6995 }
6996 else
6997 {
6999 }
7000 }
7001
7002
7004 {
7005 if (GetEconomyProfile())
7006 {
7007 float q_max = GetEconomyProfile().GetQuantityMax();
7008 if (q_max > 0)
7009 {
7010 float q_min = GetEconomyProfile().GetQuantityMin();
7011 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7012
7014 {
7015 ComponentEnergyManager comp = GetCompEM();
7017 {
7019 }
7020 }
7022 {
7024
7025 }
7026
7027 }
7028 }
7029 }
7030
7033 {
7034 EntityAI parent = GetHierarchyParent();
7035
7036 if (parent)
7037 {
7038 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7039 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7040 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7041 }
7042 }
7043
7046 {
7047 EntityAI parent = GetHierarchyParent();
7048
7049 if (parent)
7050 {
7051 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7052 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7053 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7054 }
7055 }
7056
7058 {
7059
7060
7061
7062
7064
7066 {
7067 if (ScriptInputUserData.CanStoreInputUserData())
7068 {
7069 ScriptInputUserData ctx = new ScriptInputUserData;
7075 ctx.
Write(use_stack_max);
7078
7080 {
7081 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7082 }
7083 }
7084 }
7085 else if (!
GetGame().IsMultiplayer())
7086 {
7088 }
7089 }
7090
7092 {
7094 }
7095
7097 {
7099 }
7100
7102 {
7104 }
7105
7107 {
7108
7109 return false;
7110 }
7111
7113 {
7114 return false;
7115 }
7116
7120 {
7121 return false;
7122 }
7123
7125 {
7126 return "";
7127 }
7128
7130
7132 {
7133 return false;
7134 }
7135
7137 {
7138 return true;
7139 }
7140
7141
7142
7144 {
7145 return true;
7146 }
7147
7149 {
7150 return true;
7151 }
7152
7154 {
7155 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7157 }
7158
7160 {
7162 }
7163
7165 {
7167 if (!is_being_placed)
7169 SetSynchDirty();
7170 }
7171
7172
7174
7176 {
7178 }
7179
7181 {
7183 }
7184
7186 {
7187 return 1;
7188 }
7189
7191 {
7192 return false;
7193 }
7194
7196 {
7198 SetSynchDirty();
7199 }
7200
7201
7202
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
7236 {
7237 super.OnMovedInsideCargo(container);
7238
7239 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7240 }
7241
7242 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7243 {
7244 super.EEItemLocationChanged(oldLoc,newLoc);
7245
7246 PlayerBase new_player = null;
7247 PlayerBase old_player = null;
7248
7249 if (newLoc.GetParent())
7250 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7251
7252 if (oldLoc.GetParent())
7253 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7254
7256 {
7257 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7258
7259 if (r_index >= 0)
7260 {
7261 InventoryLocation r_il = new InventoryLocation;
7262 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7263
7264 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7267 {
7268 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7269 }
7271 {
7272 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7273 }
7274
7275 }
7276 }
7277
7279 {
7280 if (new_player)
7281 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7282
7283 if (new_player == old_player)
7284 {
7285
7286 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7287 {
7289 {
7290 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7291 {
7292 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7293 }
7294 }
7295 else
7296 {
7297 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7298 }
7299 }
7300
7301 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7302 {
7303 int type = oldLoc.GetType();
7305 {
7306 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7307 }
7309 {
7310 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7311 }
7312 }
7313 if (!m_OldLocation)
7314 {
7315 m_OldLocation = new InventoryLocation;
7316 }
7317 m_OldLocation.Copy(oldLoc);
7318 }
7319 else
7320 {
7321 if (m_OldLocation)
7322 {
7323 m_OldLocation.Reset();
7324 }
7325 }
7326
7328 }
7329 else
7330 {
7331 if (new_player)
7332 {
7333 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7334 if (res_index >= 0)
7335 {
7336 InventoryLocation il = new InventoryLocation;
7337 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7339 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7342 {
7343 il.
GetParent().GetOnReleaseLock().Invoke(it);
7344 }
7346 {
7348 }
7349
7350 }
7351 }
7353 {
7354
7356 }
7357
7358 if (m_OldLocation)
7359 {
7360 m_OldLocation.Reset();
7361 }
7362 }
7363 }
7364
7365 override void EOnContact(IEntity other, Contact extra)
7366 {
7368 {
7369 int liquidType = -1;
7371 if (impactSpeed > 0.0)
7372 {
7374 #ifndef SERVER
7376 #else
7378 SetSynchDirty();
7379 #endif
7381 }
7382 }
7383
7384 #ifdef SERVER
7385 if (GetCompEM() && GetCompEM().IsPlugged())
7386 {
7387 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7388 GetCompEM().UnplugThis();
7389 }
7390 #endif
7391 }
7392
7394
7396 {
7398 }
7399
7401 {
7402
7403 }
7404
7406 {
7407 super.OnItemLocationChanged(old_owner, new_owner);
7408
7409 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7410 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7411
7412 if (!relatedPlayer && playerNew)
7413 relatedPlayer = playerNew;
7414
7415 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7416 {
7418 if (actionMgr)
7419 {
7420 ActionBase currentAction = actionMgr.GetRunningAction();
7421 if (currentAction)
7423 }
7424 }
7425
7426 Man ownerPlayerOld = null;
7427 Man ownerPlayerNew = null;
7428
7429 if (old_owner)
7430 {
7431 if (old_owner.
IsMan())
7432 {
7433 ownerPlayerOld = Man.Cast(old_owner);
7434 }
7435 else
7436 {
7437 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7438 }
7439 }
7440 else
7441 {
7443 {
7445
7446 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7447 {
7448 GetCompEM().UnplugThis();
7449 }
7450 }
7451 }
7452
7453 if (new_owner)
7454 {
7455 if (new_owner.
IsMan())
7456 {
7457 ownerPlayerNew = Man.Cast(new_owner);
7458 }
7459 else
7460 {
7461 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7462 }
7463 }
7464
7465 if (ownerPlayerOld != ownerPlayerNew)
7466 {
7467 if (ownerPlayerOld)
7468 {
7469 array<EntityAI> subItemsExit = new array<EntityAI>;
7471 for (int i = 0; i < subItemsExit.Count(); i++)
7472 {
7475 }
7476 }
7477
7478 if (ownerPlayerNew)
7479 {
7480 array<EntityAI> subItemsEnter = new array<EntityAI>;
7482 for (int j = 0; j < subItemsEnter.Count(); j++)
7483 {
7486 }
7487 }
7488 }
7489 else if (ownerPlayerNew != null)
7490 {
7491 PlayerBase nplayer;
7492 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7493 {
7494 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7496 for (int k = 0; k < subItemsUpdate.Count(); k++)
7497 {
7499 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7500 }
7501 }
7502 }
7503
7504 if (old_owner)
7505 old_owner.OnChildItemRemoved(this);
7506 if (new_owner)
7507 new_owner.OnChildItemReceived(this);
7508 }
7509
7510
7512 {
7513 super.EEDelete(parent);
7514 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7515 if (player)
7516 {
7518
7519 if (player.IsAlive())
7520 {
7521 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7522 if (r_index >= 0)
7523 {
7524 InventoryLocation r_il = new InventoryLocation;
7525 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7526
7527 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7530 {
7531 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7532 }
7534 {
7535 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7536 }
7537
7538 }
7539
7540 player.RemoveQuickBarEntityShortcut(this);
7541 }
7542 }
7543 }
7544
7546 {
7547 super.EEKilled(killer);
7548
7551 {
7552 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7553 {
7554 if (IsMagazine())
7555 {
7556 if (Magazine.Cast(this).GetAmmoCount() > 0)
7557 {
7559 }
7560 }
7561 else
7562 {
7564 }
7565 }
7566 }
7567 }
7568
7570 {
7571 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7572
7573 super.OnWasAttached(parent, slot_id);
7574
7577
7579 }
7580
7582 {
7583 super.OnWasDetached(parent, slot_id);
7584
7587 }
7588
7590 {
7591 int idx;
7594
7595 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7596 if (inventory_slots.Count() < 1)
7597 {
7598 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7599 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7600 }
7601 else
7602 {
7603 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7604 }
7605
7606 idx = inventory_slots.Find(slot);
7607 if (idx < 0)
7608 return "";
7609
7610 return attach_types.Get(idx);
7611 }
7612
7614 {
7615 int idx = -1;
7616 string slot;
7617
7620
7621 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7622 if (inventory_slots.Count() < 1)
7623 {
7624 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7625 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7626 }
7627 else
7628 {
7629 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7630 if (detach_types.Count() < 1)
7631 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7632 }
7633
7634 for (int i = 0; i < inventory_slots.Count(); i++)
7635 {
7636 slot = inventory_slots.Get(i);
7637 }
7638
7639 if (slot != "")
7640 {
7641 if (detach_types.Count() == 1)
7642 idx = 0;
7643 else
7644 idx = inventory_slots.Find(slot);
7645 }
7646 if (idx < 0)
7647 return "";
7648
7649 return detach_types.Get(idx);
7650 }
7651
7653 {
7654
7656
7657
7658 float min_time = 1;
7659 float max_time = 3;
7660 float delay = Math.RandomFloat(min_time, max_time);
7661
7662 explode_timer.Run(delay, this, "DoAmmoExplosion");
7663 }
7664
7666 {
7667 Magazine magazine = Magazine.Cast(this);
7668 int pop_sounds_count = 6;
7669 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7670
7671
7672 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7673 string sound_name = pop_sounds[ sound_idx ];
7675
7676
7677 magazine.ServerAddAmmoCount(-1);
7678
7679
7680 float min_temp_to_explode = 100;
7681
7682 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7683 {
7685 }
7686 }
7687
7688
7689 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7690 {
7691 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7692
7693 const int CHANCE_DAMAGE_CARGO = 4;
7694 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7695 const int CHANCE_DAMAGE_NOTHING = 2;
7696
7698 {
7699 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7700 int chances;
7701 int rnd;
7702
7703 if (GetInventory().GetCargo())
7704 {
7705 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7706 rnd = Math.RandomInt(0,chances);
7707
7708 if (rnd < CHANCE_DAMAGE_CARGO)
7709 {
7711 }
7712 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7713 {
7715 }
7716 }
7717 else
7718 {
7719 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7720 rnd = Math.RandomInt(0,chances);
7721
7722 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7723 {
7725 }
7726 }
7727 }
7728 }
7729
7731 {
7732 if (GetInventory().GetCargo())
7733 {
7734 int item_count = GetInventory().GetCargo().GetItemCount();
7735 if (item_count > 0)
7736 {
7737 int random_pick = Math.RandomInt(0, item_count);
7739 if (!item.IsExplosive())
7740 {
7741 item.AddHealth("","",damage);
7742 return true;
7743 }
7744 }
7745 }
7746 return false;
7747 }
7748
7750 {
7751 int attachment_count = GetInventory().AttachmentCount();
7752 if (attachment_count > 0)
7753 {
7754 int random_pick = Math.RandomInt(0, attachment_count);
7755 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7756 if (!attachment.IsExplosive())
7757 {
7758 attachment.AddHealth("","",damage);
7759 return true;
7760 }
7761 }
7762 return false;
7763 }
7764
7766 {
7768 }
7769
7771 {
7773 return GetInventory().CanRemoveEntity();
7774
7775 return false;
7776 }
7777
7779 {
7781 return;
7782
7784 {
7785 if (ScriptInputUserData.CanStoreInputUserData())
7786 {
7787 ScriptInputUserData ctx = new ScriptInputUserData;
7792 ctx.
Write(destination_entity);
7796 }
7797 }
7798 else if (!
GetGame().IsMultiplayer())
7799 {
7801 }
7802 }
7803
7805 {
7807 return;
7808
7809 float split_quantity_new;
7813 InventoryLocation loc = new InventoryLocation;
7814
7815 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7816 {
7818 split_quantity_new = stack_max;
7819 else
7821
7822 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7823 if (new_item)
7824 {
7825 new_item.SetResultOfSplit(true);
7826 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7828 new_item.SetQuantity(split_quantity_new);
7829 }
7830 }
7831 else if (destination_entity && slot_id == -1)
7832 {
7833 if (quantity > stack_max)
7834 split_quantity_new = stack_max;
7835 else
7836 split_quantity_new = quantity;
7837
7839 {
7842 }
7843
7844 if (new_item)
7845 {
7846 new_item.SetResultOfSplit(true);
7847 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7849 new_item.SetQuantity(split_quantity_new);
7850 }
7851 }
7852 else
7853 {
7854 if (stack_max != 0)
7855 {
7857 {
7859 }
7860
7861 if (split_quantity_new == 0)
7862 {
7863 if (!
GetGame().IsMultiplayer())
7864 player.PhysicalPredictiveDropItem(this);
7865 else
7866 player.ServerDropEntity(this);
7867 return;
7868 }
7869
7871
7872 if (new_item)
7873 {
7874 new_item.SetResultOfSplit(true);
7875 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7877 new_item.SetQuantity(stack_max);
7878 new_item.PlaceOnSurface();
7879 }
7880 }
7881 }
7882 }
7883
7885 {
7887 return;
7888
7889 float split_quantity_new;
7893 InventoryLocation loc = new InventoryLocation;
7894
7895 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7896 {
7898 split_quantity_new = stack_max;
7899 else
7901
7902 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7903 if (new_item)
7904 {
7905 new_item.SetResultOfSplit(true);
7906 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7908 new_item.SetQuantity(split_quantity_new);
7909 }
7910 }
7911 else if (destination_entity && slot_id == -1)
7912 {
7913 if (quantity > stack_max)
7914 split_quantity_new = stack_max;
7915 else
7916 split_quantity_new = quantity;
7917
7919 {
7922 }
7923
7924 if (new_item)
7925 {
7926 new_item.SetResultOfSplit(true);
7927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7929 new_item.SetQuantity(split_quantity_new);
7930 }
7931 }
7932 else
7933 {
7934 if (stack_max != 0)
7935 {
7937 {
7939 }
7940
7942
7943 if (new_item)
7944 {
7945 new_item.SetResultOfSplit(true);
7946 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7948 new_item.SetQuantity(stack_max);
7949 new_item.PlaceOnSurface();
7950 }
7951 }
7952 }
7953 }
7954
7956 {
7958 return;
7959
7961 {
7962 if (ScriptInputUserData.CanStoreInputUserData())
7963 {
7964 ScriptInputUserData ctx = new ScriptInputUserData;
7969 dst.WriteToContext(ctx);
7971 }
7972 }
7973 else if (!
GetGame().IsMultiplayer())
7974 {
7976 }
7977 }
7978
7980 {
7982 return;
7983
7985 {
7986 if (ScriptInputUserData.CanStoreInputUserData())
7987 {
7988 ScriptInputUserData ctx = new ScriptInputUserData;
7993 ctx.
Write(destination_entity);
7999 }
8000 }
8001 else if (!
GetGame().IsMultiplayer())
8002 {
8004 }
8005 }
8006
8008 {
8010 }
8011
8013 {
8015 return this;
8016
8018 float split_quantity_new;
8020 if (dst.IsValid())
8021 {
8022 int slot_id = dst.GetSlot();
8024
8025 if (quantity > stack_max)
8026 split_quantity_new = stack_max;
8027 else
8028 split_quantity_new = quantity;
8029
8031
8032 if (new_item)
8033 {
8034 new_item.SetResultOfSplit(true);
8035 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8038 }
8039
8040 return new_item;
8041 }
8042
8043 return null;
8044 }
8045
8047 {
8049 return;
8050
8052 float split_quantity_new;
8054 if (destination_entity)
8055 {
8057 if (quantity > stackable)
8058 split_quantity_new = stackable;
8059 else
8060 split_quantity_new = quantity;
8061
8062 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8063 if (new_item)
8064 {
8065 new_item.SetResultOfSplit(true);
8066 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8068 new_item.SetQuantity(split_quantity_new);
8069 }
8070 }
8071 }
8072
8074 {
8076 return;
8077
8079 {
8080 if (ScriptInputUserData.CanStoreInputUserData())
8081 {
8082 ScriptInputUserData ctx = new ScriptInputUserData;
8087 ItemBase destination_entity =
this;
8088 ctx.
Write(destination_entity);
8092 }
8093 }
8094 else if (!
GetGame().IsMultiplayer())
8095 {
8097 }
8098 }
8099
8101 {
8103 return;
8104
8106 float split_quantity_new;
8108 if (player)
8109 {
8111 if (quantity > stackable)
8112 split_quantity_new = stackable;
8113 else
8114 split_quantity_new = quantity;
8115
8116 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8117 new_item =
ItemBase.Cast(in_hands);
8118 if (new_item)
8119 {
8120 new_item.SetResultOfSplit(true);
8121 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8123 new_item.SetQuantity(split_quantity_new);
8124 }
8125 }
8126 }
8127
8129 {
8131 return;
8132
8134 float split_quantity_new = Math.Floor(quantity * 0.5);
8135
8137
8138 if (new_item)
8139 {
8140 if (new_item.GetQuantityMax() < split_quantity_new)
8141 {
8142 split_quantity_new = new_item.GetQuantityMax();
8143 }
8144
8145 new_item.SetResultOfSplit(true);
8146 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8147
8149 {
8152 }
8153 else
8154 {
8157 }
8158 }
8159 }
8160
8162 {
8164 return;
8165
8167 float split_quantity_new = Math.Floor(quantity / 2);
8168
8169 InventoryLocation invloc = new InventoryLocation;
8171
8173 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8174
8175 if (new_item)
8176 {
8177 if (new_item.GetQuantityMax() < split_quantity_new)
8178 {
8179 split_quantity_new = new_item.GetQuantityMax();
8180 }
8182 {
8185 }
8186 else
8187 {
8190 }
8191 }
8192 }
8193
8196 {
8197 SetWeightDirty();
8199
8200 if (parent)
8201 parent.OnAttachmentQuantityChangedEx(this, delta);
8202
8204 {
8206 {
8208 }
8210 {
8211 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8213 }
8214 }
8215
8216 }
8217
8220 {
8221
8222 }
8223
8226 {
8228 }
8229
8231 {
8232 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8233
8235 {
8236 if (newLevel == GameConstants.STATE_RUINED)
8237 {
8239 EntityAI parent = GetHierarchyParent();
8240 if (parent && parent.IsFireplace())
8241 {
8242 CargoBase cargo = GetInventory().GetCargo();
8243 if (cargo)
8244 {
8246 {
8248 }
8249 }
8250 }
8251 }
8252
8254 {
8255
8257 return;
8258 }
8259
8260 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8261 {
8263 }
8264 }
8265 }
8266
8267
8269 {
8270 super.OnRightClick();
8271
8273 {
8275 {
8276 if (ScriptInputUserData.CanStoreInputUserData())
8277 {
8278 vector m4[4];
8280
8281 EntityAI root = GetHierarchyRoot();
8282
8283 InventoryLocation dst = new InventoryLocation;
8285 {
8286 if (root)
8287 {
8288 root.GetTransform(m4);
8290 }
8291 else
8292 GetInventory().GetCurrentInventoryLocation(dst);
8293 }
8294 else
8295 {
8297
8298
8299 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8300 {
8301 if (root)
8302 {
8303 root.GetTransform(m4);
8305 }
8306 else
8307 GetInventory().GetCurrentInventoryLocation(dst);
8308 }
8309 else
8310 {
8311 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8312 }
8313 }
8314
8315 ScriptInputUserData ctx = new ScriptInputUserData;
8323 }
8324 }
8325 else if (!
GetGame().IsMultiplayer())
8326 {
8328 }
8329 }
8330 }
8331
8332 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8333 {
8334
8335 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8336 return false;
8337
8338 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8339 return false;
8340
8341
8343 return false;
8344
8345
8346 Magazine mag = Magazine.Cast(this);
8347 if (mag)
8348 {
8349 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8350 return false;
8351
8352 if (stack_max_limit)
8353 {
8354 Magazine other_mag = Magazine.Cast(other_item);
8355 if (other_item)
8356 {
8357 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8358 return false;
8359 }
8360
8361 }
8362 }
8363 else
8364 {
8365
8367 return false;
8368
8370 return false;
8371 }
8372
8373 PlayerBase player = null;
8374 if (CastTo(player, GetHierarchyRootPlayer()))
8375 {
8376 if (player.GetInventory().HasAttachment(this))
8377 return false;
8378
8379 if (player.IsItemsToDelete())
8380 return false;
8381 }
8382
8383 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8384 return false;
8385
8386 int slotID;
8388 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8389 return false;
8390
8391 return true;
8392 }
8393
8395 {
8397 }
8398
8400 {
8401 return m_IsResultOfSplit;
8402 }
8403
8405 {
8406 m_IsResultOfSplit = value;
8407 }
8408
8410 {
8412 }
8413
8415 {
8416 float other_item_quantity = other_item.GetQuantity();
8417 float this_free_space;
8418
8420
8422
8423 if (other_item_quantity > this_free_space)
8424 {
8425 return this_free_space;
8426 }
8427 else
8428 {
8429 return other_item_quantity;
8430 }
8431 }
8432
8434 {
8436 }
8437
8439 {
8441 return;
8442
8443 if (!IsMagazine() && other_item)
8444 {
8446 if (quantity_used != 0)
8447 {
8448 float hp1 = GetHealth01("","");
8449 float hp2 = other_item.GetHealth01("","");
8450 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8451 hpResult = hpResult / (
GetQuantity() + quantity_used);
8452
8453 hpResult *= GetMaxHealth();
8454 Math.Round(hpResult);
8455 SetHealth("", "Health", hpResult);
8456
8458 other_item.AddQuantity(-quantity_used);
8459 }
8460 }
8462 }
8463
8465 {
8466 #ifdef SERVER
8467 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8468 GetHierarchyParent().IncreaseLifetimeUp();
8469 #endif
8470 };
8471
8473 {
8474 PlayerBase p = PlayerBase.Cast(player);
8475
8476 array<int> recipesIds = p.m_Recipes;
8477 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8478 if (moduleRecipesManager)
8479 {
8480 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8481 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8482 }
8483
8484 for (int i = 0;i < recipesIds.Count(); i++)
8485 {
8486 int key = recipesIds.Get(i);
8487 string recipeName = moduleRecipesManager.GetRecipeName(key);
8489 }
8490 }
8491
8492
8493 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8494 {
8495 super.GetDebugActions(outputList);
8496
8497
8502
8503
8507
8511
8512
8515
8516
8518 {
8521 }
8522
8524
8527
8531 }
8532
8533
8534
8535
8537 {
8538 super.OnAction(action_id, player, ctx);
8539 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8540 {
8541 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8542 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8543 PlayerBase p = PlayerBase.Cast(player);
8544 if (
EActions.RECIPES_RANGE_START < 1000)
8545 {
8546 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8547 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8548 }
8549 }
8550 #ifndef SERVER
8551 else if (action_id ==
EActions.WATCH_PLAYER)
8552 {
8553 PluginDeveloper.SetDeveloperItemClientEx(player);
8554 }
8555 #endif
8557 {
8558 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8559 {
8560 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8561 OnDebugButtonPressServer(id + 1);
8562 }
8563
8564 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8565 {
8566 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8568 }
8569
8570 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8571 {
8572 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8574 }
8575
8576 else if (action_id ==
EActions.ADD_QUANTITY)
8577 {
8578 if (IsMagazine())
8579 {
8580 Magazine mag = Magazine.Cast(this);
8581 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8582 }
8583 else
8584 {
8586 }
8587
8588 if (m_EM)
8589 {
8590 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8591 }
8592
8593 }
8594
8595 else if (action_id ==
EActions.REMOVE_QUANTITY)
8596 {
8597 if (IsMagazine())
8598 {
8599 Magazine mag2 = Magazine.Cast(this);
8600 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8601 }
8602 else
8603 {
8605 }
8606 if (m_EM)
8607 {
8608 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8609 }
8610
8611 }
8612
8613 else if (action_id ==
EActions.SET_QUANTITY_0)
8614 {
8616
8617 if (m_EM)
8618 {
8619 m_EM.SetEnergy(0);
8620 }
8621 }
8622
8623 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8624 {
8626
8627 if (m_EM)
8628 {
8629 m_EM.SetEnergy(m_EM.GetEnergyMax());
8630 }
8631 }
8632
8633 else if (action_id ==
EActions.ADD_HEALTH)
8634 {
8635 AddHealth("","",GetMaxHealth("","Health")/5);
8636 }
8637 else if (action_id ==
EActions.REMOVE_HEALTH)
8638 {
8639 AddHealth("","",-GetMaxHealth("","Health")/5);
8640 }
8641 else if (action_id ==
EActions.DESTROY_HEALTH)
8642 {
8643 SetHealth01("","",0);
8644 }
8645 else if (action_id ==
EActions.WATCH_ITEM)
8646 {
8648 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8649 #ifdef DEVELOPER
8650 SetDebugDeveloper_item(this);
8651 #endif
8652 }
8653
8654 else if (action_id ==
EActions.ADD_TEMPERATURE)
8655 {
8656 AddTemperature(20);
8657
8658 }
8659
8660 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8661 {
8662 AddTemperature(-20);
8663
8664 }
8665
8666 else if (action_id ==
EActions.FLIP_FROZEN)
8667 {
8668 SetFrozen(!GetIsFrozen());
8669
8670 }
8671
8672 else if (action_id ==
EActions.ADD_WETNESS)
8673 {
8675
8676 }
8677
8678 else if (action_id ==
EActions.REMOVE_WETNESS)
8679 {
8681
8682 }
8683
8684 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8685 {
8688
8689
8690 }
8691
8692 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8693 {
8696 }
8697
8698 else if (action_id ==
EActions.MAKE_SPECIAL)
8699 {
8700 auto debugParams = DebugSpawnParams.WithPlayer(player);
8701 OnDebugSpawnEx(debugParams);
8702 }
8703
8704 else if (action_id ==
EActions.DELETE)
8705 {
8706 Delete();
8707 }
8708
8709 }
8710
8711
8712 return false;
8713 }
8714
8715
8716
8717
8721
8724
8725
8726
8728 {
8729 return false;
8730 }
8731
8732
8734 {
8735 return true;
8736 }
8737
8738
8740 {
8741 return true;
8742 }
8743
8744
8745
8747 {
8748 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8750 }
8751
8754 {
8755 return null;
8756 }
8757
8759 {
8760 return false;
8761 }
8762
8764 {
8765 return false;
8766 }
8767
8771
8772
8774 {
8775 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8776 return module_repairing.CanRepair(this, item_repair_kit);
8777 }
8778
8779
8780 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8781 {
8782 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8783 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8784 }
8785
8786
8788 {
8789
8790
8791
8792
8793
8794
8795
8796
8797 return 1;
8798 }
8799
8800
8801
8803 {
8805 }
8806
8807
8808
8810 {
8812 }
8813
8814
8823 {
8824 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8825
8826 if (player)
8827 {
8828 player.MessageStatus(text);
8829 }
8830 }
8831
8832
8841 {
8842 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8843
8844 if (player)
8845 {
8846 player.MessageAction(text);
8847 }
8848 }
8849
8850
8859 {
8860 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8861
8862 if (player)
8863 {
8864 player.MessageFriendly(text);
8865 }
8866 }
8867
8868
8877 {
8878 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8879
8880 if (player)
8881 {
8882 player.MessageImportant(text);
8883 }
8884 }
8885
8887 {
8888 return true;
8889 }
8890
8891
8892 override bool KindOf(
string tag)
8893 {
8894 bool found = false;
8895 string item_name = this.
GetType();
8898
8899 int array_size = item_tag_array.Count();
8900 for (int i = 0; i < array_size; i++)
8901 {
8902 if (item_tag_array.Get(i) == tag)
8903 {
8904 found = true;
8905 break;
8906 }
8907 }
8908 return found;
8909 }
8910
8911
8913 {
8914
8915 super.OnRPC(sender, rpc_type,ctx);
8916
8917
8918 switch (rpc_type)
8919 {
8920 #ifndef SERVER
8921 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8922 Param2<bool, string> p = new Param2<bool, string>(false, "");
8923
8925 return;
8926
8927 bool play = p.param1;
8928 string soundSet = p.param2;
8929
8930 if (play)
8931 {
8933 {
8935 {
8937 }
8938 }
8939 else
8940 {
8942 }
8943 }
8944 else
8945 {
8947 }
8948
8949 break;
8950 #endif
8951
8952 }
8953
8955 {
8957 }
8958 }
8959
8960
8961
8962
8964 {
8965 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8966 return plugin.GetID(
name);
8967 }
8968
8970 {
8971 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8972 return plugin.GetName(id);
8973 }
8974
8977 {
8978
8979
8980 int varFlags;
8981 if (!ctx.
Read(varFlags))
8982 return;
8983
8984 if (varFlags & ItemVariableFlags.FLOAT)
8985 {
8987 }
8988 }
8989
8991 {
8992
8993 super.SerializeNumericalVars(floats_out);
8994
8995
8996
8998 {
9000 }
9001
9003 {
9005 }
9006
9008 {
9010 }
9011
9013 {
9018 }
9019
9021 {
9023 }
9024 }
9025
9027 {
9028
9029 super.DeSerializeNumericalVars(floats);
9030
9031
9032 int index = 0;
9033 int mask = Math.Round(floats.Get(index));
9034
9035 index++;
9036
9038 {
9040 {
9042 }
9043 else
9044 {
9045 float quantity = floats.Get(index);
9047 }
9048 index++;
9049 }
9050
9052 {
9053 float wet = floats.Get(index);
9055 index++;
9056 }
9057
9059 {
9060 int liquidtype = Math.Round(floats.Get(index));
9062 index++;
9063 }
9064
9066 {
9068 index++;
9070 index++;
9072 index++;
9074 index++;
9075 }
9076
9078 {
9079 int cleanness = Math.Round(floats.Get(index));
9081 index++;
9082 }
9083 }
9084
9086 {
9087 super.WriteVarsToCTX(ctx);
9088
9089
9091 {
9093 }
9094
9096 {
9098 }
9099
9101 {
9103 }
9104
9106 {
9107 int r,g,b,a;
9113 }
9114
9116 {
9118 }
9119 }
9120
9122 {
9123 if (!super.ReadVarsFromCTX(ctx,version))
9124 return false;
9125
9126 int intValue;
9127 float value;
9128
9129 if (version < 140)
9130 {
9131 if (!ctx.
Read(intValue))
9132 return false;
9133
9134 m_VariablesMask = intValue;
9135 }
9136
9138 {
9139 if (!ctx.
Read(value))
9140 return false;
9141
9143 {
9145 }
9146 else
9147 {
9149 }
9150 }
9151
9152 if (version < 140)
9153 {
9155 {
9156 if (!ctx.
Read(value))
9157 return false;
9158 SetTemperatureDirect(value);
9159 }
9160 }
9161
9163 {
9164 if (!ctx.
Read(value))
9165 return false;
9167 }
9168
9170 {
9171 if (!ctx.
Read(intValue))
9172 return false;
9174 }
9175
9177 {
9178 int r,g,b,a;
9180 return false;
9182 return false;
9184 return false;
9186 return false;
9187
9189 }
9190
9192 {
9193 if (!ctx.
Read(intValue))
9194 return false;
9196 }
9197
9198 if (version >= 138 && version < 140)
9199 {
9201 {
9202 if (!ctx.
Read(intValue))
9203 return false;
9204 SetFrozen(intValue);
9205 }
9206 }
9207
9208 return true;
9209 }
9210
9211
9213 {
9216 {
9218 }
9219
9220 if (!super.OnStoreLoad(ctx, version))
9221 {
9223 return false;
9224 }
9225
9226 if (version >= 114)
9227 {
9228 bool hasQuickBarIndexSaved;
9229
9230 if (!ctx.
Read(hasQuickBarIndexSaved))
9231 {
9233 return false;
9234 }
9235
9236 if (hasQuickBarIndexSaved)
9237 {
9238 int itmQBIndex;
9239
9240
9241 if (!ctx.
Read(itmQBIndex))
9242 {
9244 return false;
9245 }
9246
9247 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9248 if (itmQBIndex != -1 && parentPlayer)
9249 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9250 }
9251 }
9252 else
9253 {
9254
9255 PlayerBase player;
9256 int itemQBIndex;
9257 if (version ==
int.
MAX)
9258 {
9259 if (!ctx.
Read(itemQBIndex))
9260 {
9262 return false;
9263 }
9264 }
9265 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9266 {
9267
9268 if (!ctx.
Read(itemQBIndex))
9269 {
9271 return false;
9272 }
9273 if (itemQBIndex != -1 && player)
9274 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9275 }
9276 }
9277
9278 if (version < 140)
9279 {
9280
9281 if (!LoadVariables(ctx, version))
9282 {
9284 return false;
9285 }
9286 }
9287
9288
9290 {
9292 return false;
9293 }
9294 if (version >= 132)
9295 {
9297 if (raib)
9298 {
9300 {
9302 return false;
9303 }
9304 }
9305 }
9306
9308 return true;
9309 }
9310
9311
9312
9314 {
9315 super.OnStoreSave(ctx);
9316
9317 PlayerBase player;
9318 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9319 {
9321
9322 int itemQBIndex = -1;
9323 itemQBIndex = player.FindQuickBarEntityIndex(this);
9324 ctx.
Write(itemQBIndex);
9325 }
9326 else
9327 {
9329 }
9330
9332
9334 if (raib)
9335 {
9337 }
9338 }
9339
9340
9342 {
9343 super.AfterStoreLoad();
9344
9346 {
9348 }
9349
9351 {
9354 }
9355 }
9356
9358 {
9359 super.EEOnAfterLoad();
9360
9362 {
9364 }
9365
9368 }
9369
9371 {
9372 return false;
9373 }
9374
9375
9376
9378 {
9380 {
9381 #ifdef PLATFORM_CONSOLE
9382
9384 {
9386 if (menu)
9387 {
9389 }
9390 }
9391 #endif
9392 }
9393
9395 {
9398 }
9399
9401 {
9402 SetWeightDirty();
9404 }
9406 {
9409 }
9410
9412 {
9415 }
9417 {
9420 }
9421
9422 super.OnVariablesSynchronized();
9423 }
9424
9425
9426
9428 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9429 {
9430 if (!IsServerCheck(allow_client))
9431 return false;
9432
9434 return false;
9435
9438
9439 if (value <= (min + 0.001))
9440 value = min;
9441
9442 if (value == min)
9443 {
9444 if (destroy_config)
9445 {
9446 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9447 if (dstr)
9448 {
9450 this.Delete();
9451 return true;
9452 }
9453 }
9454 else if (destroy_forced)
9455 {
9457 this.Delete();
9458 return true;
9459 }
9460
9462 }
9463
9466
9468 {
9470
9471 if (delta)
9473 }
9474
9476
9477 return false;
9478 }
9479
9480
9482 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9483 {
9485 }
9486
9488 {
9491 }
9492
9494 {
9497 }
9498
9501 {
9502 float value_clamped = Math.Clamp(value, 0, 1);
9504 SetQuantity(result, destroy_config, destroy_forced);
9505 }
9506
9507
9510 {
9512 }
9513
9515 {
9517 }
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9529 {
9530 int slot = -1;
9531 if (GetInventory())
9532 {
9533 InventoryLocation il = new InventoryLocation;
9534 GetInventory().GetCurrentInventoryLocation(il);
9536 }
9537
9539 }
9540
9542 {
9543 float quantity_max = 0;
9544
9546 {
9547 if (attSlotID != -1)
9548 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9549
9550 if (quantity_max <= 0)
9552 }
9553
9554 if (quantity_max <= 0)
9556
9557 return quantity_max;
9558 }
9559
9561 {
9563 }
9564
9566 {
9568 }
9569
9570
9572 {
9574 }
9575
9577 {
9579 }
9580
9582 {
9584 }
9585
9586
9588 {
9589
9590 float weightEx = GetWeightEx();
9591 float special = GetInventoryAndCargoWeight();
9592 return weightEx - special;
9593 }
9594
9595
9597 {
9599 }
9600
9602 {
9604 {
9605 #ifdef DEVELOPER
9606 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9607 {
9608 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9610 }
9611 #endif
9612
9614 }
9615 else if (HasEnergyManager())
9616 {
9617 #ifdef DEVELOPER
9618 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9619 {
9620 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9621 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9622 }
9623 #endif
9624 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9625 }
9626 else
9627 {
9628 #ifdef DEVELOPER
9629 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9630 {
9631 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9632 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9633 }
9634 #endif
9635 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9636 }
9637 }
9638
9641 {
9642 int item_count = 0;
9644
9645 if (GetInventory().GetCargo() != NULL)
9646 {
9647 item_count = GetInventory().GetCargo().GetItemCount();
9648 }
9649
9650 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9651 {
9652 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9653 if (item)
9654 item_count += item.GetNumberOfItems();
9655 }
9656 return item_count;
9657 }
9658
9661 {
9662 float weight = 0;
9663 float wetness = 1;
9664 if (include_wetness)
9667 {
9668 weight = wetness * m_ConfigWeight;
9669 }
9671 {
9672 weight = 1;
9673 }
9674 return weight;
9675 }
9676
9677
9678
9680 {
9681 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9682 {
9683 GameInventory inv = GetInventory();
9684 array<EntityAI> items = new array<EntityAI>;
9686 for (int i = 0; i < items.Count(); i++)
9687 {
9689 if (item)
9690 {
9692 }
9693 }
9694 }
9695 }
9696
9697
9698
9699
9701 {
9702 float energy = 0;
9703 if (HasEnergyManager())
9704 {
9705 energy = GetCompEM().GetEnergy();
9706 }
9707 return energy;
9708 }
9709
9710
9712 {
9713 super.OnEnergyConsumed();
9714
9716 }
9717
9719 {
9720 super.OnEnergyAdded();
9721
9723 }
9724
9725
9727 {
9728 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9729 {
9731 {
9732 float energy_0to1 = GetCompEM().GetEnergy0To1();
9734 }
9735 }
9736 }
9737
9738
9740 {
9741 return ConfigGetFloat("heatIsolation");
9742 }
9743
9745 {
9747 }
9748
9750 {
9751 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9752 if (
GetGame().ConfigIsExisting(paramPath))
9754
9755 return 0.0;
9756 }
9757
9759 {
9760 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9761 if (
GetGame().ConfigIsExisting(paramPath))
9763
9764 return 0.0;
9765 }
9766
9767 override void SetWet(
float value,
bool allow_client =
false)
9768 {
9769 if (!IsServerCheck(allow_client))
9770 return;
9771
9774
9776
9777 m_VarWet = Math.Clamp(value, min, max);
9778
9780 {
9783 }
9784 }
9785
9786 override void AddWet(
float value)
9787 {
9789 }
9790
9792 {
9794 }
9795
9797 {
9799 }
9800
9802 {
9804 }
9805
9807 {
9809 }
9810
9812 {
9814 }
9815
9817 {
9820 if (newLevel != oldLevel)
9821 {
9823 }
9824 }
9825
9827 {
9828 SetWeightDirty();
9829 }
9830
9832 {
9833 return GetWetLevelInternal(
m_VarWet);
9834 }
9835
9836
9837
9839 {
9841 }
9842
9844 {
9846 }
9847
9849 {
9851 }
9852
9854 {
9856 }
9857
9858
9859
9861 {
9862 if (ConfigIsExisting("itemModelLength"))
9863 {
9864 return ConfigGetFloat("itemModelLength");
9865 }
9866 return 0;
9867 }
9868
9870 {
9871 if (ConfigIsExisting("itemAttachOffset"))
9872 {
9873 return ConfigGetFloat("itemAttachOffset");
9874 }
9875 return 0;
9876 }
9877
9878 override void SetCleanness(
int value,
bool allow_client =
false)
9879 {
9880 if (!IsServerCheck(allow_client))
9881 return;
9882
9884
9886
9889 }
9890
9892 {
9894 }
9895
9897 {
9898 return true;
9899 }
9900
9901
9902
9903
9905 {
9907 }
9908
9910 {
9912 }
9913
9914
9915
9916
9917 override void SetColor(
int r,
int g,
int b,
int a)
9918 {
9924 }
9926 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9927 {
9932 }
9933
9935 {
9937 }
9938
9941 {
9942 int r,g,b,a;
9944 r = r/255;
9945 g = g/255;
9946 b = b/255;
9947 a = a/255;
9948 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9949 }
9950
9951
9952
9953 override void SetLiquidType(
int value,
bool allow_client =
false)
9954 {
9955 if (!IsServerCheck(allow_client))
9956 return;
9957
9962 }
9963
9965 {
9966 return ConfigGetInt("varLiquidTypeInit");
9967 }
9968
9970 {
9972 }
9973
9975 {
9977 SetFrozen(false);
9978 }
9979
9982 {
9983 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9984 }
9985
9986
9989 {
9990 PlayerBase nplayer;
9991 if (PlayerBase.CastTo(nplayer, player))
9992 {
9994
9995 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9996 }
9997 }
9998
9999
10002 {
10003 PlayerBase nplayer;
10004 if (PlayerBase.CastTo(nplayer,player))
10005 {
10006
10007 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10008
10009 }
10010
10011
10012 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10013
10014
10015 if (HasEnergyManager())
10016 {
10017 GetCompEM().UpdatePlugState();
10018 }
10019 }
10020
10021
10023 {
10024 super.OnPlacementStarted(player);
10025
10027 }
10028
10029 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10030 {
10032 {
10033 m_AdminLog.OnPlacementComplete(player,
this);
10034 }
10035
10036 super.OnPlacementComplete(player, position, orientation);
10037 }
10038
10039
10040
10041
10042
10044 {
10046 {
10047 return true;
10048 }
10049 else
10050 {
10051 return false;
10052 }
10053 }
10054
10055
10057 {
10059 {
10061 }
10062 }
10063
10064
10066 {
10068 }
10069
10071 {
10073 }
10074
10075 override void InsertAgent(
int agent,
float count = 1)
10076 {
10077 if (count < 1)
10078 return;
10079
10081 }
10082
10085 {
10087 }
10088
10089
10091 {
10093 }
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10137 {
10139 return false;
10140 return true;
10141 }
10142
10144 {
10145
10147 }
10148
10149
10152 {
10153 super.CheckForRoofLimited(timeTresholdMS);
10154
10156 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10157 {
10158 m_PreviousRoofTestTime = time;
10159 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10160 }
10161 }
10162
10163
10165 {
10167 {
10168 return 0;
10169 }
10170
10171 if (GetInventory().GetAttachmentSlotsCount() != 0)
10172 {
10173 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10174 if (filter)
10175 return filter.GetProtectionLevel(type, false, system);
10176 else
10177 return 0;
10178 }
10179
10180 string subclassPath, entryName;
10181
10182 switch (type)
10183 {
10185 entryName = "biological";
10186 break;
10188 entryName = "chemical";
10189 break;
10190 default:
10191 entryName = "biological";
10192 break;
10193 }
10194
10195 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10196
10198 }
10199
10200
10201
10204 {
10205 if (!IsMagazine())
10207
10209 }
10210
10211
10212
10213
10214
10219 {
10220 return true;
10221 }
10222
10224 {
10226 }
10227
10228
10229
10230
10231
10233 {
10234 if (parent)
10235 {
10236 if (parent.IsInherited(DayZInfected))
10237 return true;
10238
10239 if (!parent.IsRuined())
10240 return true;
10241 }
10242
10243 return true;
10244 }
10245
10247 {
10248 if (!super.CanPutAsAttachment(parent))
10249 {
10250 return false;
10251 }
10252
10253 if (!IsRuined() && !parent.IsRuined())
10254 {
10255 return true;
10256 }
10257
10258 return false;
10259 }
10260
10262 {
10263
10264
10265
10266
10267 return super.CanReceiveItemIntoCargo(item);
10268 }
10269
10271 {
10272
10273
10274
10275
10276 GameInventory attachmentInv = attachment.GetInventory();
10278 {
10279 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10280 return false;
10281 }
10282
10283 InventoryLocation loc = new InventoryLocation();
10284 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10285 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10286 return false;
10287
10288 return super.CanReceiveAttachment(attachment, slotId);
10289 }
10290
10292 {
10293 if (!super.CanReleaseAttachment(attachment))
10294 return false;
10295
10296 return GetInventory().AreChildrenAccessible();
10297 }
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10320 {
10321 int id = muzzle_owner.GetMuzzleID();
10322 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10323
10324 if (WPOF_array)
10325 {
10326 for (int i = 0; i < WPOF_array.Count(); i++)
10327 {
10328 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10329
10330 if (WPOF)
10331 {
10332 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10333 }
10334 }
10335 }
10336 }
10337
10338
10340 {
10341 int id = muzzle_owner.GetMuzzleID();
10343
10344 if (WPOBE_array)
10345 {
10346 for (int i = 0; i < WPOBE_array.Count(); i++)
10347 {
10348 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10349
10350 if (WPOBE)
10351 {
10352 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10353 }
10354 }
10355 }
10356 }
10357
10358
10360 {
10361 int id = muzzle_owner.GetMuzzleID();
10362 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10363
10364 if (WPOOH_array)
10365 {
10366 for (int i = 0; i < WPOOH_array.Count(); i++)
10367 {
10368 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10369
10370 if (WPOOH)
10371 {
10372 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10373 }
10374 }
10375 }
10376 }
10377
10378
10380 {
10381 int id = muzzle_owner.GetMuzzleID();
10382 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10383
10384 if (WPOOH_array)
10385 {
10386 for (int i = 0; i < WPOOH_array.Count(); i++)
10387 {
10388 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10389
10390 if (WPOOH)
10391 {
10392 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10393 }
10394 }
10395 }
10396 }
10397
10398
10400 {
10401 int id = muzzle_owner.GetMuzzleID();
10402 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10403
10404 if (WPOOH_array)
10405 {
10406 for (int i = 0; i < WPOOH_array.Count(); i++)
10407 {
10408 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10409
10410 if (WPOOH)
10411 {
10412 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10413 }
10414 }
10415 }
10416 }
10417
10418
10419
10421 {
10423 {
10424 return true;
10425 }
10426
10427 return false;
10428 }
10429
10431 {
10433 {
10434 return true;
10435 }
10436
10437 return false;
10438 }
10439
10441 {
10443 {
10444 return true;
10445 }
10446
10447 return false;
10448 }
10449
10451 {
10452 return false;
10453 }
10454
10457 {
10458 return UATimeSpent.DEFAULT_DEPLOY;
10459 }
10460
10461
10462
10463
10465 {
10467 SetSynchDirty();
10468 }
10469
10471 {
10473 }
10474
10475
10477 {
10478 return false;
10479 }
10480
10483 {
10484 string att_type = "None";
10485
10486 if (ConfigIsExisting("soundAttType"))
10487 {
10488 att_type = ConfigGetString("soundAttType");
10489 }
10490
10492 }
10493
10495 {
10497 }
10498
10499
10500
10501
10502
10506
10508 {
10511
10513 }
10514
10515
10517 {
10519 return;
10520
10522
10525
10528
10529 SoundParameters params = new SoundParameters();
10533 }
10534
10535
10537 {
10539 return;
10540
10542 SetSynchDirty();
10543
10546 }
10547
10548
10550 {
10552 return;
10553
10555 SetSynchDirty();
10556
10559 }
10560
10562 {
10564 }
10565
10567 {
10569 }
10570
10573 {
10574 if (!
GetGame().IsDedicatedServer())
10575 {
10576 if (ConfigIsExisting("attachSoundSet"))
10577 {
10578 string cfg_path = "";
10579 string soundset = "";
10580 string type_name =
GetType();
10581
10584 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10585 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10586
10587 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10588 {
10589 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10590 {
10591 if (cfg_slot_array[i] == slot_type)
10592 {
10593 soundset = cfg_soundset_array[i];
10594 break;
10595 }
10596 }
10597 }
10598
10599 if (soundset != "")
10600 {
10601 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10603 }
10604 }
10605 }
10606 }
10607
10609 {
10610
10611 }
10612
10613 void OnApply(PlayerBase player);
10614
10616 {
10617 return 1.0;
10618 };
10619
10621 {
10623 }
10624
10626 {
10628 }
10629
10631
10633 {
10634 SetDynamicPhysicsLifeTime(0.01);
10636 }
10637
10639 {
10640 array<string> zone_names = new array<string>;
10641 GetDamageZones(zone_names);
10642 for (int i = 0; i < zone_names.Count(); i++)
10643 {
10644 SetHealthMax(zone_names.Get(i),"Health");
10645 }
10646 SetHealthMax("","Health");
10647 }
10648
10651 {
10652 float global_health = GetHealth01("","Health");
10653 array<string> zones = new array<string>;
10654 GetDamageZones(zones);
10655
10656 for (int i = 0; i < zones.Count(); i++)
10657 {
10658 SetHealth01(zones.Get(i),"Health",global_health);
10659 }
10660 }
10661
10664 {
10665 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10666 }
10667
10669 {
10670 if (!hasRootAsPlayer)
10671 {
10672 if (refParentIB)
10673 {
10674
10675 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10676 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10677
10678 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10679 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10680
10683 }
10684 else
10685 {
10686
10689 }
10690 }
10691 }
10692
10694 {
10696 {
10697 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10698 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10699 {
10700 float heatPermCoef = 1.0;
10702 while (ent)
10703 {
10704 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10705 ent = ent.GetHierarchyParent();
10706 }
10707
10708 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10709 }
10710 }
10711 }
10712
10714 {
10715
10716 EntityAI parent = GetHierarchyParent();
10717 if (!parent)
10718 {
10719 hasParent = false;
10720 hasRootAsPlayer = false;
10721 }
10722 else
10723 {
10724 hasParent = true;
10725 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10726 refParentIB =
ItemBase.Cast(parent);
10727 }
10728 }
10729
10730 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10731 {
10732
10733 }
10734
10736 {
10737
10738 return false;
10739 }
10740
10742 {
10743
10744
10745 return false;
10746 }
10747
10749 {
10750
10751 return false;
10752 }
10753
10756 {
10757 return !GetIsFrozen() &&
IsOpen();
10758 }
10759
10761 {
10762 bool hasParent = false, hasRootAsPlayer = false;
10764
10765 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10766 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10767
10768 if (wwtu || foodDecay)
10769 {
10773
10774 if (processWetness || processTemperature || processDecay)
10775 {
10777
10778 if (processWetness)
10779 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10780
10781 if (processTemperature)
10783
10784 if (processDecay)
10785 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10786 }
10787 }
10788 }
10789
10792 {
10794 }
10795
10797 {
10800
10801 return super.GetTemperatureFreezeThreshold();
10802 }
10803
10805 {
10808
10809 return super.GetTemperatureThawThreshold();
10810 }
10811
10813 {
10816
10817 return super.GetItemOverheatThreshold();
10818 }
10819
10821 {
10823 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10824
10825 return super.GetTemperatureFreezeTime();
10826 }
10827
10829 {
10831 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10832
10833 return super.GetTemperatureThawTime();
10834 }
10835
10840
10842 {
10843 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10844 }
10845
10847 {
10848 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10849 }
10850
10853 {
10855 }
10856
10858 {
10860 }
10861
10863 {
10865 }
10866
10869 {
10870 return null;
10871 }
10872
10875 {
10876 return false;
10877 }
10878
10880 {
10882 {
10885 if (!trg)
10886 {
10888 explosive = this;
10889 }
10890
10891 explosive.PairRemote(trg);
10893
10894 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10895 trg.SetPersistentPairID(persistentID);
10896 explosive.SetPersistentPairID(persistentID);
10897
10898 return true;
10899 }
10900 return false;
10901 }
10902
10905 {
10906 float ret = 1.0;
10909 ret *= GetHealth01();
10910
10911 return ret;
10912 }
10913
10914 #ifdef DEVELOPER
10915 override void SetDebugItem()
10916 {
10917 super.SetDebugItem();
10918 _itemBase = this;
10919 }
10920
10922 {
10923 string text = super.GetDebugText();
10924
10926 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10927
10928 return text;
10929 }
10930 #endif
10931
10933 {
10934 return true;
10935 }
10936
10938
10940
10942 {
10945 }
10946
10947
10955
10971}
10972
10974{
10976 if (entity)
10977 {
10978 bool is_item = entity.IsInherited(
ItemBase);
10979 if (is_item && full_quantity)
10980 {
10983 }
10984 }
10985 else
10986 {
10988 return NULL;
10989 }
10990 return entity;
10991}
10992
10994{
10995 if (item)
10996 {
10997 if (health > 0)
10998 item.SetHealth("", "", health);
10999
11000 if (item.CanHaveTemperature())
11001 {
11003 if (item.CanFreeze())
11004 item.SetFrozen(false);
11005 }
11006
11007 if (item.HasEnergyManager())
11008 {
11009 if (quantity >= 0)
11010 {
11011 item.GetCompEM().SetEnergy0To1(quantity);
11012 }
11013 else
11014 {
11016 }
11017 }
11018 else if (item.IsMagazine())
11019 {
11020 Magazine mag = Magazine.Cast(item);
11021 if (quantity >= 0)
11022 {
11023 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11024 }
11025 else
11026 {
11028 }
11029
11030 }
11031 else
11032 {
11033 if (quantity >= 0)
11034 {
11035 item.SetQuantityNormalized(quantity, false);
11036 }
11037 else
11038 {
11040 }
11041
11042 }
11043 }
11044}
11045
11046#ifdef DEVELOPER
11048#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.