6347{
6349 {
6350 return true;
6351 }
6352};
6353
6354
6355
6357{
6361
6363
6366
6367
6368
6369
6370
6379
6385
6390
6395
6416 protected bool m_IsResultOfSplit
6417
6419
6424
6425
6426
6428
6432
6433
6434
6436
6439
6440
6441
6447
6448
6456
6459
6460
6462
6463
6465
6466
6471
6472
6477
6478
6480
6481
6483 {
6488
6489 if (!
GetGame().IsDedicatedServer())
6490 {
6492 {
6494
6496 {
6498 }
6499 }
6500
6503 }
6504
6505 m_OldLocation = null;
6506
6508 {
6510 }
6511
6512 if (ConfigIsExisting("headSelectionsToHide"))
6513 {
6516 }
6517
6519 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6520 {
6522 }
6523
6525
6526 m_IsResultOfSplit = false;
6527
6529 }
6530
6532 {
6533 super.InitItemVariables();
6534
6540 m_Count = ConfigGetInt(
"count");
6541
6544
6549
6552
6557
6569
6573
6574
6577 if (ConfigIsExisting("canBeSplit"))
6578 {
6581 }
6582
6584 if (ConfigIsExisting("itemBehaviour"))
6586
6587
6590 RegisterNetSyncVariableInt("m_VarLiquidType");
6591 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6592
6593 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6594 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6595 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6596
6597 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6598 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6599 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6600 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6601
6602 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6603 RegisterNetSyncVariableBool("m_IsTakeable");
6604 RegisterNetSyncVariableBool("m_IsHologram");
6605
6608 {
6611 }
6612
6614
6616 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6618
6619 }
6620
6622 {
6624 }
6625
6627 {
6630 {
6635 }
6636 }
6637
6638 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6639 {
6641 {
6644 }
6645
6647 }
6648
6650 {
6656 }
6657
6659
6661 {
6663
6664 if (!action)
6665 {
6666 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6667 return;
6668 }
6669
6671 if (!ai)
6672 {
6674 return;
6675 }
6676
6678 if (!action_array)
6679 {
6680 action_array = new array<ActionBase_Basic>;
6682 }
6683 if (LogManager.IsActionLogEnable())
6684 {
6685 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6686 }
6687
6688 if (action_array.Find(action) != -1)
6689 {
6690 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6691 }
6692 else
6693 {
6694 action_array.Insert(action);
6695 }
6696 }
6697
6699 {
6701 ActionBase action = player.GetActionManager().GetAction(actionName);
6704
6705 if (action_array)
6706 {
6707 action_array.RemoveItem(action);
6708 }
6709 }
6710
6711
6712
6714 {
6715 ActionOverrideData overrideData = new ActionOverrideData();
6719
6721 if (!actionMap)
6722 {
6725 }
6726
6727 actionMap.Insert(this.
Type(), overrideData);
6728
6729 }
6730
6732
6734
6735
6737 {
6740
6743
6744 string config_to_search = "CfgVehicles";
6745 string muzzle_owner_config;
6746
6748 {
6749 if (IsInherited(Weapon))
6750 config_to_search = "CfgWeapons";
6751
6752 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6753
6754 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6755
6757
6758 if (config_OnFire_subclass_count > 0)
6759 {
6760 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6761
6762 for (int i = 0; i < config_OnFire_subclass_count; i++)
6763 {
6764 string particle_class = "";
6766 string config_OnFire_entry = config_OnFire_class + particle_class;
6767 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6768 WPOF_array.Insert(WPOF);
6769 }
6770
6771
6773 }
6774 }
6775
6777 {
6778 config_to_search = "CfgWeapons";
6779 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6780
6781 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6782
6784
6785 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6786 {
6787 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6788
6789 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6790 {
6791 string particle_class2 = "";
6793 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6794 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6795 WPOBE_array.Insert(WPOBE);
6796 }
6797
6798
6800 }
6801 }
6802 }
6803
6804
6806 {
6809
6811 {
6812 string config_to_search = "CfgVehicles";
6813
6814 if (IsInherited(Weapon))
6815 config_to_search = "CfgWeapons";
6816
6817 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6818 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6819
6820 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6821 {
6822
6824
6826 {
6828 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6830 return;
6831 }
6832
6835
6836
6837
6839 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6840
6841 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6842 {
6843 string particle_class = "";
6845 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6847
6848 if (entry_type == CT_CLASS)
6849 {
6850 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6851 WPOOH_array.Insert(WPOF);
6852 }
6853 }
6854
6855
6857 }
6858 }
6859 }
6860
6862 {
6864 }
6865
6867 {
6869 {
6871
6874
6877
6878 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6879 }
6880 }
6881
6883 {
6885 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6886
6888 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6889
6891 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6892
6894 {
6896 }
6897 }
6898
6900 {
6902 }
6903
6905 {
6908 else
6910
6912 {
6915 }
6916 else
6917 {
6920
6923 }
6924
6926 }
6927
6929 {
6931 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6932 }
6933
6935 {
6937 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6939 }
6940
6942 {
6944 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6945 }
6946
6948 {
6951
6952 OverheatingParticle OP = new OverheatingParticle();
6957
6959 }
6960
6962 {
6965
6966 return -1;
6967 }
6968
6970 {
6972 {
6975
6976 for (int i = count; i > 0; --i)
6977 {
6978 int id = i - 1;
6981
6984
6985 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6986 {
6987 if (p)
6988 {
6991 }
6992 }
6993 }
6994 }
6995 }
6996
6998 {
7000 {
7002 {
7003 int id = i - 1;
7005
7006 if (OP)
7007 {
7009
7010 if (p)
7011 {
7013 }
7014
7015 delete OP;
7016 }
7017 }
7018
7021 }
7022 }
7023
7026 {
7027 return 0.0;
7028 }
7029
7030
7032 {
7033 return 250;
7034 }
7035
7037 {
7038 return 0;
7039 }
7040
7043 {
7045 return true;
7046
7047 return false;
7048 }
7049
7052 {
7055
7057 {
7059 }
7060 else
7061 {
7062
7064 }
7065
7067 }
7068
7075 {
7076 return -1;
7077 }
7078
7079
7080
7081
7083 {
7085 {
7087 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7088
7089 if (r_index >= 0)
7090 {
7091 InventoryLocation r_il = new InventoryLocation;
7092 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7093
7094 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7097 {
7098 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7099 }
7101 {
7102 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7103 }
7104
7105 }
7106
7107 player.GetHumanInventory().ClearUserReservedLocation(this);
7108 }
7109
7112 }
7113
7114
7115
7116
7118 {
7119 return ItemBase.m_DebugActionsMask;
7120 }
7121
7123 {
7124 return ItemBase.m_DebugActionsMask & mask;
7125 }
7126
7128 {
7129 ItemBase.m_DebugActionsMask = mask;
7130 }
7131
7133 {
7134 ItemBase.m_DebugActionsMask |= mask;
7135 }
7136
7138 {
7139 ItemBase.m_DebugActionsMask &= ~mask;
7140 }
7141
7143 {
7145 {
7147 }
7148 else
7149 {
7151 }
7152 }
7153
7154
7156 {
7157 if (GetEconomyProfile())
7158 {
7159 float q_max = GetEconomyProfile().GetQuantityMax();
7160 if (q_max > 0)
7161 {
7162 float q_min = GetEconomyProfile().GetQuantityMin();
7163 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7164
7166 {
7167 ComponentEnergyManager comp = GetCompEM();
7169 {
7171 }
7172 }
7174 {
7176
7177 }
7178
7179 }
7180 }
7181 }
7182
7185 {
7186 EntityAI parent = GetHierarchyParent();
7187
7188 if (parent)
7189 {
7190 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7191 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7192 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7193 }
7194 }
7195
7198 {
7199 EntityAI parent = GetHierarchyParent();
7200
7201 if (parent)
7202 {
7203 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7204 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7205 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7206 }
7207 }
7208
7210 {
7211
7212
7213
7214
7216
7218 {
7219 if (ScriptInputUserData.CanStoreInputUserData())
7220 {
7221 ScriptInputUserData ctx = new ScriptInputUserData;
7227 ctx.
Write(use_stack_max);
7230
7232 {
7233 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7234 }
7235 }
7236 }
7237 else if (!
GetGame().IsMultiplayer())
7238 {
7240 }
7241 }
7242
7244 {
7246 }
7247
7249 {
7251 }
7252
7254 {
7256 }
7257
7259 {
7260
7261 return false;
7262 }
7263
7265 {
7266 return false;
7267 }
7268
7272 {
7273 return false;
7274 }
7275
7277 {
7278 return "";
7279 }
7280
7282
7284 {
7285 return false;
7286 }
7287
7289 {
7290 return true;
7291 }
7292
7293
7294
7296 {
7297 return true;
7298 }
7299
7301 {
7302 return true;
7303 }
7304
7306 {
7307 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7309 }
7310
7312 {
7314 }
7315
7317 {
7319 if (!is_being_placed)
7321 SetSynchDirty();
7322 }
7323
7324
7326
7328 {
7330 }
7331
7333 {
7335 }
7336
7338 {
7339 return 1;
7340 }
7341
7343 {
7344 return false;
7345 }
7346
7348 {
7350 SetSynchDirty();
7351 }
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7388 {
7389 super.OnMovedInsideCargo(container);
7390
7391 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7392 }
7393
7394 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7395 {
7396 super.EEItemLocationChanged(oldLoc,newLoc);
7397
7398 PlayerBase new_player = null;
7399 PlayerBase old_player = null;
7400
7401 if (newLoc.GetParent())
7402 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7403
7404 if (oldLoc.GetParent())
7405 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7406
7408 {
7409 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7410
7411 if (r_index >= 0)
7412 {
7413 InventoryLocation r_il = new InventoryLocation;
7414 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7415
7416 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7419 {
7420 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7421 }
7423 {
7424 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7425 }
7426
7427 }
7428 }
7429
7431 {
7432 if (new_player)
7433 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7434
7435 if (new_player == old_player)
7436 {
7437
7438 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7439 {
7441 {
7442 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7443 {
7444 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7445 }
7446 }
7447 else
7448 {
7449 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7450 }
7451 }
7452
7453 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7454 {
7455 int type = oldLoc.GetType();
7457 {
7458 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7459 }
7461 {
7462 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7463 }
7464 }
7465 if (!m_OldLocation)
7466 {
7467 m_OldLocation = new InventoryLocation;
7468 }
7469 m_OldLocation.Copy(oldLoc);
7470 }
7471 else
7472 {
7473 if (m_OldLocation)
7474 {
7475 m_OldLocation.Reset();
7476 }
7477 }
7478
7480 }
7481 else
7482 {
7483 if (new_player)
7484 {
7485 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7486 if (res_index >= 0)
7487 {
7488 InventoryLocation il = new InventoryLocation;
7489 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7491 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7494 {
7495 il.
GetParent().GetOnReleaseLock().Invoke(it);
7496 }
7498 {
7500 }
7501
7502 }
7503 }
7505 {
7506
7508 }
7509
7510 if (m_OldLocation)
7511 {
7512 m_OldLocation.Reset();
7513 }
7514 }
7515 }
7516
7517 override void EOnContact(IEntity other, Contact extra)
7518 {
7520 {
7521 int liquidType = -1;
7523 if (impactSpeed > 0.0)
7524 {
7526 #ifndef SERVER
7528 #else
7530 SetSynchDirty();
7531 #endif
7533 }
7534 }
7535
7536 #ifdef SERVER
7537 if (GetCompEM() && GetCompEM().IsPlugged())
7538 {
7539 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7540 GetCompEM().UnplugThis();
7541 }
7542 #endif
7543 }
7544
7546
7548 {
7550 }
7551
7553 {
7554
7555 }
7556
7558 {
7559 super.OnItemLocationChanged(old_owner, new_owner);
7560
7561 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7562 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7563
7564 if (!relatedPlayer && playerNew)
7565 relatedPlayer = playerNew;
7566
7567 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7568 {
7570 if (actionMgr)
7571 {
7572 ActionBase currentAction = actionMgr.GetRunningAction();
7573 if (currentAction)
7575 }
7576 }
7577
7578 Man ownerPlayerOld = null;
7579 Man ownerPlayerNew = null;
7580
7581 if (old_owner)
7582 {
7583 if (old_owner.
IsMan())
7584 {
7585 ownerPlayerOld = Man.Cast(old_owner);
7586 }
7587 else
7588 {
7589 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7590 }
7591 }
7592 else
7593 {
7595 {
7597
7598 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7599 {
7600 GetCompEM().UnplugThis();
7601 }
7602 }
7603 }
7604
7605 if (new_owner)
7606 {
7607 if (new_owner.
IsMan())
7608 {
7609 ownerPlayerNew = Man.Cast(new_owner);
7610 }
7611 else
7612 {
7613 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7614 }
7615 }
7616
7617 if (ownerPlayerOld != ownerPlayerNew)
7618 {
7619 if (ownerPlayerOld)
7620 {
7621 array<EntityAI> subItemsExit = new array<EntityAI>;
7623 for (int i = 0; i < subItemsExit.Count(); i++)
7624 {
7627 }
7628 }
7629
7630 if (ownerPlayerNew)
7631 {
7632 array<EntityAI> subItemsEnter = new array<EntityAI>;
7634 for (int j = 0; j < subItemsEnter.Count(); j++)
7635 {
7638 }
7639 }
7640 }
7641 else if (ownerPlayerNew != null)
7642 {
7643 PlayerBase nplayer;
7644 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7645 {
7646 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7648 for (int k = 0; k < subItemsUpdate.Count(); k++)
7649 {
7651 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7652 }
7653 }
7654 }
7655
7656 if (old_owner)
7657 old_owner.OnChildItemRemoved(this);
7658 if (new_owner)
7659 new_owner.OnChildItemReceived(this);
7660 }
7661
7662
7664 {
7665 super.EEDelete(parent);
7666 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7667 if (player)
7668 {
7670
7671 if (player.IsAlive())
7672 {
7673 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7674 if (r_index >= 0)
7675 {
7676 InventoryLocation r_il = new InventoryLocation;
7677 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7678
7679 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7682 {
7683 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7684 }
7686 {
7687 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7688 }
7689
7690 }
7691
7692 player.RemoveQuickBarEntityShortcut(this);
7693 }
7694 }
7695 }
7696
7698 {
7699 super.EEKilled(killer);
7700
7703 {
7704 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7705 {
7706 if (IsMagazine())
7707 {
7708 if (Magazine.Cast(this).GetAmmoCount() > 0)
7709 {
7711 }
7712 }
7713 else
7714 {
7716 }
7717 }
7718 }
7719 }
7720
7722 {
7723 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7724
7725 super.OnWasAttached(parent, slot_id);
7726
7729
7731 }
7732
7734 {
7735 super.OnWasDetached(parent, slot_id);
7736
7739 }
7740
7742 {
7743 int idx;
7746
7747 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7748 if (inventory_slots.Count() < 1)
7749 {
7750 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7751 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7752 }
7753 else
7754 {
7755 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7756 }
7757
7758 idx = inventory_slots.Find(slot);
7759 if (idx < 0)
7760 return "";
7761
7762 return attach_types.Get(idx);
7763 }
7764
7766 {
7767 int idx = -1;
7768 string slot;
7769
7772
7773 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7774 if (inventory_slots.Count() < 1)
7775 {
7776 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7777 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7778 }
7779 else
7780 {
7781 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7782 if (detach_types.Count() < 1)
7783 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7784 }
7785
7786 for (int i = 0; i < inventory_slots.Count(); i++)
7787 {
7788 slot = inventory_slots.Get(i);
7789 }
7790
7791 if (slot != "")
7792 {
7793 if (detach_types.Count() == 1)
7794 idx = 0;
7795 else
7796 idx = inventory_slots.Find(slot);
7797 }
7798 if (idx < 0)
7799 return "";
7800
7801 return detach_types.Get(idx);
7802 }
7803
7805 {
7806
7808
7809
7810 float min_time = 1;
7811 float max_time = 3;
7812 float delay = Math.RandomFloat(min_time, max_time);
7813
7814 explode_timer.Run(delay, this, "DoAmmoExplosion");
7815 }
7816
7818 {
7819 Magazine magazine = Magazine.Cast(this);
7820 int pop_sounds_count = 6;
7821 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7822
7823
7824 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7825 string sound_name = pop_sounds[ sound_idx ];
7827
7828
7829 magazine.ServerAddAmmoCount(-1);
7830
7831
7832 float min_temp_to_explode = 100;
7833
7834 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7835 {
7837 }
7838 }
7839
7840
7841 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7842 {
7843 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7844
7845 const int CHANCE_DAMAGE_CARGO = 4;
7846 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7847 const int CHANCE_DAMAGE_NOTHING = 2;
7848
7850 {
7851 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7852 int chances;
7853 int rnd;
7854
7855 if (GetInventory().GetCargo())
7856 {
7857 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7858 rnd = Math.RandomInt(0,chances);
7859
7860 if (rnd < CHANCE_DAMAGE_CARGO)
7861 {
7863 }
7864 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7865 {
7867 }
7868 }
7869 else
7870 {
7871 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7872 rnd = Math.RandomInt(0,chances);
7873
7874 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7875 {
7877 }
7878 }
7879 }
7880 }
7881
7883 {
7884 if (GetInventory().GetCargo())
7885 {
7886 int item_count = GetInventory().GetCargo().GetItemCount();
7887 if (item_count > 0)
7888 {
7889 int random_pick = Math.RandomInt(0, item_count);
7891 if (!item.IsExplosive())
7892 {
7893 item.AddHealth("","",damage);
7894 return true;
7895 }
7896 }
7897 }
7898 return false;
7899 }
7900
7902 {
7903 int attachment_count = GetInventory().AttachmentCount();
7904 if (attachment_count > 0)
7905 {
7906 int random_pick = Math.RandomInt(0, attachment_count);
7907 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7908 if (!attachment.IsExplosive())
7909 {
7910 attachment.AddHealth("","",damage);
7911 return true;
7912 }
7913 }
7914 return false;
7915 }
7916
7918 {
7920 }
7921
7923 {
7925 return GetInventory().CanRemoveEntity();
7926
7927 return false;
7928 }
7929
7931 {
7933 return;
7934
7936 {
7937 if (ScriptInputUserData.CanStoreInputUserData())
7938 {
7939 ScriptInputUserData ctx = new ScriptInputUserData;
7944 ctx.
Write(destination_entity);
7948 }
7949 }
7950 else if (!
GetGame().IsMultiplayer())
7951 {
7953 }
7954 }
7955
7957 {
7959 return;
7960
7961 float split_quantity_new;
7965 InventoryLocation loc = new InventoryLocation;
7966
7967 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7968 {
7970 split_quantity_new = stack_max;
7971 else
7973
7974 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7975 if (new_item)
7976 {
7977 new_item.SetResultOfSplit(true);
7978 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7980 new_item.SetQuantity(split_quantity_new);
7981 }
7982 }
7983 else if (destination_entity && slot_id == -1)
7984 {
7985 if (quantity > stack_max)
7986 split_quantity_new = stack_max;
7987 else
7988 split_quantity_new = quantity;
7989
7991 {
7994 }
7995
7996 if (new_item)
7997 {
7998 new_item.SetResultOfSplit(true);
7999 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8001 new_item.SetQuantity(split_quantity_new);
8002 }
8003 }
8004 else
8005 {
8006 if (stack_max != 0)
8007 {
8009 {
8011 }
8012
8013 if (split_quantity_new == 0)
8014 {
8015 if (!
GetGame().IsMultiplayer())
8016 player.PhysicalPredictiveDropItem(this);
8017 else
8018 player.ServerDropEntity(this);
8019 return;
8020 }
8021
8023
8024 if (new_item)
8025 {
8026 new_item.SetResultOfSplit(true);
8027 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8029 new_item.SetQuantity(stack_max);
8030 new_item.PlaceOnSurface();
8031 }
8032 }
8033 }
8034 }
8035
8037 {
8039 return;
8040
8041 float split_quantity_new;
8045 InventoryLocation loc = new InventoryLocation;
8046
8047 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8048 {
8050 split_quantity_new = stack_max;
8051 else
8053
8054 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8055 if (new_item)
8056 {
8057 new_item.SetResultOfSplit(true);
8058 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8060 new_item.SetQuantity(split_quantity_new);
8061 }
8062 }
8063 else if (destination_entity && slot_id == -1)
8064 {
8065 if (quantity > stack_max)
8066 split_quantity_new = stack_max;
8067 else
8068 split_quantity_new = quantity;
8069
8071 {
8074 }
8075
8076 if (new_item)
8077 {
8078 new_item.SetResultOfSplit(true);
8079 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8081 new_item.SetQuantity(split_quantity_new);
8082 }
8083 }
8084 else
8085 {
8086 if (stack_max != 0)
8087 {
8089 {
8091 }
8092
8094
8095 if (new_item)
8096 {
8097 new_item.SetResultOfSplit(true);
8098 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8100 new_item.SetQuantity(stack_max);
8101 new_item.PlaceOnSurface();
8102 }
8103 }
8104 }
8105 }
8106
8108 {
8110 return;
8111
8113 {
8114 if (ScriptInputUserData.CanStoreInputUserData())
8115 {
8116 ScriptInputUserData ctx = new ScriptInputUserData;
8121 dst.WriteToContext(ctx);
8123 }
8124 }
8125 else if (!
GetGame().IsMultiplayer())
8126 {
8128 }
8129 }
8130
8132 {
8134 return;
8135
8137 {
8138 if (ScriptInputUserData.CanStoreInputUserData())
8139 {
8140 ScriptInputUserData ctx = new ScriptInputUserData;
8145 ctx.
Write(destination_entity);
8151 }
8152 }
8153 else if (!
GetGame().IsMultiplayer())
8154 {
8156 }
8157 }
8158
8160 {
8162 }
8163
8165 {
8167 return this;
8168
8170 float split_quantity_new;
8172 if (dst.IsValid())
8173 {
8174 int slot_id = dst.GetSlot();
8176
8177 if (quantity > stack_max)
8178 split_quantity_new = stack_max;
8179 else
8180 split_quantity_new = quantity;
8181
8183
8184 if (new_item)
8185 {
8186 new_item.SetResultOfSplit(true);
8187 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8190 }
8191
8192 return new_item;
8193 }
8194
8195 return null;
8196 }
8197
8199 {
8201 return;
8202
8204 float split_quantity_new;
8206 if (destination_entity)
8207 {
8209 if (quantity > stackable)
8210 split_quantity_new = stackable;
8211 else
8212 split_quantity_new = quantity;
8213
8214 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8215 if (new_item)
8216 {
8217 new_item.SetResultOfSplit(true);
8218 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8220 new_item.SetQuantity(split_quantity_new);
8221 }
8222 }
8223 }
8224
8226 {
8228 return;
8229
8231 {
8232 if (ScriptInputUserData.CanStoreInputUserData())
8233 {
8234 ScriptInputUserData ctx = new ScriptInputUserData;
8239 ItemBase destination_entity =
this;
8240 ctx.
Write(destination_entity);
8244 }
8245 }
8246 else if (!
GetGame().IsMultiplayer())
8247 {
8249 }
8250 }
8251
8253 {
8255 return;
8256
8258 float split_quantity_new;
8260 if (player)
8261 {
8263 if (quantity > stackable)
8264 split_quantity_new = stackable;
8265 else
8266 split_quantity_new = quantity;
8267
8268 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8269 new_item =
ItemBase.Cast(in_hands);
8270 if (new_item)
8271 {
8272 new_item.SetResultOfSplit(true);
8273 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8275 new_item.SetQuantity(split_quantity_new);
8276 }
8277 }
8278 }
8279
8281 {
8283 return;
8284
8286 float split_quantity_new = Math.Floor(quantity * 0.5);
8287
8289
8290 if (new_item)
8291 {
8292 if (new_item.GetQuantityMax() < split_quantity_new)
8293 {
8294 split_quantity_new = new_item.GetQuantityMax();
8295 }
8296
8297 new_item.SetResultOfSplit(true);
8298 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8299
8301 {
8304 }
8305 else
8306 {
8309 }
8310 }
8311 }
8312
8314 {
8316 return;
8317
8319 float split_quantity_new = Math.Floor(quantity / 2);
8320
8321 InventoryLocation invloc = new InventoryLocation;
8323
8325 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8326
8327 if (new_item)
8328 {
8329 if (new_item.GetQuantityMax() < split_quantity_new)
8330 {
8331 split_quantity_new = new_item.GetQuantityMax();
8332 }
8334 {
8337 }
8338 else
8339 {
8342 }
8343 }
8344 }
8345
8348 {
8349 SetWeightDirty();
8351
8352 if (parent)
8353 parent.OnAttachmentQuantityChangedEx(this, delta);
8354
8356 {
8358 {
8360 }
8362 {
8363 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8365 }
8366 }
8367
8368 }
8369
8372 {
8373
8374 }
8375
8378 {
8380 }
8381
8383 {
8384 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8385
8387 {
8388 if (newLevel == GameConstants.STATE_RUINED)
8389 {
8391 EntityAI parent = GetHierarchyParent();
8392 if (parent && parent.IsFireplace())
8393 {
8394 CargoBase cargo = GetInventory().GetCargo();
8395 if (cargo)
8396 {
8398 {
8400 }
8401 }
8402 }
8403 }
8404
8406 {
8407
8409 return;
8410 }
8411
8412 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8413 {
8415 }
8416 }
8417 }
8418
8419
8421 {
8422 super.OnRightClick();
8423
8425 {
8427 {
8428 if (ScriptInputUserData.CanStoreInputUserData())
8429 {
8430 vector m4[4];
8432
8433 EntityAI root = GetHierarchyRoot();
8434
8435 InventoryLocation dst = new InventoryLocation;
8437 {
8438 if (root)
8439 {
8440 root.GetTransform(m4);
8442 }
8443 else
8444 GetInventory().GetCurrentInventoryLocation(dst);
8445 }
8446 else
8447 {
8449
8450
8451 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8452 {
8453 if (root)
8454 {
8455 root.GetTransform(m4);
8457 }
8458 else
8459 GetInventory().GetCurrentInventoryLocation(dst);
8460 }
8461 else
8462 {
8463 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8464 }
8465 }
8466
8467 ScriptInputUserData ctx = new ScriptInputUserData;
8475 }
8476 }
8477 else if (!
GetGame().IsMultiplayer())
8478 {
8480 }
8481 }
8482 }
8483
8484 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8485 {
8486
8487 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8488 return false;
8489
8490 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8491 return false;
8492
8493
8495 return false;
8496
8497
8498 Magazine mag = Magazine.Cast(this);
8499 if (mag)
8500 {
8501 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8502 return false;
8503
8504 if (stack_max_limit)
8505 {
8506 Magazine other_mag = Magazine.Cast(other_item);
8507 if (other_item)
8508 {
8509 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8510 return false;
8511 }
8512
8513 }
8514 }
8515 else
8516 {
8517
8519 return false;
8520
8522 return false;
8523 }
8524
8525 PlayerBase player = null;
8526 if (CastTo(player, GetHierarchyRootPlayer()))
8527 {
8528 if (player.GetInventory().HasAttachment(this))
8529 return false;
8530
8531 if (player.IsItemsToDelete())
8532 return false;
8533 }
8534
8535 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8536 return false;
8537
8538 int slotID;
8540 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8541 return false;
8542
8543 return true;
8544 }
8545
8547 {
8549 }
8550
8552 {
8553 return m_IsResultOfSplit;
8554 }
8555
8557 {
8558 m_IsResultOfSplit = value;
8559 }
8560
8562 {
8564 }
8565
8567 {
8568 float other_item_quantity = other_item.GetQuantity();
8569 float this_free_space;
8570
8572
8574
8575 if (other_item_quantity > this_free_space)
8576 {
8577 return this_free_space;
8578 }
8579 else
8580 {
8581 return other_item_quantity;
8582 }
8583 }
8584
8586 {
8588 }
8589
8591 {
8593 return;
8594
8595 if (!IsMagazine() && other_item)
8596 {
8598 if (quantity_used != 0)
8599 {
8600 float hp1 = GetHealth01("","");
8601 float hp2 = other_item.GetHealth01("","");
8602 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8603 hpResult = hpResult / (
GetQuantity() + quantity_used);
8604
8605 hpResult *= GetMaxHealth();
8606 Math.Round(hpResult);
8607 SetHealth("", "Health", hpResult);
8608
8610 other_item.AddQuantity(-quantity_used);
8611 }
8612 }
8614 }
8615
8617 {
8618 #ifdef SERVER
8619 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8620 GetHierarchyParent().IncreaseLifetimeUp();
8621 #endif
8622 };
8623
8625 {
8626 PlayerBase p = PlayerBase.Cast(player);
8627
8628 array<int> recipesIds = p.m_Recipes;
8629 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8630 if (moduleRecipesManager)
8631 {
8632 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8633 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8634 }
8635
8636 for (int i = 0;i < recipesIds.Count(); i++)
8637 {
8638 int key = recipesIds.Get(i);
8639 string recipeName = moduleRecipesManager.GetRecipeName(key);
8641 }
8642 }
8643
8644
8645 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8646 {
8647 super.GetDebugActions(outputList);
8648
8649
8654
8655
8659
8663
8664
8667
8668
8670 {
8673 }
8674
8676
8679
8683 }
8684
8685
8686
8687
8689 {
8690 super.OnAction(action_id, player, ctx);
8691 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8692 {
8693 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8694 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8695 PlayerBase p = PlayerBase.Cast(player);
8696 if (
EActions.RECIPES_RANGE_START < 1000)
8697 {
8698 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8699 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8700 }
8701 }
8702 #ifndef SERVER
8703 else if (action_id ==
EActions.WATCH_PLAYER)
8704 {
8705 PluginDeveloper.SetDeveloperItemClientEx(player);
8706 }
8707 #endif
8709 {
8710 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8711 {
8712 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8713 OnDebugButtonPressServer(id + 1);
8714 }
8715
8716 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8717 {
8718 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8720 }
8721
8722 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8723 {
8724 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8726 }
8727
8728 else if (action_id ==
EActions.ADD_QUANTITY)
8729 {
8730 if (IsMagazine())
8731 {
8732 Magazine mag = Magazine.Cast(this);
8733 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8734 }
8735 else
8736 {
8738 }
8739
8740 if (m_EM)
8741 {
8742 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8743 }
8744
8745 }
8746
8747 else if (action_id ==
EActions.REMOVE_QUANTITY)
8748 {
8749 if (IsMagazine())
8750 {
8751 Magazine mag2 = Magazine.Cast(this);
8752 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8753 }
8754 else
8755 {
8757 }
8758 if (m_EM)
8759 {
8760 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8761 }
8762
8763 }
8764
8765 else if (action_id ==
EActions.SET_QUANTITY_0)
8766 {
8768
8769 if (m_EM)
8770 {
8771 m_EM.SetEnergy(0);
8772 }
8773 }
8774
8775 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8776 {
8778
8779 if (m_EM)
8780 {
8781 m_EM.SetEnergy(m_EM.GetEnergyMax());
8782 }
8783 }
8784
8785 else if (action_id ==
EActions.ADD_HEALTH)
8786 {
8787 AddHealth("","",GetMaxHealth("","Health")/5);
8788 }
8789 else if (action_id ==
EActions.REMOVE_HEALTH)
8790 {
8791 AddHealth("","",-GetMaxHealth("","Health")/5);
8792 }
8793 else if (action_id ==
EActions.DESTROY_HEALTH)
8794 {
8795 SetHealth01("","",0);
8796 }
8797 else if (action_id ==
EActions.WATCH_ITEM)
8798 {
8800 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8801 #ifdef DEVELOPER
8802 SetDebugDeveloper_item(this);
8803 #endif
8804 }
8805
8806 else if (action_id ==
EActions.ADD_TEMPERATURE)
8807 {
8808 AddTemperature(20);
8809
8810 }
8811
8812 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8813 {
8814 AddTemperature(-20);
8815
8816 }
8817
8818 else if (action_id ==
EActions.FLIP_FROZEN)
8819 {
8820 SetFrozen(!GetIsFrozen());
8821
8822 }
8823
8824 else if (action_id ==
EActions.ADD_WETNESS)
8825 {
8827
8828 }
8829
8830 else if (action_id ==
EActions.REMOVE_WETNESS)
8831 {
8833
8834 }
8835
8836 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8837 {
8840
8841
8842 }
8843
8844 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8845 {
8848 }
8849
8850 else if (action_id ==
EActions.MAKE_SPECIAL)
8851 {
8852 auto debugParams = DebugSpawnParams.WithPlayer(player);
8853 OnDebugSpawnEx(debugParams);
8854 }
8855
8856 else if (action_id ==
EActions.DELETE)
8857 {
8858 Delete();
8859 }
8860
8861 }
8862
8863
8864 return false;
8865 }
8866
8867
8868
8869
8873
8876
8877
8878
8880 {
8881 return false;
8882 }
8883
8884
8886 {
8887 return true;
8888 }
8889
8890
8892 {
8893 return true;
8894 }
8895
8896
8897
8899 {
8900 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8902 }
8903
8906 {
8907 return null;
8908 }
8909
8911 {
8912 return false;
8913 }
8914
8916 {
8917 return false;
8918 }
8919
8923
8924
8926 {
8927 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8928 return module_repairing.CanRepair(this, item_repair_kit);
8929 }
8930
8931
8932 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8933 {
8934 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8935 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8936 }
8937
8938
8940 {
8941
8942
8943
8944
8945
8946
8947
8948
8949 return 1;
8950 }
8951
8952
8953
8955 {
8957 }
8958
8959
8960
8962 {
8964 }
8965
8966
8975 {
8976 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8977
8978 if (player)
8979 {
8980 player.MessageStatus(text);
8981 }
8982 }
8983
8984
8993 {
8994 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8995
8996 if (player)
8997 {
8998 player.MessageAction(text);
8999 }
9000 }
9001
9002
9011 {
9012 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9013
9014 if (player)
9015 {
9016 player.MessageFriendly(text);
9017 }
9018 }
9019
9020
9029 {
9030 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9031
9032 if (player)
9033 {
9034 player.MessageImportant(text);
9035 }
9036 }
9037
9039 {
9040 return true;
9041 }
9042
9043
9044 override bool KindOf(
string tag)
9045 {
9046 bool found = false;
9047 string item_name = this.
GetType();
9050
9051 int array_size = item_tag_array.Count();
9052 for (int i = 0; i < array_size; i++)
9053 {
9054 if (item_tag_array.Get(i) == tag)
9055 {
9056 found = true;
9057 break;
9058 }
9059 }
9060 return found;
9061 }
9062
9063
9065 {
9066
9067 super.OnRPC(sender, rpc_type,ctx);
9068
9069
9070 switch (rpc_type)
9071 {
9072 #ifndef SERVER
9073 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9074 Param2<bool, string> p = new Param2<bool, string>(false, "");
9075
9077 return;
9078
9079 bool play = p.param1;
9080 string soundSet = p.param2;
9081
9082 if (play)
9083 {
9085 {
9087 {
9089 }
9090 }
9091 else
9092 {
9094 }
9095 }
9096 else
9097 {
9099 }
9100
9101 break;
9102 #endif
9103
9104 }
9105
9107 {
9109 }
9110 }
9111
9112
9113
9114
9116 {
9117 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9118 return plugin.GetID(
name);
9119 }
9120
9122 {
9123 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9124 return plugin.GetName(id);
9125 }
9126
9129 {
9130
9131
9132 int varFlags;
9133 if (!ctx.
Read(varFlags))
9134 return;
9135
9136 if (varFlags & ItemVariableFlags.FLOAT)
9137 {
9139 }
9140 }
9141
9143 {
9144
9145 super.SerializeNumericalVars(floats_out);
9146
9147
9148
9150 {
9152 }
9153
9155 {
9157 }
9158
9160 {
9162 }
9163
9165 {
9170 }
9171
9173 {
9175 }
9176 }
9177
9179 {
9180
9181 super.DeSerializeNumericalVars(floats);
9182
9183
9184 int index = 0;
9185 int mask = Math.Round(floats.Get(index));
9186
9187 index++;
9188
9190 {
9192 {
9194 }
9195 else
9196 {
9197 float quantity = floats.Get(index);
9199 }
9200 index++;
9201 }
9202
9204 {
9205 float wet = floats.Get(index);
9207 index++;
9208 }
9209
9211 {
9212 int liquidtype = Math.Round(floats.Get(index));
9214 index++;
9215 }
9216
9218 {
9220 index++;
9222 index++;
9224 index++;
9226 index++;
9227 }
9228
9230 {
9231 int cleanness = Math.Round(floats.Get(index));
9233 index++;
9234 }
9235 }
9236
9238 {
9239 super.WriteVarsToCTX(ctx);
9240
9241
9243 {
9245 }
9246
9248 {
9250 }
9251
9253 {
9255 }
9256
9258 {
9259 int r,g,b,a;
9265 }
9266
9268 {
9270 }
9271 }
9272
9274 {
9275 if (!super.ReadVarsFromCTX(ctx,version))
9276 return false;
9277
9278 int intValue;
9279 float value;
9280
9281 if (version < 140)
9282 {
9283 if (!ctx.
Read(intValue))
9284 return false;
9285
9286 m_VariablesMask = intValue;
9287 }
9288
9290 {
9291 if (!ctx.
Read(value))
9292 return false;
9293
9295 {
9297 }
9298 else
9299 {
9301 }
9302 }
9303
9304 if (version < 140)
9305 {
9307 {
9308 if (!ctx.
Read(value))
9309 return false;
9310 SetTemperatureDirect(value);
9311 }
9312 }
9313
9315 {
9316 if (!ctx.
Read(value))
9317 return false;
9319 }
9320
9322 {
9323 if (!ctx.
Read(intValue))
9324 return false;
9326 }
9327
9329 {
9330 int r,g,b,a;
9332 return false;
9334 return false;
9336 return false;
9338 return false;
9339
9341 }
9342
9344 {
9345 if (!ctx.
Read(intValue))
9346 return false;
9348 }
9349
9350 if (version >= 138 && version < 140)
9351 {
9353 {
9354 if (!ctx.
Read(intValue))
9355 return false;
9356 SetFrozen(intValue);
9357 }
9358 }
9359
9360 return true;
9361 }
9362
9363
9365 {
9368 {
9370 }
9371
9372 if (!super.OnStoreLoad(ctx, version))
9373 {
9375 return false;
9376 }
9377
9378 if (version >= 114)
9379 {
9380 bool hasQuickBarIndexSaved;
9381
9382 if (!ctx.
Read(hasQuickBarIndexSaved))
9383 {
9385 return false;
9386 }
9387
9388 if (hasQuickBarIndexSaved)
9389 {
9390 int itmQBIndex;
9391
9392
9393 if (!ctx.
Read(itmQBIndex))
9394 {
9396 return false;
9397 }
9398
9399 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9400 if (itmQBIndex != -1 && parentPlayer)
9401 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9402 }
9403 }
9404 else
9405 {
9406
9407 PlayerBase player;
9408 int itemQBIndex;
9409 if (version ==
int.
MAX)
9410 {
9411 if (!ctx.
Read(itemQBIndex))
9412 {
9414 return false;
9415 }
9416 }
9417 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9418 {
9419
9420 if (!ctx.
Read(itemQBIndex))
9421 {
9423 return false;
9424 }
9425 if (itemQBIndex != -1 && player)
9426 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9427 }
9428 }
9429
9430 if (version < 140)
9431 {
9432
9433 if (!LoadVariables(ctx, version))
9434 {
9436 return false;
9437 }
9438 }
9439
9440
9442 {
9444 return false;
9445 }
9446 if (version >= 132)
9447 {
9449 if (raib)
9450 {
9452 {
9454 return false;
9455 }
9456 }
9457 }
9458
9460 return true;
9461 }
9462
9463
9464
9466 {
9467 super.OnStoreSave(ctx);
9468
9469 PlayerBase player;
9470 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9471 {
9473
9474 int itemQBIndex = -1;
9475 itemQBIndex = player.FindQuickBarEntityIndex(this);
9476 ctx.
Write(itemQBIndex);
9477 }
9478 else
9479 {
9481 }
9482
9484
9486 if (raib)
9487 {
9489 }
9490 }
9491
9492
9494 {
9495 super.AfterStoreLoad();
9496
9498 {
9500 }
9501
9503 {
9506 }
9507 }
9508
9510 {
9511 super.EEOnAfterLoad();
9512
9514 {
9516 }
9517
9520 }
9521
9523 {
9524 return false;
9525 }
9526
9527
9528
9530 {
9532 {
9533 #ifdef PLATFORM_CONSOLE
9534
9536 {
9538 if (menu)
9539 {
9541 }
9542 }
9543 #endif
9544 }
9545
9547 {
9550 }
9551
9553 {
9554 SetWeightDirty();
9556 }
9558 {
9561 }
9562
9564 {
9567 }
9569 {
9572 }
9573
9574 super.OnVariablesSynchronized();
9575 }
9576
9577
9578
9580 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9581 {
9582 if (!IsServerCheck(allow_client))
9583 return false;
9584
9586 return false;
9587
9590
9591 if (value <= (min + 0.001))
9592 value = min;
9593
9594 if (value == min)
9595 {
9596 if (destroy_config)
9597 {
9598 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9599 if (dstr)
9600 {
9602 this.Delete();
9603 return true;
9604 }
9605 }
9606 else if (destroy_forced)
9607 {
9609 this.Delete();
9610 return true;
9611 }
9612
9614 }
9615
9618
9620 {
9622
9623 if (delta)
9625 }
9626
9628
9629 return false;
9630 }
9631
9632
9634 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9635 {
9637 }
9638
9640 {
9643 }
9644
9646 {
9649 }
9650
9653 {
9654 float value_clamped = Math.Clamp(value, 0, 1);
9656 SetQuantity(result, destroy_config, destroy_forced);
9657 }
9658
9659
9662 {
9664 }
9665
9667 {
9669 }
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9681 {
9682 int slot = -1;
9683 if (GetInventory())
9684 {
9685 InventoryLocation il = new InventoryLocation;
9686 GetInventory().GetCurrentInventoryLocation(il);
9688 }
9689
9691 }
9692
9694 {
9695 float quantity_max = 0;
9696
9698 {
9699 if (attSlotID != -1)
9700 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9701
9702 if (quantity_max <= 0)
9704 }
9705
9706 if (quantity_max <= 0)
9708
9709 return quantity_max;
9710 }
9711
9713 {
9715 }
9716
9718 {
9720 }
9721
9722
9724 {
9726 }
9727
9729 {
9731 }
9732
9734 {
9736 }
9737
9738
9740 {
9741
9742 float weightEx = GetWeightEx();
9743 float special = GetInventoryAndCargoWeight();
9744 return weightEx - special;
9745 }
9746
9747
9749 {
9751 }
9752
9754 {
9756 {
9757 #ifdef DEVELOPER
9758 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9759 {
9760 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9762 }
9763 #endif
9764
9766 }
9767 else if (HasEnergyManager())
9768 {
9769 #ifdef DEVELOPER
9770 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9771 {
9772 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9773 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9774 }
9775 #endif
9776 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9777 }
9778 else
9779 {
9780 #ifdef DEVELOPER
9781 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9782 {
9783 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9784 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9785 }
9786 #endif
9787 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9788 }
9789 }
9790
9793 {
9794 int item_count = 0;
9796
9797 if (GetInventory().GetCargo() != NULL)
9798 {
9799 item_count = GetInventory().GetCargo().GetItemCount();
9800 }
9801
9802 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9803 {
9804 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9805 if (item)
9806 item_count += item.GetNumberOfItems();
9807 }
9808 return item_count;
9809 }
9810
9813 {
9814 float weight = 0;
9815 float wetness = 1;
9816 if (include_wetness)
9819 {
9820 weight = wetness * m_ConfigWeight;
9821 }
9823 {
9824 weight = 1;
9825 }
9826 return weight;
9827 }
9828
9829
9830
9832 {
9833 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9834 {
9835 GameInventory inv = GetInventory();
9836 array<EntityAI> items = new array<EntityAI>;
9838 for (int i = 0; i < items.Count(); i++)
9839 {
9841 if (item)
9842 {
9844 }
9845 }
9846 }
9847 }
9848
9849
9850
9851
9853 {
9854 float energy = 0;
9855 if (HasEnergyManager())
9856 {
9857 energy = GetCompEM().GetEnergy();
9858 }
9859 return energy;
9860 }
9861
9862
9864 {
9865 super.OnEnergyConsumed();
9866
9868 }
9869
9871 {
9872 super.OnEnergyAdded();
9873
9875 }
9876
9877
9879 {
9880 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9881 {
9883 {
9884 float energy_0to1 = GetCompEM().GetEnergy0To1();
9886 }
9887 }
9888 }
9889
9890
9892 {
9893 return ConfigGetFloat("heatIsolation");
9894 }
9895
9897 {
9899 }
9900
9902 {
9903 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9904 if (
GetGame().ConfigIsExisting(paramPath))
9906
9907 return 0.0;
9908 }
9909
9911 {
9912 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9913 if (
GetGame().ConfigIsExisting(paramPath))
9915
9916 return 0.0;
9917 }
9918
9919 override void SetWet(
float value,
bool allow_client =
false)
9920 {
9921 if (!IsServerCheck(allow_client))
9922 return;
9923
9926
9928
9929 m_VarWet = Math.Clamp(value, min, max);
9930
9932 {
9935 }
9936 }
9937
9938 override void AddWet(
float value)
9939 {
9941 }
9942
9944 {
9946 }
9947
9949 {
9951 }
9952
9954 {
9956 }
9957
9959 {
9961 }
9962
9964 {
9966 }
9967
9969 {
9972 if (newLevel != oldLevel)
9973 {
9975 }
9976 }
9977
9979 {
9980 SetWeightDirty();
9981 }
9982
9984 {
9985 return GetWetLevelInternal(
m_VarWet);
9986 }
9987
9988
9989
9991 {
9993 }
9994
9996 {
9998 }
9999
10001 {
10003 }
10004
10006 {
10008 }
10009
10010
10011
10013 {
10014 if (ConfigIsExisting("itemModelLength"))
10015 {
10016 return ConfigGetFloat("itemModelLength");
10017 }
10018 return 0;
10019 }
10020
10022 {
10023 if (ConfigIsExisting("itemAttachOffset"))
10024 {
10025 return ConfigGetFloat("itemAttachOffset");
10026 }
10027 return 0;
10028 }
10029
10030 override void SetCleanness(
int value,
bool allow_client =
false)
10031 {
10032 if (!IsServerCheck(allow_client))
10033 return;
10034
10036
10038
10041 }
10042
10044 {
10046 }
10047
10049 {
10050 return true;
10051 }
10052
10053
10054
10055
10057 {
10059 }
10060
10062 {
10064 }
10065
10066
10067
10068
10069 override void SetColor(
int r,
int g,
int b,
int a)
10070 {
10076 }
10078 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10079 {
10084 }
10085
10087 {
10089 }
10090
10093 {
10094 int r,g,b,a;
10096 r = r/255;
10097 g = g/255;
10098 b = b/255;
10099 a = a/255;
10100 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10101 }
10102
10103
10104
10105 override void SetLiquidType(
int value,
bool allow_client =
false)
10106 {
10107 if (!IsServerCheck(allow_client))
10108 return;
10109
10114 }
10115
10117 {
10118 return ConfigGetInt("varLiquidTypeInit");
10119 }
10120
10122 {
10124 }
10125
10127 {
10129 SetFrozen(false);
10130 }
10131
10134 {
10135 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10136 }
10137
10138
10141 {
10142 PlayerBase nplayer;
10143 if (PlayerBase.CastTo(nplayer, player))
10144 {
10146
10147 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10148 }
10149 }
10150
10151
10154 {
10155 PlayerBase nplayer;
10156 if (PlayerBase.CastTo(nplayer,player))
10157 {
10158
10159 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10160
10161 }
10162
10163
10164 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10165
10166
10167 if (HasEnergyManager())
10168 {
10169 GetCompEM().UpdatePlugState();
10170 }
10171 }
10172
10173
10175 {
10176 super.OnPlacementStarted(player);
10177
10179 }
10180
10181 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10182 {
10184 {
10185 m_AdminLog.OnPlacementComplete(player,
this);
10186 }
10187
10188 super.OnPlacementComplete(player, position, orientation);
10189 }
10190
10191
10192
10193
10194
10196 {
10198 {
10199 return true;
10200 }
10201 else
10202 {
10203 return false;
10204 }
10205 }
10206
10207
10209 {
10211 {
10213 }
10214 }
10215
10216
10218 {
10220 }
10221
10223 {
10225 }
10226
10227 override void InsertAgent(
int agent,
float count = 1)
10228 {
10229 if (count < 1)
10230 return;
10231
10233 }
10234
10237 {
10239 }
10240
10241
10243 {
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
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10289 {
10291 return false;
10292 return true;
10293 }
10294
10296 {
10297
10299 }
10300
10301
10304 {
10305 super.CheckForRoofLimited(timeTresholdMS);
10306
10308 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10309 {
10310 m_PreviousRoofTestTime = time;
10311 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10312 }
10313 }
10314
10315
10317 {
10319 {
10320 return 0;
10321 }
10322
10323 if (GetInventory().GetAttachmentSlotsCount() != 0)
10324 {
10325 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10326 if (filter)
10327 return filter.GetProtectionLevel(type, false, system);
10328 else
10329 return 0;
10330 }
10331
10332 string subclassPath, entryName;
10333
10334 switch (type)
10335 {
10337 entryName = "biological";
10338 break;
10340 entryName = "chemical";
10341 break;
10342 default:
10343 entryName = "biological";
10344 break;
10345 }
10346
10347 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10348
10350 }
10351
10352
10353
10356 {
10357 if (!IsMagazine())
10359
10361 }
10362
10363
10364
10365
10366
10371 {
10372 return true;
10373 }
10374
10376 {
10378 }
10379
10380
10381
10382
10383
10385 {
10386 if (parent)
10387 {
10388 if (parent.IsInherited(DayZInfected))
10389 return true;
10390
10391 if (!parent.IsRuined())
10392 return true;
10393 }
10394
10395 return true;
10396 }
10397
10399 {
10400 if (!super.CanPutAsAttachment(parent))
10401 {
10402 return false;
10403 }
10404
10405 if (!IsRuined() && !parent.IsRuined())
10406 {
10407 return true;
10408 }
10409
10410 return false;
10411 }
10412
10414 {
10415
10416
10417
10418
10419 return super.CanReceiveItemIntoCargo(item);
10420 }
10421
10423 {
10424
10425
10426
10427
10428 GameInventory attachmentInv = attachment.GetInventory();
10430 {
10431 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10432 return false;
10433 }
10434
10435 InventoryLocation loc = new InventoryLocation();
10436 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10437 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10438 return false;
10439
10440 return super.CanReceiveAttachment(attachment, slotId);
10441 }
10442
10444 {
10445 if (!super.CanReleaseAttachment(attachment))
10446 return false;
10447
10448 return GetInventory().AreChildrenAccessible();
10449 }
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10472 {
10473 int id = muzzle_owner.GetMuzzleID();
10474 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10475
10476 if (WPOF_array)
10477 {
10478 for (int i = 0; i < WPOF_array.Count(); i++)
10479 {
10480 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10481
10482 if (WPOF)
10483 {
10484 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10485 }
10486 }
10487 }
10488 }
10489
10490
10492 {
10493 int id = muzzle_owner.GetMuzzleID();
10495
10496 if (WPOBE_array)
10497 {
10498 for (int i = 0; i < WPOBE_array.Count(); i++)
10499 {
10500 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10501
10502 if (WPOBE)
10503 {
10504 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10505 }
10506 }
10507 }
10508 }
10509
10510
10512 {
10513 int id = muzzle_owner.GetMuzzleID();
10514 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10515
10516 if (WPOOH_array)
10517 {
10518 for (int i = 0; i < WPOOH_array.Count(); i++)
10519 {
10520 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10521
10522 if (WPOOH)
10523 {
10524 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10525 }
10526 }
10527 }
10528 }
10529
10530
10532 {
10533 int id = muzzle_owner.GetMuzzleID();
10534 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10535
10536 if (WPOOH_array)
10537 {
10538 for (int i = 0; i < WPOOH_array.Count(); i++)
10539 {
10540 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10541
10542 if (WPOOH)
10543 {
10544 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10545 }
10546 }
10547 }
10548 }
10549
10550
10552 {
10553 int id = muzzle_owner.GetMuzzleID();
10554 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10555
10556 if (WPOOH_array)
10557 {
10558 for (int i = 0; i < WPOOH_array.Count(); i++)
10559 {
10560 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10561
10562 if (WPOOH)
10563 {
10564 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10565 }
10566 }
10567 }
10568 }
10569
10570
10571
10573 {
10575 {
10576 return true;
10577 }
10578
10579 return false;
10580 }
10581
10583 {
10585 {
10586 return true;
10587 }
10588
10589 return false;
10590 }
10591
10593 {
10595 {
10596 return true;
10597 }
10598
10599 return false;
10600 }
10601
10603 {
10604 return false;
10605 }
10606
10609 {
10610 return UATimeSpent.DEFAULT_DEPLOY;
10611 }
10612
10613
10614
10615
10617 {
10619 SetSynchDirty();
10620 }
10621
10623 {
10625 }
10626
10627
10629 {
10630 return false;
10631 }
10632
10635 {
10636 string att_type = "None";
10637
10638 if (ConfigIsExisting("soundAttType"))
10639 {
10640 att_type = ConfigGetString("soundAttType");
10641 }
10642
10644 }
10645
10647 {
10649 }
10650
10651
10652
10653
10654
10658
10660 {
10663
10665 }
10666
10667
10669 {
10671 return;
10672
10674
10677
10680
10681 SoundParameters params = new SoundParameters();
10685 }
10686
10687
10689 {
10691 return;
10692
10694 SetSynchDirty();
10695
10698 }
10699
10700
10702 {
10704 return;
10705
10707 SetSynchDirty();
10708
10711 }
10712
10714 {
10716 }
10717
10719 {
10721 }
10722
10725 {
10726 if (!
GetGame().IsDedicatedServer())
10727 {
10728 if (ConfigIsExisting("attachSoundSet"))
10729 {
10730 string cfg_path = "";
10731 string soundset = "";
10732 string type_name =
GetType();
10733
10736 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10737 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10738
10739 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10740 {
10741 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10742 {
10743 if (cfg_slot_array[i] == slot_type)
10744 {
10745 soundset = cfg_soundset_array[i];
10746 break;
10747 }
10748 }
10749 }
10750
10751 if (soundset != "")
10752 {
10753 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10755 }
10756 }
10757 }
10758 }
10759
10761 {
10762
10763 }
10764
10765 void OnApply(PlayerBase player);
10766
10768 {
10769 return 1.0;
10770 };
10771
10773 {
10775 }
10776
10778 {
10780 }
10781
10783
10785 {
10786 SetDynamicPhysicsLifeTime(0.01);
10788 }
10789
10791 {
10792 array<string> zone_names = new array<string>;
10793 GetDamageZones(zone_names);
10794 for (int i = 0; i < zone_names.Count(); i++)
10795 {
10796 SetHealthMax(zone_names.Get(i),"Health");
10797 }
10798 SetHealthMax("","Health");
10799 }
10800
10803 {
10804 float global_health = GetHealth01("","Health");
10805 array<string> zones = new array<string>;
10806 GetDamageZones(zones);
10807
10808 for (int i = 0; i < zones.Count(); i++)
10809 {
10810 SetHealth01(zones.Get(i),"Health",global_health);
10811 }
10812 }
10813
10816 {
10817 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10818 }
10819
10821 {
10822 if (!hasRootAsPlayer)
10823 {
10824 if (refParentIB)
10825 {
10826
10827 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10828 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10829
10830 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10831 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10832
10835 }
10836 else
10837 {
10838
10841 }
10842 }
10843 }
10844
10846 {
10848 {
10849 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10850 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10851 {
10852 float heatPermCoef = 1.0;
10854 while (ent)
10855 {
10856 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10857 ent = ent.GetHierarchyParent();
10858 }
10859
10860 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10861 }
10862 }
10863 }
10864
10866 {
10867
10868 EntityAI parent = GetHierarchyParent();
10869 if (!parent)
10870 {
10871 hasParent = false;
10872 hasRootAsPlayer = false;
10873 }
10874 else
10875 {
10876 hasParent = true;
10877 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10878 refParentIB =
ItemBase.Cast(parent);
10879 }
10880 }
10881
10882 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10883 {
10884
10885 }
10886
10888 {
10889
10890 return false;
10891 }
10892
10894 {
10895
10896
10897 return false;
10898 }
10899
10901 {
10902
10903 return false;
10904 }
10905
10908 {
10909 return !GetIsFrozen() &&
IsOpen();
10910 }
10911
10913 {
10914 bool hasParent = false, hasRootAsPlayer = false;
10916
10917 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10918 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10919
10920 if (wwtu || foodDecay)
10921 {
10925
10926 if (processWetness || processTemperature || processDecay)
10927 {
10929
10930 if (processWetness)
10931 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10932
10933 if (processTemperature)
10935
10936 if (processDecay)
10937 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10938 }
10939 }
10940 }
10941
10944 {
10946 }
10947
10949 {
10952
10953 return super.GetTemperatureFreezeThreshold();
10954 }
10955
10957 {
10960
10961 return super.GetTemperatureThawThreshold();
10962 }
10963
10965 {
10968
10969 return super.GetItemOverheatThreshold();
10970 }
10971
10973 {
10975 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10976
10977 return super.GetTemperatureFreezeTime();
10978 }
10979
10981 {
10983 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10984
10985 return super.GetTemperatureThawTime();
10986 }
10987
10992
10994 {
10995 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10996 }
10997
10999 {
11000 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11001 }
11002
11005 {
11007 }
11008
11010 {
11012 }
11013
11015 {
11017 }
11018
11021 {
11022 return null;
11023 }
11024
11027 {
11028 return false;
11029 }
11030
11032 {
11034 {
11037 if (!trg)
11038 {
11040 explosive = this;
11041 }
11042
11043 explosive.PairRemote(trg);
11045
11046 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11047 trg.SetPersistentPairID(persistentID);
11048 explosive.SetPersistentPairID(persistentID);
11049
11050 return true;
11051 }
11052 return false;
11053 }
11054
11057 {
11058 float ret = 1.0;
11061 ret *= GetHealth01();
11062
11063 return ret;
11064 }
11065
11066 #ifdef DEVELOPER
11067 override void SetDebugItem()
11068 {
11069 super.SetDebugItem();
11070 _itemBase = this;
11071 }
11072
11074 {
11075 string text = super.GetDebugText();
11076
11078 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11079
11080 return text;
11081 }
11082 #endif
11083
11085 {
11086 return true;
11087 }
11088
11090
11092
11094 {
11097 }
11098
11099
11107
11123}
11124
11126{
11128 if (entity)
11129 {
11130 bool is_item = entity.IsInherited(
ItemBase);
11131 if (is_item && full_quantity)
11132 {
11135 }
11136 }
11137 else
11138 {
11140 return NULL;
11141 }
11142 return entity;
11143}
11144
11146{
11147 if (item)
11148 {
11149 if (health > 0)
11150 item.SetHealth("", "", health);
11151
11152 if (item.CanHaveTemperature())
11153 {
11155 if (item.CanFreeze())
11156 item.SetFrozen(false);
11157 }
11158
11159 if (item.HasEnergyManager())
11160 {
11161 if (quantity >= 0)
11162 {
11163 item.GetCompEM().SetEnergy0To1(quantity);
11164 }
11165 else
11166 {
11168 }
11169 }
11170 else if (item.IsMagazine())
11171 {
11172 Magazine mag = Magazine.Cast(item);
11173 if (quantity >= 0)
11174 {
11175 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11176 }
11177 else
11178 {
11180 }
11181
11182 }
11183 else
11184 {
11185 if (quantity >= 0)
11186 {
11187 item.SetQuantityNormalized(quantity, false);
11188 }
11189 else
11190 {
11192 }
11193
11194 }
11195 }
11196}
11197
11198#ifdef DEVELOPER
11200#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.