6163{
6165 {
6166 return true;
6167 }
6168};
6169
6170
6171
6173{
6177
6179
6182
6183
6184
6185
6186
6195
6201
6206
6211
6232 protected bool m_IsResultOfSplit
6233
6235
6240
6241
6242
6244
6248
6249
6250
6252
6255
6256
6257
6263
6264
6272
6275
6276
6278
6279
6281
6282
6287
6288
6293
6294
6296
6297
6299 {
6304
6305 if (!
GetGame().IsDedicatedServer())
6306 {
6308 {
6310
6312 {
6314 }
6315 }
6316
6319 }
6320
6321 m_OldLocation = null;
6322
6324 {
6326 }
6327
6328 if (ConfigIsExisting("headSelectionsToHide"))
6329 {
6332 }
6333
6335 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6336 {
6338 }
6339
6341
6342 m_IsResultOfSplit = false;
6343
6345 }
6346
6348 {
6349 super.InitItemVariables();
6350
6356 m_Count = ConfigGetInt(
"count");
6357
6360
6365
6368
6373
6385
6389
6390
6393 if (ConfigIsExisting("canBeSplit"))
6394 {
6397 }
6398
6400 if (ConfigIsExisting("itemBehaviour"))
6402
6403
6406 RegisterNetSyncVariableInt("m_VarLiquidType");
6407 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6408
6409 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6410 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6411 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6412
6413 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6414 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6415 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6416 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6417
6418 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6419 RegisterNetSyncVariableBool("m_IsTakeable");
6420 RegisterNetSyncVariableBool("m_IsHologram");
6421
6424 {
6427 }
6428
6430
6432 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6434
6435 }
6436
6438 {
6440 }
6441
6443 {
6446 {
6451 }
6452 }
6453
6454 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6455 {
6457 {
6460 }
6461
6463 }
6464
6466 {
6472 }
6473
6475
6477 {
6479
6480 if (!action)
6481 {
6482 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6483 return;
6484 }
6485
6487 if (!ai)
6488 {
6490 return;
6491 }
6492
6494 if (!action_array)
6495 {
6496 action_array = new array<ActionBase_Basic>;
6498 }
6499 if (LogManager.IsActionLogEnable())
6500 {
6501 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6502 }
6503
6504 if (action_array.Find(action) != -1)
6505 {
6506 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6507 }
6508 else
6509 {
6510 action_array.Insert(action);
6511 }
6512 }
6513
6515 {
6517 ActionBase action = player.GetActionManager().GetAction(actionName);
6520
6521 if (action_array)
6522 {
6523 action_array.RemoveItem(action);
6524 }
6525 }
6526
6527
6528
6530 {
6531 ActionOverrideData overrideData = new ActionOverrideData();
6535
6537 if (!actionMap)
6538 {
6541 }
6542
6543 actionMap.Insert(this.
Type(), overrideData);
6544
6545 }
6546
6548
6550
6551
6553 {
6556
6559
6560 string config_to_search = "CfgVehicles";
6561 string muzzle_owner_config;
6562
6564 {
6565 if (IsInherited(Weapon))
6566 config_to_search = "CfgWeapons";
6567
6568 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6569
6570 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6571
6573
6574 if (config_OnFire_subclass_count > 0)
6575 {
6576 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6577
6578 for (int i = 0; i < config_OnFire_subclass_count; i++)
6579 {
6580 string particle_class = "";
6582 string config_OnFire_entry = config_OnFire_class + particle_class;
6583 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6584 WPOF_array.Insert(WPOF);
6585 }
6586
6587
6589 }
6590 }
6591
6593 {
6594 config_to_search = "CfgWeapons";
6595 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6596
6597 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6598
6600
6601 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6602 {
6603 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6604
6605 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6606 {
6607 string particle_class2 = "";
6609 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6610 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6611 WPOBE_array.Insert(WPOBE);
6612 }
6613
6614
6616 }
6617 }
6618 }
6619
6620
6622 {
6625
6627 {
6628 string config_to_search = "CfgVehicles";
6629
6630 if (IsInherited(Weapon))
6631 config_to_search = "CfgWeapons";
6632
6633 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6634 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6635
6636 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6637 {
6638
6640
6642 {
6644 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6646 return;
6647 }
6648
6651
6652
6653
6655 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6656
6657 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6658 {
6659 string particle_class = "";
6661 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6663
6664 if (entry_type == CT_CLASS)
6665 {
6666 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6667 WPOOH_array.Insert(WPOF);
6668 }
6669 }
6670
6671
6673 }
6674 }
6675 }
6676
6678 {
6680 }
6681
6683 {
6685 {
6687
6690
6693
6694 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6695 }
6696 }
6697
6699 {
6701 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6702
6704 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6705
6707 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6708
6710 {
6712 }
6713 }
6714
6716 {
6718 }
6719
6721 {
6724 else
6726
6728 {
6731 }
6732 else
6733 {
6736
6739 }
6740
6742 }
6743
6745 {
6747 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6748 }
6749
6751 {
6753 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6755 }
6756
6758 {
6760 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6761 }
6762
6764 {
6767
6768 OverheatingParticle OP = new OverheatingParticle();
6773
6775 }
6776
6778 {
6781
6782 return -1;
6783 }
6784
6786 {
6788 {
6791
6792 for (int i = count; i > 0; --i)
6793 {
6794 int id = i - 1;
6797
6800
6801 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6802 {
6803 if (p)
6804 {
6807 }
6808 }
6809 }
6810 }
6811 }
6812
6814 {
6816 {
6818 {
6819 int id = i - 1;
6821
6822 if (OP)
6823 {
6825
6826 if (p)
6827 {
6829 }
6830
6831 delete OP;
6832 }
6833 }
6834
6837 }
6838 }
6839
6842 {
6843 return 0.0;
6844 }
6845
6846
6848 {
6849 return 250;
6850 }
6851
6853 {
6854 return 0;
6855 }
6856
6859 {
6861 return true;
6862
6863 return false;
6864 }
6865
6868 {
6871
6873 {
6875 }
6876 else
6877 {
6878
6880 }
6881
6883 }
6884
6891 {
6892 return -1;
6893 }
6894
6895
6896
6897
6899 {
6901 {
6903 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6904
6905 if (r_index >= 0)
6906 {
6907 InventoryLocation r_il = new InventoryLocation;
6908 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6909
6910 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6913 {
6914 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6915 }
6917 {
6918 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
6919 }
6920
6921 }
6922
6923 player.GetHumanInventory().ClearUserReservedLocation(this);
6924 }
6925
6928 }
6929
6930
6931
6932
6934 {
6935 return ItemBase.m_DebugActionsMask;
6936 }
6937
6939 {
6940 return ItemBase.m_DebugActionsMask & mask;
6941 }
6942
6944 {
6945 ItemBase.m_DebugActionsMask = mask;
6946 }
6947
6949 {
6950 ItemBase.m_DebugActionsMask |= mask;
6951 }
6952
6954 {
6955 ItemBase.m_DebugActionsMask &= ~mask;
6956 }
6957
6959 {
6961 {
6963 }
6964 else
6965 {
6967 }
6968 }
6969
6970
6972 {
6973 if (GetEconomyProfile())
6974 {
6975 float q_max = GetEconomyProfile().GetQuantityMax();
6976 if (q_max > 0)
6977 {
6978 float q_min = GetEconomyProfile().GetQuantityMin();
6979 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
6980
6982 {
6983 ComponentEnergyManager comp = GetCompEM();
6985 {
6987 }
6988 }
6990 {
6992
6993 }
6994
6995 }
6996 }
6997 }
6998
7001 {
7002 EntityAI parent = GetHierarchyParent();
7003
7004 if (parent)
7005 {
7006 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7007 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7008 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7009 }
7010 }
7011
7014 {
7015 EntityAI parent = GetHierarchyParent();
7016
7017 if (parent)
7018 {
7019 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7020 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7021 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7022 }
7023 }
7024
7026 {
7027
7028
7029
7030
7032
7034 {
7035 if (ScriptInputUserData.CanStoreInputUserData())
7036 {
7037 ScriptInputUserData ctx = new ScriptInputUserData;
7043 ctx.
Write(use_stack_max);
7046
7048 {
7049 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7050 }
7051 }
7052 }
7053 else if (!
GetGame().IsMultiplayer())
7054 {
7056 }
7057 }
7058
7060 {
7062 }
7063
7065 {
7067 }
7068
7070 {
7072 }
7073
7075 {
7076
7077 return false;
7078 }
7079
7081 {
7082 return false;
7083 }
7084
7088 {
7089 return false;
7090 }
7091
7093 {
7094 return "";
7095 }
7096
7098
7100 {
7101 return false;
7102 }
7103
7105 {
7106 return true;
7107 }
7108
7109
7110
7112 {
7113 return true;
7114 }
7115
7117 {
7118 return true;
7119 }
7120
7122 {
7123 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7125 }
7126
7128 {
7130 }
7131
7133 {
7135 if (!is_being_placed)
7137 SetSynchDirty();
7138 }
7139
7140
7142
7144 {
7146 }
7147
7149 {
7151 }
7152
7154 {
7155 return 1;
7156 }
7157
7159 {
7160 return false;
7161 }
7162
7164 {
7166 SetSynchDirty();
7167 }
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7204 {
7205 super.OnMovedInsideCargo(container);
7206
7207 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7208 }
7209
7210 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7211 {
7212 super.EEItemLocationChanged(oldLoc,newLoc);
7213
7214 PlayerBase new_player = null;
7215 PlayerBase old_player = null;
7216
7217 if (newLoc.GetParent())
7218 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7219
7220 if (oldLoc.GetParent())
7221 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7222
7224 {
7225 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7226
7227 if (r_index >= 0)
7228 {
7229 InventoryLocation r_il = new InventoryLocation;
7230 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7231
7232 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7235 {
7236 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7237 }
7239 {
7240 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7241 }
7242
7243 }
7244 }
7245
7247 {
7248 if (new_player)
7249 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7250
7251 if (new_player == old_player)
7252 {
7253
7254 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7255 {
7257 {
7258 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7259 {
7260 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7261 }
7262 }
7263 else
7264 {
7265 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7266 }
7267 }
7268
7269 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7270 {
7271 int type = oldLoc.GetType();
7273 {
7274 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7275 }
7277 {
7278 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7279 }
7280 }
7281 if (!m_OldLocation)
7282 {
7283 m_OldLocation = new InventoryLocation;
7284 }
7285 m_OldLocation.Copy(oldLoc);
7286 }
7287 else
7288 {
7289 if (m_OldLocation)
7290 {
7291 m_OldLocation.Reset();
7292 }
7293 }
7294
7296 }
7297 else
7298 {
7299 if (new_player)
7300 {
7301 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7302 if (res_index >= 0)
7303 {
7304 InventoryLocation il = new InventoryLocation;
7305 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7307 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7310 {
7311 il.
GetParent().GetOnReleaseLock().Invoke(it);
7312 }
7314 {
7316 }
7317
7318 }
7319 }
7321 {
7322
7324 }
7325
7326 if (m_OldLocation)
7327 {
7328 m_OldLocation.Reset();
7329 }
7330 }
7331 }
7332
7333 override void EOnContact(IEntity other, Contact extra)
7334 {
7336 {
7337 int liquidType = -1;
7339 if (impactSpeed > 0.0)
7340 {
7342 #ifndef SERVER
7344 #else
7346 SetSynchDirty();
7347 #endif
7349 }
7350 }
7351
7352 #ifdef SERVER
7353 if (GetCompEM() && GetCompEM().IsPlugged())
7354 {
7355 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7356 GetCompEM().UnplugThis();
7357 }
7358 #endif
7359 }
7360
7362
7364 {
7366 }
7367
7369 {
7370
7371 }
7372
7374 {
7375 super.OnItemLocationChanged(old_owner, new_owner);
7376
7377 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7378 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7379
7380 if (!relatedPlayer && playerNew)
7381 relatedPlayer = playerNew;
7382
7383 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7384 {
7386 if (actionMgr)
7387 {
7388 ActionBase currentAction = actionMgr.GetRunningAction();
7389 if (currentAction)
7391 }
7392 }
7393
7394 Man ownerPlayerOld = null;
7395 Man ownerPlayerNew = null;
7396
7397 if (old_owner)
7398 {
7399 if (old_owner.
IsMan())
7400 {
7401 ownerPlayerOld = Man.Cast(old_owner);
7402 }
7403 else
7404 {
7405 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7406 }
7407 }
7408 else
7409 {
7411 {
7413
7414 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7415 {
7416 GetCompEM().UnplugThis();
7417 }
7418 }
7419 }
7420
7421 if (new_owner)
7422 {
7423 if (new_owner.
IsMan())
7424 {
7425 ownerPlayerNew = Man.Cast(new_owner);
7426 }
7427 else
7428 {
7429 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7430 }
7431 }
7432
7433 if (ownerPlayerOld != ownerPlayerNew)
7434 {
7435 if (ownerPlayerOld)
7436 {
7437 array<EntityAI> subItemsExit = new array<EntityAI>;
7439 for (int i = 0; i < subItemsExit.Count(); i++)
7440 {
7443 }
7444 }
7445
7446 if (ownerPlayerNew)
7447 {
7448 array<EntityAI> subItemsEnter = new array<EntityAI>;
7450 for (int j = 0; j < subItemsEnter.Count(); j++)
7451 {
7454 }
7455 }
7456 }
7457 else if (ownerPlayerNew != null)
7458 {
7459 PlayerBase nplayer;
7460 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7461 {
7462 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7464 for (int k = 0; k < subItemsUpdate.Count(); k++)
7465 {
7467 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7468 }
7469 }
7470 }
7471
7472 if (old_owner)
7473 old_owner.OnChildItemRemoved(this);
7474 if (new_owner)
7475 new_owner.OnChildItemReceived(this);
7476 }
7477
7478
7480 {
7481 super.EEDelete(parent);
7482 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7483 if (player)
7484 {
7486
7487 if (player.IsAlive())
7488 {
7489 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7490 if (r_index >= 0)
7491 {
7492 InventoryLocation r_il = new InventoryLocation;
7493 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7494
7495 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7498 {
7499 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7500 }
7502 {
7503 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7504 }
7505
7506 }
7507
7508 player.RemoveQuickBarEntityShortcut(this);
7509 }
7510 }
7511 }
7512
7514 {
7515 super.EEKilled(killer);
7516
7519 {
7520 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7521 {
7522 if (IsMagazine())
7523 {
7524 if (Magazine.Cast(this).GetAmmoCount() > 0)
7525 {
7527 }
7528 }
7529 else
7530 {
7532 }
7533 }
7534 }
7535 }
7536
7538 {
7539 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7540
7541 super.OnWasAttached(parent, slot_id);
7542
7545
7547 }
7548
7550 {
7551 super.OnWasDetached(parent, slot_id);
7552
7555 }
7556
7558 {
7559 int idx;
7562
7563 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7564 if (inventory_slots.Count() < 1)
7565 {
7566 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7567 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7568 }
7569 else
7570 {
7571 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7572 }
7573
7574 idx = inventory_slots.Find(slot);
7575 if (idx < 0)
7576 return "";
7577
7578 return attach_types.Get(idx);
7579 }
7580
7582 {
7583 int idx = -1;
7584 string slot;
7585
7588
7589 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7590 if (inventory_slots.Count() < 1)
7591 {
7592 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7593 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7594 }
7595 else
7596 {
7597 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7598 if (detach_types.Count() < 1)
7599 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7600 }
7601
7602 for (int i = 0; i < inventory_slots.Count(); i++)
7603 {
7604 slot = inventory_slots.Get(i);
7605 }
7606
7607 if (slot != "")
7608 {
7609 if (detach_types.Count() == 1)
7610 idx = 0;
7611 else
7612 idx = inventory_slots.Find(slot);
7613 }
7614 if (idx < 0)
7615 return "";
7616
7617 return detach_types.Get(idx);
7618 }
7619
7621 {
7622
7624
7625
7626 float min_time = 1;
7627 float max_time = 3;
7628 float delay = Math.RandomFloat(min_time, max_time);
7629
7630 explode_timer.Run(delay, this, "DoAmmoExplosion");
7631 }
7632
7634 {
7635 Magazine magazine = Magazine.Cast(this);
7636 int pop_sounds_count = 6;
7637 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7638
7639
7640 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7641 string sound_name = pop_sounds[ sound_idx ];
7643
7644
7645 magazine.ServerAddAmmoCount(-1);
7646
7647
7648 float min_temp_to_explode = 100;
7649
7650 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7651 {
7653 }
7654 }
7655
7656
7657 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7658 {
7659 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7660
7661 const int CHANCE_DAMAGE_CARGO = 4;
7662 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7663 const int CHANCE_DAMAGE_NOTHING = 2;
7664
7666 {
7667 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7668 int chances;
7669 int rnd;
7670
7671 if (GetInventory().GetCargo())
7672 {
7673 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7674 rnd = Math.RandomInt(0,chances);
7675
7676 if (rnd < CHANCE_DAMAGE_CARGO)
7677 {
7679 }
7680 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7681 {
7683 }
7684 }
7685 else
7686 {
7687 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7688 rnd = Math.RandomInt(0,chances);
7689
7690 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7691 {
7693 }
7694 }
7695 }
7696 }
7697
7699 {
7700 if (GetInventory().GetCargo())
7701 {
7702 int item_count = GetInventory().GetCargo().GetItemCount();
7703 if (item_count > 0)
7704 {
7705 int random_pick = Math.RandomInt(0, item_count);
7707 if (!item.IsExplosive())
7708 {
7709 item.AddHealth("","",damage);
7710 return true;
7711 }
7712 }
7713 }
7714 return false;
7715 }
7716
7718 {
7719 int attachment_count = GetInventory().AttachmentCount();
7720 if (attachment_count > 0)
7721 {
7722 int random_pick = Math.RandomInt(0, attachment_count);
7723 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7724 if (!attachment.IsExplosive())
7725 {
7726 attachment.AddHealth("","",damage);
7727 return true;
7728 }
7729 }
7730 return false;
7731 }
7732
7734 {
7736 }
7737
7739 {
7741 return GetInventory().CanRemoveEntity();
7742
7743 return false;
7744 }
7745
7747 {
7749 return;
7750
7752 {
7753 if (ScriptInputUserData.CanStoreInputUserData())
7754 {
7755 ScriptInputUserData ctx = new ScriptInputUserData;
7760 ctx.
Write(destination_entity);
7764 }
7765 }
7766 else if (!
GetGame().IsMultiplayer())
7767 {
7769 }
7770 }
7771
7773 {
7775 return;
7776
7777 float split_quantity_new;
7781 InventoryLocation loc = new InventoryLocation;
7782
7783 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7784 {
7786 split_quantity_new = stack_max;
7787 else
7789
7790 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7791 if (new_item)
7792 {
7793 new_item.SetResultOfSplit(true);
7794 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7796 new_item.SetQuantity(split_quantity_new);
7797 }
7798 }
7799 else if (destination_entity && slot_id == -1)
7800 {
7801 if (quantity > stack_max)
7802 split_quantity_new = stack_max;
7803 else
7804 split_quantity_new = quantity;
7805
7807 {
7810 }
7811
7812 if (new_item)
7813 {
7814 new_item.SetResultOfSplit(true);
7815 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7817 new_item.SetQuantity(split_quantity_new);
7818 }
7819 }
7820 else
7821 {
7822 if (stack_max != 0)
7823 {
7825 {
7827 }
7828
7829 if (split_quantity_new == 0)
7830 {
7831 if (!
GetGame().IsMultiplayer())
7832 player.PhysicalPredictiveDropItem(this);
7833 else
7834 player.ServerDropEntity(this);
7835 return;
7836 }
7837
7839
7840 if (new_item)
7841 {
7842 new_item.SetResultOfSplit(true);
7843 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7845 new_item.SetQuantity(stack_max);
7846 new_item.PlaceOnSurface();
7847 }
7848 }
7849 }
7850 }
7851
7853 {
7855 return;
7856
7857 float split_quantity_new;
7861 InventoryLocation loc = new InventoryLocation;
7862
7863 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7864 {
7866 split_quantity_new = stack_max;
7867 else
7869
7870 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7871 if (new_item)
7872 {
7873 new_item.SetResultOfSplit(true);
7874 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7876 new_item.SetQuantity(split_quantity_new);
7877 }
7878 }
7879 else if (destination_entity && slot_id == -1)
7880 {
7881 if (quantity > stack_max)
7882 split_quantity_new = stack_max;
7883 else
7884 split_quantity_new = quantity;
7885
7887 {
7890 }
7891
7892 if (new_item)
7893 {
7894 new_item.SetResultOfSplit(true);
7895 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7897 new_item.SetQuantity(split_quantity_new);
7898 }
7899 }
7900 else
7901 {
7902 if (stack_max != 0)
7903 {
7905 {
7907 }
7908
7910
7911 if (new_item)
7912 {
7913 new_item.SetResultOfSplit(true);
7914 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7916 new_item.SetQuantity(stack_max);
7917 new_item.PlaceOnSurface();
7918 }
7919 }
7920 }
7921 }
7922
7924 {
7926 return;
7927
7929 {
7930 if (ScriptInputUserData.CanStoreInputUserData())
7931 {
7932 ScriptInputUserData ctx = new ScriptInputUserData;
7937 dst.WriteToContext(ctx);
7939 }
7940 }
7941 else if (!
GetGame().IsMultiplayer())
7942 {
7944 }
7945 }
7946
7948 {
7950 return;
7951
7953 {
7954 if (ScriptInputUserData.CanStoreInputUserData())
7955 {
7956 ScriptInputUserData ctx = new ScriptInputUserData;
7961 ctx.
Write(destination_entity);
7967 }
7968 }
7969 else if (!
GetGame().IsMultiplayer())
7970 {
7972 }
7973 }
7974
7976 {
7978 }
7979
7981 {
7983 return this;
7984
7986 float split_quantity_new;
7988 if (dst.IsValid())
7989 {
7990 int slot_id = dst.GetSlot();
7992
7993 if (quantity > stack_max)
7994 split_quantity_new = stack_max;
7995 else
7996 split_quantity_new = quantity;
7997
7999
8000 if (new_item)
8001 {
8002 new_item.SetResultOfSplit(true);
8003 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8006 }
8007
8008 return new_item;
8009 }
8010
8011 return null;
8012 }
8013
8015 {
8017 return;
8018
8020 float split_quantity_new;
8022 if (destination_entity)
8023 {
8025 if (quantity > stackable)
8026 split_quantity_new = stackable;
8027 else
8028 split_quantity_new = quantity;
8029
8030 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8031 if (new_item)
8032 {
8033 new_item.SetResultOfSplit(true);
8034 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8036 new_item.SetQuantity(split_quantity_new);
8037 }
8038 }
8039 }
8040
8042 {
8044 return;
8045
8047 {
8048 if (ScriptInputUserData.CanStoreInputUserData())
8049 {
8050 ScriptInputUserData ctx = new ScriptInputUserData;
8055 ItemBase destination_entity =
this;
8056 ctx.
Write(destination_entity);
8060 }
8061 }
8062 else if (!
GetGame().IsMultiplayer())
8063 {
8065 }
8066 }
8067
8069 {
8071 return;
8072
8074 float split_quantity_new;
8076 if (player)
8077 {
8079 if (quantity > stackable)
8080 split_quantity_new = stackable;
8081 else
8082 split_quantity_new = quantity;
8083
8084 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8085 new_item =
ItemBase.Cast(in_hands);
8086 if (new_item)
8087 {
8088 new_item.SetResultOfSplit(true);
8089 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8091 new_item.SetQuantity(split_quantity_new);
8092 }
8093 }
8094 }
8095
8097 {
8099 return;
8100
8102 float split_quantity_new = Math.Floor(quantity * 0.5);
8103
8105
8106 if (new_item)
8107 {
8108 if (new_item.GetQuantityMax() < split_quantity_new)
8109 {
8110 split_quantity_new = new_item.GetQuantityMax();
8111 }
8112
8113 new_item.SetResultOfSplit(true);
8114 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8115
8117 {
8120 }
8121 else
8122 {
8125 }
8126 }
8127 }
8128
8130 {
8132 return;
8133
8135 float split_quantity_new = Math.Floor(quantity / 2);
8136
8137 InventoryLocation invloc = new InventoryLocation;
8139
8141 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8142
8143 if (new_item)
8144 {
8145 if (new_item.GetQuantityMax() < split_quantity_new)
8146 {
8147 split_quantity_new = new_item.GetQuantityMax();
8148 }
8150 {
8153 }
8154 else
8155 {
8158 }
8159 }
8160 }
8161
8164 {
8165 SetWeightDirty();
8167
8168 if (parent)
8169 parent.OnAttachmentQuantityChangedEx(this, delta);
8170
8172 {
8174 {
8176 }
8178 {
8179 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8181 }
8182 }
8183
8184 }
8185
8188 {
8189
8190 }
8191
8194 {
8196 }
8197
8199 {
8200 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8201
8203 {
8204 if (newLevel == GameConstants.STATE_RUINED)
8205 {
8207 EntityAI parent = GetHierarchyParent();
8208 if (parent && parent.IsFireplace())
8209 {
8210 CargoBase cargo = GetInventory().GetCargo();
8211 if (cargo)
8212 {
8214 {
8216 }
8217 }
8218 }
8219 }
8220
8222 {
8223
8225 return;
8226 }
8227
8228 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8229 {
8231 }
8232 }
8233 }
8234
8235
8237 {
8238 super.OnRightClick();
8239
8241 {
8243 {
8244 if (ScriptInputUserData.CanStoreInputUserData())
8245 {
8246 vector m4[4];
8248
8249 EntityAI root = GetHierarchyRoot();
8250
8251 InventoryLocation dst = new InventoryLocation;
8253 {
8254 if (root)
8255 {
8256 root.GetTransform(m4);
8258 }
8259 else
8260 GetInventory().GetCurrentInventoryLocation(dst);
8261 }
8262 else
8263 {
8265
8266
8267 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8268 {
8269 if (root)
8270 {
8271 root.GetTransform(m4);
8273 }
8274 else
8275 GetInventory().GetCurrentInventoryLocation(dst);
8276 }
8277 else
8278 {
8279 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8280 }
8281 }
8282
8283 ScriptInputUserData ctx = new ScriptInputUserData;
8291 }
8292 }
8293 else if (!
GetGame().IsMultiplayer())
8294 {
8296 }
8297 }
8298 }
8299
8300 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8301 {
8302
8303 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8304 return false;
8305
8306 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8307 return false;
8308
8309
8311 return false;
8312
8313
8314 Magazine mag = Magazine.Cast(this);
8315 if (mag)
8316 {
8317 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8318 return false;
8319
8320 if (stack_max_limit)
8321 {
8322 Magazine other_mag = Magazine.Cast(other_item);
8323 if (other_item)
8324 {
8325 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8326 return false;
8327 }
8328
8329 }
8330 }
8331 else
8332 {
8333
8335 return false;
8336
8338 return false;
8339 }
8340
8341 PlayerBase player = null;
8342 if (CastTo(player, GetHierarchyRootPlayer()))
8343 {
8344 if (player.GetInventory().HasAttachment(this))
8345 return false;
8346
8347 if (player.IsItemsToDelete())
8348 return false;
8349 }
8350
8351 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8352 return false;
8353
8354 int slotID;
8356 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8357 return false;
8358
8359 return true;
8360 }
8361
8363 {
8365 }
8366
8368 {
8369 return m_IsResultOfSplit;
8370 }
8371
8373 {
8374 m_IsResultOfSplit = value;
8375 }
8376
8378 {
8380 }
8381
8383 {
8384 float other_item_quantity = other_item.GetQuantity();
8385 float this_free_space;
8386
8388
8390
8391 if (other_item_quantity > this_free_space)
8392 {
8393 return this_free_space;
8394 }
8395 else
8396 {
8397 return other_item_quantity;
8398 }
8399 }
8400
8402 {
8404 }
8405
8407 {
8409 return;
8410
8411 if (!IsMagazine() && other_item)
8412 {
8414 if (quantity_used != 0)
8415 {
8416 float hp1 = GetHealth01("","");
8417 float hp2 = other_item.GetHealth01("","");
8418 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8419 hpResult = hpResult / (
GetQuantity() + quantity_used);
8420
8421 hpResult *= GetMaxHealth();
8422 Math.Round(hpResult);
8423 SetHealth("", "Health", hpResult);
8424
8426 other_item.AddQuantity(-quantity_used);
8427 }
8428 }
8430 }
8431
8433 {
8434 #ifdef SERVER
8435 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8436 GetHierarchyParent().IncreaseLifetimeUp();
8437 #endif
8438 };
8439
8441 {
8442 PlayerBase p = PlayerBase.Cast(player);
8443
8444 array<int> recipesIds = p.m_Recipes;
8445 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8446 if (moduleRecipesManager)
8447 {
8448 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8449 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8450 }
8451
8452 for (int i = 0;i < recipesIds.Count(); i++)
8453 {
8454 int key = recipesIds.Get(i);
8455 string recipeName = moduleRecipesManager.GetRecipeName(key);
8457 }
8458 }
8459
8460
8461 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8462 {
8463 super.GetDebugActions(outputList);
8464
8465
8470
8471
8475
8479
8480
8483
8484
8486 {
8489 }
8490
8492
8495
8499 }
8500
8501
8502
8503
8505 {
8506 super.OnAction(action_id, player, ctx);
8507 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8508 {
8509 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8510 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8511 PlayerBase p = PlayerBase.Cast(player);
8512 if (
EActions.RECIPES_RANGE_START < 1000)
8513 {
8514 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8515 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8516 }
8517 }
8518 #ifndef SERVER
8519 else if (action_id ==
EActions.WATCH_PLAYER)
8520 {
8521 PluginDeveloper.SetDeveloperItemClientEx(player);
8522 }
8523 #endif
8525 {
8526 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8527 {
8528 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8529 OnDebugButtonPressServer(id + 1);
8530 }
8531
8532 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8533 {
8534 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8536 }
8537
8538 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8539 {
8540 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8542 }
8543
8544 else if (action_id ==
EActions.ADD_QUANTITY)
8545 {
8546 if (IsMagazine())
8547 {
8548 Magazine mag = Magazine.Cast(this);
8549 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8550 }
8551 else
8552 {
8554 }
8555
8556 if (m_EM)
8557 {
8558 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8559 }
8560
8561 }
8562
8563 else if (action_id ==
EActions.REMOVE_QUANTITY)
8564 {
8565 if (IsMagazine())
8566 {
8567 Magazine mag2 = Magazine.Cast(this);
8568 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8569 }
8570 else
8571 {
8573 }
8574 if (m_EM)
8575 {
8576 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8577 }
8578
8579 }
8580
8581 else if (action_id ==
EActions.SET_QUANTITY_0)
8582 {
8584
8585 if (m_EM)
8586 {
8587 m_EM.SetEnergy(0);
8588 }
8589 }
8590
8591 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8592 {
8594
8595 if (m_EM)
8596 {
8597 m_EM.SetEnergy(m_EM.GetEnergyMax());
8598 }
8599 }
8600
8601 else if (action_id ==
EActions.ADD_HEALTH)
8602 {
8603 AddHealth("","",GetMaxHealth("","Health")/5);
8604 }
8605 else if (action_id ==
EActions.REMOVE_HEALTH)
8606 {
8607 AddHealth("","",-GetMaxHealth("","Health")/5);
8608 }
8609 else if (action_id ==
EActions.DESTROY_HEALTH)
8610 {
8611 SetHealth01("","",0);
8612 }
8613 else if (action_id ==
EActions.WATCH_ITEM)
8614 {
8616 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8617 #ifdef DEVELOPER
8618 SetDebugDeveloper_item(this);
8619 #endif
8620 }
8621
8622 else if (action_id ==
EActions.ADD_TEMPERATURE)
8623 {
8624 AddTemperature(20);
8625
8626 }
8627
8628 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8629 {
8630 AddTemperature(-20);
8631
8632 }
8633
8634 else if (action_id ==
EActions.FLIP_FROZEN)
8635 {
8636 SetFrozen(!GetIsFrozen());
8637
8638 }
8639
8640 else if (action_id ==
EActions.ADD_WETNESS)
8641 {
8643
8644 }
8645
8646 else if (action_id ==
EActions.REMOVE_WETNESS)
8647 {
8649
8650 }
8651
8652 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8653 {
8656
8657
8658 }
8659
8660 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8661 {
8664 }
8665
8666 else if (action_id ==
EActions.MAKE_SPECIAL)
8667 {
8668 auto debugParams = DebugSpawnParams.WithPlayer(player);
8669 OnDebugSpawnEx(debugParams);
8670 }
8671
8672 else if (action_id ==
EActions.DELETE)
8673 {
8674 Delete();
8675 }
8676
8677 }
8678
8679
8680 return false;
8681 }
8682
8683
8684
8685
8689
8692
8693
8694
8696 {
8697 return false;
8698 }
8699
8700
8702 {
8703 return true;
8704 }
8705
8706
8708 {
8709 return true;
8710 }
8711
8712
8713
8715 {
8716 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8718 }
8719
8722 {
8723 return null;
8724 }
8725
8727 {
8728 return false;
8729 }
8730
8732 {
8733 return false;
8734 }
8735
8739
8740
8742 {
8743 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8744 return module_repairing.CanRepair(this, item_repair_kit);
8745 }
8746
8747
8748 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8749 {
8750 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8751 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8752 }
8753
8754
8756 {
8757
8758
8759
8760
8761
8762
8763
8764
8765 return 1;
8766 }
8767
8768
8769
8771 {
8773 }
8774
8775
8776
8778 {
8780 }
8781
8782
8791 {
8792 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8793
8794 if (player)
8795 {
8796 player.MessageStatus(text);
8797 }
8798 }
8799
8800
8809 {
8810 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8811
8812 if (player)
8813 {
8814 player.MessageAction(text);
8815 }
8816 }
8817
8818
8827 {
8828 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8829
8830 if (player)
8831 {
8832 player.MessageFriendly(text);
8833 }
8834 }
8835
8836
8845 {
8846 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8847
8848 if (player)
8849 {
8850 player.MessageImportant(text);
8851 }
8852 }
8853
8855 {
8856 return true;
8857 }
8858
8859
8860 override bool KindOf(
string tag)
8861 {
8862 bool found = false;
8863 string item_name = this.
GetType();
8866
8867 int array_size = item_tag_array.Count();
8868 for (int i = 0; i < array_size; i++)
8869 {
8870 if (item_tag_array.Get(i) == tag)
8871 {
8872 found = true;
8873 break;
8874 }
8875 }
8876 return found;
8877 }
8878
8879
8881 {
8882
8883 super.OnRPC(sender, rpc_type,ctx);
8884
8885
8886 switch (rpc_type)
8887 {
8888 #ifndef SERVER
8889 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8890 Param2<bool, string> p = new Param2<bool, string>(false, "");
8891
8893 return;
8894
8895 bool play = p.param1;
8896 string soundSet = p.param2;
8897
8898 if (play)
8899 {
8901 {
8903 {
8905 }
8906 }
8907 else
8908 {
8910 }
8911 }
8912 else
8913 {
8915 }
8916
8917 break;
8918 #endif
8919
8920 }
8921
8923 {
8925 }
8926 }
8927
8928
8929
8930
8932 {
8933 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8934 return plugin.GetID(
name);
8935 }
8936
8938 {
8939 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
8940 return plugin.GetName(id);
8941 }
8942
8945 {
8946
8947
8948 int varFlags;
8949 if (!ctx.
Read(varFlags))
8950 return;
8951
8952 if (varFlags & ItemVariableFlags.FLOAT)
8953 {
8955 }
8956 }
8957
8959 {
8960
8961 super.SerializeNumericalVars(floats_out);
8962
8963
8964
8966 {
8968 }
8969
8971 {
8973 }
8974
8976 {
8978 }
8979
8981 {
8986 }
8987
8989 {
8991 }
8992 }
8993
8995 {
8996
8997 super.DeSerializeNumericalVars(floats);
8998
8999
9000 int index = 0;
9001 int mask = Math.Round(floats.Get(index));
9002
9003 index++;
9004
9006 {
9008 {
9010 }
9011 else
9012 {
9013 float quantity = floats.Get(index);
9015 }
9016 index++;
9017 }
9018
9020 {
9021 float wet = floats.Get(index);
9023 index++;
9024 }
9025
9027 {
9028 int liquidtype = Math.Round(floats.Get(index));
9030 index++;
9031 }
9032
9034 {
9036 index++;
9038 index++;
9040 index++;
9042 index++;
9043 }
9044
9046 {
9047 int cleanness = Math.Round(floats.Get(index));
9049 index++;
9050 }
9051 }
9052
9054 {
9055 super.WriteVarsToCTX(ctx);
9056
9057
9059 {
9061 }
9062
9064 {
9066 }
9067
9069 {
9071 }
9072
9074 {
9075 int r,g,b,a;
9081 }
9082
9084 {
9086 }
9087 }
9088
9090 {
9091 if (!super.ReadVarsFromCTX(ctx,version))
9092 return false;
9093
9094 int intValue;
9095 float value;
9096
9097 if (version < 140)
9098 {
9099 if (!ctx.
Read(intValue))
9100 return false;
9101
9102 m_VariablesMask = intValue;
9103 }
9104
9106 {
9107 if (!ctx.
Read(value))
9108 return false;
9109
9111 {
9113 }
9114 else
9115 {
9117 }
9118 }
9119
9120 if (version < 140)
9121 {
9123 {
9124 if (!ctx.
Read(value))
9125 return false;
9126 SetTemperatureDirect(value);
9127 }
9128 }
9129
9131 {
9132 if (!ctx.
Read(value))
9133 return false;
9135 }
9136
9138 {
9139 if (!ctx.
Read(intValue))
9140 return false;
9142 }
9143
9145 {
9146 int r,g,b,a;
9148 return false;
9150 return false;
9152 return false;
9154 return false;
9155
9157 }
9158
9160 {
9161 if (!ctx.
Read(intValue))
9162 return false;
9164 }
9165
9166 if (version >= 138 && version < 140)
9167 {
9169 {
9170 if (!ctx.
Read(intValue))
9171 return false;
9172 SetFrozen(intValue);
9173 }
9174 }
9175
9176 return true;
9177 }
9178
9179
9181 {
9184 {
9186 }
9187
9188 if (!super.OnStoreLoad(ctx, version))
9189 {
9191 return false;
9192 }
9193
9194 if (version >= 114)
9195 {
9196 bool hasQuickBarIndexSaved;
9197
9198 if (!ctx.
Read(hasQuickBarIndexSaved))
9199 {
9201 return false;
9202 }
9203
9204 if (hasQuickBarIndexSaved)
9205 {
9206 int itmQBIndex;
9207
9208
9209 if (!ctx.
Read(itmQBIndex))
9210 {
9212 return false;
9213 }
9214
9215 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9216 if (itmQBIndex != -1 && parentPlayer)
9217 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9218 }
9219 }
9220 else
9221 {
9222
9223 PlayerBase player;
9224 int itemQBIndex;
9225 if (version ==
int.
MAX)
9226 {
9227 if (!ctx.
Read(itemQBIndex))
9228 {
9230 return false;
9231 }
9232 }
9233 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9234 {
9235
9236 if (!ctx.
Read(itemQBIndex))
9237 {
9239 return false;
9240 }
9241 if (itemQBIndex != -1 && player)
9242 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9243 }
9244 }
9245
9246 if (version < 140)
9247 {
9248
9249 if (!LoadVariables(ctx, version))
9250 {
9252 return false;
9253 }
9254 }
9255
9256
9258 {
9260 return false;
9261 }
9262 if (version >= 132)
9263 {
9265 if (raib)
9266 {
9268 {
9270 return false;
9271 }
9272 }
9273 }
9274
9276 return true;
9277 }
9278
9279
9280
9282 {
9283 super.OnStoreSave(ctx);
9284
9285 PlayerBase player;
9286 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9287 {
9289
9290 int itemQBIndex = -1;
9291 itemQBIndex = player.FindQuickBarEntityIndex(this);
9292 ctx.
Write(itemQBIndex);
9293 }
9294 else
9295 {
9297 }
9298
9300
9302 if (raib)
9303 {
9305 }
9306 }
9307
9308
9310 {
9311 super.AfterStoreLoad();
9312
9314 {
9316 }
9317
9319 {
9322 }
9323 }
9324
9326 {
9327 super.EEOnAfterLoad();
9328
9330 {
9332 }
9333
9336 }
9337
9339 {
9340 return false;
9341 }
9342
9343
9344
9346 {
9348 {
9349 #ifdef PLATFORM_CONSOLE
9350
9352 {
9354 if (menu)
9355 {
9357 }
9358 }
9359 #endif
9360 }
9361
9363 {
9366 }
9367
9369 {
9370 SetWeightDirty();
9372 }
9374 {
9377 }
9378
9380 {
9383 }
9385 {
9388 }
9389
9390 super.OnVariablesSynchronized();
9391 }
9392
9393
9394
9396 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9397 {
9398 if (!IsServerCheck(allow_client))
9399 return false;
9400
9402 return false;
9403
9406
9407 if (value <= (min + 0.001))
9408 value = min;
9409
9410 if (value == min)
9411 {
9412 if (destroy_config)
9413 {
9414 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9415 if (dstr)
9416 {
9418 this.Delete();
9419 return true;
9420 }
9421 }
9422 else if (destroy_forced)
9423 {
9425 this.Delete();
9426 return true;
9427 }
9428
9430 }
9431
9434
9436 {
9438
9439 if (delta)
9441 }
9442
9444
9445 return false;
9446 }
9447
9448
9450 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9451 {
9453 }
9454
9456 {
9459 }
9460
9462 {
9465 }
9466
9469 {
9470 float value_clamped = Math.Clamp(value, 0, 1);
9472 SetQuantity(result, destroy_config, destroy_forced);
9473 }
9474
9475
9478 {
9480 }
9481
9483 {
9485 }
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9497 {
9498 int slot = -1;
9499 if (GetInventory())
9500 {
9501 InventoryLocation il = new InventoryLocation;
9502 GetInventory().GetCurrentInventoryLocation(il);
9504 }
9505
9507 }
9508
9510 {
9511 float quantity_max = 0;
9512
9514 {
9515 if (attSlotID != -1)
9516 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9517
9518 if (quantity_max <= 0)
9520 }
9521
9522 if (quantity_max <= 0)
9524
9525 return quantity_max;
9526 }
9527
9529 {
9531 }
9532
9534 {
9536 }
9537
9538
9540 {
9542 }
9543
9545 {
9547 }
9548
9550 {
9552 }
9553
9554
9556 {
9557
9558 float weightEx = GetWeightEx();
9559 float special = GetInventoryAndCargoWeight();
9560 return weightEx - special;
9561 }
9562
9563
9565 {
9567 }
9568
9570 {
9572 {
9573 #ifdef DEVELOPER
9574 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9575 {
9576 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9578 }
9579 #endif
9580
9582 }
9583 else if (HasEnergyManager())
9584 {
9585 #ifdef DEVELOPER
9586 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9587 {
9588 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9589 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9590 }
9591 #endif
9592 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9593 }
9594 else
9595 {
9596 #ifdef DEVELOPER
9597 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9598 {
9599 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9600 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9601 }
9602 #endif
9603 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9604 }
9605 }
9606
9609 {
9610 int item_count = 0;
9612
9613 if (GetInventory().GetCargo() != NULL)
9614 {
9615 item_count = GetInventory().GetCargo().GetItemCount();
9616 }
9617
9618 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9619 {
9620 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9621 if (item)
9622 item_count += item.GetNumberOfItems();
9623 }
9624 return item_count;
9625 }
9626
9629 {
9630 float weight = 0;
9631 float wetness = 1;
9632 if (include_wetness)
9635 {
9636 weight = wetness * m_ConfigWeight;
9637 }
9639 {
9640 weight = 1;
9641 }
9642 return weight;
9643 }
9644
9645
9646
9648 {
9649 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9650 {
9651 GameInventory inv = GetInventory();
9652 array<EntityAI> items = new array<EntityAI>;
9654 for (int i = 0; i < items.Count(); i++)
9655 {
9657 if (item)
9658 {
9660 }
9661 }
9662 }
9663 }
9664
9665
9666
9667
9669 {
9670 float energy = 0;
9671 if (HasEnergyManager())
9672 {
9673 energy = GetCompEM().GetEnergy();
9674 }
9675 return energy;
9676 }
9677
9678
9680 {
9681 super.OnEnergyConsumed();
9682
9684 }
9685
9687 {
9688 super.OnEnergyAdded();
9689
9691 }
9692
9693
9695 {
9696 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9697 {
9699 {
9700 float energy_0to1 = GetCompEM().GetEnergy0To1();
9702 }
9703 }
9704 }
9705
9706
9708 {
9709 return ConfigGetFloat("heatIsolation");
9710 }
9711
9713 {
9715 }
9716
9718 {
9719 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9720 if (
GetGame().ConfigIsExisting(paramPath))
9722
9723 return 0.0;
9724 }
9725
9727 {
9728 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9729 if (
GetGame().ConfigIsExisting(paramPath))
9731
9732 return 0.0;
9733 }
9734
9735 override void SetWet(
float value,
bool allow_client =
false)
9736 {
9737 if (!IsServerCheck(allow_client))
9738 return;
9739
9742
9744
9745 m_VarWet = Math.Clamp(value, min, max);
9746
9748 {
9751 }
9752 }
9753
9754 override void AddWet(
float value)
9755 {
9757 }
9758
9760 {
9762 }
9763
9765 {
9767 }
9768
9770 {
9772 }
9773
9775 {
9777 }
9778
9780 {
9782 }
9783
9785 {
9788 if (newLevel != oldLevel)
9789 {
9791 }
9792 }
9793
9795 {
9796 SetWeightDirty();
9797 }
9798
9800 {
9801 return GetWetLevelInternal(
m_VarWet);
9802 }
9803
9804
9805
9807 {
9809 }
9810
9812 {
9814 }
9815
9817 {
9819 }
9820
9822 {
9824 }
9825
9826
9827
9829 {
9830 if (ConfigIsExisting("itemModelLength"))
9831 {
9832 return ConfigGetFloat("itemModelLength");
9833 }
9834 return 0;
9835 }
9836
9838 {
9839 if (ConfigIsExisting("itemAttachOffset"))
9840 {
9841 return ConfigGetFloat("itemAttachOffset");
9842 }
9843 return 0;
9844 }
9845
9846 override void SetCleanness(
int value,
bool allow_client =
false)
9847 {
9848 if (!IsServerCheck(allow_client))
9849 return;
9850
9852
9854
9857 }
9858
9860 {
9862 }
9863
9865 {
9866 return true;
9867 }
9868
9869
9870
9871
9873 {
9875 }
9876
9878 {
9880 }
9881
9882
9883
9884
9885 override void SetColor(
int r,
int g,
int b,
int a)
9886 {
9892 }
9894 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9895 {
9900 }
9901
9903 {
9905 }
9906
9909 {
9910 int r,g,b,a;
9912 r = r/255;
9913 g = g/255;
9914 b = b/255;
9915 a = a/255;
9916 return MiscGameplayFunctions.GetColorString(r, g, b, a);
9917 }
9918
9919
9920
9921 override void SetLiquidType(
int value,
bool allow_client =
false)
9922 {
9923 if (!IsServerCheck(allow_client))
9924 return;
9925
9930 }
9931
9933 {
9934 return ConfigGetInt("varLiquidTypeInit");
9935 }
9936
9938 {
9940 }
9941
9943 {
9945 SetFrozen(false);
9946 }
9947
9950 {
9951 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9952 }
9953
9954
9957 {
9958 PlayerBase nplayer;
9959 if (PlayerBase.CastTo(nplayer, player))
9960 {
9962
9963 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
9964 }
9965 }
9966
9967
9970 {
9971 PlayerBase nplayer;
9972 if (PlayerBase.CastTo(nplayer,player))
9973 {
9974
9975 nplayer.SetEnableQuickBarEntityShortcut(this,false);
9976
9977 }
9978
9979
9980 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
9981
9982
9983 if (HasEnergyManager())
9984 {
9985 GetCompEM().UpdatePlugState();
9986 }
9987 }
9988
9989
9991 {
9992 super.OnPlacementStarted(player);
9993
9995 }
9996
9997 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
9998 {
10000 {
10001 m_AdminLog.OnPlacementComplete(player,
this);
10002 }
10003
10004 super.OnPlacementComplete(player, position, orientation);
10005 }
10006
10007
10008
10009
10010
10012 {
10014 {
10015 return true;
10016 }
10017 else
10018 {
10019 return false;
10020 }
10021 }
10022
10023
10025 {
10027 {
10029 }
10030 }
10031
10032
10034 {
10036 }
10037
10039 {
10041 }
10042
10043 override void InsertAgent(
int agent,
float count = 1)
10044 {
10045 if (count < 1)
10046 return;
10047
10049 }
10050
10053 {
10055 }
10056
10057
10059 {
10061 }
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10105 {
10107 return false;
10108 return true;
10109 }
10110
10112 {
10113
10115 }
10116
10117
10120 {
10121 super.CheckForRoofLimited(timeTresholdMS);
10122
10124 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10125 {
10126 m_PreviousRoofTestTime = time;
10127 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10128 }
10129 }
10130
10131
10133 {
10135 {
10136 return 0;
10137 }
10138
10139 if (GetInventory().GetAttachmentSlotsCount() != 0)
10140 {
10141 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10142 if (filter)
10143 return filter.GetProtectionLevel(type, false, system);
10144 else
10145 return 0;
10146 }
10147
10148 string subclassPath, entryName;
10149
10150 switch (type)
10151 {
10153 entryName = "biological";
10154 break;
10156 entryName = "chemical";
10157 break;
10158 default:
10159 entryName = "biological";
10160 break;
10161 }
10162
10163 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10164
10166 }
10167
10168
10169
10172 {
10173 if (!IsMagazine())
10175
10177 }
10178
10179
10180
10181
10182
10187 {
10188 return true;
10189 }
10190
10192 {
10194 }
10195
10196
10197
10198
10199
10201 {
10202 if (parent)
10203 {
10204 if (parent.IsInherited(DayZInfected))
10205 return true;
10206
10207 if (!parent.IsRuined())
10208 return true;
10209 }
10210
10211 return true;
10212 }
10213
10215 {
10216 if (!super.CanPutAsAttachment(parent))
10217 {
10218 return false;
10219 }
10220
10221 if (!IsRuined() && !parent.IsRuined())
10222 {
10223 return true;
10224 }
10225
10226 return false;
10227 }
10228
10230 {
10231
10232
10233
10234
10235 return super.CanReceiveItemIntoCargo(item);
10236 }
10237
10239 {
10240
10241
10242
10243
10244 GameInventory attachmentInv = attachment.GetInventory();
10246 {
10247 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10248 return false;
10249 }
10250
10251 InventoryLocation loc = new InventoryLocation();
10252 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10253 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10254 return false;
10255
10256 return super.CanReceiveAttachment(attachment, slotId);
10257 }
10258
10260 {
10261 if (!super.CanReleaseAttachment(attachment))
10262 return false;
10263
10264 return GetInventory().AreChildrenAccessible();
10265 }
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10288 {
10289 int id = muzzle_owner.GetMuzzleID();
10290 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10291
10292 if (WPOF_array)
10293 {
10294 for (int i = 0; i < WPOF_array.Count(); i++)
10295 {
10296 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10297
10298 if (WPOF)
10299 {
10300 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10301 }
10302 }
10303 }
10304 }
10305
10306
10308 {
10309 int id = muzzle_owner.GetMuzzleID();
10311
10312 if (WPOBE_array)
10313 {
10314 for (int i = 0; i < WPOBE_array.Count(); i++)
10315 {
10316 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10317
10318 if (WPOBE)
10319 {
10320 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10321 }
10322 }
10323 }
10324 }
10325
10326
10328 {
10329 int id = muzzle_owner.GetMuzzleID();
10330 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10331
10332 if (WPOOH_array)
10333 {
10334 for (int i = 0; i < WPOOH_array.Count(); i++)
10335 {
10336 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10337
10338 if (WPOOH)
10339 {
10340 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10341 }
10342 }
10343 }
10344 }
10345
10346
10348 {
10349 int id = muzzle_owner.GetMuzzleID();
10350 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10351
10352 if (WPOOH_array)
10353 {
10354 for (int i = 0; i < WPOOH_array.Count(); i++)
10355 {
10356 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10357
10358 if (WPOOH)
10359 {
10360 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10361 }
10362 }
10363 }
10364 }
10365
10366
10368 {
10369 int id = muzzle_owner.GetMuzzleID();
10370 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10371
10372 if (WPOOH_array)
10373 {
10374 for (int i = 0; i < WPOOH_array.Count(); i++)
10375 {
10376 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10377
10378 if (WPOOH)
10379 {
10380 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10381 }
10382 }
10383 }
10384 }
10385
10386
10387
10389 {
10391 {
10392 return true;
10393 }
10394
10395 return false;
10396 }
10397
10399 {
10401 {
10402 return true;
10403 }
10404
10405 return false;
10406 }
10407
10409 {
10411 {
10412 return true;
10413 }
10414
10415 return false;
10416 }
10417
10419 {
10420 return false;
10421 }
10422
10425 {
10426 return UATimeSpent.DEFAULT_DEPLOY;
10427 }
10428
10429
10430
10431
10433 {
10435 SetSynchDirty();
10436 }
10437
10439 {
10441 }
10442
10443
10445 {
10446 return false;
10447 }
10448
10451 {
10452 string att_type = "None";
10453
10454 if (ConfigIsExisting("soundAttType"))
10455 {
10456 att_type = ConfigGetString("soundAttType");
10457 }
10458
10460 }
10461
10463 {
10465 }
10466
10467
10468
10469
10470
10474
10476 {
10479
10481 }
10482
10483
10485 {
10487 return;
10488
10490
10493
10496
10497 SoundParameters params = new SoundParameters();
10501 }
10502
10503
10505 {
10507 return;
10508
10510 SetSynchDirty();
10511
10514 }
10515
10516
10518 {
10520 return;
10521
10523 SetSynchDirty();
10524
10527 }
10528
10530 {
10532 }
10533
10535 {
10537 }
10538
10541 {
10542 if (!
GetGame().IsDedicatedServer())
10543 {
10544 if (ConfigIsExisting("attachSoundSet"))
10545 {
10546 string cfg_path = "";
10547 string soundset = "";
10548 string type_name =
GetType();
10549
10552 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10553 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10554
10555 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10556 {
10557 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10558 {
10559 if (cfg_slot_array[i] == slot_type)
10560 {
10561 soundset = cfg_soundset_array[i];
10562 break;
10563 }
10564 }
10565 }
10566
10567 if (soundset != "")
10568 {
10569 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10571 }
10572 }
10573 }
10574 }
10575
10577 {
10578
10579 }
10580
10581 void OnApply(PlayerBase player);
10582
10584 {
10585 return 1.0;
10586 };
10587
10589 {
10591 }
10592
10594 {
10596 }
10597
10599
10601 {
10602 SetDynamicPhysicsLifeTime(0.01);
10604 }
10605
10607 {
10608 array<string> zone_names = new array<string>;
10609 GetDamageZones(zone_names);
10610 for (int i = 0; i < zone_names.Count(); i++)
10611 {
10612 SetHealthMax(zone_names.Get(i),"Health");
10613 }
10614 SetHealthMax("","Health");
10615 }
10616
10619 {
10620 float global_health = GetHealth01("","Health");
10621 array<string> zones = new array<string>;
10622 GetDamageZones(zones);
10623
10624 for (int i = 0; i < zones.Count(); i++)
10625 {
10626 SetHealth01(zones.Get(i),"Health",global_health);
10627 }
10628 }
10629
10632 {
10633 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10634 }
10635
10637 {
10638 if (!hasRootAsPlayer)
10639 {
10640 if (refParentIB)
10641 {
10642
10643 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10644 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10645
10646 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10647 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10648
10651 }
10652 else
10653 {
10654
10657 }
10658 }
10659 }
10660
10662 {
10664 {
10665 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10666 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10667 {
10668 float heatPermCoef = 1.0;
10670 while (ent)
10671 {
10672 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10673 ent = ent.GetHierarchyParent();
10674 }
10675
10676 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10677 }
10678 }
10679 }
10680
10682 {
10683
10684 EntityAI parent = GetHierarchyParent();
10685 if (!parent)
10686 {
10687 hasParent = false;
10688 hasRootAsPlayer = false;
10689 }
10690 else
10691 {
10692 hasParent = true;
10693 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10694 refParentIB =
ItemBase.Cast(parent);
10695 }
10696 }
10697
10698 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10699 {
10700
10701 }
10702
10704 {
10705
10706 return false;
10707 }
10708
10710 {
10711
10712
10713 return false;
10714 }
10715
10717 {
10718
10719 return false;
10720 }
10721
10724 {
10725 return !GetIsFrozen() &&
IsOpen();
10726 }
10727
10729 {
10730 bool hasParent = false, hasRootAsPlayer = false;
10732
10733 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10734 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10735
10736 if (wwtu || foodDecay)
10737 {
10741
10742 if (processWetness || processTemperature || processDecay)
10743 {
10745
10746 if (processWetness)
10747 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10748
10749 if (processTemperature)
10751
10752 if (processDecay)
10753 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10754 }
10755 }
10756 }
10757
10760 {
10762 }
10763
10765 {
10768
10769 return super.GetTemperatureFreezeThreshold();
10770 }
10771
10773 {
10776
10777 return super.GetTemperatureThawThreshold();
10778 }
10779
10781 {
10784
10785 return super.GetItemOverheatThreshold();
10786 }
10787
10789 {
10791 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10792
10793 return super.GetTemperatureFreezeTime();
10794 }
10795
10797 {
10799 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10800
10801 return super.GetTemperatureThawTime();
10802 }
10803
10808
10810 {
10811 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10812 }
10813
10815 {
10816 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10817 }
10818
10821 {
10823 }
10824
10826 {
10828 }
10829
10831 {
10833 }
10834
10837 {
10838 return null;
10839 }
10840
10843 {
10844 return false;
10845 }
10846
10848 {
10850 {
10853 if (!trg)
10854 {
10856 explosive = this;
10857 }
10858
10859 explosive.PairRemote(trg);
10861
10862 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10863 trg.SetPersistentPairID(persistentID);
10864 explosive.SetPersistentPairID(persistentID);
10865
10866 return true;
10867 }
10868 return false;
10869 }
10870
10873 {
10874 float ret = 1.0;
10877 ret *= GetHealth01();
10878
10879 return ret;
10880 }
10881
10882 #ifdef DEVELOPER
10883 override void SetDebugItem()
10884 {
10885 super.SetDebugItem();
10886 _itemBase = this;
10887 }
10888
10890 {
10891 string text = super.GetDebugText();
10892
10894 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10895
10896 return text;
10897 }
10898 #endif
10899
10901 {
10902 return true;
10903 }
10904
10906
10908
10910 {
10913 }
10914
10915
10923
10939}
10940
10942{
10944 if (entity)
10945 {
10946 bool is_item = entity.IsInherited(
ItemBase);
10947 if (is_item && full_quantity)
10948 {
10951 }
10952 }
10953 else
10954 {
10956 return NULL;
10957 }
10958 return entity;
10959}
10960
10962{
10963 if (item)
10964 {
10965 if (health > 0)
10966 item.SetHealth("", "", health);
10967
10968 if (item.CanHaveTemperature())
10969 {
10971 if (item.CanFreeze())
10972 item.SetFrozen(false);
10973 }
10974
10975 if (item.HasEnergyManager())
10976 {
10977 if (quantity >= 0)
10978 {
10979 item.GetCompEM().SetEnergy0To1(quantity);
10980 }
10981 else
10982 {
10984 }
10985 }
10986 else if (item.IsMagazine())
10987 {
10988 Magazine mag = Magazine.Cast(item);
10989 if (quantity >= 0)
10990 {
10991 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10992 }
10993 else
10994 {
10996 }
10997
10998 }
10999 else
11000 {
11001 if (quantity >= 0)
11002 {
11003 item.SetQuantityNormalized(quantity, false);
11004 }
11005 else
11006 {
11008 }
11009
11010 }
11011 }
11012}
11013
11014#ifdef DEVELOPER
11016#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.