6976{
6978 {
6979 return true;
6980 }
6981};
6982
6983
6984
6986{
6990
6992
6995
6996
6997
6998
6999
7008
7014
7019
7024
7045 protected bool m_IsResultOfSplit
7046
7048
7053
7054
7055
7057
7061
7062
7063
7065
7068
7069
7070
7076
7077
7085
7088
7089
7091
7092
7094
7095
7100
7101
7106
7107
7109
7110
7112 {
7117
7118 if (!
GetGame().IsDedicatedServer())
7119 {
7121 {
7123
7125 {
7127 }
7128 }
7129
7132 }
7133
7134 m_OldLocation = null;
7135
7137 {
7139 }
7140
7141 if (ConfigIsExisting("headSelectionsToHide"))
7142 {
7145 }
7146
7148 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7149 {
7151 }
7152
7154
7155 m_IsResultOfSplit = false;
7156
7158 }
7159
7161 {
7162 super.InitItemVariables();
7163
7169 m_Count = ConfigGetInt(
"count");
7170
7173
7178
7181
7186
7198
7202
7203
7206 if (ConfigIsExisting("canBeSplit"))
7207 {
7210 }
7211
7213 if (ConfigIsExisting("itemBehaviour"))
7215
7216
7219 RegisterNetSyncVariableInt("m_VarLiquidType");
7220 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7221
7222 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7223 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7224 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7225
7226 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7227 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7228 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7229 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7230
7231 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7232 RegisterNetSyncVariableBool("m_IsTakeable");
7233 RegisterNetSyncVariableBool("m_IsHologram");
7234
7237 {
7240 }
7241
7243
7245 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7247
7248 }
7249
7251 {
7253 }
7254
7256 {
7259 {
7264 }
7265 }
7266
7267 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7268 {
7270 {
7273 }
7274
7276 }
7277
7279 {
7285 }
7286
7288
7290 {
7292
7293 if (!action)
7294 {
7295 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7296 return;
7297 }
7298
7300 if (!ai)
7301 {
7303 return;
7304 }
7305
7307 if (!action_array)
7308 {
7309 action_array = new array<ActionBase_Basic>;
7311 }
7312 if (LogManager.IsActionLogEnable())
7313 {
7314 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7315 }
7316
7317 if (action_array.Find(action) != -1)
7318 {
7319 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7320 }
7321 else
7322 {
7323 action_array.Insert(action);
7324 }
7325 }
7326
7328 {
7330 ActionBase action = player.GetActionManager().GetAction(actionName);
7333
7334 if (action_array)
7335 {
7336 action_array.RemoveItem(action);
7337 }
7338 }
7339
7340
7341
7343 {
7344 ActionOverrideData overrideData = new ActionOverrideData();
7348
7350 if (!actionMap)
7351 {
7354 }
7355
7356 actionMap.Insert(this.
Type(), overrideData);
7357
7358 }
7359
7361
7363
7364
7366 {
7369
7372
7373 string config_to_search = "CfgVehicles";
7374 string muzzle_owner_config;
7375
7377 {
7378 if (IsInherited(Weapon))
7379 config_to_search = "CfgWeapons";
7380
7381 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7382
7383 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7384
7386
7387 if (config_OnFire_subclass_count > 0)
7388 {
7389 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7390
7391 for (int i = 0; i < config_OnFire_subclass_count; i++)
7392 {
7393 string particle_class = "";
7395 string config_OnFire_entry = config_OnFire_class + particle_class;
7396 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7397 WPOF_array.Insert(WPOF);
7398 }
7399
7400
7402 }
7403 }
7404
7406 {
7407 config_to_search = "CfgWeapons";
7408 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7409
7410 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7411
7413
7414 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7415 {
7416 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7417
7418 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7419 {
7420 string particle_class2 = "";
7422 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7423 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7424 WPOBE_array.Insert(WPOBE);
7425 }
7426
7427
7429 }
7430 }
7431 }
7432
7433
7435 {
7438
7440 {
7441 string config_to_search = "CfgVehicles";
7442
7443 if (IsInherited(Weapon))
7444 config_to_search = "CfgWeapons";
7445
7446 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7447 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7448
7449 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7450 {
7451
7453
7455 {
7457 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7459 return;
7460 }
7461
7464
7465
7466
7468 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7469
7470 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7471 {
7472 string particle_class = "";
7474 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7476
7477 if (entry_type == CT_CLASS)
7478 {
7479 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7480 WPOOH_array.Insert(WPOF);
7481 }
7482 }
7483
7484
7486 }
7487 }
7488 }
7489
7491 {
7493 }
7494
7496 {
7498 {
7500
7503
7506
7507 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7508 }
7509 }
7510
7512 {
7514 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7515
7517 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7518
7520 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7521
7523 {
7525 }
7526 }
7527
7529 {
7531 }
7532
7534 {
7537 else
7539
7541 {
7544 }
7545 else
7546 {
7549
7552 }
7553
7555 }
7556
7558 {
7560 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7561 }
7562
7564 {
7566 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7568 }
7569
7571 {
7573 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7574 }
7575
7577 {
7580
7581 OverheatingParticle OP = new OverheatingParticle();
7586
7588 }
7589
7591 {
7594
7595 return -1;
7596 }
7597
7599 {
7601 {
7604
7605 for (int i = count; i > 0; --i)
7606 {
7607 int id = i - 1;
7610
7613
7614 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7615 {
7616 if (p)
7617 {
7620 }
7621 }
7622 }
7623 }
7624 }
7625
7627 {
7629 {
7631 {
7632 int id = i - 1;
7634
7635 if (OP)
7636 {
7638
7639 if (p)
7640 {
7642 }
7643
7644 delete OP;
7645 }
7646 }
7647
7650 }
7651 }
7652
7655 {
7656 return 0.0;
7657 }
7658
7659
7661 {
7662 return 250;
7663 }
7664
7666 {
7667 return 0;
7668 }
7669
7672 {
7674 return true;
7675
7676 return false;
7677 }
7678
7681 {
7684
7686 {
7688 }
7689 else
7690 {
7691
7693 }
7694
7696 }
7697
7704 {
7705 return -1;
7706 }
7707
7708
7709
7710
7712 {
7714 {
7716 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7717
7718 if (r_index >= 0)
7719 {
7720 InventoryLocation r_il = new InventoryLocation;
7721 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7722
7723 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7726 {
7727 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7728 }
7730 {
7731 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7732 }
7733
7734 }
7735
7736 player.GetHumanInventory().ClearUserReservedLocation(this);
7737 }
7738
7741 }
7742
7743
7744
7745
7747 {
7748 return ItemBase.m_DebugActionsMask;
7749 }
7750
7752 {
7753 return ItemBase.m_DebugActionsMask & mask;
7754 }
7755
7757 {
7758 ItemBase.m_DebugActionsMask = mask;
7759 }
7760
7762 {
7763 ItemBase.m_DebugActionsMask |= mask;
7764 }
7765
7767 {
7768 ItemBase.m_DebugActionsMask &= ~mask;
7769 }
7770
7772 {
7774 {
7776 }
7777 else
7778 {
7780 }
7781 }
7782
7783
7785 {
7786 if (GetEconomyProfile())
7787 {
7788 float q_max = GetEconomyProfile().GetQuantityMax();
7789 if (q_max > 0)
7790 {
7791 float q_min = GetEconomyProfile().GetQuantityMin();
7792 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7793
7795 {
7796 ComponentEnergyManager comp = GetCompEM();
7798 {
7800 }
7801 }
7803 {
7805
7806 }
7807
7808 }
7809 }
7810 }
7811
7814 {
7815 EntityAI parent = GetHierarchyParent();
7816
7817 if (parent)
7818 {
7819 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7820 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7821 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7822 }
7823 }
7824
7827 {
7828 EntityAI parent = GetHierarchyParent();
7829
7830 if (parent)
7831 {
7832 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7833 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7834 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7835 }
7836 }
7837
7839 {
7840
7841
7842
7843
7845
7847 {
7848 if (ScriptInputUserData.CanStoreInputUserData())
7849 {
7850 ScriptInputUserData ctx = new ScriptInputUserData;
7856 ctx.
Write(use_stack_max);
7859
7861 {
7862 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7863 }
7864 }
7865 }
7866 else if (!
GetGame().IsMultiplayer())
7867 {
7869 }
7870 }
7871
7873 {
7875 }
7876
7878 {
7880 }
7881
7883 {
7885 }
7886
7888 {
7889
7890 return false;
7891 }
7892
7894 {
7895 return false;
7896 }
7897
7901 {
7902 return false;
7903 }
7904
7906 {
7907 return "";
7908 }
7909
7911
7913 {
7914 return false;
7915 }
7916
7918 {
7919 return true;
7920 }
7921
7922
7923
7925 {
7926 return true;
7927 }
7928
7930 {
7931 return true;
7932 }
7933
7935 {
7936 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7938 }
7939
7941 {
7943 }
7944
7946 {
7948 if (!is_being_placed)
7950 SetSynchDirty();
7951 }
7952
7953
7955
7957 {
7959 }
7960
7962 {
7964 }
7965
7967 {
7968 return 1;
7969 }
7970
7972 {
7973 return false;
7974 }
7975
7977 {
7979 SetSynchDirty();
7980 }
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8017 {
8018 super.OnMovedInsideCargo(container);
8019
8020 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8021 }
8022
8023 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8024 {
8025 super.EEItemLocationChanged(oldLoc,newLoc);
8026
8027 PlayerBase new_player = null;
8028 PlayerBase old_player = null;
8029
8030 if (newLoc.GetParent())
8031 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8032
8033 if (oldLoc.GetParent())
8034 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8035
8037 {
8038 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8039
8040 if (r_index >= 0)
8041 {
8042 InventoryLocation r_il = new InventoryLocation;
8043 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8044
8045 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8048 {
8049 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8050 }
8052 {
8053 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8054 }
8055
8056 }
8057 }
8058
8060 {
8061 if (new_player)
8062 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8063
8064 if (new_player == old_player)
8065 {
8066
8067 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8068 {
8070 {
8071 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8072 {
8073 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8074 }
8075 }
8076 else
8077 {
8078 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8079 }
8080 }
8081
8082 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8083 {
8084 int type = oldLoc.GetType();
8086 {
8087 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8088 }
8090 {
8091 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8092 }
8093 }
8094 if (!m_OldLocation)
8095 {
8096 m_OldLocation = new InventoryLocation;
8097 }
8098 m_OldLocation.Copy(oldLoc);
8099 }
8100 else
8101 {
8102 if (m_OldLocation)
8103 {
8104 m_OldLocation.Reset();
8105 }
8106 }
8107
8109 }
8110 else
8111 {
8112 if (new_player)
8113 {
8114 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8115 if (res_index >= 0)
8116 {
8117 InventoryLocation il = new InventoryLocation;
8118 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8120 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8123 {
8124 il.
GetParent().GetOnReleaseLock().Invoke(it);
8125 }
8127 {
8129 }
8130
8131 }
8132 }
8134 {
8135
8137 }
8138
8139 if (m_OldLocation)
8140 {
8141 m_OldLocation.Reset();
8142 }
8143 }
8144 }
8145
8146 override void EOnContact(IEntity other, Contact extra)
8147 {
8149 {
8150 int liquidType = -1;
8152 if (impactSpeed > 0.0)
8153 {
8155 #ifndef SERVER
8157 #else
8159 SetSynchDirty();
8160 #endif
8162 }
8163 }
8164
8165 #ifdef SERVER
8166 if (GetCompEM() && GetCompEM().IsPlugged())
8167 {
8168 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8169 GetCompEM().UnplugThis();
8170 }
8171 #endif
8172 }
8173
8175
8177 {
8179 }
8180
8182 {
8183
8184 }
8185
8187 {
8188 super.OnItemLocationChanged(old_owner, new_owner);
8189
8190 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8191 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8192
8193 if (!relatedPlayer && playerNew)
8194 relatedPlayer = playerNew;
8195
8196 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8197 {
8199 if (actionMgr)
8200 {
8201 ActionBase currentAction = actionMgr.GetRunningAction();
8202 if (currentAction)
8204 }
8205 }
8206
8207 Man ownerPlayerOld = null;
8208 Man ownerPlayerNew = null;
8209
8210 if (old_owner)
8211 {
8212 if (old_owner.
IsMan())
8213 {
8214 ownerPlayerOld = Man.Cast(old_owner);
8215 }
8216 else
8217 {
8218 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8219 }
8220 }
8221 else
8222 {
8224 {
8226
8227 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8228 {
8229 GetCompEM().UnplugThis();
8230 }
8231 }
8232 }
8233
8234 if (new_owner)
8235 {
8236 if (new_owner.
IsMan())
8237 {
8238 ownerPlayerNew = Man.Cast(new_owner);
8239 }
8240 else
8241 {
8242 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8243 }
8244 }
8245
8246 if (ownerPlayerOld != ownerPlayerNew)
8247 {
8248 if (ownerPlayerOld)
8249 {
8250 array<EntityAI> subItemsExit = new array<EntityAI>;
8252 for (int i = 0; i < subItemsExit.Count(); i++)
8253 {
8256 }
8257 }
8258
8259 if (ownerPlayerNew)
8260 {
8261 array<EntityAI> subItemsEnter = new array<EntityAI>;
8263 for (int j = 0; j < subItemsEnter.Count(); j++)
8264 {
8267 }
8268 }
8269 }
8270 else if (ownerPlayerNew != null)
8271 {
8272 PlayerBase nplayer;
8273 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8274 {
8275 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8277 for (int k = 0; k < subItemsUpdate.Count(); k++)
8278 {
8280 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8281 }
8282 }
8283 }
8284
8285 if (old_owner)
8286 old_owner.OnChildItemRemoved(this);
8287 if (new_owner)
8288 new_owner.OnChildItemReceived(this);
8289 }
8290
8291
8293 {
8294 super.EEDelete(parent);
8295 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8296 if (player)
8297 {
8299
8300 if (player.IsAlive())
8301 {
8302 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8303 if (r_index >= 0)
8304 {
8305 InventoryLocation r_il = new InventoryLocation;
8306 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8307
8308 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8311 {
8312 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8313 }
8315 {
8316 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8317 }
8318
8319 }
8320
8321 player.RemoveQuickBarEntityShortcut(this);
8322 }
8323 }
8324 }
8325
8327 {
8328 super.EEKilled(killer);
8329
8332 {
8333 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8334 {
8335 if (IsMagazine())
8336 {
8337 if (Magazine.Cast(this).GetAmmoCount() > 0)
8338 {
8340 }
8341 }
8342 else
8343 {
8345 }
8346 }
8347 }
8348 }
8349
8351 {
8352 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8353
8354 super.OnWasAttached(parent, slot_id);
8355
8358
8360 }
8361
8363 {
8364 super.OnWasDetached(parent, slot_id);
8365
8368 }
8369
8371 {
8372 int idx;
8375
8376 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8377 if (inventory_slots.Count() < 1)
8378 {
8379 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8380 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8381 }
8382 else
8383 {
8384 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8385 }
8386
8387 idx = inventory_slots.Find(slot);
8388 if (idx < 0)
8389 return "";
8390
8391 return attach_types.Get(idx);
8392 }
8393
8395 {
8396 int idx = -1;
8397 string slot;
8398
8401
8402 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8403 if (inventory_slots.Count() < 1)
8404 {
8405 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8406 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8407 }
8408 else
8409 {
8410 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8411 if (detach_types.Count() < 1)
8412 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8413 }
8414
8415 for (int i = 0; i < inventory_slots.Count(); i++)
8416 {
8417 slot = inventory_slots.Get(i);
8418 }
8419
8420 if (slot != "")
8421 {
8422 if (detach_types.Count() == 1)
8423 idx = 0;
8424 else
8425 idx = inventory_slots.Find(slot);
8426 }
8427 if (idx < 0)
8428 return "";
8429
8430 return detach_types.Get(idx);
8431 }
8432
8434 {
8435
8437
8438
8439 float min_time = 1;
8440 float max_time = 3;
8441 float delay = Math.RandomFloat(min_time, max_time);
8442
8443 explode_timer.Run(delay, this, "DoAmmoExplosion");
8444 }
8445
8447 {
8448 Magazine magazine = Magazine.Cast(this);
8449 int pop_sounds_count = 6;
8450 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8451
8452
8453 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8454 string sound_name = pop_sounds[ sound_idx ];
8456
8457
8458 magazine.ServerAddAmmoCount(-1);
8459
8460
8461 float min_temp_to_explode = 100;
8462
8463 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8464 {
8466 }
8467 }
8468
8469
8470 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8471 {
8472 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8473
8474 const int CHANCE_DAMAGE_CARGO = 4;
8475 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8476 const int CHANCE_DAMAGE_NOTHING = 2;
8477
8479 {
8480 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8481 int chances;
8482 int rnd;
8483
8484 if (GetInventory().GetCargo())
8485 {
8486 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8487 rnd = Math.RandomInt(0,chances);
8488
8489 if (rnd < CHANCE_DAMAGE_CARGO)
8490 {
8492 }
8493 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8494 {
8496 }
8497 }
8498 else
8499 {
8500 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8501 rnd = Math.RandomInt(0,chances);
8502
8503 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8504 {
8506 }
8507 }
8508 }
8509 }
8510
8512 {
8513 if (GetInventory().GetCargo())
8514 {
8515 int item_count = GetInventory().GetCargo().GetItemCount();
8516 if (item_count > 0)
8517 {
8518 int random_pick = Math.RandomInt(0, item_count);
8520 if (!item.IsExplosive())
8521 {
8522 item.AddHealth("","",damage);
8523 return true;
8524 }
8525 }
8526 }
8527 return false;
8528 }
8529
8531 {
8532 int attachment_count = GetInventory().AttachmentCount();
8533 if (attachment_count > 0)
8534 {
8535 int random_pick = Math.RandomInt(0, attachment_count);
8536 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8537 if (!attachment.IsExplosive())
8538 {
8539 attachment.AddHealth("","",damage);
8540 return true;
8541 }
8542 }
8543 return false;
8544 }
8545
8547 {
8549 }
8550
8552 {
8554 return GetInventory().CanRemoveEntity();
8555
8556 return false;
8557 }
8558
8560 {
8562 return;
8563
8565 {
8566 if (ScriptInputUserData.CanStoreInputUserData())
8567 {
8568 ScriptInputUserData ctx = new ScriptInputUserData;
8573 ctx.
Write(destination_entity);
8577 }
8578 }
8579 else if (!
GetGame().IsMultiplayer())
8580 {
8582 }
8583 }
8584
8586 {
8588 return;
8589
8590 float split_quantity_new;
8594 InventoryLocation loc = new InventoryLocation;
8595
8596 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8597 {
8599 split_quantity_new = stack_max;
8600 else
8602
8603 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8604 if (new_item)
8605 {
8606 new_item.SetResultOfSplit(true);
8607 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8609 new_item.SetQuantity(split_quantity_new);
8610 }
8611 }
8612 else if (destination_entity && slot_id == -1)
8613 {
8614 if (quantity > stack_max)
8615 split_quantity_new = stack_max;
8616 else
8617 split_quantity_new = quantity;
8618
8620 {
8623 }
8624
8625 if (new_item)
8626 {
8627 new_item.SetResultOfSplit(true);
8628 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8630 new_item.SetQuantity(split_quantity_new);
8631 }
8632 }
8633 else
8634 {
8635 if (stack_max != 0)
8636 {
8638 {
8640 }
8641
8642 if (split_quantity_new == 0)
8643 {
8644 if (!
GetGame().IsMultiplayer())
8645 player.PhysicalPredictiveDropItem(this);
8646 else
8647 player.ServerDropEntity(this);
8648 return;
8649 }
8650
8652
8653 if (new_item)
8654 {
8655 new_item.SetResultOfSplit(true);
8656 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8658 new_item.SetQuantity(stack_max);
8659 new_item.PlaceOnSurface();
8660 }
8661 }
8662 }
8663 }
8664
8666 {
8668 return;
8669
8670 float split_quantity_new;
8674 InventoryLocation loc = new InventoryLocation;
8675
8676 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8677 {
8679 split_quantity_new = stack_max;
8680 else
8682
8683 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8684 if (new_item)
8685 {
8686 new_item.SetResultOfSplit(true);
8687 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8689 new_item.SetQuantity(split_quantity_new);
8690 }
8691 }
8692 else if (destination_entity && slot_id == -1)
8693 {
8694 if (quantity > stack_max)
8695 split_quantity_new = stack_max;
8696 else
8697 split_quantity_new = quantity;
8698
8700 {
8703 }
8704
8705 if (new_item)
8706 {
8707 new_item.SetResultOfSplit(true);
8708 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8710 new_item.SetQuantity(split_quantity_new);
8711 }
8712 }
8713 else
8714 {
8715 if (stack_max != 0)
8716 {
8718 {
8720 }
8721
8723
8724 if (new_item)
8725 {
8726 new_item.SetResultOfSplit(true);
8727 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8729 new_item.SetQuantity(stack_max);
8730 new_item.PlaceOnSurface();
8731 }
8732 }
8733 }
8734 }
8735
8737 {
8739 return;
8740
8742 {
8743 if (ScriptInputUserData.CanStoreInputUserData())
8744 {
8745 ScriptInputUserData ctx = new ScriptInputUserData;
8750 dst.WriteToContext(ctx);
8752 }
8753 }
8754 else if (!
GetGame().IsMultiplayer())
8755 {
8757 }
8758 }
8759
8761 {
8763 return;
8764
8766 {
8767 if (ScriptInputUserData.CanStoreInputUserData())
8768 {
8769 ScriptInputUserData ctx = new ScriptInputUserData;
8774 ctx.
Write(destination_entity);
8780 }
8781 }
8782 else if (!
GetGame().IsMultiplayer())
8783 {
8785 }
8786 }
8787
8789 {
8791 }
8792
8794 {
8796 return this;
8797
8799 float split_quantity_new;
8801 if (dst.IsValid())
8802 {
8803 int slot_id = dst.GetSlot();
8805
8806 if (quantity > stack_max)
8807 split_quantity_new = stack_max;
8808 else
8809 split_quantity_new = quantity;
8810
8812
8813 if (new_item)
8814 {
8815 new_item.SetResultOfSplit(true);
8816 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8819 }
8820
8821 return new_item;
8822 }
8823
8824 return null;
8825 }
8826
8828 {
8830 return;
8831
8833 float split_quantity_new;
8835 if (destination_entity)
8836 {
8838 if (quantity > stackable)
8839 split_quantity_new = stackable;
8840 else
8841 split_quantity_new = quantity;
8842
8843 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8844 if (new_item)
8845 {
8846 new_item.SetResultOfSplit(true);
8847 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8849 new_item.SetQuantity(split_quantity_new);
8850 }
8851 }
8852 }
8853
8855 {
8857 return;
8858
8860 {
8861 if (ScriptInputUserData.CanStoreInputUserData())
8862 {
8863 ScriptInputUserData ctx = new ScriptInputUserData;
8868 ItemBase destination_entity =
this;
8869 ctx.
Write(destination_entity);
8873 }
8874 }
8875 else if (!
GetGame().IsMultiplayer())
8876 {
8878 }
8879 }
8880
8882 {
8884 return;
8885
8887 float split_quantity_new;
8889 if (player)
8890 {
8892 if (quantity > stackable)
8893 split_quantity_new = stackable;
8894 else
8895 split_quantity_new = quantity;
8896
8897 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8898 new_item =
ItemBase.Cast(in_hands);
8899 if (new_item)
8900 {
8901 new_item.SetResultOfSplit(true);
8902 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8904 new_item.SetQuantity(split_quantity_new);
8905 }
8906 }
8907 }
8908
8910 {
8912 return;
8913
8915 float split_quantity_new = Math.Floor(quantity * 0.5);
8916
8918
8919 if (new_item)
8920 {
8921 if (new_item.GetQuantityMax() < split_quantity_new)
8922 {
8923 split_quantity_new = new_item.GetQuantityMax();
8924 }
8925
8926 new_item.SetResultOfSplit(true);
8927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8928
8930 {
8933 }
8934 else
8935 {
8938 }
8939 }
8940 }
8941
8943 {
8945 return;
8946
8948 float split_quantity_new = Math.Floor(quantity / 2);
8949
8950 InventoryLocation invloc = new InventoryLocation;
8952
8954 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8955
8956 if (new_item)
8957 {
8958 if (new_item.GetQuantityMax() < split_quantity_new)
8959 {
8960 split_quantity_new = new_item.GetQuantityMax();
8961 }
8963 {
8966 }
8967 else
8968 {
8971 }
8972 }
8973 }
8974
8977 {
8978 SetWeightDirty();
8980
8981 if (parent)
8982 parent.OnAttachmentQuantityChangedEx(this, delta);
8983
8985 {
8987 {
8989 }
8991 {
8992 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8994 }
8995 }
8996
8997 }
8998
9001 {
9002
9003 }
9004
9007 {
9009 }
9010
9012 {
9013 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9014
9016 {
9017 if (newLevel == GameConstants.STATE_RUINED)
9018 {
9020 EntityAI parent = GetHierarchyParent();
9021 if (parent && parent.IsFireplace())
9022 {
9023 CargoBase cargo = GetInventory().GetCargo();
9024 if (cargo)
9025 {
9027 {
9029 }
9030 }
9031 }
9032 }
9033
9035 {
9036
9038 return;
9039 }
9040
9041 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9042 {
9044 }
9045 }
9046 }
9047
9048
9050 {
9051 super.OnRightClick();
9052
9054 {
9056 {
9057 if (ScriptInputUserData.CanStoreInputUserData())
9058 {
9059 vector m4[4];
9061
9062 EntityAI root = GetHierarchyRoot();
9063
9064 InventoryLocation dst = new InventoryLocation;
9066 {
9067 if (root)
9068 {
9069 root.GetTransform(m4);
9071 }
9072 else
9073 GetInventory().GetCurrentInventoryLocation(dst);
9074 }
9075 else
9076 {
9078
9079
9080 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9081 {
9082 if (root)
9083 {
9084 root.GetTransform(m4);
9086 }
9087 else
9088 GetInventory().GetCurrentInventoryLocation(dst);
9089 }
9090 else
9091 {
9092 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9093 }
9094 }
9095
9096 ScriptInputUserData ctx = new ScriptInputUserData;
9104 }
9105 }
9106 else if (!
GetGame().IsMultiplayer())
9107 {
9109 }
9110 }
9111 }
9112
9113 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9114 {
9115
9116 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9117 return false;
9118
9119 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9120 return false;
9121
9122
9124 return false;
9125
9126
9127 Magazine mag = Magazine.Cast(this);
9128 if (mag)
9129 {
9130 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9131 return false;
9132
9133 if (stack_max_limit)
9134 {
9135 Magazine other_mag = Magazine.Cast(other_item);
9136 if (other_item)
9137 {
9138 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9139 return false;
9140 }
9141
9142 }
9143 }
9144 else
9145 {
9146
9148 return false;
9149
9151 return false;
9152 }
9153
9154 PlayerBase player = null;
9155 if (CastTo(player, GetHierarchyRootPlayer()))
9156 {
9157 if (player.GetInventory().HasAttachment(this))
9158 return false;
9159
9160 if (player.IsItemsToDelete())
9161 return false;
9162 }
9163
9164 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9165 return false;
9166
9167 int slotID;
9169 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9170 return false;
9171
9172 return true;
9173 }
9174
9176 {
9178 }
9179
9181 {
9182 return m_IsResultOfSplit;
9183 }
9184
9186 {
9187 m_IsResultOfSplit = value;
9188 }
9189
9191 {
9193 }
9194
9196 {
9197 float other_item_quantity = other_item.GetQuantity();
9198 float this_free_space;
9199
9201
9203
9204 if (other_item_quantity > this_free_space)
9205 {
9206 return this_free_space;
9207 }
9208 else
9209 {
9210 return other_item_quantity;
9211 }
9212 }
9213
9215 {
9217 }
9218
9220 {
9222 return;
9223
9224 if (!IsMagazine() && other_item)
9225 {
9227 if (quantity_used != 0)
9228 {
9229 float hp1 = GetHealth01("","");
9230 float hp2 = other_item.GetHealth01("","");
9231 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9232 hpResult = hpResult / (
GetQuantity() + quantity_used);
9233
9234 hpResult *= GetMaxHealth();
9235 Math.Round(hpResult);
9236 SetHealth("", "Health", hpResult);
9237
9239 other_item.AddQuantity(-quantity_used);
9240 }
9241 }
9243 }
9244
9246 {
9247 #ifdef SERVER
9248 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9249 GetHierarchyParent().IncreaseLifetimeUp();
9250 #endif
9251 };
9252
9254 {
9255 PlayerBase p = PlayerBase.Cast(player);
9256
9257 array<int> recipesIds = p.m_Recipes;
9258 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9259 if (moduleRecipesManager)
9260 {
9261 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9262 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9263 }
9264
9265 for (int i = 0;i < recipesIds.Count(); i++)
9266 {
9267 int key = recipesIds.Get(i);
9268 string recipeName = moduleRecipesManager.GetRecipeName(key);
9270 }
9271 }
9272
9273
9274 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9275 {
9276 super.GetDebugActions(outputList);
9277
9278
9283
9284
9288
9292
9293
9296
9297
9299 {
9302 }
9303
9305
9308
9312 }
9313
9314
9315
9316
9318 {
9319 super.OnAction(action_id, player, ctx);
9320 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9321 {
9322 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9323 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9324 PlayerBase p = PlayerBase.Cast(player);
9325 if (
EActions.RECIPES_RANGE_START < 1000)
9326 {
9327 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9328 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9329 }
9330 }
9331 #ifndef SERVER
9332 else if (action_id ==
EActions.WATCH_PLAYER)
9333 {
9334 PluginDeveloper.SetDeveloperItemClientEx(player);
9335 }
9336 #endif
9338 {
9339 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9340 {
9341 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9342 OnDebugButtonPressServer(id + 1);
9343 }
9344
9345 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9346 {
9347 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9349 }
9350
9351 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9352 {
9353 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9355 }
9356
9357 else if (action_id ==
EActions.ADD_QUANTITY)
9358 {
9359 if (IsMagazine())
9360 {
9361 Magazine mag = Magazine.Cast(this);
9362 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9363 }
9364 else
9365 {
9367 }
9368
9369 if (m_EM)
9370 {
9371 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9372 }
9373
9374 }
9375
9376 else if (action_id ==
EActions.REMOVE_QUANTITY)
9377 {
9378 if (IsMagazine())
9379 {
9380 Magazine mag2 = Magazine.Cast(this);
9381 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9382 }
9383 else
9384 {
9386 }
9387 if (m_EM)
9388 {
9389 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9390 }
9391
9392 }
9393
9394 else if (action_id ==
EActions.SET_QUANTITY_0)
9395 {
9397
9398 if (m_EM)
9399 {
9400 m_EM.SetEnergy(0);
9401 }
9402 }
9403
9404 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9405 {
9407
9408 if (m_EM)
9409 {
9410 m_EM.SetEnergy(m_EM.GetEnergyMax());
9411 }
9412 }
9413
9414 else if (action_id ==
EActions.ADD_HEALTH)
9415 {
9416 AddHealth("","",GetMaxHealth("","Health")/5);
9417 }
9418 else if (action_id ==
EActions.REMOVE_HEALTH)
9419 {
9420 AddHealth("","",-GetMaxHealth("","Health")/5);
9421 }
9422 else if (action_id ==
EActions.DESTROY_HEALTH)
9423 {
9424 SetHealth01("","",0);
9425 }
9426 else if (action_id ==
EActions.WATCH_ITEM)
9427 {
9429 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9430 #ifdef DEVELOPER
9431 SetDebugDeveloper_item(this);
9432 #endif
9433 }
9434
9435 else if (action_id ==
EActions.ADD_TEMPERATURE)
9436 {
9437 AddTemperature(20);
9438
9439 }
9440
9441 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9442 {
9443 AddTemperature(-20);
9444
9445 }
9446
9447 else if (action_id ==
EActions.FLIP_FROZEN)
9448 {
9449 SetFrozen(!GetIsFrozen());
9450
9451 }
9452
9453 else if (action_id ==
EActions.ADD_WETNESS)
9454 {
9456
9457 }
9458
9459 else if (action_id ==
EActions.REMOVE_WETNESS)
9460 {
9462
9463 }
9464
9465 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9466 {
9469
9470
9471 }
9472
9473 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9474 {
9477 }
9478
9479 else if (action_id ==
EActions.MAKE_SPECIAL)
9480 {
9481 auto debugParams = DebugSpawnParams.WithPlayer(player);
9482 OnDebugSpawnEx(debugParams);
9483 }
9484
9485 else if (action_id ==
EActions.DELETE)
9486 {
9487 Delete();
9488 }
9489
9490 }
9491
9492
9493 return false;
9494 }
9495
9496
9497
9498
9502
9505
9506
9507
9509 {
9510 return false;
9511 }
9512
9513
9515 {
9516 return true;
9517 }
9518
9519
9521 {
9522 return true;
9523 }
9524
9525
9526
9528 {
9529 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9531 }
9532
9535 {
9536 return null;
9537 }
9538
9540 {
9541 return false;
9542 }
9543
9545 {
9546 return false;
9547 }
9548
9552
9553
9555 {
9556 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9557 return module_repairing.CanRepair(this, item_repair_kit);
9558 }
9559
9560
9561 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9562 {
9563 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9564 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9565 }
9566
9567
9569 {
9570
9571
9572
9573
9574
9575
9576
9577
9578 return 1;
9579 }
9580
9581
9582
9584 {
9586 }
9587
9588
9589
9591 {
9593 }
9594
9595
9604 {
9605 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9606
9607 if (player)
9608 {
9609 player.MessageStatus(text);
9610 }
9611 }
9612
9613
9622 {
9623 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9624
9625 if (player)
9626 {
9627 player.MessageAction(text);
9628 }
9629 }
9630
9631
9640 {
9641 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9642
9643 if (player)
9644 {
9645 player.MessageFriendly(text);
9646 }
9647 }
9648
9649
9658 {
9659 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9660
9661 if (player)
9662 {
9663 player.MessageImportant(text);
9664 }
9665 }
9666
9668 {
9669 return true;
9670 }
9671
9672
9673 override bool KindOf(
string tag)
9674 {
9675 bool found = false;
9676 string item_name = this.
GetType();
9679
9680 int array_size = item_tag_array.Count();
9681 for (int i = 0; i < array_size; i++)
9682 {
9683 if (item_tag_array.Get(i) == tag)
9684 {
9685 found = true;
9686 break;
9687 }
9688 }
9689 return found;
9690 }
9691
9692
9694 {
9695
9696 super.OnRPC(sender, rpc_type,ctx);
9697
9698
9699 switch (rpc_type)
9700 {
9701 #ifndef SERVER
9702 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9703 Param2<bool, string> p = new Param2<bool, string>(false, "");
9704
9706 return;
9707
9708 bool play = p.param1;
9709 string soundSet = p.param2;
9710
9711 if (play)
9712 {
9714 {
9716 {
9718 }
9719 }
9720 else
9721 {
9723 }
9724 }
9725 else
9726 {
9728 }
9729
9730 break;
9731 #endif
9732
9733 }
9734
9736 {
9738 }
9739 }
9740
9741
9742
9743
9745 {
9746 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9747 return plugin.GetID(
name);
9748 }
9749
9751 {
9752 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9753 return plugin.GetName(id);
9754 }
9755
9758 {
9759
9760
9761 int varFlags;
9762 if (!ctx.
Read(varFlags))
9763 return;
9764
9765 if (varFlags & ItemVariableFlags.FLOAT)
9766 {
9768 }
9769 }
9770
9772 {
9773
9774 super.SerializeNumericalVars(floats_out);
9775
9776
9777
9779 {
9781 }
9782
9784 {
9786 }
9787
9789 {
9791 }
9792
9794 {
9799 }
9800
9802 {
9804 }
9805 }
9806
9808 {
9809
9810 super.DeSerializeNumericalVars(floats);
9811
9812
9813 int index = 0;
9814 int mask = Math.Round(floats.Get(index));
9815
9816 index++;
9817
9819 {
9821 {
9823 }
9824 else
9825 {
9826 float quantity = floats.Get(index);
9828 }
9829 index++;
9830 }
9831
9833 {
9834 float wet = floats.Get(index);
9836 index++;
9837 }
9838
9840 {
9841 int liquidtype = Math.Round(floats.Get(index));
9843 index++;
9844 }
9845
9847 {
9849 index++;
9851 index++;
9853 index++;
9855 index++;
9856 }
9857
9859 {
9860 int cleanness = Math.Round(floats.Get(index));
9862 index++;
9863 }
9864 }
9865
9867 {
9868 super.WriteVarsToCTX(ctx);
9869
9870
9872 {
9874 }
9875
9877 {
9879 }
9880
9882 {
9884 }
9885
9887 {
9888 int r,g,b,a;
9894 }
9895
9897 {
9899 }
9900 }
9901
9903 {
9904 if (!super.ReadVarsFromCTX(ctx,version))
9905 return false;
9906
9907 int intValue;
9908 float value;
9909
9910 if (version < 140)
9911 {
9912 if (!ctx.
Read(intValue))
9913 return false;
9914
9915 m_VariablesMask = intValue;
9916 }
9917
9919 {
9920 if (!ctx.
Read(value))
9921 return false;
9922
9924 {
9926 }
9927 else
9928 {
9930 }
9931 }
9932
9933 if (version < 140)
9934 {
9936 {
9937 if (!ctx.
Read(value))
9938 return false;
9939 SetTemperatureDirect(value);
9940 }
9941 }
9942
9944 {
9945 if (!ctx.
Read(value))
9946 return false;
9948 }
9949
9951 {
9952 if (!ctx.
Read(intValue))
9953 return false;
9955 }
9956
9958 {
9959 int r,g,b,a;
9961 return false;
9963 return false;
9965 return false;
9967 return false;
9968
9970 }
9971
9973 {
9974 if (!ctx.
Read(intValue))
9975 return false;
9977 }
9978
9979 if (version >= 138 && version < 140)
9980 {
9982 {
9983 if (!ctx.
Read(intValue))
9984 return false;
9985 SetFrozen(intValue);
9986 }
9987 }
9988
9989 return true;
9990 }
9991
9992
9994 {
9997 {
9999 }
10000
10001 if (!super.OnStoreLoad(ctx, version))
10002 {
10004 return false;
10005 }
10006
10007 if (version >= 114)
10008 {
10009 bool hasQuickBarIndexSaved;
10010
10011 if (!ctx.
Read(hasQuickBarIndexSaved))
10012 {
10014 return false;
10015 }
10016
10017 if (hasQuickBarIndexSaved)
10018 {
10019 int itmQBIndex;
10020
10021
10022 if (!ctx.
Read(itmQBIndex))
10023 {
10025 return false;
10026 }
10027
10028 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10029 if (itmQBIndex != -1 && parentPlayer)
10030 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10031 }
10032 }
10033 else
10034 {
10035
10036 PlayerBase player;
10037 int itemQBIndex;
10038 if (version ==
int.
MAX)
10039 {
10040 if (!ctx.
Read(itemQBIndex))
10041 {
10043 return false;
10044 }
10045 }
10046 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10047 {
10048
10049 if (!ctx.
Read(itemQBIndex))
10050 {
10052 return false;
10053 }
10054 if (itemQBIndex != -1 && player)
10055 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10056 }
10057 }
10058
10059 if (version < 140)
10060 {
10061
10062 if (!LoadVariables(ctx, version))
10063 {
10065 return false;
10066 }
10067 }
10068
10069
10071 {
10073 return false;
10074 }
10075 if (version >= 132)
10076 {
10078 if (raib)
10079 {
10081 {
10083 return false;
10084 }
10085 }
10086 }
10087
10089 return true;
10090 }
10091
10092
10093
10095 {
10096 super.OnStoreSave(ctx);
10097
10098 PlayerBase player;
10099 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10100 {
10102
10103 int itemQBIndex = -1;
10104 itemQBIndex = player.FindQuickBarEntityIndex(this);
10105 ctx.
Write(itemQBIndex);
10106 }
10107 else
10108 {
10110 }
10111
10113
10115 if (raib)
10116 {
10118 }
10119 }
10120
10121
10123 {
10124 super.AfterStoreLoad();
10125
10127 {
10129 }
10130
10132 {
10135 }
10136 }
10137
10139 {
10140 super.EEOnAfterLoad();
10141
10143 {
10145 }
10146
10149 }
10150
10152 {
10153 return false;
10154 }
10155
10156
10157
10159 {
10161 {
10162 #ifdef PLATFORM_CONSOLE
10163
10165 {
10167 if (menu)
10168 {
10170 }
10171 }
10172 #endif
10173 }
10174
10176 {
10179 }
10180
10182 {
10183 SetWeightDirty();
10185 }
10187 {
10190 }
10191
10193 {
10196 }
10198 {
10201 }
10202
10203 super.OnVariablesSynchronized();
10204 }
10205
10206
10207
10209 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10210 {
10211 if (!IsServerCheck(allow_client))
10212 return false;
10213
10215 return false;
10216
10219
10220 if (value <= (min + 0.001))
10221 value = min;
10222
10223 if (value == min)
10224 {
10225 if (destroy_config)
10226 {
10227 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10228 if (dstr)
10229 {
10231 this.Delete();
10232 return true;
10233 }
10234 }
10235 else if (destroy_forced)
10236 {
10238 this.Delete();
10239 return true;
10240 }
10241
10243 }
10244
10247
10249 {
10251
10252 if (delta)
10254 }
10255
10257
10258 return false;
10259 }
10260
10261
10263 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10264 {
10266 }
10267
10269 {
10272 }
10273
10275 {
10278 }
10279
10282 {
10283 float value_clamped = Math.Clamp(value, 0, 1);
10285 SetQuantity(result, destroy_config, destroy_forced);
10286 }
10287
10288
10291 {
10293 }
10294
10296 {
10298 }
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10310 {
10311 int slot = -1;
10312 if (GetInventory())
10313 {
10314 InventoryLocation il = new InventoryLocation;
10315 GetInventory().GetCurrentInventoryLocation(il);
10317 }
10318
10320 }
10321
10323 {
10324 float quantity_max = 0;
10325
10327 {
10328 if (attSlotID != -1)
10329 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10330
10331 if (quantity_max <= 0)
10333 }
10334
10335 if (quantity_max <= 0)
10337
10338 return quantity_max;
10339 }
10340
10342 {
10344 }
10345
10347 {
10349 }
10350
10351
10353 {
10355 }
10356
10358 {
10360 }
10361
10363 {
10365 }
10366
10367
10369 {
10370
10371 float weightEx = GetWeightEx();
10372 float special = GetInventoryAndCargoWeight();
10373 return weightEx - special;
10374 }
10375
10376
10378 {
10380 }
10381
10383 {
10385 {
10386 #ifdef DEVELOPER
10387 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10388 {
10389 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10391 }
10392 #endif
10393
10394 return GetQuantity() * GetConfigWeightModified();
10395 }
10396 else if (HasEnergyManager())
10397 {
10398 #ifdef DEVELOPER
10399 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10400 {
10401 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10402 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10403 }
10404 #endif
10405 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10406 }
10407 else
10408 {
10409 #ifdef DEVELOPER
10410 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10411 {
10412 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10413 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10414 }
10415 #endif
10416 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10417 }
10418 }
10419
10422 {
10423 int item_count = 0;
10425
10426 if (GetInventory().GetCargo() != NULL)
10427 {
10428 item_count = GetInventory().GetCargo().GetItemCount();
10429 }
10430
10431 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10432 {
10433 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10434 if (item)
10435 item_count += item.GetNumberOfItems();
10436 }
10437 return item_count;
10438 }
10439
10442 {
10443 float weight = 0;
10444 float wetness = 1;
10445 if (include_wetness)
10448 {
10449 weight = wetness * m_ConfigWeight;
10450 }
10452 {
10453 weight = 1;
10454 }
10455 return weight;
10456 }
10457
10458
10459
10461 {
10462 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10463 {
10464 GameInventory inv = GetInventory();
10465 array<EntityAI> items = new array<EntityAI>;
10467 for (int i = 0; i < items.Count(); i++)
10468 {
10470 if (item)
10471 {
10473 }
10474 }
10475 }
10476 }
10477
10478
10479
10480
10482 {
10483 float energy = 0;
10484 if (HasEnergyManager())
10485 {
10486 energy = GetCompEM().GetEnergy();
10487 }
10488 return energy;
10489 }
10490
10491
10493 {
10494 super.OnEnergyConsumed();
10495
10497 }
10498
10500 {
10501 super.OnEnergyAdded();
10502
10504 }
10505
10506
10508 {
10509 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10510 {
10512 {
10513 float energy_0to1 = GetCompEM().GetEnergy0To1();
10515 }
10516 }
10517 }
10518
10519
10521 {
10522 return ConfigGetFloat("heatIsolation");
10523 }
10524
10526 {
10528 }
10529
10531 {
10532 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10533 if (
GetGame().ConfigIsExisting(paramPath))
10535
10536 return 0.0;
10537 }
10538
10540 {
10541 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10542 if (
GetGame().ConfigIsExisting(paramPath))
10544
10545 return 0.0;
10546 }
10547
10548 override void SetWet(
float value,
bool allow_client =
false)
10549 {
10550 if (!IsServerCheck(allow_client))
10551 return;
10552
10555
10557
10558 m_VarWet = Math.Clamp(value, min, max);
10559
10561 {
10564 }
10565 }
10566
10567 override void AddWet(
float value)
10568 {
10570 }
10571
10573 {
10575 }
10576
10578 {
10580 }
10581
10583 {
10585 }
10586
10588 {
10590 }
10591
10593 {
10595 }
10596
10597 override void OnWetChanged(
float newVal,
float oldVal)
10598 {
10601 if (newLevel != oldLevel)
10602 {
10604 }
10605 }
10606
10608 {
10609 SetWeightDirty();
10610 }
10611
10613 {
10614 return GetWetLevelInternal(
m_VarWet);
10615 }
10616
10617
10618
10620 {
10622 }
10623
10625 {
10627 }
10628
10630 {
10632 }
10633
10635 {
10637 }
10638
10639
10640
10642 {
10643 if (ConfigIsExisting("itemModelLength"))
10644 {
10645 return ConfigGetFloat("itemModelLength");
10646 }
10647 return 0;
10648 }
10649
10651 {
10652 if (ConfigIsExisting("itemAttachOffset"))
10653 {
10654 return ConfigGetFloat("itemAttachOffset");
10655 }
10656 return 0;
10657 }
10658
10659 override void SetCleanness(
int value,
bool allow_client =
false)
10660 {
10661 if (!IsServerCheck(allow_client))
10662 return;
10663
10665
10667
10670 }
10671
10673 {
10675 }
10676
10678 {
10679 return true;
10680 }
10681
10682
10683
10684
10686 {
10688 }
10689
10691 {
10693 }
10694
10695
10696
10697
10698 override void SetColor(
int r,
int g,
int b,
int a)
10699 {
10705 }
10707 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10708 {
10713 }
10714
10716 {
10718 }
10719
10722 {
10723 int r,g,b,a;
10725 r = r/255;
10726 g = g/255;
10727 b = b/255;
10728 a = a/255;
10729 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10730 }
10731
10732
10733
10734 override void SetLiquidType(
int value,
bool allow_client =
false)
10735 {
10736 if (!IsServerCheck(allow_client))
10737 return;
10738
10743 }
10744
10746 {
10747 return ConfigGetInt("varLiquidTypeInit");
10748 }
10749
10751 {
10753 }
10754
10756 {
10758 SetFrozen(false);
10759 }
10760
10763 {
10764 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10765 }
10766
10767
10770 {
10771 PlayerBase nplayer;
10772 if (PlayerBase.CastTo(nplayer, player))
10773 {
10775
10776 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10777 }
10778 }
10779
10780
10783 {
10784 PlayerBase nplayer;
10785 if (PlayerBase.CastTo(nplayer,player))
10786 {
10787
10788 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10789
10790 }
10791
10792
10793 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10794
10795
10796 if (HasEnergyManager())
10797 {
10798 GetCompEM().UpdatePlugState();
10799 }
10800 }
10801
10802
10804 {
10805 super.OnPlacementStarted(player);
10806
10808 }
10809
10810 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10811 {
10813 {
10814 m_AdminLog.OnPlacementComplete(player,
this);
10815 }
10816
10817 super.OnPlacementComplete(player, position, orientation);
10818 }
10819
10820
10821
10822
10823
10825 {
10827 {
10828 return true;
10829 }
10830 else
10831 {
10832 return false;
10833 }
10834 }
10835
10836
10838 {
10840 {
10842 }
10843 }
10844
10845
10847 {
10849 }
10850
10852 {
10854 }
10855
10856 override void InsertAgent(
int agent,
float count = 1)
10857 {
10858 if (count < 1)
10859 return;
10860
10862 }
10863
10866 {
10868 }
10869
10870
10872 {
10874 }
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10918 {
10920 return false;
10921 return true;
10922 }
10923
10925 {
10926
10928 }
10929
10930
10933 {
10934 super.CheckForRoofLimited(timeTresholdMS);
10935
10937 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10938 {
10939 m_PreviousRoofTestTime = time;
10940 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10941 }
10942 }
10943
10944
10946 {
10948 {
10949 return 0;
10950 }
10951
10952 if (GetInventory().GetAttachmentSlotsCount() != 0)
10953 {
10954 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10955 if (filter)
10956 return filter.GetProtectionLevel(type, false, system);
10957 else
10958 return 0;
10959 }
10960
10961 string subclassPath, entryName;
10962
10963 switch (type)
10964 {
10966 entryName = "biological";
10967 break;
10969 entryName = "chemical";
10970 break;
10971 default:
10972 entryName = "biological";
10973 break;
10974 }
10975
10976 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10977
10979 }
10980
10981
10982
10985 {
10986 if (!IsMagazine())
10988
10990 }
10991
10992
10993
10994
10995
11000 {
11001 return true;
11002 }
11003
11005 {
11007 }
11008
11009
11010
11011
11012
11014 {
11015 if (parent)
11016 {
11017 if (parent.IsInherited(DayZInfected))
11018 return true;
11019
11020 if (!parent.IsRuined())
11021 return true;
11022 }
11023
11024 return true;
11025 }
11026
11028 {
11029 if (!super.CanPutAsAttachment(parent))
11030 {
11031 return false;
11032 }
11033
11034 if (!IsRuined() && !parent.IsRuined())
11035 {
11036 return true;
11037 }
11038
11039 return false;
11040 }
11041
11043 {
11044
11045
11046
11047
11048 return super.CanReceiveItemIntoCargo(item);
11049 }
11050
11052 {
11053
11054
11055
11056
11057 GameInventory attachmentInv = attachment.GetInventory();
11059 {
11060 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11061 return false;
11062 }
11063
11064 InventoryLocation loc = new InventoryLocation();
11065 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11066 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11067 return false;
11068
11069 return super.CanReceiveAttachment(attachment, slotId);
11070 }
11071
11073 {
11074 if (!super.CanReleaseAttachment(attachment))
11075 return false;
11076
11077 return GetInventory().AreChildrenAccessible();
11078 }
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11101 {
11102 int id = muzzle_owner.GetMuzzleID();
11103 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11104
11105 if (WPOF_array)
11106 {
11107 for (int i = 0; i < WPOF_array.Count(); i++)
11108 {
11109 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11110
11111 if (WPOF)
11112 {
11113 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11114 }
11115 }
11116 }
11117 }
11118
11119
11121 {
11122 int id = muzzle_owner.GetMuzzleID();
11124
11125 if (WPOBE_array)
11126 {
11127 for (int i = 0; i < WPOBE_array.Count(); i++)
11128 {
11129 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11130
11131 if (WPOBE)
11132 {
11133 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11134 }
11135 }
11136 }
11137 }
11138
11139
11141 {
11142 int id = muzzle_owner.GetMuzzleID();
11143 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11144
11145 if (WPOOH_array)
11146 {
11147 for (int i = 0; i < WPOOH_array.Count(); i++)
11148 {
11149 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11150
11151 if (WPOOH)
11152 {
11153 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11154 }
11155 }
11156 }
11157 }
11158
11159
11161 {
11162 int id = muzzle_owner.GetMuzzleID();
11163 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11164
11165 if (WPOOH_array)
11166 {
11167 for (int i = 0; i < WPOOH_array.Count(); i++)
11168 {
11169 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11170
11171 if (WPOOH)
11172 {
11173 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11174 }
11175 }
11176 }
11177 }
11178
11179
11181 {
11182 int id = muzzle_owner.GetMuzzleID();
11183 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11184
11185 if (WPOOH_array)
11186 {
11187 for (int i = 0; i < WPOOH_array.Count(); i++)
11188 {
11189 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11190
11191 if (WPOOH)
11192 {
11193 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11194 }
11195 }
11196 }
11197 }
11198
11199
11200
11202 {
11204 {
11205 return true;
11206 }
11207
11208 return false;
11209 }
11210
11212 {
11214 {
11215 return true;
11216 }
11217
11218 return false;
11219 }
11220
11222 {
11224 {
11225 return true;
11226 }
11227
11228 return false;
11229 }
11230
11232 {
11233 return false;
11234 }
11235
11238 {
11239 return UATimeSpent.DEFAULT_DEPLOY;
11240 }
11241
11242
11243
11244
11246 {
11248 SetSynchDirty();
11249 }
11250
11252 {
11254 }
11255
11256
11258 {
11259 return false;
11260 }
11261
11264 {
11265 string att_type = "None";
11266
11267 if (ConfigIsExisting("soundAttType"))
11268 {
11269 att_type = ConfigGetString("soundAttType");
11270 }
11271
11273 }
11274
11276 {
11278 }
11279
11280
11281
11282
11283
11287
11289 {
11292
11294 }
11295
11296
11298 {
11300 return;
11301
11303
11306
11309
11310 SoundParameters params = new SoundParameters();
11314 }
11315
11316
11318 {
11320 return;
11321
11323 SetSynchDirty();
11324
11327 }
11328
11329
11331 {
11333 return;
11334
11336 SetSynchDirty();
11337
11340 }
11341
11343 {
11345 }
11346
11348 {
11350 }
11351
11354 {
11355 if (!
GetGame().IsDedicatedServer())
11356 {
11357 if (ConfigIsExisting("attachSoundSet"))
11358 {
11359 string cfg_path = "";
11360 string soundset = "";
11361 string type_name =
GetType();
11362
11365 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11366 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11367
11368 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11369 {
11370 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11371 {
11372 if (cfg_slot_array[i] == slot_type)
11373 {
11374 soundset = cfg_soundset_array[i];
11375 break;
11376 }
11377 }
11378 }
11379
11380 if (soundset != "")
11381 {
11382 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11384 }
11385 }
11386 }
11387 }
11388
11390 {
11391
11392 }
11393
11394 void OnApply(PlayerBase player);
11395
11397 {
11398 return 1.0;
11399 };
11400
11402 {
11404 }
11405
11407 {
11409 }
11410
11412
11414 {
11415 SetDynamicPhysicsLifeTime(0.01);
11417 }
11418
11420 {
11421 array<string> zone_names = new array<string>;
11422 GetDamageZones(zone_names);
11423 for (int i = 0; i < zone_names.Count(); i++)
11424 {
11425 SetHealthMax(zone_names.Get(i),"Health");
11426 }
11427 SetHealthMax("","Health");
11428 }
11429
11432 {
11433 float global_health = GetHealth01("","Health");
11434 array<string> zones = new array<string>;
11435 GetDamageZones(zones);
11436
11437 for (int i = 0; i < zones.Count(); i++)
11438 {
11439 SetHealth01(zones.Get(i),"Health",global_health);
11440 }
11441 }
11442
11445 {
11446 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11447 }
11448
11450 {
11451 if (!hasRootAsPlayer)
11452 {
11453 if (refParentIB)
11454 {
11455
11456 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11457 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11458
11459 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11460 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11461
11464 }
11465 else
11466 {
11467
11470 }
11471 }
11472 }
11473
11475 {
11477 {
11478 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11479 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11480 {
11481 float heatPermCoef = 1.0;
11483 while (ent)
11484 {
11485 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11486 ent = ent.GetHierarchyParent();
11487 }
11488
11489 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11490 }
11491 }
11492 }
11493
11495 {
11496
11497 EntityAI parent = GetHierarchyParent();
11498 if (!parent)
11499 {
11500 hasParent = false;
11501 hasRootAsPlayer = false;
11502 }
11503 else
11504 {
11505 hasParent = true;
11506 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11507 refParentIB =
ItemBase.Cast(parent);
11508 }
11509 }
11510
11511 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11512 {
11513
11514 }
11515
11517 {
11518
11519 return false;
11520 }
11521
11523 {
11524
11525
11526 return false;
11527 }
11528
11530 {
11531
11532 return false;
11533 }
11534
11537 {
11538 return !GetIsFrozen() &&
IsOpen();
11539 }
11540
11542 {
11543 bool hasParent = false, hasRootAsPlayer = false;
11545
11546 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11547 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11548
11549 if (wwtu || foodDecay)
11550 {
11554
11555 if (processWetness || processTemperature || processDecay)
11556 {
11558
11559 if (processWetness)
11560 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11561
11562 if (processTemperature)
11564
11565 if (processDecay)
11566 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11567 }
11568 }
11569 }
11570
11573 {
11575 }
11576
11578 {
11581
11582 return super.GetTemperatureFreezeThreshold();
11583 }
11584
11586 {
11589
11590 return super.GetTemperatureThawThreshold();
11591 }
11592
11594 {
11597
11598 return super.GetItemOverheatThreshold();
11599 }
11600
11602 {
11604 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11605
11606 return super.GetTemperatureFreezeTime();
11607 }
11608
11610 {
11612 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11613
11614 return super.GetTemperatureThawTime();
11615 }
11616
11621
11623 {
11624 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11625 }
11626
11628 {
11629 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11630 }
11631
11634 {
11636 }
11637
11639 {
11641 }
11642
11644 {
11646 }
11647
11650 {
11651 return null;
11652 }
11653
11656 {
11657 return false;
11658 }
11659
11661 {
11663 {
11666 if (!trg)
11667 {
11669 explosive = this;
11670 }
11671
11672 explosive.PairRemote(trg);
11674
11675 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11676 trg.SetPersistentPairID(persistentID);
11677 explosive.SetPersistentPairID(persistentID);
11678
11679 return true;
11680 }
11681 return false;
11682 }
11683
11686 {
11687 float ret = 1.0;
11690 ret *= GetHealth01();
11691
11692 return ret;
11693 }
11694
11695 #ifdef DEVELOPER
11696 override void SetDebugItem()
11697 {
11698 super.SetDebugItem();
11699 _itemBase = this;
11700 }
11701
11703 {
11704 string text = super.GetDebugText();
11705
11707 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11708
11709 return text;
11710 }
11711 #endif
11712
11714 {
11715 return true;
11716 }
11717
11719
11721
11723 {
11726 }
11727
11728
11736
11752}
11753
11755{
11757 if (entity)
11758 {
11759 bool is_item = entity.IsInherited(
ItemBase);
11760 if (is_item && full_quantity)
11761 {
11764 }
11765 }
11766 else
11767 {
11769 return NULL;
11770 }
11771 return entity;
11772}
11773
11775{
11776 if (item)
11777 {
11778 if (health > 0)
11779 item.SetHealth("", "", health);
11780
11781 if (item.CanHaveTemperature())
11782 {
11784 if (item.CanFreeze())
11785 item.SetFrozen(false);
11786 }
11787
11788 if (item.HasEnergyManager())
11789 {
11790 if (quantity >= 0)
11791 {
11792 item.GetCompEM().SetEnergy0To1(quantity);
11793 }
11794 else
11795 {
11797 }
11798 }
11799 else if (item.IsMagazine())
11800 {
11801 Magazine mag = Magazine.Cast(item);
11802 if (quantity >= 0)
11803 {
11804 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11805 }
11806 else
11807 {
11809 }
11810
11811 }
11812 else
11813 {
11814 if (quantity >= 0)
11815 {
11816 item.SetQuantityNormalized(quantity, false);
11817 }
11818 else
11819 {
11821 }
11822
11823 }
11824 }
11825}
11826
11827#ifdef DEVELOPER
11829#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.