6093{
6095 {
6096 return true;
6097 }
6098};
6099
6100
6101
6103{
6107
6109
6112
6113
6114
6115
6116
6125
6131
6136
6141
6162 protected bool m_IsResultOfSplit
6163
6165
6170
6171
6172
6174
6178
6179
6180
6182
6185
6186
6187
6193
6194
6202
6205
6206
6208
6209
6211
6212
6217
6218
6223
6224
6226
6227
6229 {
6234
6235 if (!
GetGame().IsDedicatedServer())
6236 {
6238 {
6240
6242 {
6244 }
6245 }
6246
6249 }
6250
6251 m_OldLocation = null;
6252
6254 {
6256 }
6257
6258 if (ConfigIsExisting("headSelectionsToHide"))
6259 {
6262 }
6263
6265 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6266 {
6268 }
6269
6271
6272 m_IsResultOfSplit = false;
6273
6275 }
6276
6278 {
6279 super.InitItemVariables();
6280
6286 m_Count = ConfigGetInt(
"count");
6287
6290
6295
6298
6303
6315
6319
6320
6323 if (ConfigIsExisting("canBeSplit"))
6324 {
6327 }
6328
6330 if (ConfigIsExisting("itemBehaviour"))
6332
6333
6336 RegisterNetSyncVariableInt("m_VarLiquidType");
6337 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6338
6339 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6340 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6341 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6342
6343 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6344 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6345 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6346 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6347
6348 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6349 RegisterNetSyncVariableBool("m_IsTakeable");
6350 RegisterNetSyncVariableBool("m_IsHologram");
6351
6354 {
6357 }
6358
6360
6362 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6364
6365 }
6366
6368 {
6370 }
6371
6373 {
6376 {
6381 }
6382 }
6383
6384 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6385 {
6387 {
6390 }
6391
6393 }
6394
6396 {
6402 }
6403
6405
6407 {
6409
6410 if (!action)
6411 {
6412 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6413 return;
6414 }
6415
6417 if (!ai)
6418 {
6420 return;
6421 }
6422
6424 if (!action_array)
6425 {
6426 action_array = new array<ActionBase_Basic>;
6428 }
6429 if (LogManager.IsActionLogEnable())
6430 {
6431 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6432 }
6433
6434 if (action_array.Find(action) != -1)
6435 {
6436 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6437 }
6438 else
6439 {
6440 action_array.Insert(action);
6441 }
6442 }
6443
6445 {
6447 ActionBase action = player.GetActionManager().GetAction(actionName);
6450
6451 if (action_array)
6452 {
6453 action_array.RemoveItem(action);
6454 }
6455 }
6456
6457
6458
6460 {
6461 ActionOverrideData overrideData = new ActionOverrideData();
6465
6467 if (!actionMap)
6468 {
6471 }
6472
6473 actionMap.Insert(this.
Type(), overrideData);
6474
6475 }
6476
6478
6480
6481
6483 {
6486
6489
6490 string config_to_search = "CfgVehicles";
6491 string muzzle_owner_config;
6492
6494 {
6495 if (IsInherited(Weapon))
6496 config_to_search = "CfgWeapons";
6497
6498 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6499
6500 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6501
6503
6504 if (config_OnFire_subclass_count > 0)
6505 {
6506 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6507
6508 for (int i = 0; i < config_OnFire_subclass_count; i++)
6509 {
6510 string particle_class = "";
6512 string config_OnFire_entry = config_OnFire_class + particle_class;
6513 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6514 WPOF_array.Insert(WPOF);
6515 }
6516
6517
6519 }
6520 }
6521
6523 {
6524 config_to_search = "CfgWeapons";
6525 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6526
6527 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6528
6530
6531 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6532 {
6533 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6534
6535 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6536 {
6537 string particle_class2 = "";
6539 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6540 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6541 WPOBE_array.Insert(WPOBE);
6542 }
6543
6544
6546 }
6547 }
6548 }
6549
6550
6552 {
6555
6557 {
6558 string config_to_search = "CfgVehicles";
6559
6560 if (IsInherited(Weapon))
6561 config_to_search = "CfgWeapons";
6562
6563 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6564 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6565
6566 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6567 {
6568
6570
6572 {
6574 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6576 return;
6577 }
6578
6581
6582
6583
6585 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6586
6587 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6588 {
6589 string particle_class = "";
6591 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6593
6594 if (entry_type == CT_CLASS)
6595 {
6596 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6597 WPOOH_array.Insert(WPOF);
6598 }
6599 }
6600
6601
6603 }
6604 }
6605 }
6606
6608 {
6610 }
6611
6613 {
6615 {
6617
6620
6623
6624 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6625 }
6626 }
6627
6629 {
6631 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6632
6634 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6635
6637 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6638
6640 {
6642 }
6643 }
6644
6646 {
6648 }
6649
6651 {
6654 else
6656
6658 {
6661 }
6662 else
6663 {
6666
6669 }
6670
6672 }
6673
6675 {
6677 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6678 }
6679
6681 {
6683 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6685 }
6686
6688 {
6690 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6691 }
6692
6694 {
6697
6698 OverheatingParticle OP = new OverheatingParticle();
6703
6705 }
6706
6708 {
6711
6712 return -1;
6713 }
6714
6716 {
6718 {
6721
6722 for (int i = count; i > 0; --i)
6723 {
6724 int id = i - 1;
6727
6730
6731 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6732 {
6733 if (p)
6734 {
6737 }
6738 }
6739 }
6740 }
6741 }
6742
6744 {
6746 {
6748 {
6749 int id = i - 1;
6751
6752 if (OP)
6753 {
6755
6756 if (p)
6757 {
6759 }
6760
6761 delete OP;
6762 }
6763 }
6764
6767 }
6768 }
6769
6772 {
6773 return 0.0;
6774 }
6775
6776
6778 {
6779 return 250;
6780 }
6781
6783 {
6784 return 0;
6785 }
6786
6789 {
6791 return true;
6792
6793 return false;
6794 }
6795
6798 {
6801
6803 {
6805 }
6806 else
6807 {
6808
6810 }
6811
6813 }
6814
6821 {
6822 return -1;
6823 }
6824
6825
6826
6827
6829 {
6831 {
6833 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6834
6835 if (r_index >= 0)
6836 {
6837 InventoryLocation r_il = new InventoryLocation;
6838 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6839
6840 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6843 {
6844 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6845 }
6847 {
6848 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6849 }
6850
6851 }
6852
6853 player.GetHumanInventory().ClearUserReservedLocation(this);
6854 }
6855
6858 }
6859
6860
6861
6862
6864 {
6865 return ItemBase.m_DebugActionsMask;
6866 }
6867
6869 {
6870 return ItemBase.m_DebugActionsMask & mask;
6871 }
6872
6874 {
6875 ItemBase.m_DebugActionsMask = mask;
6876 }
6877
6879 {
6880 ItemBase.m_DebugActionsMask |= mask;
6881 }
6882
6884 {
6885 ItemBase.m_DebugActionsMask &= ~mask;
6886 }
6887
6889 {
6891 {
6893 }
6894 else
6895 {
6897 }
6898 }
6899
6900
6902 {
6903 if (GetEconomyProfile())
6904 {
6905 float q_max = GetEconomyProfile().GetQuantityMax();
6906 if (q_max > 0)
6907 {
6908 float q_min = GetEconomyProfile().GetQuantityMin();
6909 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6910
6912 {
6913 ComponentEnergyManager comp = GetCompEM();
6915 {
6917 }
6918 }
6920 {
6922
6923 }
6924
6925 }
6926 }
6927 }
6928
6931 {
6932 EntityAI parent = GetHierarchyParent();
6933
6934 if (parent)
6935 {
6936 InventoryLocation inventory_location_to_lock = new InventoryLocation;
6937 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
6938 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
6939 }
6940 }
6941
6944 {
6945 EntityAI parent = GetHierarchyParent();
6946
6947 if (parent)
6948 {
6949 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
6950 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
6951 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
6952 }
6953 }
6954
6956 {
6957
6958
6959
6960
6962
6964 {
6965 if (ScriptInputUserData.CanStoreInputUserData())
6966 {
6967 ScriptInputUserData ctx = new ScriptInputUserData;
6973 ctx.
Write(use_stack_max);
6976
6978 {
6979 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
6980 }
6981 }
6982 }
6983 else if (!
GetGame().IsMultiplayer())
6984 {
6986 }
6987 }
6988
6990 {
6992 }
6993
6995 {
6997 }
6998
7000 {
7002 }
7003
7005 {
7006
7007 return false;
7008 }
7009
7011 {
7012 return false;
7013 }
7014
7018 {
7019 return false;
7020 }
7021
7023 {
7024 return "";
7025 }
7026
7028
7030 {
7031 return false;
7032 }
7033
7035 {
7036 return true;
7037 }
7038
7039
7040
7042 {
7043 return true;
7044 }
7045
7047 {
7048 return true;
7049 }
7050
7052 {
7053 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7055 }
7056
7058 {
7060 }
7061
7063 {
7065 if (!is_being_placed)
7067 SetSynchDirty();
7068 }
7069
7070
7072
7074 {
7076 }
7077
7079 {
7081 }
7082
7084 {
7085 return 1;
7086 }
7087
7089 {
7090 return false;
7091 }
7092
7094 {
7096 SetSynchDirty();
7097 }
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7134 {
7135 super.OnMovedInsideCargo(container);
7136
7137 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7138 }
7139
7140 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7141 {
7142 super.EEItemLocationChanged(oldLoc,newLoc);
7143
7144 PlayerBase new_player = null;
7145 PlayerBase old_player = null;
7146
7147 if (newLoc.GetParent())
7148 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7149
7150 if (oldLoc.GetParent())
7151 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7152
7154 {
7155 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7156
7157 if (r_index >= 0)
7158 {
7159 InventoryLocation r_il = new InventoryLocation;
7160 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7161
7162 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7165 {
7166 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7167 }
7169 {
7170 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7171 }
7172
7173 }
7174 }
7175
7177 {
7178 if (new_player)
7179 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7180
7181 if (new_player == old_player)
7182 {
7183
7184 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7185 {
7187 {
7188 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7189 {
7190 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7191 }
7192 }
7193 else
7194 {
7195 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7196 }
7197 }
7198
7199 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7200 {
7201 int type = oldLoc.GetType();
7203 {
7204 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7205 }
7207 {
7208 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7209 }
7210 }
7211 if (!m_OldLocation)
7212 {
7213 m_OldLocation = new InventoryLocation;
7214 }
7215 m_OldLocation.Copy(oldLoc);
7216 }
7217 else
7218 {
7219 if (m_OldLocation)
7220 {
7221 m_OldLocation.Reset();
7222 }
7223 }
7224
7226 }
7227 else
7228 {
7229 if (new_player)
7230 {
7231 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7232 if (res_index >= 0)
7233 {
7234 InventoryLocation il = new InventoryLocation;
7235 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7237 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7240 {
7241 il.
GetParent().GetOnReleaseLock().Invoke(it);
7242 }
7244 {
7246 }
7247
7248 }
7249 }
7251 {
7252
7254 }
7255
7256 if (m_OldLocation)
7257 {
7258 m_OldLocation.Reset();
7259 }
7260 }
7261 }
7262
7263 override void EOnContact(IEntity other, Contact extra)
7264 {
7266 {
7267 int liquidType = -1;
7269 if (impactSpeed > 0.0)
7270 {
7272 #ifndef SERVER
7274 #else
7276 SetSynchDirty();
7277 #endif
7279 }
7280 }
7281
7282 #ifdef SERVER
7283 if (GetCompEM() && GetCompEM().IsPlugged())
7284 {
7285 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7286 GetCompEM().UnplugThis();
7287 }
7288 #endif
7289 }
7290
7292
7294 {
7296 }
7297
7299 {
7300
7301 }
7302
7304 {
7305 super.OnItemLocationChanged(old_owner, new_owner);
7306
7307 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7308 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7309
7310 if (!relatedPlayer && playerNew)
7311 relatedPlayer = playerNew;
7312
7313 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7314 {
7316 if (actionMgr)
7317 {
7318 ActionBase currentAction = actionMgr.GetRunningAction();
7319 if (currentAction)
7321 }
7322 }
7323
7324 Man ownerPlayerOld = null;
7325 Man ownerPlayerNew = null;
7326
7327 if (old_owner)
7328 {
7329 if (old_owner.
IsMan())
7330 {
7331 ownerPlayerOld = Man.Cast(old_owner);
7332 }
7333 else
7334 {
7335 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7336 }
7337 }
7338 else
7339 {
7341 {
7343
7344 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7345 {
7346 GetCompEM().UnplugThis();
7347 }
7348 }
7349 }
7350
7351 if (new_owner)
7352 {
7353 if (new_owner.
IsMan())
7354 {
7355 ownerPlayerNew = Man.Cast(new_owner);
7356 }
7357 else
7358 {
7359 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7360 }
7361 }
7362
7363 if (ownerPlayerOld != ownerPlayerNew)
7364 {
7365 if (ownerPlayerOld)
7366 {
7367 array<EntityAI> subItemsExit = new array<EntityAI>;
7369 for (int i = 0; i < subItemsExit.Count(); i++)
7370 {
7373 }
7374 }
7375
7376 if (ownerPlayerNew)
7377 {
7378 array<EntityAI> subItemsEnter = new array<EntityAI>;
7380 for (int j = 0; j < subItemsEnter.Count(); j++)
7381 {
7384 }
7385 }
7386 }
7387 else if (ownerPlayerNew != null)
7388 {
7389 PlayerBase nplayer;
7390 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7391 {
7392 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7394 for (int k = 0; k < subItemsUpdate.Count(); k++)
7395 {
7397 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7398 }
7399 }
7400 }
7401
7402 if (old_owner)
7403 old_owner.OnChildItemRemoved(this);
7404 if (new_owner)
7405 new_owner.OnChildItemReceived(this);
7406 }
7407
7408
7410 {
7411 super.EEDelete(parent);
7412 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7413 if (player)
7414 {
7416
7417 if (player.IsAlive())
7418 {
7419 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7420 if (r_index >= 0)
7421 {
7422 InventoryLocation r_il = new InventoryLocation;
7423 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7424
7425 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7428 {
7429 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7430 }
7432 {
7433 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7434 }
7435
7436 }
7437
7438 player.RemoveQuickBarEntityShortcut(this);
7439 }
7440 }
7441 }
7442
7444 {
7445 super.EEKilled(killer);
7446
7449 {
7450 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7451 {
7452 if (IsMagazine())
7453 {
7454 if (Magazine.Cast(this).GetAmmoCount() > 0)
7455 {
7457 }
7458 }
7459 else
7460 {
7462 }
7463 }
7464 }
7465 }
7466
7468 {
7469 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7470
7471 super.OnWasAttached(parent, slot_id);
7472
7475
7477 }
7478
7480 {
7481 super.OnWasDetached(parent, slot_id);
7482
7485 }
7486
7488 {
7489 int idx;
7492
7493 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7494 if (inventory_slots.Count() < 1)
7495 {
7496 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7497 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7498 }
7499 else
7500 {
7501 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7502 }
7503
7504 idx = inventory_slots.Find(slot);
7505 if (idx < 0)
7506 return "";
7507
7508 return attach_types.Get(idx);
7509 }
7510
7512 {
7513 int idx = -1;
7514 string slot;
7515
7518
7519 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7520 if (inventory_slots.Count() < 1)
7521 {
7522 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7523 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7524 }
7525 else
7526 {
7527 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7528 if (detach_types.Count() < 1)
7529 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7530 }
7531
7532 for (int i = 0; i < inventory_slots.Count(); i++)
7533 {
7534 slot = inventory_slots.Get(i);
7535 }
7536
7537 if (slot != "")
7538 {
7539 if (detach_types.Count() == 1)
7540 idx = 0;
7541 else
7542 idx = inventory_slots.Find(slot);
7543 }
7544 if (idx < 0)
7545 return "";
7546
7547 return detach_types.Get(idx);
7548 }
7549
7551 {
7552
7554
7555
7556 float min_time = 1;
7557 float max_time = 3;
7558 float delay = Math.RandomFloat(min_time, max_time);
7559
7560 explode_timer.Run(delay, this, "DoAmmoExplosion");
7561 }
7562
7564 {
7565 Magazine magazine = Magazine.Cast(this);
7566 int pop_sounds_count = 6;
7567 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7568
7569
7570 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7571 string sound_name = pop_sounds[ sound_idx ];
7573
7574
7575 magazine.ServerAddAmmoCount(-1);
7576
7577
7578 float min_temp_to_explode = 100;
7579
7580 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7581 {
7583 }
7584 }
7585
7586
7587 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7588 {
7589 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7590
7591 const int CHANCE_DAMAGE_CARGO = 4;
7592 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7593 const int CHANCE_DAMAGE_NOTHING = 2;
7594
7596 {
7597 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7598 int chances;
7599 int rnd;
7600
7601 if (GetInventory().GetCargo())
7602 {
7603 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7604 rnd = Math.RandomInt(0,chances);
7605
7606 if (rnd < CHANCE_DAMAGE_CARGO)
7607 {
7609 }
7610 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7611 {
7613 }
7614 }
7615 else
7616 {
7617 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7618 rnd = Math.RandomInt(0,chances);
7619
7620 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7621 {
7623 }
7624 }
7625 }
7626 }
7627
7629 {
7630 if (GetInventory().GetCargo())
7631 {
7632 int item_count = GetInventory().GetCargo().GetItemCount();
7633 if (item_count > 0)
7634 {
7635 int random_pick = Math.RandomInt(0, item_count);
7637 if (!item.IsExplosive())
7638 {
7639 item.AddHealth("","",damage);
7640 return true;
7641 }
7642 }
7643 }
7644 return false;
7645 }
7646
7648 {
7649 int attachment_count = GetInventory().AttachmentCount();
7650 if (attachment_count > 0)
7651 {
7652 int random_pick = Math.RandomInt(0, attachment_count);
7653 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7654 if (!attachment.IsExplosive())
7655 {
7656 attachment.AddHealth("","",damage);
7657 return true;
7658 }
7659 }
7660 return false;
7661 }
7662
7664 {
7666 }
7667
7669 {
7671 return GetInventory().CanRemoveEntity();
7672
7673 return false;
7674 }
7675
7677 {
7679 return;
7680
7682 {
7683 if (ScriptInputUserData.CanStoreInputUserData())
7684 {
7685 ScriptInputUserData ctx = new ScriptInputUserData;
7690 ctx.
Write(destination_entity);
7694 }
7695 }
7696 else if (!
GetGame().IsMultiplayer())
7697 {
7699 }
7700 }
7701
7703 {
7705 return;
7706
7707 float split_quantity_new;
7711 InventoryLocation loc = new InventoryLocation;
7712
7713 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7714 {
7716 split_quantity_new = stack_max;
7717 else
7719
7720 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7721 if (new_item)
7722 {
7723 new_item.SetResultOfSplit(true);
7724 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7726 new_item.SetQuantity(split_quantity_new);
7727 }
7728 }
7729 else if (destination_entity && slot_id == -1)
7730 {
7731 if (quantity > stack_max)
7732 split_quantity_new = stack_max;
7733 else
7734 split_quantity_new = quantity;
7735
7737 {
7740 }
7741
7742 if (new_item)
7743 {
7744 new_item.SetResultOfSplit(true);
7745 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7747 new_item.SetQuantity(split_quantity_new);
7748 }
7749 }
7750 else
7751 {
7752 if (stack_max != 0)
7753 {
7755 {
7757 }
7758
7759 if (split_quantity_new == 0)
7760 {
7761 if (!
GetGame().IsMultiplayer())
7762 player.PhysicalPredictiveDropItem(this);
7763 else
7764 player.ServerDropEntity(this);
7765 return;
7766 }
7767
7769
7770 if (new_item)
7771 {
7772 new_item.SetResultOfSplit(true);
7773 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7775 new_item.SetQuantity(stack_max);
7776 new_item.PlaceOnSurface();
7777 }
7778 }
7779 }
7780 }
7781
7783 {
7785 return;
7786
7787 float split_quantity_new;
7791 InventoryLocation loc = new InventoryLocation;
7792
7793 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7794 {
7796 split_quantity_new = stack_max;
7797 else
7799
7800 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7801 if (new_item)
7802 {
7803 new_item.SetResultOfSplit(true);
7804 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7806 new_item.SetQuantity(split_quantity_new);
7807 }
7808 }
7809 else if (destination_entity && slot_id == -1)
7810 {
7811 if (quantity > stack_max)
7812 split_quantity_new = stack_max;
7813 else
7814 split_quantity_new = quantity;
7815
7817 {
7820 }
7821
7822 if (new_item)
7823 {
7824 new_item.SetResultOfSplit(true);
7825 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7827 new_item.SetQuantity(split_quantity_new);
7828 }
7829 }
7830 else
7831 {
7832 if (stack_max != 0)
7833 {
7835 {
7837 }
7838
7840
7841 if (new_item)
7842 {
7843 new_item.SetResultOfSplit(true);
7844 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7846 new_item.SetQuantity(stack_max);
7847 new_item.PlaceOnSurface();
7848 }
7849 }
7850 }
7851 }
7852
7854 {
7856 return;
7857
7859 {
7860 if (ScriptInputUserData.CanStoreInputUserData())
7861 {
7862 ScriptInputUserData ctx = new ScriptInputUserData;
7867 dst.WriteToContext(ctx);
7869 }
7870 }
7871 else if (!
GetGame().IsMultiplayer())
7872 {
7874 }
7875 }
7876
7878 {
7880 return;
7881
7883 {
7884 if (ScriptInputUserData.CanStoreInputUserData())
7885 {
7886 ScriptInputUserData ctx = new ScriptInputUserData;
7891 ctx.
Write(destination_entity);
7897 }
7898 }
7899 else if (!
GetGame().IsMultiplayer())
7900 {
7902 }
7903 }
7904
7906 {
7908 }
7909
7911 {
7913 return this;
7914
7916 float split_quantity_new;
7918 if (dst.IsValid())
7919 {
7920 int slot_id = dst.GetSlot();
7922
7923 if (quantity > stack_max)
7924 split_quantity_new = stack_max;
7925 else
7926 split_quantity_new = quantity;
7927
7929
7930 if (new_item)
7931 {
7932 new_item.SetResultOfSplit(true);
7933 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7936 }
7937
7938 return new_item;
7939 }
7940
7941 return null;
7942 }
7943
7945 {
7947 return;
7948
7950 float split_quantity_new;
7952 if (destination_entity)
7953 {
7955 if (quantity > stackable)
7956 split_quantity_new = stackable;
7957 else
7958 split_quantity_new = quantity;
7959
7960 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
7961 if (new_item)
7962 {
7963 new_item.SetResultOfSplit(true);
7964 MiscGameplayFunctions.TransferItemProperties(this,new_item);
7966 new_item.SetQuantity(split_quantity_new);
7967 }
7968 }
7969 }
7970
7972 {
7974 return;
7975
7977 {
7978 if (ScriptInputUserData.CanStoreInputUserData())
7979 {
7980 ScriptInputUserData ctx = new ScriptInputUserData;
7985 ItemBase destination_entity =
this;
7986 ctx.
Write(destination_entity);
7990 }
7991 }
7992 else if (!
GetGame().IsMultiplayer())
7993 {
7995 }
7996 }
7997
7999 {
8001 return;
8002
8004 float split_quantity_new;
8006 if (player)
8007 {
8009 if (quantity > stackable)
8010 split_quantity_new = stackable;
8011 else
8012 split_quantity_new = quantity;
8013
8014 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8015 new_item =
ItemBase.Cast(in_hands);
8016 if (new_item)
8017 {
8018 new_item.SetResultOfSplit(true);
8019 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8021 new_item.SetQuantity(split_quantity_new);
8022 }
8023 }
8024 }
8025
8027 {
8029 return;
8030
8032 float split_quantity_new = Math.Floor(quantity * 0.5);
8033
8035
8036 if (new_item)
8037 {
8038 if (new_item.GetQuantityMax() < split_quantity_new)
8039 {
8040 split_quantity_new = new_item.GetQuantityMax();
8041 }
8042
8043 new_item.SetResultOfSplit(true);
8044 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8045
8047 {
8050 }
8051 else
8052 {
8055 }
8056 }
8057 }
8058
8060 {
8062 return;
8063
8065 float split_quantity_new = Math.Floor(quantity / 2);
8066
8067 InventoryLocation invloc = new InventoryLocation;
8069
8071 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8072
8073 if (new_item)
8074 {
8075 if (new_item.GetQuantityMax() < split_quantity_new)
8076 {
8077 split_quantity_new = new_item.GetQuantityMax();
8078 }
8080 {
8083 }
8084 else
8085 {
8088 }
8089 }
8090 }
8091
8094 {
8095 SetWeightDirty();
8097
8098 if (parent)
8099 parent.OnAttachmentQuantityChangedEx(this, delta);
8100
8102 {
8104 {
8106 }
8108 {
8109 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8111 }
8112 }
8113
8114 }
8115
8118 {
8119
8120 }
8121
8124 {
8126 }
8127
8129 {
8130 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8131
8133 {
8134 if (newLevel == GameConstants.STATE_RUINED)
8135 {
8137 EntityAI parent = GetHierarchyParent();
8138 if (parent && parent.IsFireplace())
8139 {
8140 CargoBase cargo = GetInventory().GetCargo();
8141 if (cargo)
8142 {
8144 {
8146 }
8147 }
8148 }
8149 }
8150
8152 {
8153
8155 return;
8156 }
8157
8158 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8159 {
8161 }
8162 }
8163 }
8164
8165
8167 {
8168 super.OnRightClick();
8169
8171 {
8173 {
8174 if (ScriptInputUserData.CanStoreInputUserData())
8175 {
8176 vector m4[4];
8178
8179 EntityAI root = GetHierarchyRoot();
8180
8181 InventoryLocation dst = new InventoryLocation;
8183 {
8184 if (root)
8185 {
8186 root.GetTransform(m4);
8188 }
8189 else
8190 GetInventory().GetCurrentInventoryLocation(dst);
8191 }
8192 else
8193 {
8195
8196
8197 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8198 {
8199 if (root)
8200 {
8201 root.GetTransform(m4);
8203 }
8204 else
8205 GetInventory().GetCurrentInventoryLocation(dst);
8206 }
8207 else
8208 {
8209 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8210 }
8211 }
8212
8213 ScriptInputUserData ctx = new ScriptInputUserData;
8221 }
8222 }
8223 else if (!
GetGame().IsMultiplayer())
8224 {
8226 }
8227 }
8228 }
8229
8230 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8231 {
8232
8233 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8234 return false;
8235
8236 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8237 return false;
8238
8239
8241 return false;
8242
8243
8244 Magazine mag = Magazine.Cast(this);
8245 if (mag)
8246 {
8247 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8248 return false;
8249
8250 if (stack_max_limit)
8251 {
8252 Magazine other_mag = Magazine.Cast(other_item);
8253 if (other_item)
8254 {
8255 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8256 return false;
8257 }
8258
8259 }
8260 }
8261 else
8262 {
8263
8265 return false;
8266
8268 return false;
8269 }
8270
8271 PlayerBase player = null;
8272 if (CastTo(player, GetHierarchyRootPlayer()))
8273 {
8274 if (player.GetInventory().HasAttachment(this))
8275 return false;
8276
8277 if (player.IsItemsToDelete())
8278 return false;
8279 }
8280
8281 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8282 return false;
8283
8284 int slotID;
8286 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8287 return false;
8288
8289 return true;
8290 }
8291
8293 {
8295 }
8296
8298 {
8299 return m_IsResultOfSplit;
8300 }
8301
8303 {
8304 m_IsResultOfSplit = value;
8305 }
8306
8308 {
8310 }
8311
8313 {
8314 float other_item_quantity = other_item.GetQuantity();
8315 float this_free_space;
8316
8318
8320
8321 if (other_item_quantity > this_free_space)
8322 {
8323 return this_free_space;
8324 }
8325 else
8326 {
8327 return other_item_quantity;
8328 }
8329 }
8330
8332 {
8334 }
8335
8337 {
8339 return;
8340
8341 if (!IsMagazine() && other_item)
8342 {
8344 if (quantity_used != 0)
8345 {
8346 float hp1 = GetHealth01("","");
8347 float hp2 = other_item.GetHealth01("","");
8348 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8349 hpResult = hpResult / (
GetQuantity() + quantity_used);
8350
8351 hpResult *= GetMaxHealth();
8352 Math.Round(hpResult);
8353 SetHealth("", "Health", hpResult);
8354
8356 other_item.AddQuantity(-quantity_used);
8357 }
8358 }
8360 }
8361
8363 {
8364 #ifdef SERVER
8365 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8366 GetHierarchyParent().IncreaseLifetimeUp();
8367 #endif
8368 };
8369
8371 {
8372 PlayerBase p = PlayerBase.Cast(player);
8373
8374 array<int> recipesIds = p.m_Recipes;
8375 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8376 if (moduleRecipesManager)
8377 {
8378 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8379 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8380 }
8381
8382 for (int i = 0;i < recipesIds.Count(); i++)
8383 {
8384 int key = recipesIds.Get(i);
8385 string recipeName = moduleRecipesManager.GetRecipeName(key);
8387 }
8388 }
8389
8390
8391 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8392 {
8393 super.GetDebugActions(outputList);
8394
8395
8400
8401
8405
8409
8410
8413
8414
8416 {
8419 }
8420
8422
8425
8429 }
8430
8431
8432
8433
8435 {
8436 super.OnAction(action_id, player, ctx);
8437 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8438 {
8439 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8440 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8441 PlayerBase p = PlayerBase.Cast(player);
8442 if (
EActions.RECIPES_RANGE_START < 1000)
8443 {
8444 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8445 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8446 }
8447 }
8448 #ifndef SERVER
8449 else if (action_id ==
EActions.WATCH_PLAYER)
8450 {
8451 PluginDeveloper.SetDeveloperItemClientEx(player);
8452 }
8453 #endif
8455 {
8456 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8457 {
8458 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8459 OnDebugButtonPressServer(id + 1);
8460 }
8461
8462 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8463 {
8464 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8466 }
8467
8468 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8469 {
8470 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8472 }
8473
8474 else if (action_id ==
EActions.ADD_QUANTITY)
8475 {
8476 if (IsMagazine())
8477 {
8478 Magazine mag = Magazine.Cast(this);
8479 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8480 }
8481 else
8482 {
8484 }
8485
8486 if (m_EM)
8487 {
8488 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8489 }
8490
8491 }
8492
8493 else if (action_id ==
EActions.REMOVE_QUANTITY)
8494 {
8495 if (IsMagazine())
8496 {
8497 Magazine mag2 = Magazine.Cast(this);
8498 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8499 }
8500 else
8501 {
8503 }
8504 if (m_EM)
8505 {
8506 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8507 }
8508
8509 }
8510
8511 else if (action_id ==
EActions.SET_QUANTITY_0)
8512 {
8514
8515 if (m_EM)
8516 {
8517 m_EM.SetEnergy(0);
8518 }
8519 }
8520
8521 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8522 {
8524
8525 if (m_EM)
8526 {
8527 m_EM.SetEnergy(m_EM.GetEnergyMax());
8528 }
8529 }
8530
8531 else if (action_id ==
EActions.ADD_HEALTH)
8532 {
8533 AddHealth("","",GetMaxHealth("","Health")/5);
8534 }
8535 else if (action_id ==
EActions.REMOVE_HEALTH)
8536 {
8537 AddHealth("","",-GetMaxHealth("","Health")/5);
8538 }
8539 else if (action_id ==
EActions.DESTROY_HEALTH)
8540 {
8541 SetHealth01("","",0);
8542 }
8543 else if (action_id ==
EActions.WATCH_ITEM)
8544 {
8546 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8547 #ifdef DEVELOPER
8548 SetDebugDeveloper_item(this);
8549 #endif
8550 }
8551
8552 else if (action_id ==
EActions.ADD_TEMPERATURE)
8553 {
8554 AddTemperature(20);
8555
8556 }
8557
8558 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8559 {
8560 AddTemperature(-20);
8561
8562 }
8563
8564 else if (action_id ==
EActions.FLIP_FROZEN)
8565 {
8566 SetFrozen(!GetIsFrozen());
8567
8568 }
8569
8570 else if (action_id ==
EActions.ADD_WETNESS)
8571 {
8573
8574 }
8575
8576 else if (action_id ==
EActions.REMOVE_WETNESS)
8577 {
8579
8580 }
8581
8582 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8583 {
8586
8587
8588 }
8589
8590 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8591 {
8594 }
8595
8596 else if (action_id ==
EActions.MAKE_SPECIAL)
8597 {
8598 auto debugParams = DebugSpawnParams.WithPlayer(player);
8599 OnDebugSpawnEx(debugParams);
8600 }
8601
8602 else if (action_id ==
EActions.DELETE)
8603 {
8604 Delete();
8605 }
8606
8607 }
8608
8609
8610 return false;
8611 }
8612
8613
8614
8615
8619
8622
8623
8624
8626 {
8627 return false;
8628 }
8629
8630
8632 {
8633 return true;
8634 }
8635
8636
8638 {
8639 return true;
8640 }
8641
8642
8643
8645 {
8646 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8648 }
8649
8652 {
8653 return null;
8654 }
8655
8657 {
8658 return false;
8659 }
8660
8662 {
8663 return false;
8664 }
8665
8669
8670
8672 {
8673 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8674 return module_repairing.CanRepair(this, item_repair_kit);
8675 }
8676
8677
8678 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8679 {
8680 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8681 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8682 }
8683
8684
8686 {
8687
8688
8689
8690
8691
8692
8693
8694
8695 return 1;
8696 }
8697
8698
8699
8701 {
8703 }
8704
8705
8706
8708 {
8710 }
8711
8712
8721 {
8722 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8723
8724 if (player)
8725 {
8726 player.MessageStatus(text);
8727 }
8728 }
8729
8730
8739 {
8740 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8741
8742 if (player)
8743 {
8744 player.MessageAction(text);
8745 }
8746 }
8747
8748
8757 {
8758 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8759
8760 if (player)
8761 {
8762 player.MessageFriendly(text);
8763 }
8764 }
8765
8766
8775 {
8776 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8777
8778 if (player)
8779 {
8780 player.MessageImportant(text);
8781 }
8782 }
8783
8785 {
8786 return true;
8787 }
8788
8789
8790 override bool KindOf(
string tag)
8791 {
8792 bool found = false;
8793 string item_name = this.
GetType();
8796
8797 int array_size = item_tag_array.Count();
8798 for (int i = 0; i < array_size; i++)
8799 {
8800 if (item_tag_array.Get(i) == tag)
8801 {
8802 found = true;
8803 break;
8804 }
8805 }
8806 return found;
8807 }
8808
8809
8811 {
8812
8813 super.OnRPC(sender, rpc_type,ctx);
8814
8815
8816 switch (rpc_type)
8817 {
8818 #ifndef SERVER
8819 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8820 Param2<bool, string> p = new Param2<bool, string>(false, "");
8821
8823 return;
8824
8825 bool play = p.param1;
8826 string soundSet = p.param2;
8827
8828 if (play)
8829 {
8831 {
8833 {
8835 }
8836 }
8837 else
8838 {
8840 }
8841 }
8842 else
8843 {
8845 }
8846
8847 break;
8848 #endif
8849
8850 }
8851
8853 {
8855 }
8856 }
8857
8858
8859
8860
8862 {
8863 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8864 return plugin.GetID(
name);
8865 }
8866
8868 {
8869 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8870 return plugin.GetName(id);
8871 }
8872
8875 {
8876
8877
8878 int varFlags;
8879 if (!ctx.
Read(varFlags))
8880 return;
8881
8882 if (varFlags & ItemVariableFlags.FLOAT)
8883 {
8885 }
8886 }
8887
8889 {
8890
8891 super.SerializeNumericalVars(floats_out);
8892
8893
8894
8896 {
8898 }
8899
8901 {
8903 }
8904
8906 {
8908 }
8909
8911 {
8916 }
8917
8919 {
8921 }
8922 }
8923
8925 {
8926
8927 super.DeSerializeNumericalVars(floats);
8928
8929
8930 int index = 0;
8931 int mask = Math.Round(floats.Get(index));
8932
8933 index++;
8934
8936 {
8938 {
8940 }
8941 else
8942 {
8943 float quantity = floats.Get(index);
8945 }
8946 index++;
8947 }
8948
8950 {
8951 float wet = floats.Get(index);
8953 index++;
8954 }
8955
8957 {
8958 int liquidtype = Math.Round(floats.Get(index));
8960 index++;
8961 }
8962
8964 {
8966 index++;
8968 index++;
8970 index++;
8972 index++;
8973 }
8974
8976 {
8977 int cleanness = Math.Round(floats.Get(index));
8979 index++;
8980 }
8981 }
8982
8984 {
8985 super.WriteVarsToCTX(ctx);
8986
8987
8989 {
8991 }
8992
8994 {
8996 }
8997
8999 {
9001 }
9002
9004 {
9005 int r,g,b,a;
9011 }
9012
9014 {
9016 }
9017 }
9018
9020 {
9021 if (!super.ReadVarsFromCTX(ctx,version))
9022 return false;
9023
9024 int intValue;
9025 float value;
9026
9027 if (version < 140)
9028 {
9029 if (!ctx.
Read(intValue))
9030 return false;
9031
9032 m_VariablesMask = intValue;
9033 }
9034
9036 {
9037 if (!ctx.
Read(value))
9038 return false;
9039
9041 {
9043 }
9044 else
9045 {
9047 }
9048 }
9049
9050 if (version < 140)
9051 {
9053 {
9054 if (!ctx.
Read(value))
9055 return false;
9056 SetTemperatureDirect(value);
9057 }
9058 }
9059
9061 {
9062 if (!ctx.
Read(value))
9063 return false;
9065 }
9066
9068 {
9069 if (!ctx.
Read(intValue))
9070 return false;
9072 }
9073
9075 {
9076 int r,g,b,a;
9078 return false;
9080 return false;
9082 return false;
9084 return false;
9085
9087 }
9088
9090 {
9091 if (!ctx.
Read(intValue))
9092 return false;
9094 }
9095
9096 if (version >= 138 && version < 140)
9097 {
9099 {
9100 if (!ctx.
Read(intValue))
9101 return false;
9102 SetFrozen(intValue);
9103 }
9104 }
9105
9106 return true;
9107 }
9108
9109
9111 {
9114 {
9116 }
9117
9118 if (!super.OnStoreLoad(ctx, version))
9119 {
9121 return false;
9122 }
9123
9124 if (version >= 114)
9125 {
9126 bool hasQuickBarIndexSaved;
9127
9128 if (!ctx.
Read(hasQuickBarIndexSaved))
9129 {
9131 return false;
9132 }
9133
9134 if (hasQuickBarIndexSaved)
9135 {
9136 int itmQBIndex;
9137
9138
9139 if (!ctx.
Read(itmQBIndex))
9140 {
9142 return false;
9143 }
9144
9145 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9146 if (itmQBIndex != -1 && parentPlayer)
9147 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9148 }
9149 }
9150 else
9151 {
9152
9153 PlayerBase player;
9154 int itemQBIndex;
9155 if (version ==
int.
MAX)
9156 {
9157 if (!ctx.
Read(itemQBIndex))
9158 {
9160 return false;
9161 }
9162 }
9163 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9164 {
9165
9166 if (!ctx.
Read(itemQBIndex))
9167 {
9169 return false;
9170 }
9171 if (itemQBIndex != -1 && player)
9172 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9173 }
9174 }
9175
9176 if (version < 140)
9177 {
9178
9179 if (!LoadVariables(ctx, version))
9180 {
9182 return false;
9183 }
9184 }
9185
9186
9188 {
9190 return false;
9191 }
9192 if (version >= 132)
9193 {
9195 if (raib)
9196 {
9198 {
9200 return false;
9201 }
9202 }
9203 }
9204
9206 return true;
9207 }
9208
9209
9210
9212 {
9213 super.OnStoreSave(ctx);
9214
9215 PlayerBase player;
9216 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9217 {
9219
9220 int itemQBIndex = -1;
9221 itemQBIndex = player.FindQuickBarEntityIndex(this);
9222 ctx.
Write(itemQBIndex);
9223 }
9224 else
9225 {
9227 }
9228
9230
9232 if (raib)
9233 {
9235 }
9236 }
9237
9238
9240 {
9241 super.AfterStoreLoad();
9242
9244 {
9246 }
9247
9249 {
9252 }
9253 }
9254
9256 {
9257 super.EEOnAfterLoad();
9258
9260 {
9262 }
9263
9266 }
9267
9269 {
9270 return false;
9271 }
9272
9273
9274
9276 {
9278 {
9279 #ifdef PLATFORM_CONSOLE
9280
9282 {
9284 if (menu)
9285 {
9287 }
9288 }
9289 #endif
9290 }
9291
9293 {
9296 }
9297
9299 {
9300 SetWeightDirty();
9302 }
9304 {
9307 }
9308
9310 {
9313 }
9315 {
9318 }
9319
9320 super.OnVariablesSynchronized();
9321 }
9322
9323
9324
9326 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9327 {
9328 if (!IsServerCheck(allow_client))
9329 return false;
9330
9332 return false;
9333
9336
9337 if (value <= (min + 0.001))
9338 value = min;
9339
9340 if (value == min)
9341 {
9342 if (destroy_config)
9343 {
9344 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9345 if (dstr)
9346 {
9348 this.Delete();
9349 return true;
9350 }
9351 }
9352 else if (destroy_forced)
9353 {
9355 this.Delete();
9356 return true;
9357 }
9358
9360 }
9361
9364
9366 {
9368
9369 if (delta)
9371 }
9372
9374
9375 return false;
9376 }
9377
9378
9380 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9381 {
9383 }
9384
9386 {
9389 }
9390
9392 {
9395 }
9396
9399 {
9400 float value_clamped = Math.Clamp(value, 0, 1);
9402 SetQuantity(result, destroy_config, destroy_forced);
9403 }
9404
9405
9408 {
9410 }
9411
9413 {
9415 }
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9427 {
9428 int slot = -1;
9429 if (GetInventory())
9430 {
9431 InventoryLocation il = new InventoryLocation;
9432 GetInventory().GetCurrentInventoryLocation(il);
9434 }
9435
9437 }
9438
9440 {
9441 float quantity_max = 0;
9442
9444 {
9445 if (attSlotID != -1)
9446 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9447
9448 if (quantity_max <= 0)
9450 }
9451
9452 if (quantity_max <= 0)
9454
9455 return quantity_max;
9456 }
9457
9459 {
9461 }
9462
9464 {
9466 }
9467
9468
9470 {
9472 }
9473
9475 {
9477 }
9478
9480 {
9482 }
9483
9484
9486 {
9487
9488 float weightEx = GetWeightEx();
9489 float special = GetInventoryAndCargoWeight();
9490 return weightEx - special;
9491 }
9492
9493
9495 {
9497 }
9498
9500 {
9502 {
9503 #ifdef DEVELOPER
9504 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9505 {
9506 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9508 }
9509 #endif
9510
9512 }
9513 else if (HasEnergyManager())
9514 {
9515 #ifdef DEVELOPER
9516 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9517 {
9518 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9519 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9520 }
9521 #endif
9522 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9523 }
9524 else
9525 {
9526 #ifdef DEVELOPER
9527 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9528 {
9529 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9530 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9531 }
9532 #endif
9533 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9534 }
9535 }
9536
9539 {
9540 int item_count = 0;
9542
9543 if (GetInventory().GetCargo() != NULL)
9544 {
9545 item_count = GetInventory().GetCargo().GetItemCount();
9546 }
9547
9548 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9549 {
9550 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9551 if (item)
9552 item_count += item.GetNumberOfItems();
9553 }
9554 return item_count;
9555 }
9556
9559 {
9560 float weight = 0;
9561 float wetness = 1;
9562 if (include_wetness)
9565 {
9566 weight = wetness * m_ConfigWeight;
9567 }
9569 {
9570 weight = 1;
9571 }
9572 return weight;
9573 }
9574
9575
9576
9578 {
9579 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9580 {
9581 GameInventory inv = GetInventory();
9582 array<EntityAI> items = new array<EntityAI>;
9584 for (int i = 0; i < items.Count(); i++)
9585 {
9587 if (item)
9588 {
9590 }
9591 }
9592 }
9593 }
9594
9595
9596
9597
9599 {
9600 float energy = 0;
9601 if (HasEnergyManager())
9602 {
9603 energy = GetCompEM().GetEnergy();
9604 }
9605 return energy;
9606 }
9607
9608
9610 {
9611 super.OnEnergyConsumed();
9612
9614 }
9615
9617 {
9618 super.OnEnergyAdded();
9619
9621 }
9622
9623
9625 {
9626 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9627 {
9629 {
9630 float energy_0to1 = GetCompEM().GetEnergy0To1();
9632 }
9633 }
9634 }
9635
9636
9638 {
9639 return ConfigGetFloat("heatIsolation");
9640 }
9641
9643 {
9645 }
9646
9648 {
9649 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9650 if (
GetGame().ConfigIsExisting(paramPath))
9652
9653 return 0.0;
9654 }
9655
9657 {
9658 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9659 if (
GetGame().ConfigIsExisting(paramPath))
9661
9662 return 0.0;
9663 }
9664
9665 override void SetWet(
float value,
bool allow_client =
false)
9666 {
9667 if (!IsServerCheck(allow_client))
9668 return;
9669
9672
9674
9675 m_VarWet = Math.Clamp(value, min, max);
9676
9678 {
9681 }
9682 }
9683
9684 override void AddWet(
float value)
9685 {
9687 }
9688
9690 {
9692 }
9693
9695 {
9697 }
9698
9700 {
9702 }
9703
9705 {
9707 }
9708
9710 {
9712 }
9713
9715 {
9718 if (newLevel != oldLevel)
9719 {
9721 }
9722 }
9723
9725 {
9726 SetWeightDirty();
9727 }
9728
9730 {
9731 return GetWetLevelInternal(
m_VarWet);
9732 }
9733
9734
9735
9737 {
9739 }
9740
9742 {
9744 }
9745
9747 {
9749 }
9750
9752 {
9754 }
9755
9756
9757
9759 {
9760 if (ConfigIsExisting("itemModelLength"))
9761 {
9762 return ConfigGetFloat("itemModelLength");
9763 }
9764 return 0;
9765 }
9766
9768 {
9769 if (ConfigIsExisting("itemAttachOffset"))
9770 {
9771 return ConfigGetFloat("itemAttachOffset");
9772 }
9773 return 0;
9774 }
9775
9776 override void SetCleanness(
int value,
bool allow_client =
false)
9777 {
9778 if (!IsServerCheck(allow_client))
9779 return;
9780
9782
9784
9787 }
9788
9790 {
9792 }
9793
9795 {
9796 return true;
9797 }
9798
9799
9800
9801
9803 {
9805 }
9806
9808 {
9810 }
9811
9812
9813
9814
9815 override void SetColor(
int r,
int g,
int b,
int a)
9816 {
9822 }
9824 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9825 {
9830 }
9831
9833 {
9835 }
9836
9839 {
9840 int r,g,b,a;
9842 r = r/255;
9843 g = g/255;
9844 b = b/255;
9845 a = a/255;
9846 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9847 }
9848
9849
9850
9851 override void SetLiquidType(
int value,
bool allow_client =
false)
9852 {
9853 if (!IsServerCheck(allow_client))
9854 return;
9855
9860 }
9861
9863 {
9864 return ConfigGetInt("varLiquidTypeInit");
9865 }
9866
9868 {
9870 }
9871
9873 {
9875 SetFrozen(false);
9876 }
9877
9880 {
9881 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9882 }
9883
9884
9887 {
9888 PlayerBase nplayer;
9889 if (PlayerBase.CastTo(nplayer, player))
9890 {
9892
9893 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9894 }
9895 }
9896
9897
9900 {
9901 PlayerBase nplayer;
9902 if (PlayerBase.CastTo(nplayer,player))
9903 {
9904
9905 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9906
9907 }
9908
9909
9910 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9911
9912
9913 if (HasEnergyManager())
9914 {
9915 GetCompEM().UpdatePlugState();
9916 }
9917 }
9918
9919
9921 {
9922 super.OnPlacementStarted(player);
9923
9925 }
9926
9927 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9928 {
9930 {
9931 m_AdminLog.OnPlacementComplete(player,
this);
9932 }
9933
9934 super.OnPlacementComplete(player, position, orientation);
9935 }
9936
9937
9938
9939
9940
9942 {
9944 {
9945 return true;
9946 }
9947 else
9948 {
9949 return false;
9950 }
9951 }
9952
9953
9955 {
9957 {
9959 }
9960 }
9961
9962
9964 {
9966 }
9967
9969 {
9971 }
9972
9973 override void InsertAgent(
int agent,
float count = 1)
9974 {
9975 if (count < 1)
9976 return;
9977
9979 }
9980
9983 {
9985 }
9986
9987
9989 {
9991 }
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10035 {
10037 return false;
10038 return true;
10039 }
10040
10042 {
10043
10045 }
10046
10047
10050 {
10051 super.CheckForRoofLimited(timeTresholdMS);
10052
10054 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10055 {
10056 m_PreviousRoofTestTime = time;
10057 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10058 }
10059 }
10060
10061
10063 {
10065 {
10066 return 0;
10067 }
10068
10069 if (GetInventory().GetAttachmentSlotsCount() != 0)
10070 {
10071 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10072 if (filter)
10073 return filter.GetProtectionLevel(type, false, system);
10074 else
10075 return 0;
10076 }
10077
10078 string subclassPath, entryName;
10079
10080 switch (type)
10081 {
10083 entryName = "biological";
10084 break;
10086 entryName = "chemical";
10087 break;
10088 default:
10089 entryName = "biological";
10090 break;
10091 }
10092
10093 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10094
10096 }
10097
10098
10099
10102 {
10103 if (!IsMagazine())
10105
10107 }
10108
10109
10110
10111
10112
10117 {
10118 return true;
10119 }
10120
10122 {
10124 }
10125
10126
10127
10128
10129
10131 {
10132 if (parent)
10133 {
10134 if (parent.IsInherited(DayZInfected))
10135 return true;
10136
10137 if (!parent.IsRuined())
10138 return true;
10139 }
10140
10141 return true;
10142 }
10143
10145 {
10146 if (!super.CanPutAsAttachment(parent))
10147 {
10148 return false;
10149 }
10150
10151 if (!IsRuined() && !parent.IsRuined())
10152 {
10153 return true;
10154 }
10155
10156 return false;
10157 }
10158
10160 {
10161
10162
10163
10164
10165 return super.CanReceiveItemIntoCargo(item);
10166 }
10167
10169 {
10170
10171
10172
10173
10174 GameInventory attachmentInv = attachment.GetInventory();
10176 {
10177 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10178 return false;
10179 }
10180
10181 InventoryLocation loc = new InventoryLocation();
10182 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10183 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10184 return false;
10185
10186 return super.CanReceiveAttachment(attachment, slotId);
10187 }
10188
10190 {
10191 if (!super.CanReleaseAttachment(attachment))
10192 return false;
10193
10194 return GetInventory().AreChildrenAccessible();
10195 }
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10218 {
10219 int id = muzzle_owner.GetMuzzleID();
10220 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10221
10222 if (WPOF_array)
10223 {
10224 for (int i = 0; i < WPOF_array.Count(); i++)
10225 {
10226 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10227
10228 if (WPOF)
10229 {
10230 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10231 }
10232 }
10233 }
10234 }
10235
10236
10238 {
10239 int id = muzzle_owner.GetMuzzleID();
10241
10242 if (WPOBE_array)
10243 {
10244 for (int i = 0; i < WPOBE_array.Count(); i++)
10245 {
10246 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10247
10248 if (WPOBE)
10249 {
10250 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10251 }
10252 }
10253 }
10254 }
10255
10256
10258 {
10259 int id = muzzle_owner.GetMuzzleID();
10260 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10261
10262 if (WPOOH_array)
10263 {
10264 for (int i = 0; i < WPOOH_array.Count(); i++)
10265 {
10266 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10267
10268 if (WPOOH)
10269 {
10270 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10271 }
10272 }
10273 }
10274 }
10275
10276
10278 {
10279 int id = muzzle_owner.GetMuzzleID();
10280 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10281
10282 if (WPOOH_array)
10283 {
10284 for (int i = 0; i < WPOOH_array.Count(); i++)
10285 {
10286 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10287
10288 if (WPOOH)
10289 {
10290 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10291 }
10292 }
10293 }
10294 }
10295
10296
10298 {
10299 int id = muzzle_owner.GetMuzzleID();
10300 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10301
10302 if (WPOOH_array)
10303 {
10304 for (int i = 0; i < WPOOH_array.Count(); i++)
10305 {
10306 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10307
10308 if (WPOOH)
10309 {
10310 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10311 }
10312 }
10313 }
10314 }
10315
10316
10317
10319 {
10321 {
10322 return true;
10323 }
10324
10325 return false;
10326 }
10327
10329 {
10331 {
10332 return true;
10333 }
10334
10335 return false;
10336 }
10337
10339 {
10341 {
10342 return true;
10343 }
10344
10345 return false;
10346 }
10347
10349 {
10350 return false;
10351 }
10352
10355 {
10356 return UATimeSpent.DEFAULT_DEPLOY;
10357 }
10358
10359
10360
10361
10363 {
10365 SetSynchDirty();
10366 }
10367
10369 {
10371 }
10372
10373
10375 {
10376 return false;
10377 }
10378
10381 {
10382 string att_type = "None";
10383
10384 if (ConfigIsExisting("soundAttType"))
10385 {
10386 att_type = ConfigGetString("soundAttType");
10387 }
10388
10390 }
10391
10393 {
10395 }
10396
10397
10398
10399
10400
10404
10406 {
10409
10411 }
10412
10413
10415 {
10417 return;
10418
10420
10423
10426
10427 SoundParameters params = new SoundParameters();
10431 }
10432
10433
10435 {
10437 return;
10438
10440 SetSynchDirty();
10441
10444 }
10445
10446
10448 {
10450 return;
10451
10453 SetSynchDirty();
10454
10457 }
10458
10460 {
10462 }
10463
10465 {
10467 }
10468
10471 {
10472 if (!
GetGame().IsDedicatedServer())
10473 {
10474 if (ConfigIsExisting("attachSoundSet"))
10475 {
10476 string cfg_path = "";
10477 string soundset = "";
10478 string type_name =
GetType();
10479
10482 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10483 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10484
10485 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10486 {
10487 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10488 {
10489 if (cfg_slot_array[i] == slot_type)
10490 {
10491 soundset = cfg_soundset_array[i];
10492 break;
10493 }
10494 }
10495 }
10496
10497 if (soundset != "")
10498 {
10499 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10501 }
10502 }
10503 }
10504 }
10505
10507 {
10508
10509 }
10510
10511 void OnApply(PlayerBase player);
10512
10514 {
10515 return 1.0;
10516 };
10517
10519 {
10521 }
10522
10524 {
10526 }
10527
10529
10531 {
10532 SetDynamicPhysicsLifeTime(0.01);
10534 }
10535
10537 {
10538 array<string> zone_names = new array<string>;
10539 GetDamageZones(zone_names);
10540 for (int i = 0; i < zone_names.Count(); i++)
10541 {
10542 SetHealthMax(zone_names.Get(i),"Health");
10543 }
10544 SetHealthMax("","Health");
10545 }
10546
10549 {
10550 float global_health = GetHealth01("","Health");
10551 array<string> zones = new array<string>;
10552 GetDamageZones(zones);
10553
10554 for (int i = 0; i < zones.Count(); i++)
10555 {
10556 SetHealth01(zones.Get(i),"Health",global_health);
10557 }
10558 }
10559
10562 {
10563 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10564 }
10565
10567 {
10568 if (!hasRootAsPlayer)
10569 {
10570 if (refParentIB)
10571 {
10572
10573 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10574 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10575
10576 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10577 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10578
10581 }
10582 else
10583 {
10584
10587 }
10588 }
10589 }
10590
10592 {
10594 {
10595 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10596 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10597 {
10598 float heatPermCoef = 1.0;
10600 while (ent)
10601 {
10602 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10603 ent = ent.GetHierarchyParent();
10604 }
10605
10606 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10607 }
10608 }
10609 }
10610
10612 {
10613
10614 EntityAI parent = GetHierarchyParent();
10615 if (!parent)
10616 {
10617 hasParent = false;
10618 hasRootAsPlayer = false;
10619 }
10620 else
10621 {
10622 hasParent = true;
10623 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10624 refParentIB =
ItemBase.Cast(parent);
10625 }
10626 }
10627
10628 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10629 {
10630
10631 }
10632
10634 {
10635
10636 return false;
10637 }
10638
10640 {
10641
10642
10643 return false;
10644 }
10645
10647 {
10648
10649 return false;
10650 }
10651
10654 {
10655 return !GetIsFrozen() &&
IsOpen();
10656 }
10657
10659 {
10660 bool hasParent = false, hasRootAsPlayer = false;
10662
10663 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10664 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10665
10666 if (wwtu || foodDecay)
10667 {
10671
10672 if (processWetness || processTemperature || processDecay)
10673 {
10675
10676 if (processWetness)
10677 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10678
10679 if (processTemperature)
10681
10682 if (processDecay)
10683 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10684 }
10685 }
10686 }
10687
10690 {
10692 }
10693
10695 {
10698
10699 return super.GetTemperatureFreezeThreshold();
10700 }
10701
10703 {
10706
10707 return super.GetTemperatureThawThreshold();
10708 }
10709
10711 {
10714
10715 return super.GetItemOverheatThreshold();
10716 }
10717
10719 {
10721 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10722
10723 return super.GetTemperatureFreezeTime();
10724 }
10725
10727 {
10729 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10730
10731 return super.GetTemperatureThawTime();
10732 }
10733
10738
10740 {
10741 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10742 }
10743
10745 {
10746 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10747 }
10748
10751 {
10753 }
10754
10756 {
10758 }
10759
10761 {
10763 }
10764
10767 {
10768 return null;
10769 }
10770
10773 {
10774 return false;
10775 }
10776
10778 {
10780 {
10783 if (!trg)
10784 {
10786 explosive = this;
10787 }
10788
10789 explosive.PairRemote(trg);
10791
10792 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10793 trg.SetPersistentPairID(persistentID);
10794 explosive.SetPersistentPairID(persistentID);
10795
10796 return true;
10797 }
10798 return false;
10799 }
10800
10803 {
10804 float ret = 1.0;
10807 ret *= GetHealth01();
10808
10809 return ret;
10810 }
10811
10812 #ifdef DEVELOPER
10813 override void SetDebugItem()
10814 {
10815 super.SetDebugItem();
10816 _itemBase = this;
10817 }
10818
10820 {
10821 string text = super.GetDebugText();
10822
10824 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10825
10826 return text;
10827 }
10828 #endif
10829
10831 {
10832 return true;
10833 }
10834
10836
10838
10840 {
10843 }
10844
10845
10853
10869}
10870
10872{
10874 if (entity)
10875 {
10876 bool is_item = entity.IsInherited(
ItemBase);
10877 if (is_item && full_quantity)
10878 {
10881 }
10882 }
10883 else
10884 {
10886 return NULL;
10887 }
10888 return entity;
10889}
10890
10892{
10893 if (item)
10894 {
10895 if (health > 0)
10896 item.SetHealth("", "", health);
10897
10898 if (item.CanHaveTemperature())
10899 {
10901 if (item.CanFreeze())
10902 item.SetFrozen(false);
10903 }
10904
10905 if (item.HasEnergyManager())
10906 {
10907 if (quantity >= 0)
10908 {
10909 item.GetCompEM().SetEnergy0To1(quantity);
10910 }
10911 else
10912 {
10914 }
10915 }
10916 else if (item.IsMagazine())
10917 {
10918 Magazine mag = Magazine.Cast(item);
10919 if (quantity >= 0)
10920 {
10921 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10922 }
10923 else
10924 {
10926 }
10927
10928 }
10929 else
10930 {
10931 if (quantity >= 0)
10932 {
10933 item.SetQuantityNormalized(quantity, false);
10934 }
10935 else
10936 {
10938 }
10939
10940 }
10941 }
10942}
10943
10944#ifdef DEVELOPER
10946#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.