6331{
6333 {
6334 return true;
6335 }
6336};
6337
6338
6339
6341{
6345
6347
6350
6351
6352
6353
6354
6363
6369
6374
6379
6400 protected bool m_IsResultOfSplit
6401
6403
6408
6409
6410
6412
6416
6417
6418
6420
6423
6424
6425
6431
6432
6440
6443
6444
6446
6447
6449
6450
6455
6456
6461
6462
6464
6465
6467 {
6472
6473 if (!
GetGame().IsDedicatedServer())
6474 {
6476 {
6478
6480 {
6482 }
6483 }
6484
6487 }
6488
6489 m_OldLocation = null;
6490
6492 {
6494 }
6495
6496 if (ConfigIsExisting("headSelectionsToHide"))
6497 {
6500 }
6501
6503 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6504 {
6506 }
6507
6509
6510 m_IsResultOfSplit = false;
6511
6513 }
6514
6516 {
6517 super.InitItemVariables();
6518
6524 m_Count = ConfigGetInt(
"count");
6525
6528
6533
6536
6541
6553
6557
6558
6561 if (ConfigIsExisting("canBeSplit"))
6562 {
6565 }
6566
6568 if (ConfigIsExisting("itemBehaviour"))
6570
6571
6574 RegisterNetSyncVariableInt("m_VarLiquidType");
6575 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6576
6577 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6578 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6579 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6580
6581 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6582 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6583 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6584 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6585
6586 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6587 RegisterNetSyncVariableBool("m_IsTakeable");
6588 RegisterNetSyncVariableBool("m_IsHologram");
6589
6592 {
6595 }
6596
6598
6600 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6602
6603 }
6604
6606 {
6608 }
6609
6611 {
6614 {
6619 }
6620 }
6621
6622 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6623 {
6625 {
6628 }
6629
6631 }
6632
6634 {
6640 }
6641
6643
6645 {
6647
6648 if (!action)
6649 {
6650 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6651 return;
6652 }
6653
6655 if (!ai)
6656 {
6658 return;
6659 }
6660
6662 if (!action_array)
6663 {
6664 action_array = new array<ActionBase_Basic>;
6666 }
6667 if (LogManager.IsActionLogEnable())
6668 {
6669 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6670 }
6671
6672 if (action_array.Find(action) != -1)
6673 {
6674 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6675 }
6676 else
6677 {
6678 action_array.Insert(action);
6679 }
6680 }
6681
6683 {
6685 ActionBase action = player.GetActionManager().GetAction(actionName);
6688
6689 if (action_array)
6690 {
6691 action_array.RemoveItem(action);
6692 }
6693 }
6694
6695
6696
6698 {
6699 ActionOverrideData overrideData = new ActionOverrideData();
6703
6705 if (!actionMap)
6706 {
6709 }
6710
6711 actionMap.Insert(this.
Type(), overrideData);
6712
6713 }
6714
6716
6718
6719
6721 {
6724
6727
6728 string config_to_search = "CfgVehicles";
6729 string muzzle_owner_config;
6730
6732 {
6733 if (IsInherited(Weapon))
6734 config_to_search = "CfgWeapons";
6735
6736 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6737
6738 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6739
6741
6742 if (config_OnFire_subclass_count > 0)
6743 {
6744 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6745
6746 for (int i = 0; i < config_OnFire_subclass_count; i++)
6747 {
6748 string particle_class = "";
6750 string config_OnFire_entry = config_OnFire_class + particle_class;
6751 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6752 WPOF_array.Insert(WPOF);
6753 }
6754
6755
6757 }
6758 }
6759
6761 {
6762 config_to_search = "CfgWeapons";
6763 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6764
6765 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6766
6768
6769 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6770 {
6771 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6772
6773 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6774 {
6775 string particle_class2 = "";
6777 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6778 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6779 WPOBE_array.Insert(WPOBE);
6780 }
6781
6782
6784 }
6785 }
6786 }
6787
6788
6790 {
6793
6795 {
6796 string config_to_search = "CfgVehicles";
6797
6798 if (IsInherited(Weapon))
6799 config_to_search = "CfgWeapons";
6800
6801 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6802 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6803
6804 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6805 {
6806
6808
6810 {
6812 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6814 return;
6815 }
6816
6819
6820
6821
6823 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6824
6825 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6826 {
6827 string particle_class = "";
6829 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6831
6832 if (entry_type == CT_CLASS)
6833 {
6834 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6835 WPOOH_array.Insert(WPOF);
6836 }
6837 }
6838
6839
6841 }
6842 }
6843 }
6844
6846 {
6848 }
6849
6851 {
6853 {
6855
6858
6861
6862 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6863 }
6864 }
6865
6867 {
6869 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6870
6872 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6873
6875 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6876
6878 {
6880 }
6881 }
6882
6884 {
6886 }
6887
6889 {
6892 else
6894
6896 {
6899 }
6900 else
6901 {
6904
6907 }
6908
6910 }
6911
6913 {
6915 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6916 }
6917
6919 {
6921 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6923 }
6924
6926 {
6928 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6929 }
6930
6932 {
6935
6936 OverheatingParticle OP = new OverheatingParticle();
6941
6943 }
6944
6946 {
6949
6950 return -1;
6951 }
6952
6954 {
6956 {
6959
6960 for (int i = count; i > 0; --i)
6961 {
6962 int id = i - 1;
6965
6968
6969 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6970 {
6971 if (p)
6972 {
6975 }
6976 }
6977 }
6978 }
6979 }
6980
6982 {
6984 {
6986 {
6987 int id = i - 1;
6989
6990 if (OP)
6991 {
6993
6994 if (p)
6995 {
6997 }
6998
6999 delete OP;
7000 }
7001 }
7002
7005 }
7006 }
7007
7010 {
7011 return 0.0;
7012 }
7013
7014
7016 {
7017 return 250;
7018 }
7019
7021 {
7022 return 0;
7023 }
7024
7027 {
7029 return true;
7030
7031 return false;
7032 }
7033
7036 {
7039
7041 {
7043 }
7044 else
7045 {
7046
7048 }
7049
7051 }
7052
7059 {
7060 return -1;
7061 }
7062
7063
7064
7065
7067 {
7069 {
7071 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7072
7073 if (r_index >= 0)
7074 {
7075 InventoryLocation r_il = new InventoryLocation;
7076 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7077
7078 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7081 {
7082 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7083 }
7085 {
7086 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7087 }
7088
7089 }
7090
7091 player.GetHumanInventory().ClearUserReservedLocation(this);
7092 }
7093
7096 }
7097
7098
7099
7100
7102 {
7103 return ItemBase.m_DebugActionsMask;
7104 }
7105
7107 {
7108 return ItemBase.m_DebugActionsMask & mask;
7109 }
7110
7112 {
7113 ItemBase.m_DebugActionsMask = mask;
7114 }
7115
7117 {
7118 ItemBase.m_DebugActionsMask |= mask;
7119 }
7120
7122 {
7123 ItemBase.m_DebugActionsMask &= ~mask;
7124 }
7125
7127 {
7129 {
7131 }
7132 else
7133 {
7135 }
7136 }
7137
7138
7140 {
7141 if (GetEconomyProfile())
7142 {
7143 float q_max = GetEconomyProfile().GetQuantityMax();
7144 if (q_max > 0)
7145 {
7146 float q_min = GetEconomyProfile().GetQuantityMin();
7147 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7148
7150 {
7151 ComponentEnergyManager comp = GetCompEM();
7153 {
7155 }
7156 }
7158 {
7160
7161 }
7162
7163 }
7164 }
7165 }
7166
7169 {
7170 EntityAI parent = GetHierarchyParent();
7171
7172 if (parent)
7173 {
7174 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7175 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7176 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7177 }
7178 }
7179
7182 {
7183 EntityAI parent = GetHierarchyParent();
7184
7185 if (parent)
7186 {
7187 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7188 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7189 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7190 }
7191 }
7192
7194 {
7195
7196
7197
7198
7200
7202 {
7203 if (ScriptInputUserData.CanStoreInputUserData())
7204 {
7205 ScriptInputUserData ctx = new ScriptInputUserData;
7211 ctx.
Write(use_stack_max);
7214
7216 {
7217 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7218 }
7219 }
7220 }
7221 else if (!
GetGame().IsMultiplayer())
7222 {
7224 }
7225 }
7226
7228 {
7230 }
7231
7233 {
7235 }
7236
7238 {
7240 }
7241
7243 {
7244
7245 return false;
7246 }
7247
7249 {
7250 return false;
7251 }
7252
7256 {
7257 return false;
7258 }
7259
7261 {
7262 return "";
7263 }
7264
7266
7268 {
7269 return false;
7270 }
7271
7273 {
7274 return true;
7275 }
7276
7277
7278
7280 {
7281 return true;
7282 }
7283
7285 {
7286 return true;
7287 }
7288
7290 {
7291 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7293 }
7294
7296 {
7298 }
7299
7301 {
7303 if (!is_being_placed)
7305 SetSynchDirty();
7306 }
7307
7308
7310
7312 {
7314 }
7315
7317 {
7319 }
7320
7322 {
7323 return 1;
7324 }
7325
7327 {
7328 return false;
7329 }
7330
7332 {
7334 SetSynchDirty();
7335 }
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7372 {
7373 super.OnMovedInsideCargo(container);
7374
7375 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7376 }
7377
7378 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7379 {
7380 super.EEItemLocationChanged(oldLoc,newLoc);
7381
7382 PlayerBase new_player = null;
7383 PlayerBase old_player = null;
7384
7385 if (newLoc.GetParent())
7386 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7387
7388 if (oldLoc.GetParent())
7389 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7390
7392 {
7393 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7394
7395 if (r_index >= 0)
7396 {
7397 InventoryLocation r_il = new InventoryLocation;
7398 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7399
7400 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7403 {
7404 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7405 }
7407 {
7408 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7409 }
7410
7411 }
7412 }
7413
7415 {
7416 if (new_player)
7417 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7418
7419 if (new_player == old_player)
7420 {
7421
7422 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7423 {
7425 {
7426 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7427 {
7428 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7429 }
7430 }
7431 else
7432 {
7433 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7434 }
7435 }
7436
7437 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7438 {
7439 int type = oldLoc.GetType();
7441 {
7442 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7443 }
7445 {
7446 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7447 }
7448 }
7449 if (!m_OldLocation)
7450 {
7451 m_OldLocation = new InventoryLocation;
7452 }
7453 m_OldLocation.Copy(oldLoc);
7454 }
7455 else
7456 {
7457 if (m_OldLocation)
7458 {
7459 m_OldLocation.Reset();
7460 }
7461 }
7462
7464 }
7465 else
7466 {
7467 if (new_player)
7468 {
7469 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7470 if (res_index >= 0)
7471 {
7472 InventoryLocation il = new InventoryLocation;
7473 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7475 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7478 {
7479 il.
GetParent().GetOnReleaseLock().Invoke(it);
7480 }
7482 {
7484 }
7485
7486 }
7487 }
7489 {
7490
7492 }
7493
7494 if (m_OldLocation)
7495 {
7496 m_OldLocation.Reset();
7497 }
7498 }
7499 }
7500
7501 override void EOnContact(IEntity other, Contact extra)
7502 {
7504 {
7505 int liquidType = -1;
7507 if (impactSpeed > 0.0)
7508 {
7510 #ifndef SERVER
7512 #else
7514 SetSynchDirty();
7515 #endif
7517 }
7518 }
7519
7520 #ifdef SERVER
7521 if (GetCompEM() && GetCompEM().IsPlugged())
7522 {
7523 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7524 GetCompEM().UnplugThis();
7525 }
7526 #endif
7527 }
7528
7530
7532 {
7534 }
7535
7537 {
7538
7539 }
7540
7542 {
7543 super.OnItemLocationChanged(old_owner, new_owner);
7544
7545 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7546 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7547
7548 if (!relatedPlayer && playerNew)
7549 relatedPlayer = playerNew;
7550
7551 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7552 {
7554 if (actionMgr)
7555 {
7556 ActionBase currentAction = actionMgr.GetRunningAction();
7557 if (currentAction)
7559 }
7560 }
7561
7562 Man ownerPlayerOld = null;
7563 Man ownerPlayerNew = null;
7564
7565 if (old_owner)
7566 {
7567 if (old_owner.
IsMan())
7568 {
7569 ownerPlayerOld = Man.Cast(old_owner);
7570 }
7571 else
7572 {
7573 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7574 }
7575 }
7576 else
7577 {
7579 {
7581
7582 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7583 {
7584 GetCompEM().UnplugThis();
7585 }
7586 }
7587 }
7588
7589 if (new_owner)
7590 {
7591 if (new_owner.
IsMan())
7592 {
7593 ownerPlayerNew = Man.Cast(new_owner);
7594 }
7595 else
7596 {
7597 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7598 }
7599 }
7600
7601 if (ownerPlayerOld != ownerPlayerNew)
7602 {
7603 if (ownerPlayerOld)
7604 {
7605 array<EntityAI> subItemsExit = new array<EntityAI>;
7607 for (int i = 0; i < subItemsExit.Count(); i++)
7608 {
7611 }
7612 }
7613
7614 if (ownerPlayerNew)
7615 {
7616 array<EntityAI> subItemsEnter = new array<EntityAI>;
7618 for (int j = 0; j < subItemsEnter.Count(); j++)
7619 {
7622 }
7623 }
7624 }
7625 else if (ownerPlayerNew != null)
7626 {
7627 PlayerBase nplayer;
7628 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7629 {
7630 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7632 for (int k = 0; k < subItemsUpdate.Count(); k++)
7633 {
7635 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7636 }
7637 }
7638 }
7639
7640 if (old_owner)
7641 old_owner.OnChildItemRemoved(this);
7642 if (new_owner)
7643 new_owner.OnChildItemReceived(this);
7644 }
7645
7646
7648 {
7649 super.EEDelete(parent);
7650 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7651 if (player)
7652 {
7654
7655 if (player.IsAlive())
7656 {
7657 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7658 if (r_index >= 0)
7659 {
7660 InventoryLocation r_il = new InventoryLocation;
7661 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7662
7663 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7666 {
7667 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7668 }
7670 {
7671 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7672 }
7673
7674 }
7675
7676 player.RemoveQuickBarEntityShortcut(this);
7677 }
7678 }
7679 }
7680
7682 {
7683 super.EEKilled(killer);
7684
7687 {
7688 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7689 {
7690 if (IsMagazine())
7691 {
7692 if (Magazine.Cast(this).GetAmmoCount() > 0)
7693 {
7695 }
7696 }
7697 else
7698 {
7700 }
7701 }
7702 }
7703 }
7704
7706 {
7707 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7708
7709 super.OnWasAttached(parent, slot_id);
7710
7713
7715 }
7716
7718 {
7719 super.OnWasDetached(parent, slot_id);
7720
7723 }
7724
7726 {
7727 int idx;
7730
7731 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7732 if (inventory_slots.Count() < 1)
7733 {
7734 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7735 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7736 }
7737 else
7738 {
7739 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7740 }
7741
7742 idx = inventory_slots.Find(slot);
7743 if (idx < 0)
7744 return "";
7745
7746 return attach_types.Get(idx);
7747 }
7748
7750 {
7751 int idx = -1;
7752 string slot;
7753
7756
7757 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7758 if (inventory_slots.Count() < 1)
7759 {
7760 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7761 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7762 }
7763 else
7764 {
7765 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7766 if (detach_types.Count() < 1)
7767 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7768 }
7769
7770 for (int i = 0; i < inventory_slots.Count(); i++)
7771 {
7772 slot = inventory_slots.Get(i);
7773 }
7774
7775 if (slot != "")
7776 {
7777 if (detach_types.Count() == 1)
7778 idx = 0;
7779 else
7780 idx = inventory_slots.Find(slot);
7781 }
7782 if (idx < 0)
7783 return "";
7784
7785 return detach_types.Get(idx);
7786 }
7787
7789 {
7790
7792
7793
7794 float min_time = 1;
7795 float max_time = 3;
7796 float delay = Math.RandomFloat(min_time, max_time);
7797
7798 explode_timer.Run(delay, this, "DoAmmoExplosion");
7799 }
7800
7802 {
7803 Magazine magazine = Magazine.Cast(this);
7804 int pop_sounds_count = 6;
7805 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7806
7807
7808 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7809 string sound_name = pop_sounds[ sound_idx ];
7811
7812
7813 magazine.ServerAddAmmoCount(-1);
7814
7815
7816 float min_temp_to_explode = 100;
7817
7818 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7819 {
7821 }
7822 }
7823
7824
7825 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7826 {
7827 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7828
7829 const int CHANCE_DAMAGE_CARGO = 4;
7830 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7831 const int CHANCE_DAMAGE_NOTHING = 2;
7832
7834 {
7835 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7836 int chances;
7837 int rnd;
7838
7839 if (GetInventory().GetCargo())
7840 {
7841 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7842 rnd = Math.RandomInt(0,chances);
7843
7844 if (rnd < CHANCE_DAMAGE_CARGO)
7845 {
7847 }
7848 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7849 {
7851 }
7852 }
7853 else
7854 {
7855 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7856 rnd = Math.RandomInt(0,chances);
7857
7858 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7859 {
7861 }
7862 }
7863 }
7864 }
7865
7867 {
7868 if (GetInventory().GetCargo())
7869 {
7870 int item_count = GetInventory().GetCargo().GetItemCount();
7871 if (item_count > 0)
7872 {
7873 int random_pick = Math.RandomInt(0, item_count);
7875 if (!item.IsExplosive())
7876 {
7877 item.AddHealth("","",damage);
7878 return true;
7879 }
7880 }
7881 }
7882 return false;
7883 }
7884
7886 {
7887 int attachment_count = GetInventory().AttachmentCount();
7888 if (attachment_count > 0)
7889 {
7890 int random_pick = Math.RandomInt(0, attachment_count);
7891 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7892 if (!attachment.IsExplosive())
7893 {
7894 attachment.AddHealth("","",damage);
7895 return true;
7896 }
7897 }
7898 return false;
7899 }
7900
7902 {
7904 }
7905
7907 {
7909 return GetInventory().CanRemoveEntity();
7910
7911 return false;
7912 }
7913
7915 {
7917 return;
7918
7920 {
7921 if (ScriptInputUserData.CanStoreInputUserData())
7922 {
7923 ScriptInputUserData ctx = new ScriptInputUserData;
7928 ctx.
Write(destination_entity);
7932 }
7933 }
7934 else if (!
GetGame().IsMultiplayer())
7935 {
7937 }
7938 }
7939
7941 {
7943 return;
7944
7945 float split_quantity_new;
7949 InventoryLocation loc = new InventoryLocation;
7950
7951 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7952 {
7954 split_quantity_new = stack_max;
7955 else
7957
7958 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7959 if (new_item)
7960 {
7961 new_item.SetResultOfSplit(true);
7962 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7964 new_item.SetQuantity(split_quantity_new);
7965 }
7966 }
7967 else if (destination_entity && slot_id == -1)
7968 {
7969 if (quantity > stack_max)
7970 split_quantity_new = stack_max;
7971 else
7972 split_quantity_new = quantity;
7973
7975 {
7978 }
7979
7980 if (new_item)
7981 {
7982 new_item.SetResultOfSplit(true);
7983 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7985 new_item.SetQuantity(split_quantity_new);
7986 }
7987 }
7988 else
7989 {
7990 if (stack_max != 0)
7991 {
7993 {
7995 }
7996
7997 if (split_quantity_new == 0)
7998 {
7999 if (!
GetGame().IsMultiplayer())
8000 player.PhysicalPredictiveDropItem(this);
8001 else
8002 player.ServerDropEntity(this);
8003 return;
8004 }
8005
8007
8008 if (new_item)
8009 {
8010 new_item.SetResultOfSplit(true);
8011 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8013 new_item.SetQuantity(stack_max);
8014 new_item.PlaceOnSurface();
8015 }
8016 }
8017 }
8018 }
8019
8021 {
8023 return;
8024
8025 float split_quantity_new;
8029 InventoryLocation loc = new InventoryLocation;
8030
8031 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8032 {
8034 split_quantity_new = stack_max;
8035 else
8037
8038 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8039 if (new_item)
8040 {
8041 new_item.SetResultOfSplit(true);
8042 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8044 new_item.SetQuantity(split_quantity_new);
8045 }
8046 }
8047 else if (destination_entity && slot_id == -1)
8048 {
8049 if (quantity > stack_max)
8050 split_quantity_new = stack_max;
8051 else
8052 split_quantity_new = quantity;
8053
8055 {
8058 }
8059
8060 if (new_item)
8061 {
8062 new_item.SetResultOfSplit(true);
8063 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8065 new_item.SetQuantity(split_quantity_new);
8066 }
8067 }
8068 else
8069 {
8070 if (stack_max != 0)
8071 {
8073 {
8075 }
8076
8078
8079 if (new_item)
8080 {
8081 new_item.SetResultOfSplit(true);
8082 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8084 new_item.SetQuantity(stack_max);
8085 new_item.PlaceOnSurface();
8086 }
8087 }
8088 }
8089 }
8090
8092 {
8094 return;
8095
8097 {
8098 if (ScriptInputUserData.CanStoreInputUserData())
8099 {
8100 ScriptInputUserData ctx = new ScriptInputUserData;
8105 dst.WriteToContext(ctx);
8107 }
8108 }
8109 else if (!
GetGame().IsMultiplayer())
8110 {
8112 }
8113 }
8114
8116 {
8118 return;
8119
8121 {
8122 if (ScriptInputUserData.CanStoreInputUserData())
8123 {
8124 ScriptInputUserData ctx = new ScriptInputUserData;
8129 ctx.
Write(destination_entity);
8135 }
8136 }
8137 else if (!
GetGame().IsMultiplayer())
8138 {
8140 }
8141 }
8142
8144 {
8146 }
8147
8149 {
8151 return this;
8152
8154 float split_quantity_new;
8156 if (dst.IsValid())
8157 {
8158 int slot_id = dst.GetSlot();
8160
8161 if (quantity > stack_max)
8162 split_quantity_new = stack_max;
8163 else
8164 split_quantity_new = quantity;
8165
8167
8168 if (new_item)
8169 {
8170 new_item.SetResultOfSplit(true);
8171 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8174 }
8175
8176 return new_item;
8177 }
8178
8179 return null;
8180 }
8181
8183 {
8185 return;
8186
8188 float split_quantity_new;
8190 if (destination_entity)
8191 {
8193 if (quantity > stackable)
8194 split_quantity_new = stackable;
8195 else
8196 split_quantity_new = quantity;
8197
8198 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8199 if (new_item)
8200 {
8201 new_item.SetResultOfSplit(true);
8202 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8204 new_item.SetQuantity(split_quantity_new);
8205 }
8206 }
8207 }
8208
8210 {
8212 return;
8213
8215 {
8216 if (ScriptInputUserData.CanStoreInputUserData())
8217 {
8218 ScriptInputUserData ctx = new ScriptInputUserData;
8223 ItemBase destination_entity =
this;
8224 ctx.
Write(destination_entity);
8228 }
8229 }
8230 else if (!
GetGame().IsMultiplayer())
8231 {
8233 }
8234 }
8235
8237 {
8239 return;
8240
8242 float split_quantity_new;
8244 if (player)
8245 {
8247 if (quantity > stackable)
8248 split_quantity_new = stackable;
8249 else
8250 split_quantity_new = quantity;
8251
8252 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8253 new_item =
ItemBase.Cast(in_hands);
8254 if (new_item)
8255 {
8256 new_item.SetResultOfSplit(true);
8257 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8259 new_item.SetQuantity(split_quantity_new);
8260 }
8261 }
8262 }
8263
8265 {
8267 return;
8268
8270 float split_quantity_new = Math.Floor(quantity * 0.5);
8271
8273
8274 if (new_item)
8275 {
8276 if (new_item.GetQuantityMax() < split_quantity_new)
8277 {
8278 split_quantity_new = new_item.GetQuantityMax();
8279 }
8280
8281 new_item.SetResultOfSplit(true);
8282 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8283
8285 {
8288 }
8289 else
8290 {
8293 }
8294 }
8295 }
8296
8298 {
8300 return;
8301
8303 float split_quantity_new = Math.Floor(quantity / 2);
8304
8305 InventoryLocation invloc = new InventoryLocation;
8307
8309 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8310
8311 if (new_item)
8312 {
8313 if (new_item.GetQuantityMax() < split_quantity_new)
8314 {
8315 split_quantity_new = new_item.GetQuantityMax();
8316 }
8318 {
8321 }
8322 else
8323 {
8326 }
8327 }
8328 }
8329
8332 {
8333 SetWeightDirty();
8335
8336 if (parent)
8337 parent.OnAttachmentQuantityChangedEx(this, delta);
8338
8340 {
8342 {
8344 }
8346 {
8347 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8349 }
8350 }
8351
8352 }
8353
8356 {
8357
8358 }
8359
8362 {
8364 }
8365
8367 {
8368 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8369
8371 {
8372 if (newLevel == GameConstants.STATE_RUINED)
8373 {
8375 EntityAI parent = GetHierarchyParent();
8376 if (parent && parent.IsFireplace())
8377 {
8378 CargoBase cargo = GetInventory().GetCargo();
8379 if (cargo)
8380 {
8382 {
8384 }
8385 }
8386 }
8387 }
8388
8390 {
8391
8393 return;
8394 }
8395
8396 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8397 {
8399 }
8400 }
8401 }
8402
8403
8405 {
8406 super.OnRightClick();
8407
8409 {
8411 {
8412 if (ScriptInputUserData.CanStoreInputUserData())
8413 {
8414 vector m4[4];
8416
8417 EntityAI root = GetHierarchyRoot();
8418
8419 InventoryLocation dst = new InventoryLocation;
8421 {
8422 if (root)
8423 {
8424 root.GetTransform(m4);
8426 }
8427 else
8428 GetInventory().GetCurrentInventoryLocation(dst);
8429 }
8430 else
8431 {
8433
8434
8435 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8436 {
8437 if (root)
8438 {
8439 root.GetTransform(m4);
8441 }
8442 else
8443 GetInventory().GetCurrentInventoryLocation(dst);
8444 }
8445 else
8446 {
8447 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8448 }
8449 }
8450
8451 ScriptInputUserData ctx = new ScriptInputUserData;
8459 }
8460 }
8461 else if (!
GetGame().IsMultiplayer())
8462 {
8464 }
8465 }
8466 }
8467
8468 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8469 {
8470
8471 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8472 return false;
8473
8474 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8475 return false;
8476
8477
8479 return false;
8480
8481
8482 Magazine mag = Magazine.Cast(this);
8483 if (mag)
8484 {
8485 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8486 return false;
8487
8488 if (stack_max_limit)
8489 {
8490 Magazine other_mag = Magazine.Cast(other_item);
8491 if (other_item)
8492 {
8493 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8494 return false;
8495 }
8496
8497 }
8498 }
8499 else
8500 {
8501
8503 return false;
8504
8506 return false;
8507 }
8508
8509 PlayerBase player = null;
8510 if (CastTo(player, GetHierarchyRootPlayer()))
8511 {
8512 if (player.GetInventory().HasAttachment(this))
8513 return false;
8514
8515 if (player.IsItemsToDelete())
8516 return false;
8517 }
8518
8519 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8520 return false;
8521
8522 int slotID;
8524 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8525 return false;
8526
8527 return true;
8528 }
8529
8531 {
8533 }
8534
8536 {
8537 return m_IsResultOfSplit;
8538 }
8539
8541 {
8542 m_IsResultOfSplit = value;
8543 }
8544
8546 {
8548 }
8549
8551 {
8552 float other_item_quantity = other_item.GetQuantity();
8553 float this_free_space;
8554
8556
8558
8559 if (other_item_quantity > this_free_space)
8560 {
8561 return this_free_space;
8562 }
8563 else
8564 {
8565 return other_item_quantity;
8566 }
8567 }
8568
8570 {
8572 }
8573
8575 {
8577 return;
8578
8579 if (!IsMagazine() && other_item)
8580 {
8582 if (quantity_used != 0)
8583 {
8584 float hp1 = GetHealth01("","");
8585 float hp2 = other_item.GetHealth01("","");
8586 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8587 hpResult = hpResult / (
GetQuantity() + quantity_used);
8588
8589 hpResult *= GetMaxHealth();
8590 Math.Round(hpResult);
8591 SetHealth("", "Health", hpResult);
8592
8594 other_item.AddQuantity(-quantity_used);
8595 }
8596 }
8598 }
8599
8601 {
8602 #ifdef SERVER
8603 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8604 GetHierarchyParent().IncreaseLifetimeUp();
8605 #endif
8606 };
8607
8609 {
8610 PlayerBase p = PlayerBase.Cast(player);
8611
8612 array<int> recipesIds = p.m_Recipes;
8613 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8614 if (moduleRecipesManager)
8615 {
8616 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8617 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8618 }
8619
8620 for (int i = 0;i < recipesIds.Count(); i++)
8621 {
8622 int key = recipesIds.Get(i);
8623 string recipeName = moduleRecipesManager.GetRecipeName(key);
8625 }
8626 }
8627
8628
8629 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8630 {
8631 super.GetDebugActions(outputList);
8632
8633
8638
8639
8643
8647
8648
8651
8652
8654 {
8657 }
8658
8660
8663
8667 }
8668
8669
8670
8671
8673 {
8674 super.OnAction(action_id, player, ctx);
8675 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8676 {
8677 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8678 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8679 PlayerBase p = PlayerBase.Cast(player);
8680 if (
EActions.RECIPES_RANGE_START < 1000)
8681 {
8682 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8683 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8684 }
8685 }
8686 #ifndef SERVER
8687 else if (action_id ==
EActions.WATCH_PLAYER)
8688 {
8689 PluginDeveloper.SetDeveloperItemClientEx(player);
8690 }
8691 #endif
8693 {
8694 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8695 {
8696 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8697 OnDebugButtonPressServer(id + 1);
8698 }
8699
8700 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8701 {
8702 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8704 }
8705
8706 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8707 {
8708 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8710 }
8711
8712 else if (action_id ==
EActions.ADD_QUANTITY)
8713 {
8714 if (IsMagazine())
8715 {
8716 Magazine mag = Magazine.Cast(this);
8717 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8718 }
8719 else
8720 {
8722 }
8723
8724 if (m_EM)
8725 {
8726 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8727 }
8728
8729 }
8730
8731 else if (action_id ==
EActions.REMOVE_QUANTITY)
8732 {
8733 if (IsMagazine())
8734 {
8735 Magazine mag2 = Magazine.Cast(this);
8736 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8737 }
8738 else
8739 {
8741 }
8742 if (m_EM)
8743 {
8744 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8745 }
8746
8747 }
8748
8749 else if (action_id ==
EActions.SET_QUANTITY_0)
8750 {
8752
8753 if (m_EM)
8754 {
8755 m_EM.SetEnergy(0);
8756 }
8757 }
8758
8759 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8760 {
8762
8763 if (m_EM)
8764 {
8765 m_EM.SetEnergy(m_EM.GetEnergyMax());
8766 }
8767 }
8768
8769 else if (action_id ==
EActions.ADD_HEALTH)
8770 {
8771 AddHealth("","",GetMaxHealth("","Health")/5);
8772 }
8773 else if (action_id ==
EActions.REMOVE_HEALTH)
8774 {
8775 AddHealth("","",-GetMaxHealth("","Health")/5);
8776 }
8777 else if (action_id ==
EActions.DESTROY_HEALTH)
8778 {
8779 SetHealth01("","",0);
8780 }
8781 else if (action_id ==
EActions.WATCH_ITEM)
8782 {
8784 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8785 #ifdef DEVELOPER
8786 SetDebugDeveloper_item(this);
8787 #endif
8788 }
8789
8790 else if (action_id ==
EActions.ADD_TEMPERATURE)
8791 {
8792 AddTemperature(20);
8793
8794 }
8795
8796 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8797 {
8798 AddTemperature(-20);
8799
8800 }
8801
8802 else if (action_id ==
EActions.FLIP_FROZEN)
8803 {
8804 SetFrozen(!GetIsFrozen());
8805
8806 }
8807
8808 else if (action_id ==
EActions.ADD_WETNESS)
8809 {
8811
8812 }
8813
8814 else if (action_id ==
EActions.REMOVE_WETNESS)
8815 {
8817
8818 }
8819
8820 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8821 {
8824
8825
8826 }
8827
8828 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8829 {
8832 }
8833
8834 else if (action_id ==
EActions.MAKE_SPECIAL)
8835 {
8836 auto debugParams = DebugSpawnParams.WithPlayer(player);
8837 OnDebugSpawnEx(debugParams);
8838 }
8839
8840 else if (action_id ==
EActions.DELETE)
8841 {
8842 Delete();
8843 }
8844
8845 }
8846
8847
8848 return false;
8849 }
8850
8851
8852
8853
8857
8860
8861
8862
8864 {
8865 return false;
8866 }
8867
8868
8870 {
8871 return true;
8872 }
8873
8874
8876 {
8877 return true;
8878 }
8879
8880
8881
8883 {
8884 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8886 }
8887
8890 {
8891 return null;
8892 }
8893
8895 {
8896 return false;
8897 }
8898
8900 {
8901 return false;
8902 }
8903
8907
8908
8910 {
8911 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8912 return module_repairing.CanRepair(this, item_repair_kit);
8913 }
8914
8915
8916 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8917 {
8918 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8919 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8920 }
8921
8922
8924 {
8925
8926
8927
8928
8929
8930
8931
8932
8933 return 1;
8934 }
8935
8936
8937
8939 {
8941 }
8942
8943
8944
8946 {
8948 }
8949
8950
8959 {
8960 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8961
8962 if (player)
8963 {
8964 player.MessageStatus(text);
8965 }
8966 }
8967
8968
8977 {
8978 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8979
8980 if (player)
8981 {
8982 player.MessageAction(text);
8983 }
8984 }
8985
8986
8995 {
8996 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8997
8998 if (player)
8999 {
9000 player.MessageFriendly(text);
9001 }
9002 }
9003
9004
9013 {
9014 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9015
9016 if (player)
9017 {
9018 player.MessageImportant(text);
9019 }
9020 }
9021
9023 {
9024 return true;
9025 }
9026
9027
9028 override bool KindOf(
string tag)
9029 {
9030 bool found = false;
9031 string item_name = this.
GetType();
9034
9035 int array_size = item_tag_array.Count();
9036 for (int i = 0; i < array_size; i++)
9037 {
9038 if (item_tag_array.Get(i) == tag)
9039 {
9040 found = true;
9041 break;
9042 }
9043 }
9044 return found;
9045 }
9046
9047
9049 {
9050
9051 super.OnRPC(sender, rpc_type,ctx);
9052
9053
9054 switch (rpc_type)
9055 {
9056 #ifndef SERVER
9057 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9058 Param2<bool, string> p = new Param2<bool, string>(false, "");
9059
9061 return;
9062
9063 bool play = p.param1;
9064 string soundSet = p.param2;
9065
9066 if (play)
9067 {
9069 {
9071 {
9073 }
9074 }
9075 else
9076 {
9078 }
9079 }
9080 else
9081 {
9083 }
9084
9085 break;
9086 #endif
9087
9088 }
9089
9091 {
9093 }
9094 }
9095
9096
9097
9098
9100 {
9101 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9102 return plugin.GetID(
name);
9103 }
9104
9106 {
9107 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9108 return plugin.GetName(id);
9109 }
9110
9113 {
9114
9115
9116 int varFlags;
9117 if (!ctx.
Read(varFlags))
9118 return;
9119
9120 if (varFlags & ItemVariableFlags.FLOAT)
9121 {
9123 }
9124 }
9125
9127 {
9128
9129 super.SerializeNumericalVars(floats_out);
9130
9131
9132
9134 {
9136 }
9137
9139 {
9141 }
9142
9144 {
9146 }
9147
9149 {
9154 }
9155
9157 {
9159 }
9160 }
9161
9163 {
9164
9165 super.DeSerializeNumericalVars(floats);
9166
9167
9168 int index = 0;
9169 int mask = Math.Round(floats.Get(index));
9170
9171 index++;
9172
9174 {
9176 {
9178 }
9179 else
9180 {
9181 float quantity = floats.Get(index);
9183 }
9184 index++;
9185 }
9186
9188 {
9189 float wet = floats.Get(index);
9191 index++;
9192 }
9193
9195 {
9196 int liquidtype = Math.Round(floats.Get(index));
9198 index++;
9199 }
9200
9202 {
9204 index++;
9206 index++;
9208 index++;
9210 index++;
9211 }
9212
9214 {
9215 int cleanness = Math.Round(floats.Get(index));
9217 index++;
9218 }
9219 }
9220
9222 {
9223 super.WriteVarsToCTX(ctx);
9224
9225
9227 {
9229 }
9230
9232 {
9234 }
9235
9237 {
9239 }
9240
9242 {
9243 int r,g,b,a;
9249 }
9250
9252 {
9254 }
9255 }
9256
9258 {
9259 if (!super.ReadVarsFromCTX(ctx,version))
9260 return false;
9261
9262 int intValue;
9263 float value;
9264
9265 if (version < 140)
9266 {
9267 if (!ctx.
Read(intValue))
9268 return false;
9269
9270 m_VariablesMask = intValue;
9271 }
9272
9274 {
9275 if (!ctx.
Read(value))
9276 return false;
9277
9279 {
9281 }
9282 else
9283 {
9285 }
9286 }
9287
9288 if (version < 140)
9289 {
9291 {
9292 if (!ctx.
Read(value))
9293 return false;
9294 SetTemperatureDirect(value);
9295 }
9296 }
9297
9299 {
9300 if (!ctx.
Read(value))
9301 return false;
9303 }
9304
9306 {
9307 if (!ctx.
Read(intValue))
9308 return false;
9310 }
9311
9313 {
9314 int r,g,b,a;
9316 return false;
9318 return false;
9320 return false;
9322 return false;
9323
9325 }
9326
9328 {
9329 if (!ctx.
Read(intValue))
9330 return false;
9332 }
9333
9334 if (version >= 138 && version < 140)
9335 {
9337 {
9338 if (!ctx.
Read(intValue))
9339 return false;
9340 SetFrozen(intValue);
9341 }
9342 }
9343
9344 return true;
9345 }
9346
9347
9349 {
9352 {
9354 }
9355
9356 if (!super.OnStoreLoad(ctx, version))
9357 {
9359 return false;
9360 }
9361
9362 if (version >= 114)
9363 {
9364 bool hasQuickBarIndexSaved;
9365
9366 if (!ctx.
Read(hasQuickBarIndexSaved))
9367 {
9369 return false;
9370 }
9371
9372 if (hasQuickBarIndexSaved)
9373 {
9374 int itmQBIndex;
9375
9376
9377 if (!ctx.
Read(itmQBIndex))
9378 {
9380 return false;
9381 }
9382
9383 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9384 if (itmQBIndex != -1 && parentPlayer)
9385 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9386 }
9387 }
9388 else
9389 {
9390
9391 PlayerBase player;
9392 int itemQBIndex;
9393 if (version ==
int.
MAX)
9394 {
9395 if (!ctx.
Read(itemQBIndex))
9396 {
9398 return false;
9399 }
9400 }
9401 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9402 {
9403
9404 if (!ctx.
Read(itemQBIndex))
9405 {
9407 return false;
9408 }
9409 if (itemQBIndex != -1 && player)
9410 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9411 }
9412 }
9413
9414 if (version < 140)
9415 {
9416
9417 if (!LoadVariables(ctx, version))
9418 {
9420 return false;
9421 }
9422 }
9423
9424
9426 {
9428 return false;
9429 }
9430 if (version >= 132)
9431 {
9433 if (raib)
9434 {
9436 {
9438 return false;
9439 }
9440 }
9441 }
9442
9444 return true;
9445 }
9446
9447
9448
9450 {
9451 super.OnStoreSave(ctx);
9452
9453 PlayerBase player;
9454 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9455 {
9457
9458 int itemQBIndex = -1;
9459 itemQBIndex = player.FindQuickBarEntityIndex(this);
9460 ctx.
Write(itemQBIndex);
9461 }
9462 else
9463 {
9465 }
9466
9468
9470 if (raib)
9471 {
9473 }
9474 }
9475
9476
9478 {
9479 super.AfterStoreLoad();
9480
9482 {
9484 }
9485
9487 {
9490 }
9491 }
9492
9494 {
9495 super.EEOnAfterLoad();
9496
9498 {
9500 }
9501
9504 }
9505
9507 {
9508 return false;
9509 }
9510
9511
9512
9514 {
9516 {
9517 #ifdef PLATFORM_CONSOLE
9518
9520 {
9522 if (menu)
9523 {
9525 }
9526 }
9527 #endif
9528 }
9529
9531 {
9534 }
9535
9537 {
9538 SetWeightDirty();
9540 }
9542 {
9545 }
9546
9548 {
9551 }
9553 {
9556 }
9557
9558 super.OnVariablesSynchronized();
9559 }
9560
9561
9562
9564 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9565 {
9566 if (!IsServerCheck(allow_client))
9567 return false;
9568
9570 return false;
9571
9574
9575 if (value <= (min + 0.001))
9576 value = min;
9577
9578 if (value == min)
9579 {
9580 if (destroy_config)
9581 {
9582 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9583 if (dstr)
9584 {
9586 this.Delete();
9587 return true;
9588 }
9589 }
9590 else if (destroy_forced)
9591 {
9593 this.Delete();
9594 return true;
9595 }
9596
9598 }
9599
9602
9604 {
9606
9607 if (delta)
9609 }
9610
9612
9613 return false;
9614 }
9615
9616
9618 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9619 {
9621 }
9622
9624 {
9627 }
9628
9630 {
9633 }
9634
9637 {
9638 float value_clamped = Math.Clamp(value, 0, 1);
9640 SetQuantity(result, destroy_config, destroy_forced);
9641 }
9642
9643
9646 {
9648 }
9649
9651 {
9653 }
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9665 {
9666 int slot = -1;
9667 if (GetInventory())
9668 {
9669 InventoryLocation il = new InventoryLocation;
9670 GetInventory().GetCurrentInventoryLocation(il);
9672 }
9673
9675 }
9676
9678 {
9679 float quantity_max = 0;
9680
9682 {
9683 if (attSlotID != -1)
9684 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9685
9686 if (quantity_max <= 0)
9688 }
9689
9690 if (quantity_max <= 0)
9692
9693 return quantity_max;
9694 }
9695
9697 {
9699 }
9700
9702 {
9704 }
9705
9706
9708 {
9710 }
9711
9713 {
9715 }
9716
9718 {
9720 }
9721
9722
9724 {
9725
9726 float weightEx = GetWeightEx();
9727 float special = GetInventoryAndCargoWeight();
9728 return weightEx - special;
9729 }
9730
9731
9733 {
9735 }
9736
9738 {
9740 {
9741 #ifdef DEVELOPER
9742 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9743 {
9744 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9746 }
9747 #endif
9748
9750 }
9751 else if (HasEnergyManager())
9752 {
9753 #ifdef DEVELOPER
9754 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9755 {
9756 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9757 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9758 }
9759 #endif
9760 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9761 }
9762 else
9763 {
9764 #ifdef DEVELOPER
9765 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9766 {
9767 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9768 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9769 }
9770 #endif
9771 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9772 }
9773 }
9774
9777 {
9778 int item_count = 0;
9780
9781 if (GetInventory().GetCargo() != NULL)
9782 {
9783 item_count = GetInventory().GetCargo().GetItemCount();
9784 }
9785
9786 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9787 {
9788 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9789 if (item)
9790 item_count += item.GetNumberOfItems();
9791 }
9792 return item_count;
9793 }
9794
9797 {
9798 float weight = 0;
9799 float wetness = 1;
9800 if (include_wetness)
9803 {
9804 weight = wetness * m_ConfigWeight;
9805 }
9807 {
9808 weight = 1;
9809 }
9810 return weight;
9811 }
9812
9813
9814
9816 {
9817 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9818 {
9819 GameInventory inv = GetInventory();
9820 array<EntityAI> items = new array<EntityAI>;
9822 for (int i = 0; i < items.Count(); i++)
9823 {
9825 if (item)
9826 {
9828 }
9829 }
9830 }
9831 }
9832
9833
9834
9835
9837 {
9838 float energy = 0;
9839 if (HasEnergyManager())
9840 {
9841 energy = GetCompEM().GetEnergy();
9842 }
9843 return energy;
9844 }
9845
9846
9848 {
9849 super.OnEnergyConsumed();
9850
9852 }
9853
9855 {
9856 super.OnEnergyAdded();
9857
9859 }
9860
9861
9863 {
9864 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9865 {
9867 {
9868 float energy_0to1 = GetCompEM().GetEnergy0To1();
9870 }
9871 }
9872 }
9873
9874
9876 {
9877 return ConfigGetFloat("heatIsolation");
9878 }
9879
9881 {
9883 }
9884
9886 {
9887 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9888 if (
GetGame().ConfigIsExisting(paramPath))
9890
9891 return 0.0;
9892 }
9893
9895 {
9896 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9897 if (
GetGame().ConfigIsExisting(paramPath))
9899
9900 return 0.0;
9901 }
9902
9903 override void SetWet(
float value,
bool allow_client =
false)
9904 {
9905 if (!IsServerCheck(allow_client))
9906 return;
9907
9910
9912
9913 m_VarWet = Math.Clamp(value, min, max);
9914
9916 {
9919 }
9920 }
9921
9922 override void AddWet(
float value)
9923 {
9925 }
9926
9928 {
9930 }
9931
9933 {
9935 }
9936
9938 {
9940 }
9941
9943 {
9945 }
9946
9948 {
9950 }
9951
9953 {
9956 if (newLevel != oldLevel)
9957 {
9959 }
9960 }
9961
9963 {
9964 SetWeightDirty();
9965 }
9966
9968 {
9969 return GetWetLevelInternal(
m_VarWet);
9970 }
9971
9972
9973
9975 {
9977 }
9978
9980 {
9982 }
9983
9985 {
9987 }
9988
9990 {
9992 }
9993
9994
9995
9997 {
9998 if (ConfigIsExisting("itemModelLength"))
9999 {
10000 return ConfigGetFloat("itemModelLength");
10001 }
10002 return 0;
10003 }
10004
10006 {
10007 if (ConfigIsExisting("itemAttachOffset"))
10008 {
10009 return ConfigGetFloat("itemAttachOffset");
10010 }
10011 return 0;
10012 }
10013
10014 override void SetCleanness(
int value,
bool allow_client =
false)
10015 {
10016 if (!IsServerCheck(allow_client))
10017 return;
10018
10020
10022
10025 }
10026
10028 {
10030 }
10031
10033 {
10034 return true;
10035 }
10036
10037
10038
10039
10041 {
10043 }
10044
10046 {
10048 }
10049
10050
10051
10052
10053 override void SetColor(
int r,
int g,
int b,
int a)
10054 {
10060 }
10062 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10063 {
10068 }
10069
10071 {
10073 }
10074
10077 {
10078 int r,g,b,a;
10080 r = r/255;
10081 g = g/255;
10082 b = b/255;
10083 a = a/255;
10084 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10085 }
10086
10087
10088
10089 override void SetLiquidType(
int value,
bool allow_client =
false)
10090 {
10091 if (!IsServerCheck(allow_client))
10092 return;
10093
10098 }
10099
10101 {
10102 return ConfigGetInt("varLiquidTypeInit");
10103 }
10104
10106 {
10108 }
10109
10111 {
10113 SetFrozen(false);
10114 }
10115
10118 {
10119 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10120 }
10121
10122
10125 {
10126 PlayerBase nplayer;
10127 if (PlayerBase.CastTo(nplayer, player))
10128 {
10130
10131 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10132 }
10133 }
10134
10135
10138 {
10139 PlayerBase nplayer;
10140 if (PlayerBase.CastTo(nplayer,player))
10141 {
10142
10143 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10144
10145 }
10146
10147
10148 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10149
10150
10151 if (HasEnergyManager())
10152 {
10153 GetCompEM().UpdatePlugState();
10154 }
10155 }
10156
10157
10159 {
10160 super.OnPlacementStarted(player);
10161
10163 }
10164
10165 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10166 {
10168 {
10169 m_AdminLog.OnPlacementComplete(player,
this);
10170 }
10171
10172 super.OnPlacementComplete(player, position, orientation);
10173 }
10174
10175
10176
10177
10178
10180 {
10182 {
10183 return true;
10184 }
10185 else
10186 {
10187 return false;
10188 }
10189 }
10190
10191
10193 {
10195 {
10197 }
10198 }
10199
10200
10202 {
10204 }
10205
10207 {
10209 }
10210
10211 override void InsertAgent(
int agent,
float count = 1)
10212 {
10213 if (count < 1)
10214 return;
10215
10217 }
10218
10221 {
10223 }
10224
10225
10227 {
10229 }
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10273 {
10275 return false;
10276 return true;
10277 }
10278
10280 {
10281
10283 }
10284
10285
10288 {
10289 super.CheckForRoofLimited(timeTresholdMS);
10290
10292 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10293 {
10294 m_PreviousRoofTestTime = time;
10295 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10296 }
10297 }
10298
10299
10301 {
10303 {
10304 return 0;
10305 }
10306
10307 if (GetInventory().GetAttachmentSlotsCount() != 0)
10308 {
10309 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10310 if (filter)
10311 return filter.GetProtectionLevel(type, false, system);
10312 else
10313 return 0;
10314 }
10315
10316 string subclassPath, entryName;
10317
10318 switch (type)
10319 {
10321 entryName = "biological";
10322 break;
10324 entryName = "chemical";
10325 break;
10326 default:
10327 entryName = "biological";
10328 break;
10329 }
10330
10331 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10332
10334 }
10335
10336
10337
10340 {
10341 if (!IsMagazine())
10343
10345 }
10346
10347
10348
10349
10350
10355 {
10356 return true;
10357 }
10358
10360 {
10362 }
10363
10364
10365
10366
10367
10369 {
10370 if (parent)
10371 {
10372 if (parent.IsInherited(DayZInfected))
10373 return true;
10374
10375 if (!parent.IsRuined())
10376 return true;
10377 }
10378
10379 return true;
10380 }
10381
10383 {
10384 if (!super.CanPutAsAttachment(parent))
10385 {
10386 return false;
10387 }
10388
10389 if (!IsRuined() && !parent.IsRuined())
10390 {
10391 return true;
10392 }
10393
10394 return false;
10395 }
10396
10398 {
10399
10400
10401
10402
10403 return super.CanReceiveItemIntoCargo(item);
10404 }
10405
10407 {
10408
10409
10410
10411
10412 GameInventory attachmentInv = attachment.GetInventory();
10414 {
10415 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10416 return false;
10417 }
10418
10419 InventoryLocation loc = new InventoryLocation();
10420 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10421 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10422 return false;
10423
10424 return super.CanReceiveAttachment(attachment, slotId);
10425 }
10426
10428 {
10429 if (!super.CanReleaseAttachment(attachment))
10430 return false;
10431
10432 return GetInventory().AreChildrenAccessible();
10433 }
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10456 {
10457 int id = muzzle_owner.GetMuzzleID();
10458 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10459
10460 if (WPOF_array)
10461 {
10462 for (int i = 0; i < WPOF_array.Count(); i++)
10463 {
10464 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10465
10466 if (WPOF)
10467 {
10468 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10469 }
10470 }
10471 }
10472 }
10473
10474
10476 {
10477 int id = muzzle_owner.GetMuzzleID();
10479
10480 if (WPOBE_array)
10481 {
10482 for (int i = 0; i < WPOBE_array.Count(); i++)
10483 {
10484 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10485
10486 if (WPOBE)
10487 {
10488 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10489 }
10490 }
10491 }
10492 }
10493
10494
10496 {
10497 int id = muzzle_owner.GetMuzzleID();
10498 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10499
10500 if (WPOOH_array)
10501 {
10502 for (int i = 0; i < WPOOH_array.Count(); i++)
10503 {
10504 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10505
10506 if (WPOOH)
10507 {
10508 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10509 }
10510 }
10511 }
10512 }
10513
10514
10516 {
10517 int id = muzzle_owner.GetMuzzleID();
10518 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10519
10520 if (WPOOH_array)
10521 {
10522 for (int i = 0; i < WPOOH_array.Count(); i++)
10523 {
10524 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10525
10526 if (WPOOH)
10527 {
10528 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10529 }
10530 }
10531 }
10532 }
10533
10534
10536 {
10537 int id = muzzle_owner.GetMuzzleID();
10538 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10539
10540 if (WPOOH_array)
10541 {
10542 for (int i = 0; i < WPOOH_array.Count(); i++)
10543 {
10544 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10545
10546 if (WPOOH)
10547 {
10548 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10549 }
10550 }
10551 }
10552 }
10553
10554
10555
10557 {
10559 {
10560 return true;
10561 }
10562
10563 return false;
10564 }
10565
10567 {
10569 {
10570 return true;
10571 }
10572
10573 return false;
10574 }
10575
10577 {
10579 {
10580 return true;
10581 }
10582
10583 return false;
10584 }
10585
10587 {
10588 return false;
10589 }
10590
10593 {
10594 return UATimeSpent.DEFAULT_DEPLOY;
10595 }
10596
10597
10598
10599
10601 {
10603 SetSynchDirty();
10604 }
10605
10607 {
10609 }
10610
10611
10613 {
10614 return false;
10615 }
10616
10619 {
10620 string att_type = "None";
10621
10622 if (ConfigIsExisting("soundAttType"))
10623 {
10624 att_type = ConfigGetString("soundAttType");
10625 }
10626
10628 }
10629
10631 {
10633 }
10634
10635
10636
10637
10638
10642
10644 {
10647
10649 }
10650
10651
10653 {
10655 return;
10656
10658
10661
10664
10665 SoundParameters params = new SoundParameters();
10669 }
10670
10671
10673 {
10675 return;
10676
10678 SetSynchDirty();
10679
10682 }
10683
10684
10686 {
10688 return;
10689
10691 SetSynchDirty();
10692
10695 }
10696
10698 {
10700 }
10701
10703 {
10705 }
10706
10709 {
10710 if (!
GetGame().IsDedicatedServer())
10711 {
10712 if (ConfigIsExisting("attachSoundSet"))
10713 {
10714 string cfg_path = "";
10715 string soundset = "";
10716 string type_name =
GetType();
10717
10720 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10721 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10722
10723 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10724 {
10725 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10726 {
10727 if (cfg_slot_array[i] == slot_type)
10728 {
10729 soundset = cfg_soundset_array[i];
10730 break;
10731 }
10732 }
10733 }
10734
10735 if (soundset != "")
10736 {
10737 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10739 }
10740 }
10741 }
10742 }
10743
10745 {
10746
10747 }
10748
10749 void OnApply(PlayerBase player);
10750
10752 {
10753 return 1.0;
10754 };
10755
10757 {
10759 }
10760
10762 {
10764 }
10765
10767
10769 {
10770 SetDynamicPhysicsLifeTime(0.01);
10772 }
10773
10775 {
10776 array<string> zone_names = new array<string>;
10777 GetDamageZones(zone_names);
10778 for (int i = 0; i < zone_names.Count(); i++)
10779 {
10780 SetHealthMax(zone_names.Get(i),"Health");
10781 }
10782 SetHealthMax("","Health");
10783 }
10784
10787 {
10788 float global_health = GetHealth01("","Health");
10789 array<string> zones = new array<string>;
10790 GetDamageZones(zones);
10791
10792 for (int i = 0; i < zones.Count(); i++)
10793 {
10794 SetHealth01(zones.Get(i),"Health",global_health);
10795 }
10796 }
10797
10800 {
10801 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10802 }
10803
10805 {
10806 if (!hasRootAsPlayer)
10807 {
10808 if (refParentIB)
10809 {
10810
10811 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10812 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10813
10814 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10815 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10816
10819 }
10820 else
10821 {
10822
10825 }
10826 }
10827 }
10828
10830 {
10832 {
10833 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10834 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10835 {
10836 float heatPermCoef = 1.0;
10838 while (ent)
10839 {
10840 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10841 ent = ent.GetHierarchyParent();
10842 }
10843
10844 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10845 }
10846 }
10847 }
10848
10850 {
10851
10852 EntityAI parent = GetHierarchyParent();
10853 if (!parent)
10854 {
10855 hasParent = false;
10856 hasRootAsPlayer = false;
10857 }
10858 else
10859 {
10860 hasParent = true;
10861 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10862 refParentIB =
ItemBase.Cast(parent);
10863 }
10864 }
10865
10866 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10867 {
10868
10869 }
10870
10872 {
10873
10874 return false;
10875 }
10876
10878 {
10879
10880
10881 return false;
10882 }
10883
10885 {
10886
10887 return false;
10888 }
10889
10892 {
10893 return !GetIsFrozen() &&
IsOpen();
10894 }
10895
10897 {
10898 bool hasParent = false, hasRootAsPlayer = false;
10900
10901 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10902 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10903
10904 if (wwtu || foodDecay)
10905 {
10909
10910 if (processWetness || processTemperature || processDecay)
10911 {
10913
10914 if (processWetness)
10915 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10916
10917 if (processTemperature)
10919
10920 if (processDecay)
10921 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10922 }
10923 }
10924 }
10925
10928 {
10930 }
10931
10933 {
10936
10937 return super.GetTemperatureFreezeThreshold();
10938 }
10939
10941 {
10944
10945 return super.GetTemperatureThawThreshold();
10946 }
10947
10949 {
10952
10953 return super.GetItemOverheatThreshold();
10954 }
10955
10957 {
10959 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10960
10961 return super.GetTemperatureFreezeTime();
10962 }
10963
10965 {
10967 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10968
10969 return super.GetTemperatureThawTime();
10970 }
10971
10976
10978 {
10979 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10980 }
10981
10983 {
10984 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10985 }
10986
10989 {
10991 }
10992
10994 {
10996 }
10997
10999 {
11001 }
11002
11005 {
11006 return null;
11007 }
11008
11011 {
11012 return false;
11013 }
11014
11016 {
11018 {
11021 if (!trg)
11022 {
11024 explosive = this;
11025 }
11026
11027 explosive.PairRemote(trg);
11029
11030 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11031 trg.SetPersistentPairID(persistentID);
11032 explosive.SetPersistentPairID(persistentID);
11033
11034 return true;
11035 }
11036 return false;
11037 }
11038
11041 {
11042 float ret = 1.0;
11045 ret *= GetHealth01();
11046
11047 return ret;
11048 }
11049
11050 #ifdef DEVELOPER
11051 override void SetDebugItem()
11052 {
11053 super.SetDebugItem();
11054 _itemBase = this;
11055 }
11056
11058 {
11059 string text = super.GetDebugText();
11060
11062 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11063
11064 return text;
11065 }
11066 #endif
11067
11069 {
11070 return true;
11071 }
11072
11074
11076
11078 {
11081 }
11082
11083
11091
11107}
11108
11110{
11112 if (entity)
11113 {
11114 bool is_item = entity.IsInherited(
ItemBase);
11115 if (is_item && full_quantity)
11116 {
11119 }
11120 }
11121 else
11122 {
11124 return NULL;
11125 }
11126 return entity;
11127}
11128
11130{
11131 if (item)
11132 {
11133 if (health > 0)
11134 item.SetHealth("", "", health);
11135
11136 if (item.CanHaveTemperature())
11137 {
11139 if (item.CanFreeze())
11140 item.SetFrozen(false);
11141 }
11142
11143 if (item.HasEnergyManager())
11144 {
11145 if (quantity >= 0)
11146 {
11147 item.GetCompEM().SetEnergy0To1(quantity);
11148 }
11149 else
11150 {
11152 }
11153 }
11154 else if (item.IsMagazine())
11155 {
11156 Magazine mag = Magazine.Cast(item);
11157 if (quantity >= 0)
11158 {
11159 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11160 }
11161 else
11162 {
11164 }
11165
11166 }
11167 else
11168 {
11169 if (quantity >= 0)
11170 {
11171 item.SetQuantityNormalized(quantity, false);
11172 }
11173 else
11174 {
11176 }
11177
11178 }
11179 }
11180}
11181
11182#ifdef DEVELOPER
11184#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.