6247{
6249 {
6250 return true;
6251 }
6252};
6253
6254
6255
6257{
6261
6263
6266
6267
6268
6269
6270
6279
6285
6290
6295
6316 protected bool m_IsResultOfSplit
6317
6319
6324
6325
6326
6328
6332
6333
6334
6336
6339
6340
6341
6347
6348
6356
6359
6360
6362
6363
6365
6366
6371
6372
6377
6378
6380
6381
6383 {
6388
6389 if (!
GetGame().IsDedicatedServer())
6390 {
6392 {
6394
6396 {
6398 }
6399 }
6400
6403 }
6404
6405 m_OldLocation = null;
6406
6408 {
6410 }
6411
6412 if (ConfigIsExisting("headSelectionsToHide"))
6413 {
6416 }
6417
6419 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6420 {
6422 }
6423
6425
6426 m_IsResultOfSplit = false;
6427
6429 }
6430
6432 {
6433 super.InitItemVariables();
6434
6440 m_Count = ConfigGetInt(
"count");
6441
6444
6449
6452
6457
6469
6473
6474
6477 if (ConfigIsExisting("canBeSplit"))
6478 {
6481 }
6482
6484 if (ConfigIsExisting("itemBehaviour"))
6486
6487
6490 RegisterNetSyncVariableInt("m_VarLiquidType");
6491 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6492
6493 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6494 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6495 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6496
6497 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6498 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6499 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6500 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6501
6502 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6503 RegisterNetSyncVariableBool("m_IsTakeable");
6504 RegisterNetSyncVariableBool("m_IsHologram");
6505
6508 {
6511 }
6512
6514
6516 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6518
6519 }
6520
6522 {
6524 }
6525
6527 {
6530 {
6535 }
6536 }
6537
6538 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6539 {
6541 {
6544 }
6545
6547 }
6548
6550 {
6556 }
6557
6559
6561 {
6563
6564 if (!action)
6565 {
6566 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6567 return;
6568 }
6569
6571 if (!ai)
6572 {
6574 return;
6575 }
6576
6578 if (!action_array)
6579 {
6580 action_array = new array<ActionBase_Basic>;
6582 }
6583 if (LogManager.IsActionLogEnable())
6584 {
6585 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6586 }
6587
6588 if (action_array.Find(action) != -1)
6589 {
6590 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6591 }
6592 else
6593 {
6594 action_array.Insert(action);
6595 }
6596 }
6597
6599 {
6601 ActionBase action = player.GetActionManager().GetAction(actionName);
6604
6605 if (action_array)
6606 {
6607 action_array.RemoveItem(action);
6608 }
6609 }
6610
6611
6612
6614 {
6615 ActionOverrideData overrideData = new ActionOverrideData();
6619
6621 if (!actionMap)
6622 {
6625 }
6626
6627 actionMap.Insert(this.
Type(), overrideData);
6628
6629 }
6630
6632
6634
6635
6637 {
6640
6643
6644 string config_to_search = "CfgVehicles";
6645 string muzzle_owner_config;
6646
6648 {
6649 if (IsInherited(Weapon))
6650 config_to_search = "CfgWeapons";
6651
6652 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6653
6654 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6655
6657
6658 if (config_OnFire_subclass_count > 0)
6659 {
6660 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6661
6662 for (int i = 0; i < config_OnFire_subclass_count; i++)
6663 {
6664 string particle_class = "";
6666 string config_OnFire_entry = config_OnFire_class + particle_class;
6667 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6668 WPOF_array.Insert(WPOF);
6669 }
6670
6671
6673 }
6674 }
6675
6677 {
6678 config_to_search = "CfgWeapons";
6679 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6680
6681 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6682
6684
6685 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
6686 {
6687 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
6688
6689 for (i = 0; i < config_OnBulletCasingEject_count; i++)
6690 {
6691 string particle_class2 = "";
6693 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
6694 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
6695 WPOBE_array.Insert(WPOBE);
6696 }
6697
6698
6700 }
6701 }
6702 }
6703
6704
6706 {
6709
6711 {
6712 string config_to_search = "CfgVehicles";
6713
6714 if (IsInherited(Weapon))
6715 config_to_search = "CfgWeapons";
6716
6717 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6718 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
6719
6720 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
6721 {
6722
6724
6726 {
6728 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
6730 return;
6731 }
6732
6735
6736
6737
6739 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
6740
6741 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
6742 {
6743 string particle_class = "";
6745 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
6747
6748 if (entry_type == CT_CLASS)
6749 {
6750 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
6751 WPOOH_array.Insert(WPOF);
6752 }
6753 }
6754
6755
6757 }
6758 }
6759 }
6760
6762 {
6764 }
6765
6767 {
6769 {
6771
6774
6777
6778 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6779 }
6780 }
6781
6783 {
6785 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6786
6788 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6789
6791 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6792
6794 {
6796 }
6797 }
6798
6800 {
6802 }
6803
6805 {
6808 else
6810
6812 {
6815 }
6816 else
6817 {
6820
6823 }
6824
6826 }
6827
6829 {
6831 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6832 }
6833
6835 {
6837 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
6839 }
6840
6842 {
6844 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
6845 }
6846
6848 {
6851
6852 OverheatingParticle OP = new OverheatingParticle();
6857
6859 }
6860
6862 {
6865
6866 return -1;
6867 }
6868
6870 {
6872 {
6875
6876 for (int i = count; i > 0; --i)
6877 {
6878 int id = i - 1;
6881
6884
6885 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
6886 {
6887 if (p)
6888 {
6891 }
6892 }
6893 }
6894 }
6895 }
6896
6898 {
6900 {
6902 {
6903 int id = i - 1;
6905
6906 if (OP)
6907 {
6909
6910 if (p)
6911 {
6913 }
6914
6915 delete OP;
6916 }
6917 }
6918
6921 }
6922 }
6923
6926 {
6927 return 0.0;
6928 }
6929
6930
6932 {
6933 return 250;
6934 }
6935
6937 {
6938 return 0;
6939 }
6940
6943 {
6945 return true;
6946
6947 return false;
6948 }
6949
6952 {
6955
6957 {
6959 }
6960 else
6961 {
6962
6964 }
6965
6967 }
6968
6975 {
6976 return -1;
6977 }
6978
6979
6980
6981
6983 {
6985 {
6987 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
6988
6989 if (r_index >= 0)
6990 {
6991 InventoryLocation r_il = new InventoryLocation;
6992 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
6993
6994 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
6997 {
6998 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
6999 }
7001 {
7002 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7003 }
7004
7005 }
7006
7007 player.GetHumanInventory().ClearUserReservedLocation(this);
7008 }
7009
7012 }
7013
7014
7015
7016
7018 {
7019 return ItemBase.m_DebugActionsMask;
7020 }
7021
7023 {
7024 return ItemBase.m_DebugActionsMask & mask;
7025 }
7026
7028 {
7029 ItemBase.m_DebugActionsMask = mask;
7030 }
7031
7033 {
7034 ItemBase.m_DebugActionsMask |= mask;
7035 }
7036
7038 {
7039 ItemBase.m_DebugActionsMask &= ~mask;
7040 }
7041
7043 {
7045 {
7047 }
7048 else
7049 {
7051 }
7052 }
7053
7054
7056 {
7057 if (GetEconomyProfile())
7058 {
7059 float q_max = GetEconomyProfile().GetQuantityMax();
7060 if (q_max > 0)
7061 {
7062 float q_min = GetEconomyProfile().GetQuantityMin();
7063 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7064
7066 {
7067 ComponentEnergyManager comp = GetCompEM();
7069 {
7071 }
7072 }
7074 {
7076
7077 }
7078
7079 }
7080 }
7081 }
7082
7085 {
7086 EntityAI parent = GetHierarchyParent();
7087
7088 if (parent)
7089 {
7090 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7091 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7092 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7093 }
7094 }
7095
7098 {
7099 EntityAI parent = GetHierarchyParent();
7100
7101 if (parent)
7102 {
7103 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7104 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7105 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7106 }
7107 }
7108
7110 {
7111
7112
7113
7114
7116
7118 {
7119 if (ScriptInputUserData.CanStoreInputUserData())
7120 {
7121 ScriptInputUserData ctx = new ScriptInputUserData;
7127 ctx.
Write(use_stack_max);
7130
7132 {
7133 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7134 }
7135 }
7136 }
7137 else if (!
GetGame().IsMultiplayer())
7138 {
7140 }
7141 }
7142
7144 {
7146 }
7147
7149 {
7151 }
7152
7154 {
7156 }
7157
7159 {
7160
7161 return false;
7162 }
7163
7165 {
7166 return false;
7167 }
7168
7172 {
7173 return false;
7174 }
7175
7177 {
7178 return "";
7179 }
7180
7182
7184 {
7185 return false;
7186 }
7187
7189 {
7190 return true;
7191 }
7192
7193
7194
7196 {
7197 return true;
7198 }
7199
7201 {
7202 return true;
7203 }
7204
7206 {
7207 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7209 }
7210
7212 {
7214 }
7215
7217 {
7219 if (!is_being_placed)
7221 SetSynchDirty();
7222 }
7223
7224
7226
7228 {
7230 }
7231
7233 {
7235 }
7236
7238 {
7239 return 1;
7240 }
7241
7243 {
7244 return false;
7245 }
7246
7248 {
7250 SetSynchDirty();
7251 }
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7288 {
7289 super.OnMovedInsideCargo(container);
7290
7291 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7292 }
7293
7294 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7295 {
7296 super.EEItemLocationChanged(oldLoc,newLoc);
7297
7298 PlayerBase new_player = null;
7299 PlayerBase old_player = null;
7300
7301 if (newLoc.GetParent())
7302 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7303
7304 if (oldLoc.GetParent())
7305 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7306
7308 {
7309 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7310
7311 if (r_index >= 0)
7312 {
7313 InventoryLocation r_il = new InventoryLocation;
7314 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7315
7316 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7319 {
7320 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7321 }
7323 {
7324 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7325 }
7326
7327 }
7328 }
7329
7331 {
7332 if (new_player)
7333 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7334
7335 if (new_player == old_player)
7336 {
7337
7338 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7339 {
7341 {
7342 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7343 {
7344 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7345 }
7346 }
7347 else
7348 {
7349 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7350 }
7351 }
7352
7353 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7354 {
7355 int type = oldLoc.GetType();
7357 {
7358 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7359 }
7361 {
7362 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7363 }
7364 }
7365 if (!m_OldLocation)
7366 {
7367 m_OldLocation = new InventoryLocation;
7368 }
7369 m_OldLocation.Copy(oldLoc);
7370 }
7371 else
7372 {
7373 if (m_OldLocation)
7374 {
7375 m_OldLocation.Reset();
7376 }
7377 }
7378
7380 }
7381 else
7382 {
7383 if (new_player)
7384 {
7385 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7386 if (res_index >= 0)
7387 {
7388 InventoryLocation il = new InventoryLocation;
7389 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7391 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7394 {
7395 il.
GetParent().GetOnReleaseLock().Invoke(it);
7396 }
7398 {
7400 }
7401
7402 }
7403 }
7405 {
7406
7408 }
7409
7410 if (m_OldLocation)
7411 {
7412 m_OldLocation.Reset();
7413 }
7414 }
7415 }
7416
7417 override void EOnContact(IEntity other, Contact extra)
7418 {
7420 {
7421 int liquidType = -1;
7423 if (impactSpeed > 0.0)
7424 {
7426 #ifndef SERVER
7428 #else
7430 SetSynchDirty();
7431 #endif
7433 }
7434 }
7435
7436 #ifdef SERVER
7437 if (GetCompEM() && GetCompEM().IsPlugged())
7438 {
7439 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7440 GetCompEM().UnplugThis();
7441 }
7442 #endif
7443 }
7444
7446
7448 {
7450 }
7451
7453 {
7454
7455 }
7456
7458 {
7459 super.OnItemLocationChanged(old_owner, new_owner);
7460
7461 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7462 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7463
7464 if (!relatedPlayer && playerNew)
7465 relatedPlayer = playerNew;
7466
7467 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7468 {
7470 if (actionMgr)
7471 {
7472 ActionBase currentAction = actionMgr.GetRunningAction();
7473 if (currentAction)
7475 }
7476 }
7477
7478 Man ownerPlayerOld = null;
7479 Man ownerPlayerNew = null;
7480
7481 if (old_owner)
7482 {
7483 if (old_owner.
IsMan())
7484 {
7485 ownerPlayerOld = Man.Cast(old_owner);
7486 }
7487 else
7488 {
7489 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7490 }
7491 }
7492 else
7493 {
7495 {
7497
7498 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7499 {
7500 GetCompEM().UnplugThis();
7501 }
7502 }
7503 }
7504
7505 if (new_owner)
7506 {
7507 if (new_owner.
IsMan())
7508 {
7509 ownerPlayerNew = Man.Cast(new_owner);
7510 }
7511 else
7512 {
7513 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7514 }
7515 }
7516
7517 if (ownerPlayerOld != ownerPlayerNew)
7518 {
7519 if (ownerPlayerOld)
7520 {
7521 array<EntityAI> subItemsExit = new array<EntityAI>;
7523 for (int i = 0; i < subItemsExit.Count(); i++)
7524 {
7527 }
7528 }
7529
7530 if (ownerPlayerNew)
7531 {
7532 array<EntityAI> subItemsEnter = new array<EntityAI>;
7534 for (int j = 0; j < subItemsEnter.Count(); j++)
7535 {
7538 }
7539 }
7540 }
7541 else if (ownerPlayerNew != null)
7542 {
7543 PlayerBase nplayer;
7544 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7545 {
7546 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7548 for (int k = 0; k < subItemsUpdate.Count(); k++)
7549 {
7551 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7552 }
7553 }
7554 }
7555
7556 if (old_owner)
7557 old_owner.OnChildItemRemoved(this);
7558 if (new_owner)
7559 new_owner.OnChildItemReceived(this);
7560 }
7561
7562
7564 {
7565 super.EEDelete(parent);
7566 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7567 if (player)
7568 {
7570
7571 if (player.IsAlive())
7572 {
7573 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7574 if (r_index >= 0)
7575 {
7576 InventoryLocation r_il = new InventoryLocation;
7577 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7578
7579 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7582 {
7583 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7584 }
7586 {
7587 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7588 }
7589
7590 }
7591
7592 player.RemoveQuickBarEntityShortcut(this);
7593 }
7594 }
7595 }
7596
7598 {
7599 super.EEKilled(killer);
7600
7603 {
7604 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7605 {
7606 if (IsMagazine())
7607 {
7608 if (Magazine.Cast(this).GetAmmoCount() > 0)
7609 {
7611 }
7612 }
7613 else
7614 {
7616 }
7617 }
7618 }
7619 }
7620
7622 {
7623 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7624
7625 super.OnWasAttached(parent, slot_id);
7626
7629
7631 }
7632
7634 {
7635 super.OnWasDetached(parent, slot_id);
7636
7639 }
7640
7642 {
7643 int idx;
7646
7647 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7648 if (inventory_slots.Count() < 1)
7649 {
7650 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7651 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7652 }
7653 else
7654 {
7655 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7656 }
7657
7658 idx = inventory_slots.Find(slot);
7659 if (idx < 0)
7660 return "";
7661
7662 return attach_types.Get(idx);
7663 }
7664
7666 {
7667 int idx = -1;
7668 string slot;
7669
7672
7673 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7674 if (inventory_slots.Count() < 1)
7675 {
7676 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7677 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7678 }
7679 else
7680 {
7681 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7682 if (detach_types.Count() < 1)
7683 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7684 }
7685
7686 for (int i = 0; i < inventory_slots.Count(); i++)
7687 {
7688 slot = inventory_slots.Get(i);
7689 }
7690
7691 if (slot != "")
7692 {
7693 if (detach_types.Count() == 1)
7694 idx = 0;
7695 else
7696 idx = inventory_slots.Find(slot);
7697 }
7698 if (idx < 0)
7699 return "";
7700
7701 return detach_types.Get(idx);
7702 }
7703
7705 {
7706
7708
7709
7710 float min_time = 1;
7711 float max_time = 3;
7712 float delay = Math.RandomFloat(min_time, max_time);
7713
7714 explode_timer.Run(delay, this, "DoAmmoExplosion");
7715 }
7716
7718 {
7719 Magazine magazine = Magazine.Cast(this);
7720 int pop_sounds_count = 6;
7721 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
7722
7723
7724 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
7725 string sound_name = pop_sounds[ sound_idx ];
7727
7728
7729 magazine.ServerAddAmmoCount(-1);
7730
7731
7732 float min_temp_to_explode = 100;
7733
7734 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
7735 {
7737 }
7738 }
7739
7740
7741 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
7742 {
7743 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
7744
7745 const int CHANCE_DAMAGE_CARGO = 4;
7746 const int CHANCE_DAMAGE_ATTACHMENT = 1;
7747 const int CHANCE_DAMAGE_NOTHING = 2;
7748
7750 {
7751 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
7752 int chances;
7753 int rnd;
7754
7755 if (GetInventory().GetCargo())
7756 {
7757 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7758 rnd = Math.RandomInt(0,chances);
7759
7760 if (rnd < CHANCE_DAMAGE_CARGO)
7761 {
7763 }
7764 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
7765 {
7767 }
7768 }
7769 else
7770 {
7771 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
7772 rnd = Math.RandomInt(0,chances);
7773
7774 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
7775 {
7777 }
7778 }
7779 }
7780 }
7781
7783 {
7784 if (GetInventory().GetCargo())
7785 {
7786 int item_count = GetInventory().GetCargo().GetItemCount();
7787 if (item_count > 0)
7788 {
7789 int random_pick = Math.RandomInt(0, item_count);
7791 if (!item.IsExplosive())
7792 {
7793 item.AddHealth("","",damage);
7794 return true;
7795 }
7796 }
7797 }
7798 return false;
7799 }
7800
7802 {
7803 int attachment_count = GetInventory().AttachmentCount();
7804 if (attachment_count > 0)
7805 {
7806 int random_pick = Math.RandomInt(0, attachment_count);
7807 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
7808 if (!attachment.IsExplosive())
7809 {
7810 attachment.AddHealth("","",damage);
7811 return true;
7812 }
7813 }
7814 return false;
7815 }
7816
7818 {
7820 }
7821
7823 {
7825 return GetInventory().CanRemoveEntity();
7826
7827 return false;
7828 }
7829
7831 {
7833 return;
7834
7836 {
7837 if (ScriptInputUserData.CanStoreInputUserData())
7838 {
7839 ScriptInputUserData ctx = new ScriptInputUserData;
7844 ctx.
Write(destination_entity);
7848 }
7849 }
7850 else if (!
GetGame().IsMultiplayer())
7851 {
7853 }
7854 }
7855
7857 {
7859 return;
7860
7861 float split_quantity_new;
7865 InventoryLocation loc = new InventoryLocation;
7866
7867 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7868 {
7870 split_quantity_new = stack_max;
7871 else
7873
7874 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7875 if (new_item)
7876 {
7877 new_item.SetResultOfSplit(true);
7878 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7880 new_item.SetQuantity(split_quantity_new);
7881 }
7882 }
7883 else if (destination_entity && slot_id == -1)
7884 {
7885 if (quantity > stack_max)
7886 split_quantity_new = stack_max;
7887 else
7888 split_quantity_new = quantity;
7889
7891 {
7894 }
7895
7896 if (new_item)
7897 {
7898 new_item.SetResultOfSplit(true);
7899 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7901 new_item.SetQuantity(split_quantity_new);
7902 }
7903 }
7904 else
7905 {
7906 if (stack_max != 0)
7907 {
7909 {
7911 }
7912
7913 if (split_quantity_new == 0)
7914 {
7915 if (!
GetGame().IsMultiplayer())
7916 player.PhysicalPredictiveDropItem(this);
7917 else
7918 player.ServerDropEntity(this);
7919 return;
7920 }
7921
7923
7924 if (new_item)
7925 {
7926 new_item.SetResultOfSplit(true);
7927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7929 new_item.SetQuantity(stack_max);
7930 new_item.PlaceOnSurface();
7931 }
7932 }
7933 }
7934 }
7935
7937 {
7939 return;
7940
7941 float split_quantity_new;
7945 InventoryLocation loc = new InventoryLocation;
7946
7947 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
7948 {
7950 split_quantity_new = stack_max;
7951 else
7953
7954 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
7955 if (new_item)
7956 {
7957 new_item.SetResultOfSplit(true);
7958 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7960 new_item.SetQuantity(split_quantity_new);
7961 }
7962 }
7963 else if (destination_entity && slot_id == -1)
7964 {
7965 if (quantity > stack_max)
7966 split_quantity_new = stack_max;
7967 else
7968 split_quantity_new = quantity;
7969
7971 {
7974 }
7975
7976 if (new_item)
7977 {
7978 new_item.SetResultOfSplit(true);
7979 MiscGameplayFunctions.TransferItemProperties(this, new_item);
7981 new_item.SetQuantity(split_quantity_new);
7982 }
7983 }
7984 else
7985 {
7986 if (stack_max != 0)
7987 {
7989 {
7991 }
7992
7994
7995 if (new_item)
7996 {
7997 new_item.SetResultOfSplit(true);
7998 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8000 new_item.SetQuantity(stack_max);
8001 new_item.PlaceOnSurface();
8002 }
8003 }
8004 }
8005 }
8006
8008 {
8010 return;
8011
8013 {
8014 if (ScriptInputUserData.CanStoreInputUserData())
8015 {
8016 ScriptInputUserData ctx = new ScriptInputUserData;
8021 dst.WriteToContext(ctx);
8023 }
8024 }
8025 else if (!
GetGame().IsMultiplayer())
8026 {
8028 }
8029 }
8030
8032 {
8034 return;
8035
8037 {
8038 if (ScriptInputUserData.CanStoreInputUserData())
8039 {
8040 ScriptInputUserData ctx = new ScriptInputUserData;
8045 ctx.
Write(destination_entity);
8051 }
8052 }
8053 else if (!
GetGame().IsMultiplayer())
8054 {
8056 }
8057 }
8058
8060 {
8062 }
8063
8065 {
8067 return this;
8068
8070 float split_quantity_new;
8072 if (dst.IsValid())
8073 {
8074 int slot_id = dst.GetSlot();
8076
8077 if (quantity > stack_max)
8078 split_quantity_new = stack_max;
8079 else
8080 split_quantity_new = quantity;
8081
8083
8084 if (new_item)
8085 {
8086 new_item.SetResultOfSplit(true);
8087 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8090 }
8091
8092 return new_item;
8093 }
8094
8095 return null;
8096 }
8097
8099 {
8101 return;
8102
8104 float split_quantity_new;
8106 if (destination_entity)
8107 {
8109 if (quantity > stackable)
8110 split_quantity_new = stackable;
8111 else
8112 split_quantity_new = quantity;
8113
8114 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8115 if (new_item)
8116 {
8117 new_item.SetResultOfSplit(true);
8118 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8120 new_item.SetQuantity(split_quantity_new);
8121 }
8122 }
8123 }
8124
8126 {
8128 return;
8129
8131 {
8132 if (ScriptInputUserData.CanStoreInputUserData())
8133 {
8134 ScriptInputUserData ctx = new ScriptInputUserData;
8139 ItemBase destination_entity =
this;
8140 ctx.
Write(destination_entity);
8144 }
8145 }
8146 else if (!
GetGame().IsMultiplayer())
8147 {
8149 }
8150 }
8151
8153 {
8155 return;
8156
8158 float split_quantity_new;
8160 if (player)
8161 {
8163 if (quantity > stackable)
8164 split_quantity_new = stackable;
8165 else
8166 split_quantity_new = quantity;
8167
8168 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8169 new_item =
ItemBase.Cast(in_hands);
8170 if (new_item)
8171 {
8172 new_item.SetResultOfSplit(true);
8173 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8175 new_item.SetQuantity(split_quantity_new);
8176 }
8177 }
8178 }
8179
8181 {
8183 return;
8184
8186 float split_quantity_new = Math.Floor(quantity * 0.5);
8187
8189
8190 if (new_item)
8191 {
8192 if (new_item.GetQuantityMax() < split_quantity_new)
8193 {
8194 split_quantity_new = new_item.GetQuantityMax();
8195 }
8196
8197 new_item.SetResultOfSplit(true);
8198 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8199
8201 {
8204 }
8205 else
8206 {
8209 }
8210 }
8211 }
8212
8214 {
8216 return;
8217
8219 float split_quantity_new = Math.Floor(quantity / 2);
8220
8221 InventoryLocation invloc = new InventoryLocation;
8223
8225 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8226
8227 if (new_item)
8228 {
8229 if (new_item.GetQuantityMax() < split_quantity_new)
8230 {
8231 split_quantity_new = new_item.GetQuantityMax();
8232 }
8234 {
8237 }
8238 else
8239 {
8242 }
8243 }
8244 }
8245
8248 {
8249 SetWeightDirty();
8251
8252 if (parent)
8253 parent.OnAttachmentQuantityChangedEx(this, delta);
8254
8256 {
8258 {
8260 }
8262 {
8263 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8265 }
8266 }
8267
8268 }
8269
8272 {
8273
8274 }
8275
8278 {
8280 }
8281
8283 {
8284 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8285
8287 {
8288 if (newLevel == GameConstants.STATE_RUINED)
8289 {
8291 EntityAI parent = GetHierarchyParent();
8292 if (parent && parent.IsFireplace())
8293 {
8294 CargoBase cargo = GetInventory().GetCargo();
8295 if (cargo)
8296 {
8298 {
8300 }
8301 }
8302 }
8303 }
8304
8306 {
8307
8309 return;
8310 }
8311
8312 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8313 {
8315 }
8316 }
8317 }
8318
8319
8321 {
8322 super.OnRightClick();
8323
8325 {
8327 {
8328 if (ScriptInputUserData.CanStoreInputUserData())
8329 {
8330 vector m4[4];
8332
8333 EntityAI root = GetHierarchyRoot();
8334
8335 InventoryLocation dst = new InventoryLocation;
8337 {
8338 if (root)
8339 {
8340 root.GetTransform(m4);
8342 }
8343 else
8344 GetInventory().GetCurrentInventoryLocation(dst);
8345 }
8346 else
8347 {
8349
8350
8351 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8352 {
8353 if (root)
8354 {
8355 root.GetTransform(m4);
8357 }
8358 else
8359 GetInventory().GetCurrentInventoryLocation(dst);
8360 }
8361 else
8362 {
8363 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8364 }
8365 }
8366
8367 ScriptInputUserData ctx = new ScriptInputUserData;
8375 }
8376 }
8377 else if (!
GetGame().IsMultiplayer())
8378 {
8380 }
8381 }
8382 }
8383
8384 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8385 {
8386
8387 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8388 return false;
8389
8390 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8391 return false;
8392
8393
8395 return false;
8396
8397
8398 Magazine mag = Magazine.Cast(this);
8399 if (mag)
8400 {
8401 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8402 return false;
8403
8404 if (stack_max_limit)
8405 {
8406 Magazine other_mag = Magazine.Cast(other_item);
8407 if (other_item)
8408 {
8409 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8410 return false;
8411 }
8412
8413 }
8414 }
8415 else
8416 {
8417
8419 return false;
8420
8422 return false;
8423 }
8424
8425 PlayerBase player = null;
8426 if (CastTo(player, GetHierarchyRootPlayer()))
8427 {
8428 if (player.GetInventory().HasAttachment(this))
8429 return false;
8430
8431 if (player.IsItemsToDelete())
8432 return false;
8433 }
8434
8435 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8436 return false;
8437
8438 int slotID;
8440 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8441 return false;
8442
8443 return true;
8444 }
8445
8447 {
8449 }
8450
8452 {
8453 return m_IsResultOfSplit;
8454 }
8455
8457 {
8458 m_IsResultOfSplit = value;
8459 }
8460
8462 {
8464 }
8465
8467 {
8468 float other_item_quantity = other_item.GetQuantity();
8469 float this_free_space;
8470
8472
8474
8475 if (other_item_quantity > this_free_space)
8476 {
8477 return this_free_space;
8478 }
8479 else
8480 {
8481 return other_item_quantity;
8482 }
8483 }
8484
8486 {
8488 }
8489
8491 {
8493 return;
8494
8495 if (!IsMagazine() && other_item)
8496 {
8498 if (quantity_used != 0)
8499 {
8500 float hp1 = GetHealth01("","");
8501 float hp2 = other_item.GetHealth01("","");
8502 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8503 hpResult = hpResult / (
GetQuantity() + quantity_used);
8504
8505 hpResult *= GetMaxHealth();
8506 Math.Round(hpResult);
8507 SetHealth("", "Health", hpResult);
8508
8510 other_item.AddQuantity(-quantity_used);
8511 }
8512 }
8514 }
8515
8517 {
8518 #ifdef SERVER
8519 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8520 GetHierarchyParent().IncreaseLifetimeUp();
8521 #endif
8522 };
8523
8525 {
8526 PlayerBase p = PlayerBase.Cast(player);
8527
8528 array<int> recipesIds = p.m_Recipes;
8529 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8530 if (moduleRecipesManager)
8531 {
8532 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8533 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8534 }
8535
8536 for (int i = 0;i < recipesIds.Count(); i++)
8537 {
8538 int key = recipesIds.Get(i);
8539 string recipeName = moduleRecipesManager.GetRecipeName(key);
8541 }
8542 }
8543
8544
8545 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8546 {
8547 super.GetDebugActions(outputList);
8548
8549
8554
8555
8559
8563
8564
8567
8568
8570 {
8573 }
8574
8576
8579
8583 }
8584
8585
8586
8587
8589 {
8590 super.OnAction(action_id, player, ctx);
8591 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8592 {
8593 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8594 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8595 PlayerBase p = PlayerBase.Cast(player);
8596 if (
EActions.RECIPES_RANGE_START < 1000)
8597 {
8598 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8599 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8600 }
8601 }
8602 #ifndef SERVER
8603 else if (action_id ==
EActions.WATCH_PLAYER)
8604 {
8605 PluginDeveloper.SetDeveloperItemClientEx(player);
8606 }
8607 #endif
8609 {
8610 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8611 {
8612 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8613 OnDebugButtonPressServer(id + 1);
8614 }
8615
8616 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8617 {
8618 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8620 }
8621
8622 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8623 {
8624 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8626 }
8627
8628 else if (action_id ==
EActions.ADD_QUANTITY)
8629 {
8630 if (IsMagazine())
8631 {
8632 Magazine mag = Magazine.Cast(this);
8633 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8634 }
8635 else
8636 {
8638 }
8639
8640 if (m_EM)
8641 {
8642 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8643 }
8644
8645 }
8646
8647 else if (action_id ==
EActions.REMOVE_QUANTITY)
8648 {
8649 if (IsMagazine())
8650 {
8651 Magazine mag2 = Magazine.Cast(this);
8652 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8653 }
8654 else
8655 {
8657 }
8658 if (m_EM)
8659 {
8660 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8661 }
8662
8663 }
8664
8665 else if (action_id ==
EActions.SET_QUANTITY_0)
8666 {
8668
8669 if (m_EM)
8670 {
8671 m_EM.SetEnergy(0);
8672 }
8673 }
8674
8675 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8676 {
8678
8679 if (m_EM)
8680 {
8681 m_EM.SetEnergy(m_EM.GetEnergyMax());
8682 }
8683 }
8684
8685 else if (action_id ==
EActions.ADD_HEALTH)
8686 {
8687 AddHealth("","",GetMaxHealth("","Health")/5);
8688 }
8689 else if (action_id ==
EActions.REMOVE_HEALTH)
8690 {
8691 AddHealth("","",-GetMaxHealth("","Health")/5);
8692 }
8693 else if (action_id ==
EActions.DESTROY_HEALTH)
8694 {
8695 SetHealth01("","",0);
8696 }
8697 else if (action_id ==
EActions.WATCH_ITEM)
8698 {
8700 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
8701 #ifdef DEVELOPER
8702 SetDebugDeveloper_item(this);
8703 #endif
8704 }
8705
8706 else if (action_id ==
EActions.ADD_TEMPERATURE)
8707 {
8708 AddTemperature(20);
8709
8710 }
8711
8712 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
8713 {
8714 AddTemperature(-20);
8715
8716 }
8717
8718 else if (action_id ==
EActions.FLIP_FROZEN)
8719 {
8720 SetFrozen(!GetIsFrozen());
8721
8722 }
8723
8724 else if (action_id ==
EActions.ADD_WETNESS)
8725 {
8727
8728 }
8729
8730 else if (action_id ==
EActions.REMOVE_WETNESS)
8731 {
8733
8734 }
8735
8736 else if (action_id ==
EActions.LIQUIDTYPE_UP)
8737 {
8740
8741
8742 }
8743
8744 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
8745 {
8748 }
8749
8750 else if (action_id ==
EActions.MAKE_SPECIAL)
8751 {
8752 auto debugParams = DebugSpawnParams.WithPlayer(player);
8753 OnDebugSpawnEx(debugParams);
8754 }
8755
8756 else if (action_id ==
EActions.DELETE)
8757 {
8758 Delete();
8759 }
8760
8761 }
8762
8763
8764 return false;
8765 }
8766
8767
8768
8769
8773
8776
8777
8778
8780 {
8781 return false;
8782 }
8783
8784
8786 {
8787 return true;
8788 }
8789
8790
8792 {
8793 return true;
8794 }
8795
8796
8797
8799 {
8800 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
8802 }
8803
8806 {
8807 return null;
8808 }
8809
8811 {
8812 return false;
8813 }
8814
8816 {
8817 return false;
8818 }
8819
8823
8824
8826 {
8827 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8828 return module_repairing.CanRepair(this, item_repair_kit);
8829 }
8830
8831
8832 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
8833 {
8834 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
8835 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
8836 }
8837
8838
8840 {
8841
8842
8843
8844
8845
8846
8847
8848
8849 return 1;
8850 }
8851
8852
8853
8855 {
8857 }
8858
8859
8860
8862 {
8864 }
8865
8866
8875 {
8876 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8877
8878 if (player)
8879 {
8880 player.MessageStatus(text);
8881 }
8882 }
8883
8884
8893 {
8894 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8895
8896 if (player)
8897 {
8898 player.MessageAction(text);
8899 }
8900 }
8901
8902
8911 {
8912 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8913
8914 if (player)
8915 {
8916 player.MessageFriendly(text);
8917 }
8918 }
8919
8920
8929 {
8930 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
8931
8932 if (player)
8933 {
8934 player.MessageImportant(text);
8935 }
8936 }
8937
8939 {
8940 return true;
8941 }
8942
8943
8944 override bool KindOf(
string tag)
8945 {
8946 bool found = false;
8947 string item_name = this.
GetType();
8950
8951 int array_size = item_tag_array.Count();
8952 for (int i = 0; i < array_size; i++)
8953 {
8954 if (item_tag_array.Get(i) == tag)
8955 {
8956 found = true;
8957 break;
8958 }
8959 }
8960 return found;
8961 }
8962
8963
8965 {
8966
8967 super.OnRPC(sender, rpc_type,ctx);
8968
8969
8970 switch (rpc_type)
8971 {
8972 #ifndef SERVER
8973 case ERPCs.RPC_SOUND_LOCK_ATTACH:
8974 Param2<bool, string> p = new Param2<bool, string>(false, "");
8975
8977 return;
8978
8979 bool play = p.param1;
8980 string soundSet = p.param2;
8981
8982 if (play)
8983 {
8985 {
8987 {
8989 }
8990 }
8991 else
8992 {
8994 }
8995 }
8996 else
8997 {
8999 }
9000
9001 break;
9002 #endif
9003
9004 }
9005
9007 {
9009 }
9010 }
9011
9012
9013
9014
9016 {
9017 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9018 return plugin.GetID(
name);
9019 }
9020
9022 {
9023 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9024 return plugin.GetName(id);
9025 }
9026
9029 {
9030
9031
9032 int varFlags;
9033 if (!ctx.
Read(varFlags))
9034 return;
9035
9036 if (varFlags & ItemVariableFlags.FLOAT)
9037 {
9039 }
9040 }
9041
9043 {
9044
9045 super.SerializeNumericalVars(floats_out);
9046
9047
9048
9050 {
9052 }
9053
9055 {
9057 }
9058
9060 {
9062 }
9063
9065 {
9070 }
9071
9073 {
9075 }
9076 }
9077
9079 {
9080
9081 super.DeSerializeNumericalVars(floats);
9082
9083
9084 int index = 0;
9085 int mask = Math.Round(floats.Get(index));
9086
9087 index++;
9088
9090 {
9092 {
9094 }
9095 else
9096 {
9097 float quantity = floats.Get(index);
9099 }
9100 index++;
9101 }
9102
9104 {
9105 float wet = floats.Get(index);
9107 index++;
9108 }
9109
9111 {
9112 int liquidtype = Math.Round(floats.Get(index));
9114 index++;
9115 }
9116
9118 {
9120 index++;
9122 index++;
9124 index++;
9126 index++;
9127 }
9128
9130 {
9131 int cleanness = Math.Round(floats.Get(index));
9133 index++;
9134 }
9135 }
9136
9138 {
9139 super.WriteVarsToCTX(ctx);
9140
9141
9143 {
9145 }
9146
9148 {
9150 }
9151
9153 {
9155 }
9156
9158 {
9159 int r,g,b,a;
9165 }
9166
9168 {
9170 }
9171 }
9172
9174 {
9175 if (!super.ReadVarsFromCTX(ctx,version))
9176 return false;
9177
9178 int intValue;
9179 float value;
9180
9181 if (version < 140)
9182 {
9183 if (!ctx.
Read(intValue))
9184 return false;
9185
9186 m_VariablesMask = intValue;
9187 }
9188
9190 {
9191 if (!ctx.
Read(value))
9192 return false;
9193
9195 {
9197 }
9198 else
9199 {
9201 }
9202 }
9203
9204 if (version < 140)
9205 {
9207 {
9208 if (!ctx.
Read(value))
9209 return false;
9210 SetTemperatureDirect(value);
9211 }
9212 }
9213
9215 {
9216 if (!ctx.
Read(value))
9217 return false;
9219 }
9220
9222 {
9223 if (!ctx.
Read(intValue))
9224 return false;
9226 }
9227
9229 {
9230 int r,g,b,a;
9232 return false;
9234 return false;
9236 return false;
9238 return false;
9239
9241 }
9242
9244 {
9245 if (!ctx.
Read(intValue))
9246 return false;
9248 }
9249
9250 if (version >= 138 && version < 140)
9251 {
9253 {
9254 if (!ctx.
Read(intValue))
9255 return false;
9256 SetFrozen(intValue);
9257 }
9258 }
9259
9260 return true;
9261 }
9262
9263
9265 {
9268 {
9270 }
9271
9272 if (!super.OnStoreLoad(ctx, version))
9273 {
9275 return false;
9276 }
9277
9278 if (version >= 114)
9279 {
9280 bool hasQuickBarIndexSaved;
9281
9282 if (!ctx.
Read(hasQuickBarIndexSaved))
9283 {
9285 return false;
9286 }
9287
9288 if (hasQuickBarIndexSaved)
9289 {
9290 int itmQBIndex;
9291
9292
9293 if (!ctx.
Read(itmQBIndex))
9294 {
9296 return false;
9297 }
9298
9299 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9300 if (itmQBIndex != -1 && parentPlayer)
9301 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9302 }
9303 }
9304 else
9305 {
9306
9307 PlayerBase player;
9308 int itemQBIndex;
9309 if (version ==
int.
MAX)
9310 {
9311 if (!ctx.
Read(itemQBIndex))
9312 {
9314 return false;
9315 }
9316 }
9317 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9318 {
9319
9320 if (!ctx.
Read(itemQBIndex))
9321 {
9323 return false;
9324 }
9325 if (itemQBIndex != -1 && player)
9326 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9327 }
9328 }
9329
9330 if (version < 140)
9331 {
9332
9333 if (!LoadVariables(ctx, version))
9334 {
9336 return false;
9337 }
9338 }
9339
9340
9342 {
9344 return false;
9345 }
9346 if (version >= 132)
9347 {
9349 if (raib)
9350 {
9352 {
9354 return false;
9355 }
9356 }
9357 }
9358
9360 return true;
9361 }
9362
9363
9364
9366 {
9367 super.OnStoreSave(ctx);
9368
9369 PlayerBase player;
9370 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9371 {
9373
9374 int itemQBIndex = -1;
9375 itemQBIndex = player.FindQuickBarEntityIndex(this);
9376 ctx.
Write(itemQBIndex);
9377 }
9378 else
9379 {
9381 }
9382
9384
9386 if (raib)
9387 {
9389 }
9390 }
9391
9392
9394 {
9395 super.AfterStoreLoad();
9396
9398 {
9400 }
9401
9403 {
9406 }
9407 }
9408
9410 {
9411 super.EEOnAfterLoad();
9412
9414 {
9416 }
9417
9420 }
9421
9423 {
9424 return false;
9425 }
9426
9427
9428
9430 {
9432 {
9433 #ifdef PLATFORM_CONSOLE
9434
9436 {
9438 if (menu)
9439 {
9441 }
9442 }
9443 #endif
9444 }
9445
9447 {
9450 }
9451
9453 {
9454 SetWeightDirty();
9456 }
9458 {
9461 }
9462
9464 {
9467 }
9469 {
9472 }
9473
9474 super.OnVariablesSynchronized();
9475 }
9476
9477
9478
9480 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9481 {
9482 if (!IsServerCheck(allow_client))
9483 return false;
9484
9486 return false;
9487
9490
9491 if (value <= (min + 0.001))
9492 value = min;
9493
9494 if (value == min)
9495 {
9496 if (destroy_config)
9497 {
9498 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9499 if (dstr)
9500 {
9502 this.Delete();
9503 return true;
9504 }
9505 }
9506 else if (destroy_forced)
9507 {
9509 this.Delete();
9510 return true;
9511 }
9512
9514 }
9515
9518
9520 {
9522
9523 if (delta)
9525 }
9526
9528
9529 return false;
9530 }
9531
9532
9534 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9535 {
9537 }
9538
9540 {
9543 }
9544
9546 {
9549 }
9550
9553 {
9554 float value_clamped = Math.Clamp(value, 0, 1);
9556 SetQuantity(result, destroy_config, destroy_forced);
9557 }
9558
9559
9562 {
9564 }
9565
9567 {
9569 }
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9581 {
9582 int slot = -1;
9583 if (GetInventory())
9584 {
9585 InventoryLocation il = new InventoryLocation;
9586 GetInventory().GetCurrentInventoryLocation(il);
9588 }
9589
9591 }
9592
9594 {
9595 float quantity_max = 0;
9596
9598 {
9599 if (attSlotID != -1)
9600 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9601
9602 if (quantity_max <= 0)
9604 }
9605
9606 if (quantity_max <= 0)
9608
9609 return quantity_max;
9610 }
9611
9613 {
9615 }
9616
9618 {
9620 }
9621
9622
9624 {
9626 }
9627
9629 {
9631 }
9632
9634 {
9636 }
9637
9638
9640 {
9641
9642 float weightEx = GetWeightEx();
9643 float special = GetInventoryAndCargoWeight();
9644 return weightEx - special;
9645 }
9646
9647
9649 {
9651 }
9652
9654 {
9656 {
9657 #ifdef DEVELOPER
9658 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9659 {
9660 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9662 }
9663 #endif
9664
9666 }
9667 else if (HasEnergyManager())
9668 {
9669 #ifdef DEVELOPER
9670 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9671 {
9672 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9673 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9674 }
9675 #endif
9676 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9677 }
9678 else
9679 {
9680 #ifdef DEVELOPER
9681 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9682 {
9683 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9684 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9685 }
9686 #endif
9687 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
9688 }
9689 }
9690
9693 {
9694 int item_count = 0;
9696
9697 if (GetInventory().GetCargo() != NULL)
9698 {
9699 item_count = GetInventory().GetCargo().GetItemCount();
9700 }
9701
9702 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
9703 {
9704 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
9705 if (item)
9706 item_count += item.GetNumberOfItems();
9707 }
9708 return item_count;
9709 }
9710
9713 {
9714 float weight = 0;
9715 float wetness = 1;
9716 if (include_wetness)
9719 {
9720 weight = wetness * m_ConfigWeight;
9721 }
9723 {
9724 weight = 1;
9725 }
9726 return weight;
9727 }
9728
9729
9730
9732 {
9733 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
9734 {
9735 GameInventory inv = GetInventory();
9736 array<EntityAI> items = new array<EntityAI>;
9738 for (int i = 0; i < items.Count(); i++)
9739 {
9741 if (item)
9742 {
9744 }
9745 }
9746 }
9747 }
9748
9749
9750
9751
9753 {
9754 float energy = 0;
9755 if (HasEnergyManager())
9756 {
9757 energy = GetCompEM().GetEnergy();
9758 }
9759 return energy;
9760 }
9761
9762
9764 {
9765 super.OnEnergyConsumed();
9766
9768 }
9769
9771 {
9772 super.OnEnergyAdded();
9773
9775 }
9776
9777
9779 {
9780 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
9781 {
9783 {
9784 float energy_0to1 = GetCompEM().GetEnergy0To1();
9786 }
9787 }
9788 }
9789
9790
9792 {
9793 return ConfigGetFloat("heatIsolation");
9794 }
9795
9797 {
9799 }
9800
9802 {
9803 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
9804 if (
GetGame().ConfigIsExisting(paramPath))
9806
9807 return 0.0;
9808 }
9809
9811 {
9812 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
9813 if (
GetGame().ConfigIsExisting(paramPath))
9815
9816 return 0.0;
9817 }
9818
9819 override void SetWet(
float value,
bool allow_client =
false)
9820 {
9821 if (!IsServerCheck(allow_client))
9822 return;
9823
9826
9828
9829 m_VarWet = Math.Clamp(value, min, max);
9830
9832 {
9835 }
9836 }
9837
9838 override void AddWet(
float value)
9839 {
9841 }
9842
9844 {
9846 }
9847
9849 {
9851 }
9852
9854 {
9856 }
9857
9859 {
9861 }
9862
9864 {
9866 }
9867
9869 {
9872 if (newLevel != oldLevel)
9873 {
9875 }
9876 }
9877
9879 {
9880 SetWeightDirty();
9881 }
9882
9884 {
9885 return GetWetLevelInternal(
m_VarWet);
9886 }
9887
9888
9889
9891 {
9893 }
9894
9896 {
9898 }
9899
9901 {
9903 }
9904
9906 {
9908 }
9909
9910
9911
9913 {
9914 if (ConfigIsExisting("itemModelLength"))
9915 {
9916 return ConfigGetFloat("itemModelLength");
9917 }
9918 return 0;
9919 }
9920
9922 {
9923 if (ConfigIsExisting("itemAttachOffset"))
9924 {
9925 return ConfigGetFloat("itemAttachOffset");
9926 }
9927 return 0;
9928 }
9929
9930 override void SetCleanness(
int value,
bool allow_client =
false)
9931 {
9932 if (!IsServerCheck(allow_client))
9933 return;
9934
9936
9938
9941 }
9942
9944 {
9946 }
9947
9949 {
9950 return true;
9951 }
9952
9953
9954
9955
9957 {
9959 }
9960
9962 {
9964 }
9965
9966
9967
9968
9969 override void SetColor(
int r,
int g,
int b,
int a)
9970 {
9976 }
9978 override void GetColor(out
int r,out
int g,out
int b,out
int a)
9979 {
9984 }
9985
9987 {
9989 }
9990
9993 {
9994 int r,g,b,a;
9996 r = r/255;
9997 g = g/255;
9998 b = b/255;
9999 a = a/255;
10000 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10001 }
10002
10003
10004
10005 override void SetLiquidType(
int value,
bool allow_client =
false)
10006 {
10007 if (!IsServerCheck(allow_client))
10008 return;
10009
10014 }
10015
10017 {
10018 return ConfigGetInt("varLiquidTypeInit");
10019 }
10020
10022 {
10024 }
10025
10027 {
10029 SetFrozen(false);
10030 }
10031
10034 {
10035 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10036 }
10037
10038
10041 {
10042 PlayerBase nplayer;
10043 if (PlayerBase.CastTo(nplayer, player))
10044 {
10046
10047 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10048 }
10049 }
10050
10051
10054 {
10055 PlayerBase nplayer;
10056 if (PlayerBase.CastTo(nplayer,player))
10057 {
10058
10059 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10060
10061 }
10062
10063
10064 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10065
10066
10067 if (HasEnergyManager())
10068 {
10069 GetCompEM().UpdatePlugState();
10070 }
10071 }
10072
10073
10075 {
10076 super.OnPlacementStarted(player);
10077
10079 }
10080
10081 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10082 {
10084 {
10085 m_AdminLog.OnPlacementComplete(player,
this);
10086 }
10087
10088 super.OnPlacementComplete(player, position, orientation);
10089 }
10090
10091
10092
10093
10094
10096 {
10098 {
10099 return true;
10100 }
10101 else
10102 {
10103 return false;
10104 }
10105 }
10106
10107
10109 {
10111 {
10113 }
10114 }
10115
10116
10118 {
10120 }
10121
10123 {
10125 }
10126
10127 override void InsertAgent(
int agent,
float count = 1)
10128 {
10129 if (count < 1)
10130 return;
10131
10133 }
10134
10137 {
10139 }
10140
10141
10143 {
10145 }
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10189 {
10191 return false;
10192 return true;
10193 }
10194
10196 {
10197
10199 }
10200
10201
10204 {
10205 super.CheckForRoofLimited(timeTresholdMS);
10206
10208 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10209 {
10210 m_PreviousRoofTestTime = time;
10211 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10212 }
10213 }
10214
10215
10217 {
10219 {
10220 return 0;
10221 }
10222
10223 if (GetInventory().GetAttachmentSlotsCount() != 0)
10224 {
10225 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10226 if (filter)
10227 return filter.GetProtectionLevel(type, false, system);
10228 else
10229 return 0;
10230 }
10231
10232 string subclassPath, entryName;
10233
10234 switch (type)
10235 {
10237 entryName = "biological";
10238 break;
10240 entryName = "chemical";
10241 break;
10242 default:
10243 entryName = "biological";
10244 break;
10245 }
10246
10247 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10248
10250 }
10251
10252
10253
10256 {
10257 if (!IsMagazine())
10259
10261 }
10262
10263
10264
10265
10266
10271 {
10272 return true;
10273 }
10274
10276 {
10278 }
10279
10280
10281
10282
10283
10285 {
10286 if (parent)
10287 {
10288 if (parent.IsInherited(DayZInfected))
10289 return true;
10290
10291 if (!parent.IsRuined())
10292 return true;
10293 }
10294
10295 return true;
10296 }
10297
10299 {
10300 if (!super.CanPutAsAttachment(parent))
10301 {
10302 return false;
10303 }
10304
10305 if (!IsRuined() && !parent.IsRuined())
10306 {
10307 return true;
10308 }
10309
10310 return false;
10311 }
10312
10314 {
10315
10316
10317
10318
10319 return super.CanReceiveItemIntoCargo(item);
10320 }
10321
10323 {
10324
10325
10326
10327
10328 GameInventory attachmentInv = attachment.GetInventory();
10330 {
10331 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10332 return false;
10333 }
10334
10335 InventoryLocation loc = new InventoryLocation();
10336 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10337 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10338 return false;
10339
10340 return super.CanReceiveAttachment(attachment, slotId);
10341 }
10342
10344 {
10345 if (!super.CanReleaseAttachment(attachment))
10346 return false;
10347
10348 return GetInventory().AreChildrenAccessible();
10349 }
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10372 {
10373 int id = muzzle_owner.GetMuzzleID();
10374 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10375
10376 if (WPOF_array)
10377 {
10378 for (int i = 0; i < WPOF_array.Count(); i++)
10379 {
10380 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10381
10382 if (WPOF)
10383 {
10384 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10385 }
10386 }
10387 }
10388 }
10389
10390
10392 {
10393 int id = muzzle_owner.GetMuzzleID();
10395
10396 if (WPOBE_array)
10397 {
10398 for (int i = 0; i < WPOBE_array.Count(); i++)
10399 {
10400 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10401
10402 if (WPOBE)
10403 {
10404 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10405 }
10406 }
10407 }
10408 }
10409
10410
10412 {
10413 int id = muzzle_owner.GetMuzzleID();
10414 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10415
10416 if (WPOOH_array)
10417 {
10418 for (int i = 0; i < WPOOH_array.Count(); i++)
10419 {
10420 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10421
10422 if (WPOOH)
10423 {
10424 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10425 }
10426 }
10427 }
10428 }
10429
10430
10432 {
10433 int id = muzzle_owner.GetMuzzleID();
10434 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10435
10436 if (WPOOH_array)
10437 {
10438 for (int i = 0; i < WPOOH_array.Count(); i++)
10439 {
10440 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10441
10442 if (WPOOH)
10443 {
10444 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10445 }
10446 }
10447 }
10448 }
10449
10450
10452 {
10453 int id = muzzle_owner.GetMuzzleID();
10454 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10455
10456 if (WPOOH_array)
10457 {
10458 for (int i = 0; i < WPOOH_array.Count(); i++)
10459 {
10460 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10461
10462 if (WPOOH)
10463 {
10464 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10465 }
10466 }
10467 }
10468 }
10469
10470
10471
10473 {
10475 {
10476 return true;
10477 }
10478
10479 return false;
10480 }
10481
10483 {
10485 {
10486 return true;
10487 }
10488
10489 return false;
10490 }
10491
10493 {
10495 {
10496 return true;
10497 }
10498
10499 return false;
10500 }
10501
10503 {
10504 return false;
10505 }
10506
10509 {
10510 return UATimeSpent.DEFAULT_DEPLOY;
10511 }
10512
10513
10514
10515
10517 {
10519 SetSynchDirty();
10520 }
10521
10523 {
10525 }
10526
10527
10529 {
10530 return false;
10531 }
10532
10535 {
10536 string att_type = "None";
10537
10538 if (ConfigIsExisting("soundAttType"))
10539 {
10540 att_type = ConfigGetString("soundAttType");
10541 }
10542
10544 }
10545
10547 {
10549 }
10550
10551
10552
10553
10554
10558
10560 {
10563
10565 }
10566
10567
10569 {
10571 return;
10572
10574
10577
10580
10581 SoundParameters params = new SoundParameters();
10585 }
10586
10587
10589 {
10591 return;
10592
10594 SetSynchDirty();
10595
10598 }
10599
10600
10602 {
10604 return;
10605
10607 SetSynchDirty();
10608
10611 }
10612
10614 {
10616 }
10617
10619 {
10621 }
10622
10625 {
10626 if (!
GetGame().IsDedicatedServer())
10627 {
10628 if (ConfigIsExisting("attachSoundSet"))
10629 {
10630 string cfg_path = "";
10631 string soundset = "";
10632 string type_name =
GetType();
10633
10636 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10637 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10638
10639 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10640 {
10641 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10642 {
10643 if (cfg_slot_array[i] == slot_type)
10644 {
10645 soundset = cfg_soundset_array[i];
10646 break;
10647 }
10648 }
10649 }
10650
10651 if (soundset != "")
10652 {
10653 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10655 }
10656 }
10657 }
10658 }
10659
10661 {
10662
10663 }
10664
10665 void OnApply(PlayerBase player);
10666
10668 {
10669 return 1.0;
10670 };
10671
10673 {
10675 }
10676
10678 {
10680 }
10681
10683
10685 {
10686 SetDynamicPhysicsLifeTime(0.01);
10688 }
10689
10691 {
10692 array<string> zone_names = new array<string>;
10693 GetDamageZones(zone_names);
10694 for (int i = 0; i < zone_names.Count(); i++)
10695 {
10696 SetHealthMax(zone_names.Get(i),"Health");
10697 }
10698 SetHealthMax("","Health");
10699 }
10700
10703 {
10704 float global_health = GetHealth01("","Health");
10705 array<string> zones = new array<string>;
10706 GetDamageZones(zones);
10707
10708 for (int i = 0; i < zones.Count(); i++)
10709 {
10710 SetHealth01(zones.Get(i),"Health",global_health);
10711 }
10712 }
10713
10716 {
10717 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
10718 }
10719
10721 {
10722 if (!hasRootAsPlayer)
10723 {
10724 if (refParentIB)
10725 {
10726
10727 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
10728 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
10729
10730 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
10731 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
10732
10735 }
10736 else
10737 {
10738
10741 }
10742 }
10743 }
10744
10746 {
10748 {
10749 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
10750 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
10751 {
10752 float heatPermCoef = 1.0;
10754 while (ent)
10755 {
10756 heatPermCoef *= ent.GetHeatPermeabilityCoef();
10757 ent = ent.GetHierarchyParent();
10758 }
10759
10760 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
10761 }
10762 }
10763 }
10764
10766 {
10767
10768 EntityAI parent = GetHierarchyParent();
10769 if (!parent)
10770 {
10771 hasParent = false;
10772 hasRootAsPlayer = false;
10773 }
10774 else
10775 {
10776 hasParent = true;
10777 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
10778 refParentIB =
ItemBase.Cast(parent);
10779 }
10780 }
10781
10782 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
10783 {
10784
10785 }
10786
10788 {
10789
10790 return false;
10791 }
10792
10794 {
10795
10796
10797 return false;
10798 }
10799
10801 {
10802
10803 return false;
10804 }
10805
10808 {
10809 return !GetIsFrozen() &&
IsOpen();
10810 }
10811
10813 {
10814 bool hasParent = false, hasRootAsPlayer = false;
10816
10817 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
10818 bool foodDecay =
g_Game.IsFoodDecayEnabled();
10819
10820 if (wwtu || foodDecay)
10821 {
10825
10826 if (processWetness || processTemperature || processDecay)
10827 {
10829
10830 if (processWetness)
10831 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
10832
10833 if (processTemperature)
10835
10836 if (processDecay)
10837 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
10838 }
10839 }
10840 }
10841
10844 {
10846 }
10847
10849 {
10852
10853 return super.GetTemperatureFreezeThreshold();
10854 }
10855
10857 {
10860
10861 return super.GetTemperatureThawThreshold();
10862 }
10863
10865 {
10868
10869 return super.GetItemOverheatThreshold();
10870 }
10871
10873 {
10875 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
10876
10877 return super.GetTemperatureFreezeTime();
10878 }
10879
10881 {
10883 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
10884
10885 return super.GetTemperatureThawTime();
10886 }
10887
10892
10894 {
10895 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10896 }
10897
10899 {
10900 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10901 }
10902
10905 {
10907 }
10908
10910 {
10912 }
10913
10915 {
10917 }
10918
10921 {
10922 return null;
10923 }
10924
10927 {
10928 return false;
10929 }
10930
10932 {
10934 {
10937 if (!trg)
10938 {
10940 explosive = this;
10941 }
10942
10943 explosive.PairRemote(trg);
10945
10946 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10947 trg.SetPersistentPairID(persistentID);
10948 explosive.SetPersistentPairID(persistentID);
10949
10950 return true;
10951 }
10952 return false;
10953 }
10954
10957 {
10958 float ret = 1.0;
10961 ret *= GetHealth01();
10962
10963 return ret;
10964 }
10965
10966 #ifdef DEVELOPER
10967 override void SetDebugItem()
10968 {
10969 super.SetDebugItem();
10970 _itemBase = this;
10971 }
10972
10974 {
10975 string text = super.GetDebugText();
10976
10978 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
10979
10980 return text;
10981 }
10982 #endif
10983
10985 {
10986 return true;
10987 }
10988
10990
10992
10994 {
10997 }
10998
10999
11007
11023}
11024
11026{
11028 if (entity)
11029 {
11030 bool is_item = entity.IsInherited(
ItemBase);
11031 if (is_item && full_quantity)
11032 {
11035 }
11036 }
11037 else
11038 {
11040 return NULL;
11041 }
11042 return entity;
11043}
11044
11046{
11047 if (item)
11048 {
11049 if (health > 0)
11050 item.SetHealth("", "", health);
11051
11052 if (item.CanHaveTemperature())
11053 {
11055 if (item.CanFreeze())
11056 item.SetFrozen(false);
11057 }
11058
11059 if (item.HasEnergyManager())
11060 {
11061 if (quantity >= 0)
11062 {
11063 item.GetCompEM().SetEnergy0To1(quantity);
11064 }
11065 else
11066 {
11068 }
11069 }
11070 else if (item.IsMagazine())
11071 {
11072 Magazine mag = Magazine.Cast(item);
11073 if (quantity >= 0)
11074 {
11075 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11076 }
11077 else
11078 {
11080 }
11081
11082 }
11083 else
11084 {
11085 if (quantity >= 0)
11086 {
11087 item.SetQuantityNormalized(quantity, false);
11088 }
11089 else
11090 {
11092 }
11093
11094 }
11095 }
11096}
11097
11098#ifdef DEVELOPER
11100#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.