6151{
6153 {
6154 return true;
6155 }
6156};
6157
6158
6159
6161{
6165
6167
6170
6171
6172
6173
6174
6183
6189
6194
6199
6220 protected bool m_IsResultOfSplit
6221
6223
6228
6229
6230
6232
6236
6237
6238
6240
6243
6244
6245
6251
6252
6260
6263
6264
6266
6267
6269
6270
6275
6276
6281
6282
6284
6285
6287 {
6292
6293 if (!
GetGame().IsDedicatedServer())
6294 {
6296 {
6298
6300 {
6302 }
6303 }
6304
6307 }
6308
6309 m_OldLocation = null;
6310
6312 {
6314 }
6315
6316 if (ConfigIsExisting("headSelectionsToHide"))
6317 {
6320 }
6321
6323 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6324 {
6326 }
6327
6329
6330 m_IsResultOfSplit = false;
6331
6333 }
6334
6336 {
6337 super.InitItemVariables();
6338
6344 m_Count = ConfigGetInt(
"count");
6345
6348
6353
6356
6361
6373
6377
6378
6381 if (ConfigIsExisting("canBeSplit"))
6382 {
6385 }
6386
6388 if (ConfigIsExisting("itemBehaviour"))
6390
6391
6394 RegisterNetSyncVariableInt("m_VarLiquidType");
6395 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6396
6397 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6398 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6399 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6400
6401 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6402 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6403 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6404 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6405
6406 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6407 RegisterNetSyncVariableBool("m_IsTakeable");
6408 RegisterNetSyncVariableBool("m_IsHologram");
6409
6412 {
6415 }
6416
6418
6420 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6422
6423 }
6424
6426 {
6428 }
6429
6431 {
6434 {
6439 }
6440 }
6441
6442 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6443 {
6445 {
6448 }
6449
6451 }
6452
6454 {
6460 }
6461
6463
6465 {
6467
6468 if (!action)
6469 {
6470 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6471 return;
6472 }
6473
6475 if (!ai)
6476 {
6478 return;
6479 }
6480
6482 if (!action_array)
6483 {
6484 action_array = new array<ActionBase_Basic>;
6486 }
6487 if (LogManager.IsActionLogEnable())
6488 {
6489 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6490 }
6491
6492 if (action_array.Find(action) != -1)
6493 {
6494 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6495 }
6496 else
6497 {
6498 action_array.Insert(action);
6499 }
6500 }
6501
6503 {
6505 ActionBase action = player.GetActionManager().GetAction(actionName);
6508
6509 if (action_array)
6510 {
6511 action_array.RemoveItem(action);
6512 }
6513 }
6514
6515
6516
6518 {
6519 ActionOverrideData overrideData = new ActionOverrideData();
6523
6525 if (!actionMap)
6526 {
6529 }
6530
6531 actionMap.Insert(this.
Type(), overrideData);
6532
6533 }
6534
6536
6538
6539
6541 {
6544
6547
6548 string config_to_search = "CfgVehicles";
6549 string muzzle_owner_config;
6550
6552 {
6553 if (IsInherited(Weapon))
6554 config_to_search = "CfgWeapons";
6555
6556 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6557
6558 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6559
6561
6562 if (config_OnFire_subclass_count > 0)
6563 {
6564 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6565
6566 for (int i = 0; i < config_OnFire_subclass_count; i++)
6567 {
6568 string particle_class = "";
6570 string config_OnFire_entry = config_OnFire_class + particle_class;
6571 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6572 WPOF_array.Insert(WPOF);
6573 }
6574
6575
6577 }
6578 }
6579
6581 {
6582 config_to_search = "CfgWeapons";
6583 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6584
6585 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6586
6588
6589 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6590 {
6591 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6592
6593 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6594 {
6595 string particle_class2 = "";
6597 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6598 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6599 WPOBE_array.Insert(WPOBE);
6600 }
6601
6602
6604 }
6605 }
6606 }
6607
6608
6610 {
6613
6615 {
6616 string config_to_search = "CfgVehicles";
6617
6618 if (IsInherited(Weapon))
6619 config_to_search = "CfgWeapons";
6620
6621 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6622 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6623
6624 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6625 {
6626
6628
6630 {
6632 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6634 return;
6635 }
6636
6639
6640
6641
6643 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6644
6645 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6646 {
6647 string particle_class = "";
6649 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6651
6652 if (entry_type == CT_CLASS)
6653 {
6654 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6655 WPOOH_array.Insert(WPOF);
6656 }
6657 }
6658
6659
6661 }
6662 }
6663 }
6664
6666 {
6668 }
6669
6671 {
6673 {
6675
6678
6681
6682 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6683 }
6684 }
6685
6687 {
6689 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6690
6692 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6693
6695 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6696
6698 {
6700 }
6701 }
6702
6704 {
6706 }
6707
6709 {
6712 else
6714
6716 {
6719 }
6720 else
6721 {
6724
6727 }
6728
6730 }
6731
6733 {
6735 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6736 }
6737
6739 {
6741 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6743 }
6744
6746 {
6748 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6749 }
6750
6752 {
6755
6756 OverheatingParticle OP = new OverheatingParticle();
6761
6763 }
6764
6766 {
6769
6770 return -1;
6771 }
6772
6774 {
6776 {
6779
6780 for (int i = count; i > 0; --i)
6781 {
6782 int id = i - 1;
6785
6788
6789 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6790 {
6791 if (p)
6792 {
6795 }
6796 }
6797 }
6798 }
6799 }
6800
6802 {
6804 {
6806 {
6807 int id = i - 1;
6809
6810 if (OP)
6811 {
6813
6814 if (p)
6815 {
6817 }
6818
6819 delete OP;
6820 }
6821 }
6822
6825 }
6826 }
6827
6830 {
6831 return 0.0;
6832 }
6833
6834
6836 {
6837 return 250;
6838 }
6839
6841 {
6842 return 0;
6843 }
6844
6847 {
6849 return true;
6850
6851 return false;
6852 }
6853
6856 {
6859
6861 {
6863 }
6864 else
6865 {
6866
6868 }
6869
6871 }
6872
6879 {
6880 return -1;
6881 }
6882
6883
6884
6885
6887 {
6889 {
6891 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6892
6893 if (r_index >= 0)
6894 {
6895 InventoryLocation r_il = new InventoryLocation;
6896 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6897
6898 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6901 {
6902 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6903 }
6905 {
6906 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6907 }
6908
6909 }
6910
6911 player.GetHumanInventory().ClearUserReservedLocation(this);
6912 }
6913
6916 }
6917
6918
6919
6920
6922 {
6923 return ItemBase.m_DebugActionsMask;
6924 }
6925
6927 {
6928 return ItemBase.m_DebugActionsMask & mask;
6929 }
6930
6932 {
6933 ItemBase.m_DebugActionsMask = mask;
6934 }
6935
6937 {
6938 ItemBase.m_DebugActionsMask |= mask;
6939 }
6940
6942 {
6943 ItemBase.m_DebugActionsMask &= ~mask;
6944 }
6945
6947 {
6949 {
6951 }
6952 else
6953 {
6955 }
6956 }
6957
6958
6960 {
6961 if (GetEconomyProfile())
6962 {
6963 float q_max = GetEconomyProfile().GetQuantityMax();
6964 if (q_max > 0)
6965 {
6966 float q_min = GetEconomyProfile().GetQuantityMin();
6967 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6968
6970 {
6971 ComponentEnergyManager comp = GetCompEM();
6973 {
6975 }
6976 }
6978 {
6980
6981 }
6982
6983 }
6984 }
6985 }
6986
6989 {
6990 EntityAI parent = GetHierarchyParent();
6991
6992 if (parent)
6993 {
6994 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6995 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6996 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6997 }
6998 }
6999
7002 {
7003 EntityAI parent = GetHierarchyParent();
7004
7005 if (parent)
7006 {
7007 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7008 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7009 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7010 }
7011 }
7012
7014 {
7015
7016
7017
7018
7020
7022 {
7023 if (ScriptInputUserData.CanStoreInputUserData())
7024 {
7025 ScriptInputUserData ctx = new ScriptInputUserData;
7031 ctx.
Write(use_stack_max);
7034
7036 {
7037 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7038 }
7039 }
7040 }
7041 else if (!
GetGame().IsMultiplayer())
7042 {
7044 }
7045 }
7046
7048 {
7050 }
7051
7053 {
7055 }
7056
7058 {
7060 }
7061
7063 {
7064
7065 return false;
7066 }
7067
7069 {
7070 return false;
7071 }
7072
7076 {
7077 return false;
7078 }
7079
7081 {
7082 return "";
7083 }
7084
7086
7088 {
7089 return false;
7090 }
7091
7093 {
7094 return true;
7095 }
7096
7097
7098
7100 {
7101 return true;
7102 }
7103
7105 {
7106 return true;
7107 }
7108
7110 {
7111 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7113 }
7114
7116 {
7118 }
7119
7121 {
7123 if (!is_being_placed)
7125 SetSynchDirty();
7126 }
7127
7128
7130
7132 {
7134 }
7135
7137 {
7139 }
7140
7142 {
7143 return 1;
7144 }
7145
7147 {
7148 return false;
7149 }
7150
7152 {
7154 SetSynchDirty();
7155 }
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7192 {
7193 super.OnMovedInsideCargo(container);
7194
7195 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7196 }
7197
7198 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7199 {
7200 super.EEItemLocationChanged(oldLoc,newLoc);
7201
7202 PlayerBase new_player = null;
7203 PlayerBase old_player = null;
7204
7205 if (newLoc.GetParent())
7206 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7207
7208 if (oldLoc.GetParent())
7209 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7210
7212 {
7213 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7214
7215 if (r_index >= 0)
7216 {
7217 InventoryLocation r_il = new InventoryLocation;
7218 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7219
7220 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7223 {
7224 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7225 }
7227 {
7228 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7229 }
7230
7231 }
7232 }
7233
7235 {
7236 if (new_player)
7237 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7238
7239 if (new_player == old_player)
7240 {
7241
7242 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7243 {
7245 {
7246 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7247 {
7248 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7249 }
7250 }
7251 else
7252 {
7253 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7254 }
7255 }
7256
7257 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7258 {
7259 int type = oldLoc.GetType();
7261 {
7262 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7263 }
7265 {
7266 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7267 }
7268 }
7269 if (!m_OldLocation)
7270 {
7271 m_OldLocation = new InventoryLocation;
7272 }
7273 m_OldLocation.Copy(oldLoc);
7274 }
7275 else
7276 {
7277 if (m_OldLocation)
7278 {
7279 m_OldLocation.Reset();
7280 }
7281 }
7282
7284 }
7285 else
7286 {
7287 if (new_player)
7288 {
7289 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7290 if (res_index >= 0)
7291 {
7292 InventoryLocation il = new InventoryLocation;
7293 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7295 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7298 {
7299 il.
GetParent().GetOnReleaseLock().Invoke(it);
7300 }
7302 {
7304 }
7305
7306 }
7307 }
7309 {
7310
7312 }
7313
7314 if (m_OldLocation)
7315 {
7316 m_OldLocation.Reset();
7317 }
7318 }
7319 }
7320
7321 override void EOnContact(IEntity other, Contact extra)
7322 {
7324 {
7325 int liquidType = -1;
7327 if (impactSpeed > 0.0)
7328 {
7330 #ifndef SERVER
7332 #else
7334 SetSynchDirty();
7335 #endif
7337 }
7338 }
7339
7340 #ifdef SERVER
7341 if (GetCompEM() && GetCompEM().IsPlugged())
7342 {
7343 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7344 GetCompEM().UnplugThis();
7345 }
7346 #endif
7347 }
7348
7350
7352 {
7354 }
7355
7357 {
7358
7359 }
7360
7362 {
7363 super.OnItemLocationChanged(old_owner, new_owner);
7364
7365 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7366 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7367
7368 if (!relatedPlayer && playerNew)
7369 relatedPlayer = playerNew;
7370
7371 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7372 {
7374 if (actionMgr)
7375 {
7376 ActionBase currentAction = actionMgr.GetRunningAction();
7377 if (currentAction)
7379 }
7380 }
7381
7382 Man ownerPlayerOld = null;
7383 Man ownerPlayerNew = null;
7384
7385 if (old_owner)
7386 {
7387 if (old_owner.
IsMan())
7388 {
7389 ownerPlayerOld = Man.Cast(old_owner);
7390 }
7391 else
7392 {
7393 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7394 }
7395 }
7396 else
7397 {
7399 {
7401
7402 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7403 {
7404 GetCompEM().UnplugThis();
7405 }
7406 }
7407 }
7408
7409 if (new_owner)
7410 {
7411 if (new_owner.
IsMan())
7412 {
7413 ownerPlayerNew = Man.Cast(new_owner);
7414 }
7415 else
7416 {
7417 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7418 }
7419 }
7420
7421 if (ownerPlayerOld != ownerPlayerNew)
7422 {
7423 if (ownerPlayerOld)
7424 {
7425 array<EntityAI> subItemsExit = new array<EntityAI>;
7427 for (int i = 0; i < subItemsExit.Count(); i++)
7428 {
7431 }
7432 }
7433
7434 if (ownerPlayerNew)
7435 {
7436 array<EntityAI> subItemsEnter = new array<EntityAI>;
7438 for (int j = 0; j < subItemsEnter.Count(); j++)
7439 {
7442 }
7443 }
7444 }
7445 else if (ownerPlayerNew != null)
7446 {
7447 PlayerBase nplayer;
7448 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7449 {
7450 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7452 for (int k = 0; k < subItemsUpdate.Count(); k++)
7453 {
7455 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7456 }
7457 }
7458 }
7459
7460 if (old_owner)
7461 old_owner.OnChildItemRemoved(this);
7462 if (new_owner)
7463 new_owner.OnChildItemReceived(this);
7464 }
7465
7466
7468 {
7469 super.EEDelete(parent);
7470 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7471 if (player)
7472 {
7474
7475 if (player.IsAlive())
7476 {
7477 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7478 if (r_index >= 0)
7479 {
7480 InventoryLocation r_il = new InventoryLocation;
7481 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7482
7483 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7486 {
7487 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7488 }
7490 {
7491 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7492 }
7493
7494 }
7495
7496 player.RemoveQuickBarEntityShortcut(this);
7497 }
7498 }
7499 }
7500
7502 {
7503 super.EEKilled(killer);
7504
7507 {
7508 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7509 {
7510 if (IsMagazine())
7511 {
7512 if (Magazine.Cast(this).GetAmmoCount() > 0)
7513 {
7515 }
7516 }
7517 else
7518 {
7520 }
7521 }
7522 }
7523 }
7524
7526 {
7527 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7528
7529 super.OnWasAttached(parent, slot_id);
7530
7533
7535 }
7536
7538 {
7539 super.OnWasDetached(parent, slot_id);
7540
7543 }
7544
7546 {
7547 int idx;
7550
7551 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7552 if (inventory_slots.Count() < 1)
7553 {
7554 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7555 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7556 }
7557 else
7558 {
7559 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7560 }
7561
7562 idx = inventory_slots.Find(slot);
7563 if (idx < 0)
7564 return "";
7565
7566 return attach_types.Get(idx);
7567 }
7568
7570 {
7571 int idx = -1;
7572 string slot;
7573
7576
7577 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7578 if (inventory_slots.Count() < 1)
7579 {
7580 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7581 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7582 }
7583 else
7584 {
7585 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7586 if (detach_types.Count() < 1)
7587 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7588 }
7589
7590 for (int i = 0; i < inventory_slots.Count(); i++)
7591 {
7592 slot = inventory_slots.Get(i);
7593 }
7594
7595 if (slot != "")
7596 {
7597 if (detach_types.Count() == 1)
7598 idx = 0;
7599 else
7600 idx = inventory_slots.Find(slot);
7601 }
7602 if (idx < 0)
7603 return "";
7604
7605 return detach_types.Get(idx);
7606 }
7607
7609 {
7610
7612
7613
7614 float min_time = 1;
7615 float max_time = 3;
7616 float delay = Math.RandomFloat(min_time, max_time);
7617
7618 explode_timer.Run(delay, this, "DoAmmoExplosion");
7619 }
7620
7622 {
7623 Magazine magazine = Magazine.Cast(this);
7624 int pop_sounds_count = 6;
7625 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7626
7627
7628 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7629 string sound_name = pop_sounds[ sound_idx ];
7631
7632
7633 magazine.ServerAddAmmoCount(-1);
7634
7635
7636 float min_temp_to_explode = 100;
7637
7638 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7639 {
7641 }
7642 }
7643
7644
7645 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7646 {
7647 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7648
7649 const int CHANCE_DAMAGE_CARGO = 4;
7650 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7651 const int CHANCE_DAMAGE_NOTHING = 2;
7652
7654 {
7655 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7656 int chances;
7657 int rnd;
7658
7659 if (GetInventory().GetCargo())
7660 {
7661 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7662 rnd = Math.RandomInt(0,chances);
7663
7664 if (rnd < CHANCE_DAMAGE_CARGO)
7665 {
7667 }
7668 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7669 {
7671 }
7672 }
7673 else
7674 {
7675 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7676 rnd = Math.RandomInt(0,chances);
7677
7678 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7679 {
7681 }
7682 }
7683 }
7684 }
7685
7687 {
7688 if (GetInventory().GetCargo())
7689 {
7690 int item_count = GetInventory().GetCargo().GetItemCount();
7691 if (item_count > 0)
7692 {
7693 int random_pick = Math.RandomInt(0, item_count);
7695 if (!item.IsExplosive())
7696 {
7697 item.AddHealth("","",damage);
7698 return true;
7699 }
7700 }
7701 }
7702 return false;
7703 }
7704
7706 {
7707 int attachment_count = GetInventory().AttachmentCount();
7708 if (attachment_count > 0)
7709 {
7710 int random_pick = Math.RandomInt(0, attachment_count);
7711 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7712 if (!attachment.IsExplosive())
7713 {
7714 attachment.AddHealth("","",damage);
7715 return true;
7716 }
7717 }
7718 return false;
7719 }
7720
7722 {
7724 }
7725
7727 {
7729 return GetInventory().CanRemoveEntity();
7730
7731 return false;
7732 }
7733
7735 {
7737 return;
7738
7740 {
7741 if (ScriptInputUserData.CanStoreInputUserData())
7742 {
7743 ScriptInputUserData ctx = new ScriptInputUserData;
7748 ctx.
Write(destination_entity);
7752 }
7753 }
7754 else if (!
GetGame().IsMultiplayer())
7755 {
7757 }
7758 }
7759
7761 {
7763 return;
7764
7765 float split_quantity_new;
7769 InventoryLocation loc = new InventoryLocation;
7770
7771 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7772 {
7774 split_quantity_new = stack_max;
7775 else
7777
7778 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7779 if (new_item)
7780 {
7781 new_item.SetResultOfSplit(true);
7782 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7784 new_item.SetQuantity(split_quantity_new);
7785 }
7786 }
7787 else if (destination_entity && slot_id == -1)
7788 {
7789 if (quantity > stack_max)
7790 split_quantity_new = stack_max;
7791 else
7792 split_quantity_new = quantity;
7793
7795 {
7798 }
7799
7800 if (new_item)
7801 {
7802 new_item.SetResultOfSplit(true);
7803 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7805 new_item.SetQuantity(split_quantity_new);
7806 }
7807 }
7808 else
7809 {
7810 if (stack_max != 0)
7811 {
7813 {
7815 }
7816
7817 if (split_quantity_new == 0)
7818 {
7819 if (!
GetGame().IsMultiplayer())
7820 player.PhysicalPredictiveDropItem(this);
7821 else
7822 player.ServerDropEntity(this);
7823 return;
7824 }
7825
7827
7828 if (new_item)
7829 {
7830 new_item.SetResultOfSplit(true);
7831 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7833 new_item.SetQuantity(stack_max);
7834 new_item.PlaceOnSurface();
7835 }
7836 }
7837 }
7838 }
7839
7841 {
7843 return;
7844
7845 float split_quantity_new;
7849 InventoryLocation loc = new InventoryLocation;
7850
7851 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7852 {
7854 split_quantity_new = stack_max;
7855 else
7857
7858 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7859 if (new_item)
7860 {
7861 new_item.SetResultOfSplit(true);
7862 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7864 new_item.SetQuantity(split_quantity_new);
7865 }
7866 }
7867 else if (destination_entity && slot_id == -1)
7868 {
7869 if (quantity > stack_max)
7870 split_quantity_new = stack_max;
7871 else
7872 split_quantity_new = quantity;
7873
7875 {
7878 }
7879
7880 if (new_item)
7881 {
7882 new_item.SetResultOfSplit(true);
7883 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7885 new_item.SetQuantity(split_quantity_new);
7886 }
7887 }
7888 else
7889 {
7890 if (stack_max != 0)
7891 {
7893 {
7895 }
7896
7898
7899 if (new_item)
7900 {
7901 new_item.SetResultOfSplit(true);
7902 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7904 new_item.SetQuantity(stack_max);
7905 new_item.PlaceOnSurface();
7906 }
7907 }
7908 }
7909 }
7910
7912 {
7914 return;
7915
7917 {
7918 if (ScriptInputUserData.CanStoreInputUserData())
7919 {
7920 ScriptInputUserData ctx = new ScriptInputUserData;
7925 dst.WriteToContext(ctx);
7927 }
7928 }
7929 else if (!
GetGame().IsMultiplayer())
7930 {
7932 }
7933 }
7934
7936 {
7938 return;
7939
7941 {
7942 if (ScriptInputUserData.CanStoreInputUserData())
7943 {
7944 ScriptInputUserData ctx = new ScriptInputUserData;
7949 ctx.
Write(destination_entity);
7955 }
7956 }
7957 else if (!
GetGame().IsMultiplayer())
7958 {
7960 }
7961 }
7962
7964 {
7966 }
7967
7969 {
7971 return this;
7972
7974 float split_quantity_new;
7976 if (dst.IsValid())
7977 {
7978 int slot_id = dst.GetSlot();
7980
7981 if (quantity > stack_max)
7982 split_quantity_new = stack_max;
7983 else
7984 split_quantity_new = quantity;
7985
7987
7988 if (new_item)
7989 {
7990 new_item.SetResultOfSplit(true);
7991 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7994 }
7995
7996 return new_item;
7997 }
7998
7999 return null;
8000 }
8001
8003 {
8005 return;
8006
8008 float split_quantity_new;
8010 if (destination_entity)
8011 {
8013 if (quantity > stackable)
8014 split_quantity_new = stackable;
8015 else
8016 split_quantity_new = quantity;
8017
8018 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8019 if (new_item)
8020 {
8021 new_item.SetResultOfSplit(true);
8022 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8024 new_item.SetQuantity(split_quantity_new);
8025 }
8026 }
8027 }
8028
8030 {
8032 return;
8033
8035 {
8036 if (ScriptInputUserData.CanStoreInputUserData())
8037 {
8038 ScriptInputUserData ctx = new ScriptInputUserData;
8043 ItemBase destination_entity =
this;
8044 ctx.
Write(destination_entity);
8048 }
8049 }
8050 else if (!
GetGame().IsMultiplayer())
8051 {
8053 }
8054 }
8055
8057 {
8059 return;
8060
8062 float split_quantity_new;
8064 if (player)
8065 {
8067 if (quantity > stackable)
8068 split_quantity_new = stackable;
8069 else
8070 split_quantity_new = quantity;
8071
8072 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8073 new_item =
ItemBase.Cast(in_hands);
8074 if (new_item)
8075 {
8076 new_item.SetResultOfSplit(true);
8077 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8079 new_item.SetQuantity(split_quantity_new);
8080 }
8081 }
8082 }
8083
8085 {
8087 return;
8088
8090 float split_quantity_new = Math.Floor(quantity * 0.5);
8091
8093
8094 if (new_item)
8095 {
8096 if (new_item.GetQuantityMax() < split_quantity_new)
8097 {
8098 split_quantity_new = new_item.GetQuantityMax();
8099 }
8100
8101 new_item.SetResultOfSplit(true);
8102 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8103
8105 {
8108 }
8109 else
8110 {
8113 }
8114 }
8115 }
8116
8118 {
8120 return;
8121
8123 float split_quantity_new = Math.Floor(quantity / 2);
8124
8125 InventoryLocation invloc = new InventoryLocation;
8127
8129 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8130
8131 if (new_item)
8132 {
8133 if (new_item.GetQuantityMax() < split_quantity_new)
8134 {
8135 split_quantity_new = new_item.GetQuantityMax();
8136 }
8138 {
8141 }
8142 else
8143 {
8146 }
8147 }
8148 }
8149
8152 {
8153 SetWeightDirty();
8155
8156 if (parent)
8157 parent.OnAttachmentQuantityChangedEx(this, delta);
8158
8160 {
8162 {
8164 }
8166 {
8167 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8169 }
8170 }
8171
8172 }
8173
8176 {
8177
8178 }
8179
8182 {
8184 }
8185
8187 {
8188 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8189
8191 {
8192 if (newLevel == GameConstants.STATE_RUINED)
8193 {
8195 EntityAI parent = GetHierarchyParent();
8196 if (parent && parent.IsFireplace())
8197 {
8198 CargoBase cargo = GetInventory().GetCargo();
8199 if (cargo)
8200 {
8202 {
8204 }
8205 }
8206 }
8207 }
8208
8210 {
8211
8213 return;
8214 }
8215
8216 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8217 {
8219 }
8220 }
8221 }
8222
8223
8225 {
8226 super.OnRightClick();
8227
8229 {
8231 {
8232 if (ScriptInputUserData.CanStoreInputUserData())
8233 {
8234 vector m4[4];
8236
8237 EntityAI root = GetHierarchyRoot();
8238
8239 InventoryLocation dst = new InventoryLocation;
8241 {
8242 if (root)
8243 {
8244 root.GetTransform(m4);
8246 }
8247 else
8248 GetInventory().GetCurrentInventoryLocation(dst);
8249 }
8250 else
8251 {
8253
8254
8255 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8256 {
8257 if (root)
8258 {
8259 root.GetTransform(m4);
8261 }
8262 else
8263 GetInventory().GetCurrentInventoryLocation(dst);
8264 }
8265 else
8266 {
8267 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8268 }
8269 }
8270
8271 ScriptInputUserData ctx = new ScriptInputUserData;
8279 }
8280 }
8281 else if (!
GetGame().IsMultiplayer())
8282 {
8284 }
8285 }
8286 }
8287
8288 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8289 {
8290
8291 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8292 return false;
8293
8294 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8295 return false;
8296
8297
8299 return false;
8300
8301
8302 Magazine mag = Magazine.Cast(this);
8303 if (mag)
8304 {
8305 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8306 return false;
8307
8308 if (stack_max_limit)
8309 {
8310 Magazine other_mag = Magazine.Cast(other_item);
8311 if (other_item)
8312 {
8313 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8314 return false;
8315 }
8316
8317 }
8318 }
8319 else
8320 {
8321
8323 return false;
8324
8326 return false;
8327 }
8328
8329 PlayerBase player = null;
8330 if (CastTo(player, GetHierarchyRootPlayer()))
8331 {
8332 if (player.GetInventory().HasAttachment(this))
8333 return false;
8334
8335 if (player.IsItemsToDelete())
8336 return false;
8337 }
8338
8339 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8340 return false;
8341
8342 int slotID;
8344 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8345 return false;
8346
8347 return true;
8348 }
8349
8351 {
8353 }
8354
8356 {
8357 return m_IsResultOfSplit;
8358 }
8359
8361 {
8362 m_IsResultOfSplit = value;
8363 }
8364
8366 {
8368 }
8369
8371 {
8372 float other_item_quantity = other_item.GetQuantity();
8373 float this_free_space;
8374
8376
8378
8379 if (other_item_quantity > this_free_space)
8380 {
8381 return this_free_space;
8382 }
8383 else
8384 {
8385 return other_item_quantity;
8386 }
8387 }
8388
8390 {
8392 }
8393
8395 {
8397 return;
8398
8399 if (!IsMagazine() && other_item)
8400 {
8402 if (quantity_used != 0)
8403 {
8404 float hp1 = GetHealth01("","");
8405 float hp2 = other_item.GetHealth01("","");
8406 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8407 hpResult = hpResult / (
GetQuantity() + quantity_used);
8408
8409 hpResult *= GetMaxHealth();
8410 Math.Round(hpResult);
8411 SetHealth("", "Health", hpResult);
8412
8414 other_item.AddQuantity(-quantity_used);
8415 }
8416 }
8418 }
8419
8421 {
8422 #ifdef SERVER
8423 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8424 GetHierarchyParent().IncreaseLifetimeUp();
8425 #endif
8426 };
8427
8429 {
8430 PlayerBase p = PlayerBase.Cast(player);
8431
8432 array<int> recipesIds = p.m_Recipes;
8433 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8434 if (moduleRecipesManager)
8435 {
8436 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8437 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8438 }
8439
8440 for (int i = 0;i < recipesIds.Count(); i++)
8441 {
8442 int key = recipesIds.Get(i);
8443 string recipeName = moduleRecipesManager.GetRecipeName(key);
8445 }
8446 }
8447
8448
8449 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8450 {
8451 super.GetDebugActions(outputList);
8452
8453
8458
8459
8463
8467
8468
8471
8472
8474 {
8477 }
8478
8480
8483
8487 }
8488
8489
8490
8491
8493 {
8494 super.OnAction(action_id, player, ctx);
8495 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8496 {
8497 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8498 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8499 PlayerBase p = PlayerBase.Cast(player);
8500 if (
EActions.RECIPES_RANGE_START < 1000)
8501 {
8502 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8503 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8504 }
8505 }
8506 #ifndef SERVER
8507 else if (action_id ==
EActions.WATCH_PLAYER)
8508 {
8509 PluginDeveloper.SetDeveloperItemClientEx(player);
8510 }
8511 #endif
8513 {
8514 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8515 {
8516 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8517 OnDebugButtonPressServer(id + 1);
8518 }
8519
8520 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8521 {
8522 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8524 }
8525
8526 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8527 {
8528 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8530 }
8531
8532 else if (action_id ==
EActions.ADD_QUANTITY)
8533 {
8534 if (IsMagazine())
8535 {
8536 Magazine mag = Magazine.Cast(this);
8537 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8538 }
8539 else
8540 {
8542 }
8543
8544 if (m_EM)
8545 {
8546 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8547 }
8548
8549 }
8550
8551 else if (action_id ==
EActions.REMOVE_QUANTITY)
8552 {
8553 if (IsMagazine())
8554 {
8555 Magazine mag2 = Magazine.Cast(this);
8556 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8557 }
8558 else
8559 {
8561 }
8562 if (m_EM)
8563 {
8564 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8565 }
8566
8567 }
8568
8569 else if (action_id ==
EActions.SET_QUANTITY_0)
8570 {
8572
8573 if (m_EM)
8574 {
8575 m_EM.SetEnergy(0);
8576 }
8577 }
8578
8579 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8580 {
8582
8583 if (m_EM)
8584 {
8585 m_EM.SetEnergy(m_EM.GetEnergyMax());
8586 }
8587 }
8588
8589 else if (action_id ==
EActions.ADD_HEALTH)
8590 {
8591 AddHealth("","",GetMaxHealth("","Health")/5);
8592 }
8593 else if (action_id ==
EActions.REMOVE_HEALTH)
8594 {
8595 AddHealth("","",-GetMaxHealth("","Health")/5);
8596 }
8597 else if (action_id ==
EActions.DESTROY_HEALTH)
8598 {
8599 SetHealth01("","",0);
8600 }
8601 else if (action_id ==
EActions.WATCH_ITEM)
8602 {
8604 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8605 #ifdef DEVELOPER
8606 SetDebugDeveloper_item(this);
8607 #endif
8608 }
8609
8610 else if (action_id ==
EActions.ADD_TEMPERATURE)
8611 {
8612 AddTemperature(20);
8613
8614 }
8615
8616 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8617 {
8618 AddTemperature(-20);
8619
8620 }
8621
8622 else if (action_id ==
EActions.FLIP_FROZEN)
8623 {
8624 SetFrozen(!GetIsFrozen());
8625
8626 }
8627
8628 else if (action_id ==
EActions.ADD_WETNESS)
8629 {
8631
8632 }
8633
8634 else if (action_id ==
EActions.REMOVE_WETNESS)
8635 {
8637
8638 }
8639
8640 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8641 {
8644
8645
8646 }
8647
8648 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8649 {
8652 }
8653
8654 else if (action_id ==
EActions.MAKE_SPECIAL)
8655 {
8656 auto debugParams = DebugSpawnParams.WithPlayer(player);
8657 OnDebugSpawnEx(debugParams);
8658 }
8659
8660 else if (action_id ==
EActions.DELETE)
8661 {
8662 Delete();
8663 }
8664
8665 }
8666
8667
8668 return false;
8669 }
8670
8671
8672
8673
8677
8680
8681
8682
8684 {
8685 return false;
8686 }
8687
8688
8690 {
8691 return true;
8692 }
8693
8694
8696 {
8697 return true;
8698 }
8699
8700
8701
8703 {
8704 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8706 }
8707
8710 {
8711 return null;
8712 }
8713
8715 {
8716 return false;
8717 }
8718
8720 {
8721 return false;
8722 }
8723
8727
8728
8730 {
8731 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8732 return module_repairing.CanRepair(this, item_repair_kit);
8733 }
8734
8735
8736 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8737 {
8738 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8739 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8740 }
8741
8742
8744 {
8745
8746
8747
8748
8749
8750
8751
8752
8753 return 1;
8754 }
8755
8756
8757
8759 {
8761 }
8762
8763
8764
8766 {
8768 }
8769
8770
8779 {
8780 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8781
8782 if (player)
8783 {
8784 player.MessageStatus(text);
8785 }
8786 }
8787
8788
8797 {
8798 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8799
8800 if (player)
8801 {
8802 player.MessageAction(text);
8803 }
8804 }
8805
8806
8815 {
8816 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8817
8818 if (player)
8819 {
8820 player.MessageFriendly(text);
8821 }
8822 }
8823
8824
8833 {
8834 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8835
8836 if (player)
8837 {
8838 player.MessageImportant(text);
8839 }
8840 }
8841
8843 {
8844 return true;
8845 }
8846
8847
8848 override bool KindOf(
string tag)
8849 {
8850 bool found = false;
8851 string item_name = this.
GetType();
8854
8855 int array_size = item_tag_array.Count();
8856 for (int i = 0; i < array_size; i++)
8857 {
8858 if (item_tag_array.Get(i) == tag)
8859 {
8860 found = true;
8861 break;
8862 }
8863 }
8864 return found;
8865 }
8866
8867
8869 {
8870
8871 super.OnRPC(sender, rpc_type,ctx);
8872
8873
8874 switch (rpc_type)
8875 {
8876 #ifndef SERVER
8877 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8878 Param2<bool, string> p = new Param2<bool, string>(false, "");
8879
8881 return;
8882
8883 bool play = p.param1;
8884 string soundSet = p.param2;
8885
8886 if (play)
8887 {
8889 {
8891 {
8893 }
8894 }
8895 else
8896 {
8898 }
8899 }
8900 else
8901 {
8903 }
8904
8905 break;
8906 #endif
8907
8908 }
8909
8911 {
8913 }
8914 }
8915
8916
8917
8918
8920 {
8921 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8922 return plugin.GetID(
name);
8923 }
8924
8926 {
8927 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8928 return plugin.GetName(id);
8929 }
8930
8933 {
8934
8935
8936 int varFlags;
8937 if (!ctx.
Read(varFlags))
8938 return;
8939
8940 if (varFlags & ItemVariableFlags.FLOAT)
8941 {
8943 }
8944 }
8945
8947 {
8948
8949 super.SerializeNumericalVars(floats_out);
8950
8951
8952
8954 {
8956 }
8957
8959 {
8961 }
8962
8964 {
8966 }
8967
8969 {
8974 }
8975
8977 {
8979 }
8980 }
8981
8983 {
8984
8985 super.DeSerializeNumericalVars(floats);
8986
8987
8988 int index = 0;
8989 int mask = Math.Round(floats.Get(index));
8990
8991 index++;
8992
8994 {
8996 {
8998 }
8999 else
9000 {
9001 float quantity = floats.Get(index);
9003 }
9004 index++;
9005 }
9006
9008 {
9009 float wet = floats.Get(index);
9011 index++;
9012 }
9013
9015 {
9016 int liquidtype = Math.Round(floats.Get(index));
9018 index++;
9019 }
9020
9022 {
9024 index++;
9026 index++;
9028 index++;
9030 index++;
9031 }
9032
9034 {
9035 int cleanness = Math.Round(floats.Get(index));
9037 index++;
9038 }
9039 }
9040
9042 {
9043 super.WriteVarsToCTX(ctx);
9044
9045
9047 {
9049 }
9050
9052 {
9054 }
9055
9057 {
9059 }
9060
9062 {
9063 int r,g,b,a;
9069 }
9070
9072 {
9074 }
9075 }
9076
9078 {
9079 if (!super.ReadVarsFromCTX(ctx,version))
9080 return false;
9081
9082 int intValue;
9083 float value;
9084
9085 if (version < 140)
9086 {
9087 if (!ctx.
Read(intValue))
9088 return false;
9089
9090 m_VariablesMask = intValue;
9091 }
9092
9094 {
9095 if (!ctx.
Read(value))
9096 return false;
9097
9099 {
9101 }
9102 else
9103 {
9105 }
9106 }
9107
9108 if (version < 140)
9109 {
9111 {
9112 if (!ctx.
Read(value))
9113 return false;
9114 SetTemperatureDirect(value);
9115 }
9116 }
9117
9119 {
9120 if (!ctx.
Read(value))
9121 return false;
9123 }
9124
9126 {
9127 if (!ctx.
Read(intValue))
9128 return false;
9130 }
9131
9133 {
9134 int r,g,b,a;
9136 return false;
9138 return false;
9140 return false;
9142 return false;
9143
9145 }
9146
9148 {
9149 if (!ctx.
Read(intValue))
9150 return false;
9152 }
9153
9154 if (version >= 138 && version < 140)
9155 {
9157 {
9158 if (!ctx.
Read(intValue))
9159 return false;
9160 SetFrozen(intValue);
9161 }
9162 }
9163
9164 return true;
9165 }
9166
9167
9169 {
9172 {
9174 }
9175
9176 if (!super.OnStoreLoad(ctx, version))
9177 {
9179 return false;
9180 }
9181
9182 if (version >= 114)
9183 {
9184 bool hasQuickBarIndexSaved;
9185
9186 if (!ctx.
Read(hasQuickBarIndexSaved))
9187 {
9189 return false;
9190 }
9191
9192 if (hasQuickBarIndexSaved)
9193 {
9194 int itmQBIndex;
9195
9196
9197 if (!ctx.
Read(itmQBIndex))
9198 {
9200 return false;
9201 }
9202
9203 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9204 if (itmQBIndex != -1 && parentPlayer)
9205 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9206 }
9207 }
9208 else
9209 {
9210
9211 PlayerBase player;
9212 int itemQBIndex;
9213 if (version ==
int.
MAX)
9214 {
9215 if (!ctx.
Read(itemQBIndex))
9216 {
9218 return false;
9219 }
9220 }
9221 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9222 {
9223
9224 if (!ctx.
Read(itemQBIndex))
9225 {
9227 return false;
9228 }
9229 if (itemQBIndex != -1 && player)
9230 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9231 }
9232 }
9233
9234 if (version < 140)
9235 {
9236
9237 if (!LoadVariables(ctx, version))
9238 {
9240 return false;
9241 }
9242 }
9243
9244
9246 {
9248 return false;
9249 }
9250 if (version >= 132)
9251 {
9253 if (raib)
9254 {
9256 {
9258 return false;
9259 }
9260 }
9261 }
9262
9264 return true;
9265 }
9266
9267
9268
9270 {
9271 super.OnStoreSave(ctx);
9272
9273 PlayerBase player;
9274 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9275 {
9277
9278 int itemQBIndex = -1;
9279 itemQBIndex = player.FindQuickBarEntityIndex(this);
9280 ctx.
Write(itemQBIndex);
9281 }
9282 else
9283 {
9285 }
9286
9288
9290 if (raib)
9291 {
9293 }
9294 }
9295
9296
9298 {
9299 super.AfterStoreLoad();
9300
9302 {
9304 }
9305
9307 {
9310 }
9311 }
9312
9314 {
9315 super.EEOnAfterLoad();
9316
9318 {
9320 }
9321
9324 }
9325
9327 {
9328 return false;
9329 }
9330
9331
9332
9334 {
9336 {
9337 #ifdef PLATFORM_CONSOLE
9338
9340 {
9342 if (menu)
9343 {
9345 }
9346 }
9347 #endif
9348 }
9349
9351 {
9354 }
9355
9357 {
9358 SetWeightDirty();
9360 }
9362 {
9365 }
9366
9368 {
9371 }
9373 {
9376 }
9377
9378 super.OnVariablesSynchronized();
9379 }
9380
9381
9382
9384 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9385 {
9386 if (!IsServerCheck(allow_client))
9387 return false;
9388
9390 return false;
9391
9394
9395 if (value <= (min + 0.001))
9396 value = min;
9397
9398 if (value == min)
9399 {
9400 if (destroy_config)
9401 {
9402 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9403 if (dstr)
9404 {
9406 this.Delete();
9407 return true;
9408 }
9409 }
9410 else if (destroy_forced)
9411 {
9413 this.Delete();
9414 return true;
9415 }
9416
9418 }
9419
9422
9424 {
9426
9427 if (delta)
9429 }
9430
9432
9433 return false;
9434 }
9435
9436
9438 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9439 {
9441 }
9442
9444 {
9447 }
9448
9450 {
9453 }
9454
9457 {
9458 float value_clamped = Math.Clamp(value, 0, 1);
9460 SetQuantity(result, destroy_config, destroy_forced);
9461 }
9462
9463
9466 {
9468 }
9469
9471 {
9473 }
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9485 {
9486 int slot = -1;
9487 if (GetInventory())
9488 {
9489 InventoryLocation il = new InventoryLocation;
9490 GetInventory().GetCurrentInventoryLocation(il);
9492 }
9493
9495 }
9496
9498 {
9499 float quantity_max = 0;
9500
9502 {
9503 if (attSlotID != -1)
9504 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9505
9506 if (quantity_max <= 0)
9508 }
9509
9510 if (quantity_max <= 0)
9512
9513 return quantity_max;
9514 }
9515
9517 {
9519 }
9520
9522 {
9524 }
9525
9526
9528 {
9530 }
9531
9533 {
9535 }
9536
9538 {
9540 }
9541
9542
9544 {
9545
9546 float weightEx = GetWeightEx();
9547 float special = GetInventoryAndCargoWeight();
9548 return weightEx - special;
9549 }
9550
9551
9553 {
9555 }
9556
9558 {
9560 {
9561 #ifdef DEVELOPER
9562 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9563 {
9564 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9566 }
9567 #endif
9568
9570 }
9571 else if (HasEnergyManager())
9572 {
9573 #ifdef DEVELOPER
9574 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9575 {
9576 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9577 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9578 }
9579 #endif
9580 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9581 }
9582 else
9583 {
9584 #ifdef DEVELOPER
9585 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9586 {
9587 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9588 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9589 }
9590 #endif
9591 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9592 }
9593 }
9594
9597 {
9598 int item_count = 0;
9600
9601 if (GetInventory().GetCargo() != NULL)
9602 {
9603 item_count = GetInventory().GetCargo().GetItemCount();
9604 }
9605
9606 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9607 {
9608 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9609 if (item)
9610 item_count += item.GetNumberOfItems();
9611 }
9612 return item_count;
9613 }
9614
9617 {
9618 float weight = 0;
9619 float wetness = 1;
9620 if (include_wetness)
9623 {
9624 weight = wetness * m_ConfigWeight;
9625 }
9627 {
9628 weight = 1;
9629 }
9630 return weight;
9631 }
9632
9633
9634
9636 {
9637 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9638 {
9639 GameInventory inv = GetInventory();
9640 array<EntityAI> items = new array<EntityAI>;
9642 for (int i = 0; i < items.Count(); i++)
9643 {
9645 if (item)
9646 {
9648 }
9649 }
9650 }
9651 }
9652
9653
9654
9655
9657 {
9658 float energy = 0;
9659 if (HasEnergyManager())
9660 {
9661 energy = GetCompEM().GetEnergy();
9662 }
9663 return energy;
9664 }
9665
9666
9668 {
9669 super.OnEnergyConsumed();
9670
9672 }
9673
9675 {
9676 super.OnEnergyAdded();
9677
9679 }
9680
9681
9683 {
9684 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9685 {
9687 {
9688 float energy_0to1 = GetCompEM().GetEnergy0To1();
9690 }
9691 }
9692 }
9693
9694
9696 {
9697 return ConfigGetFloat("heatIsolation");
9698 }
9699
9701 {
9703 }
9704
9706 {
9707 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9708 if (
GetGame().ConfigIsExisting(paramPath))
9710
9711 return 0.0;
9712 }
9713
9715 {
9716 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9717 if (
GetGame().ConfigIsExisting(paramPath))
9719
9720 return 0.0;
9721 }
9722
9723 override void SetWet(
float value,
bool allow_client =
false)
9724 {
9725 if (!IsServerCheck(allow_client))
9726 return;
9727
9730
9732
9733 m_VarWet = Math.Clamp(value, min, max);
9734
9736 {
9739 }
9740 }
9741
9742 override void AddWet(
float value)
9743 {
9745 }
9746
9748 {
9750 }
9751
9753 {
9755 }
9756
9758 {
9760 }
9761
9763 {
9765 }
9766
9768 {
9770 }
9771
9773 {
9776 if (newLevel != oldLevel)
9777 {
9779 }
9780 }
9781
9783 {
9784 SetWeightDirty();
9785 }
9786
9788 {
9789 return GetWetLevelInternal(
m_VarWet);
9790 }
9791
9792
9793
9795 {
9797 }
9798
9800 {
9802 }
9803
9805 {
9807 }
9808
9810 {
9812 }
9813
9814
9815
9817 {
9818 if (ConfigIsExisting("itemModelLength"))
9819 {
9820 return ConfigGetFloat("itemModelLength");
9821 }
9822 return 0;
9823 }
9824
9826 {
9827 if (ConfigIsExisting("itemAttachOffset"))
9828 {
9829 return ConfigGetFloat("itemAttachOffset");
9830 }
9831 return 0;
9832 }
9833
9834 override void SetCleanness(
int value,
bool allow_client =
false)
9835 {
9836 if (!IsServerCheck(allow_client))
9837 return;
9838
9840
9842
9845 }
9846
9848 {
9850 }
9851
9853 {
9854 return true;
9855 }
9856
9857
9858
9859
9861 {
9863 }
9864
9866 {
9868 }
9869
9870
9871
9872
9873 override void SetColor(
int r,
int g,
int b,
int a)
9874 {
9880 }
9882 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9883 {
9888 }
9889
9891 {
9893 }
9894
9897 {
9898 int r,g,b,a;
9900 r = r/255;
9901 g = g/255;
9902 b = b/255;
9903 a = a/255;
9904 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9905 }
9906
9907
9908
9909 override void SetLiquidType(
int value,
bool allow_client =
false)
9910 {
9911 if (!IsServerCheck(allow_client))
9912 return;
9913
9918 }
9919
9921 {
9922 return ConfigGetInt("varLiquidTypeInit");
9923 }
9924
9926 {
9928 }
9929
9931 {
9933 SetFrozen(false);
9934 }
9935
9938 {
9939 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9940 }
9941
9942
9945 {
9946 PlayerBase nplayer;
9947 if (PlayerBase.CastTo(nplayer, player))
9948 {
9950
9951 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9952 }
9953 }
9954
9955
9958 {
9959 PlayerBase nplayer;
9960 if (PlayerBase.CastTo(nplayer,player))
9961 {
9962
9963 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9964
9965 }
9966
9967
9968 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9969
9970
9971 if (HasEnergyManager())
9972 {
9973 GetCompEM().UpdatePlugState();
9974 }
9975 }
9976
9977
9979 {
9980 super.OnPlacementStarted(player);
9981
9983 }
9984
9985 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9986 {
9988 {
9989 m_AdminLog.OnPlacementComplete(player,
this);
9990 }
9991
9992 super.OnPlacementComplete(player, position, orientation);
9993 }
9994
9995
9996
9997
9998
10000 {
10002 {
10003 return true;
10004 }
10005 else
10006 {
10007 return false;
10008 }
10009 }
10010
10011
10013 {
10015 {
10017 }
10018 }
10019
10020
10022 {
10024 }
10025
10027 {
10029 }
10030
10031 override void InsertAgent(
int agent,
float count = 1)
10032 {
10033 if (count < 1)
10034 return;
10035
10037 }
10038
10041 {
10043 }
10044
10045
10047 {
10049 }
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10093 {
10095 return false;
10096 return true;
10097 }
10098
10100 {
10101
10103 }
10104
10105
10108 {
10109 super.CheckForRoofLimited(timeTresholdMS);
10110
10112 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10113 {
10114 m_PreviousRoofTestTime = time;
10115 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10116 }
10117 }
10118
10119
10121 {
10123 {
10124 return 0;
10125 }
10126
10127 if (GetInventory().GetAttachmentSlotsCount() != 0)
10128 {
10129 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10130 if (filter)
10131 return filter.GetProtectionLevel(type, false, system);
10132 else
10133 return 0;
10134 }
10135
10136 string subclassPath, entryName;
10137
10138 switch (type)
10139 {
10141 entryName = "biological";
10142 break;
10144 entryName = "chemical";
10145 break;
10146 default:
10147 entryName = "biological";
10148 break;
10149 }
10150
10151 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10152
10154 }
10155
10156
10157
10160 {
10161 if (!IsMagazine())
10163
10165 }
10166
10167
10168
10169
10170
10175 {
10176 return true;
10177 }
10178
10180 {
10182 }
10183
10184
10185
10186
10187
10189 {
10190 if (parent)
10191 {
10192 if (parent.IsInherited(DayZInfected))
10193 return true;
10194
10195 if (!parent.IsRuined())
10196 return true;
10197 }
10198
10199 return true;
10200 }
10201
10203 {
10204 if (!super.CanPutAsAttachment(parent))
10205 {
10206 return false;
10207 }
10208
10209 if (!IsRuined() && !parent.IsRuined())
10210 {
10211 return true;
10212 }
10213
10214 return false;
10215 }
10216
10218 {
10219
10220
10221
10222
10223 return super.CanReceiveItemIntoCargo(item);
10224 }
10225
10227 {
10228
10229
10230
10231
10232 GameInventory attachmentInv = attachment.GetInventory();
10234 {
10235 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10236 return false;
10237 }
10238
10239 InventoryLocation loc = new InventoryLocation();
10240 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10241 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10242 return false;
10243
10244 return super.CanReceiveAttachment(attachment, slotId);
10245 }
10246
10248 {
10249 if (!super.CanReleaseAttachment(attachment))
10250 return false;
10251
10252 return GetInventory().AreChildrenAccessible();
10253 }
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10276 {
10277 int id = muzzle_owner.GetMuzzleID();
10278 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10279
10280 if (WPOF_array)
10281 {
10282 for (int i = 0; i < WPOF_array.Count(); i++)
10283 {
10284 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10285
10286 if (WPOF)
10287 {
10288 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10289 }
10290 }
10291 }
10292 }
10293
10294
10296 {
10297 int id = muzzle_owner.GetMuzzleID();
10299
10300 if (WPOBE_array)
10301 {
10302 for (int i = 0; i < WPOBE_array.Count(); i++)
10303 {
10304 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10305
10306 if (WPOBE)
10307 {
10308 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10309 }
10310 }
10311 }
10312 }
10313
10314
10316 {
10317 int id = muzzle_owner.GetMuzzleID();
10318 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10319
10320 if (WPOOH_array)
10321 {
10322 for (int i = 0; i < WPOOH_array.Count(); i++)
10323 {
10324 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10325
10326 if (WPOOH)
10327 {
10328 WPOOH.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.OnUpdate(weapon, 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.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10369 }
10370 }
10371 }
10372 }
10373
10374
10375
10377 {
10379 {
10380 return true;
10381 }
10382
10383 return false;
10384 }
10385
10387 {
10389 {
10390 return true;
10391 }
10392
10393 return false;
10394 }
10395
10397 {
10399 {
10400 return true;
10401 }
10402
10403 return false;
10404 }
10405
10407 {
10408 return false;
10409 }
10410
10413 {
10414 return UATimeSpent.DEFAULT_DEPLOY;
10415 }
10416
10417
10418
10419
10421 {
10423 SetSynchDirty();
10424 }
10425
10427 {
10429 }
10430
10431
10433 {
10434 return false;
10435 }
10436
10439 {
10440 string att_type = "None";
10441
10442 if (ConfigIsExisting("soundAttType"))
10443 {
10444 att_type = ConfigGetString("soundAttType");
10445 }
10446
10448 }
10449
10451 {
10453 }
10454
10455
10456
10457
10458
10462
10464 {
10467
10469 }
10470
10471
10473 {
10475 return;
10476
10478
10481
10484
10485 SoundParameters params = new SoundParameters();
10489 }
10490
10491
10493 {
10495 return;
10496
10498 SetSynchDirty();
10499
10502 }
10503
10504
10506 {
10508 return;
10509
10511 SetSynchDirty();
10512
10515 }
10516
10518 {
10520 }
10521
10523 {
10525 }
10526
10529 {
10530 if (!
GetGame().IsDedicatedServer())
10531 {
10532 if (ConfigIsExisting("attachSoundSet"))
10533 {
10534 string cfg_path = "";
10535 string soundset = "";
10536 string type_name =
GetType();
10537
10540 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10541 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10542
10543 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10544 {
10545 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10546 {
10547 if (cfg_slot_array[i] == slot_type)
10548 {
10549 soundset = cfg_soundset_array[i];
10550 break;
10551 }
10552 }
10553 }
10554
10555 if (soundset != "")
10556 {
10557 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10559 }
10560 }
10561 }
10562 }
10563
10565 {
10566
10567 }
10568
10569 void OnApply(PlayerBase player);
10570
10572 {
10573 return 1.0;
10574 };
10575
10577 {
10579 }
10580
10582 {
10584 }
10585
10587
10589 {
10590 SetDynamicPhysicsLifeTime(0.01);
10592 }
10593
10595 {
10596 array<string> zone_names = new array<string>;
10597 GetDamageZones(zone_names);
10598 for (int i = 0; i < zone_names.Count(); i++)
10599 {
10600 SetHealthMax(zone_names.Get(i),"Health");
10601 }
10602 SetHealthMax("","Health");
10603 }
10604
10607 {
10608 float global_health = GetHealth01("","Health");
10609 array<string> zones = new array<string>;
10610 GetDamageZones(zones);
10611
10612 for (int i = 0; i < zones.Count(); i++)
10613 {
10614 SetHealth01(zones.Get(i),"Health",global_health);
10615 }
10616 }
10617
10620 {
10621 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10622 }
10623
10625 {
10626 if (!hasRootAsPlayer)
10627 {
10628 if (refParentIB)
10629 {
10630
10631 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10632 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10633
10634 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10635 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10636
10639 }
10640 else
10641 {
10642
10645 }
10646 }
10647 }
10648
10650 {
10652 {
10653 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10654 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10655 {
10656 float heatPermCoef = 1.0;
10658 while (ent)
10659 {
10660 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10661 ent = ent.GetHierarchyParent();
10662 }
10663
10664 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10665 }
10666 }
10667 }
10668
10670 {
10671
10672 EntityAI parent = GetHierarchyParent();
10673 if (!parent)
10674 {
10675 hasParent = false;
10676 hasRootAsPlayer = false;
10677 }
10678 else
10679 {
10680 hasParent = true;
10681 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10682 refParentIB =
ItemBase.Cast(parent);
10683 }
10684 }
10685
10686 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10687 {
10688
10689 }
10690
10692 {
10693
10694 return false;
10695 }
10696
10698 {
10699
10700
10701 return false;
10702 }
10703
10705 {
10706
10707 return false;
10708 }
10709
10712 {
10713 return !GetIsFrozen() &&
IsOpen();
10714 }
10715
10717 {
10718 bool hasParent = false, hasRootAsPlayer = false;
10720
10721 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10722 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10723
10724 if (wwtu || foodDecay)
10725 {
10729
10730 if (processWetness || processTemperature || processDecay)
10731 {
10733
10734 if (processWetness)
10735 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10736
10737 if (processTemperature)
10739
10740 if (processDecay)
10741 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10742 }
10743 }
10744 }
10745
10748 {
10750 }
10751
10753 {
10756
10757 return super.GetTemperatureFreezeThreshold();
10758 }
10759
10761 {
10764
10765 return super.GetTemperatureThawThreshold();
10766 }
10767
10769 {
10772
10773 return super.GetItemOverheatThreshold();
10774 }
10775
10777 {
10779 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10780
10781 return super.GetTemperatureFreezeTime();
10782 }
10783
10785 {
10787 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10788
10789 return super.GetTemperatureThawTime();
10790 }
10791
10796
10798 {
10799 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10800 }
10801
10803 {
10804 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10805 }
10806
10809 {
10811 }
10812
10814 {
10816 }
10817
10819 {
10821 }
10822
10825 {
10826 return null;
10827 }
10828
10831 {
10832 return false;
10833 }
10834
10836 {
10838 {
10841 if (!trg)
10842 {
10844 explosive = this;
10845 }
10846
10847 explosive.PairRemote(trg);
10849
10850 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10851 trg.SetPersistentPairID(persistentID);
10852 explosive.SetPersistentPairID(persistentID);
10853
10854 return true;
10855 }
10856 return false;
10857 }
10858
10861 {
10862 float ret = 1.0;
10865 ret *= GetHealth01();
10866
10867 return ret;
10868 }
10869
10870 #ifdef DEVELOPER
10871 override void SetDebugItem()
10872 {
10873 super.SetDebugItem();
10874 _itemBase = this;
10875 }
10876
10878 {
10879 string text = super.GetDebugText();
10880
10882 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10883
10884 return text;
10885 }
10886 #endif
10887
10889 {
10890 return true;
10891 }
10892
10894
10896
10898 {
10901 }
10902
10903
10911
10927}
10928
10930{
10932 if (entity)
10933 {
10934 bool is_item = entity.IsInherited(
ItemBase);
10935 if (is_item && full_quantity)
10936 {
10939 }
10940 }
10941 else
10942 {
10944 return NULL;
10945 }
10946 return entity;
10947}
10948
10950{
10951 if (item)
10952 {
10953 if (health > 0)
10954 item.SetHealth("", "", health);
10955
10956 if (item.CanHaveTemperature())
10957 {
10959 if (item.CanFreeze())
10960 item.SetFrozen(false);
10961 }
10962
10963 if (item.HasEnergyManager())
10964 {
10965 if (quantity >= 0)
10966 {
10967 item.GetCompEM().SetEnergy0To1(quantity);
10968 }
10969 else
10970 {
10972 }
10973 }
10974 else if (item.IsMagazine())
10975 {
10976 Magazine mag = Magazine.Cast(item);
10977 if (quantity >= 0)
10978 {
10979 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10980 }
10981 else
10982 {
10984 }
10985
10986 }
10987 else
10988 {
10989 if (quantity >= 0)
10990 {
10991 item.SetQuantityNormalized(quantity, false);
10992 }
10993 else
10994 {
10996 }
10997
10998 }
10999 }
11000}
11001
11002#ifdef DEVELOPER
11004#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.