6996{
6998 {
6999 return true;
7000 }
7001};
7002
7003
7004
7006{
7010
7012
7015
7016
7017
7018
7019
7028
7034
7039
7044
7065 protected bool m_IsResultOfSplit
7066
7068
7073
7074
7075
7077
7081
7082
7083
7085
7088
7089
7090
7096
7097
7105
7108
7109
7111
7112
7114
7115
7120
7121
7126
7127
7129
7130
7132 {
7137
7138 if (!
GetGame().IsDedicatedServer())
7139 {
7141 {
7143
7145 {
7147 }
7148 }
7149
7152 }
7153
7154 m_OldLocation = null;
7155
7157 {
7159 }
7160
7161 if (ConfigIsExisting("headSelectionsToHide"))
7162 {
7165 }
7166
7168 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7169 {
7171 }
7172
7174
7175 m_IsResultOfSplit = false;
7176
7178 }
7179
7181 {
7182 super.InitItemVariables();
7183
7189 m_Count = ConfigGetInt(
"count");
7190
7193
7198
7201
7206
7218
7222
7223
7226 if (ConfigIsExisting("canBeSplit"))
7227 {
7230 }
7231
7233 if (ConfigIsExisting("itemBehaviour"))
7235
7236
7239 RegisterNetSyncVariableInt("m_VarLiquidType");
7240 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7241
7242 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7243 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7244 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7245
7246 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7247 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7248 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7249 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7250
7251 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7252 RegisterNetSyncVariableBool("m_IsTakeable");
7253 RegisterNetSyncVariableBool("m_IsHologram");
7254
7257 {
7260 }
7261
7263
7265 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7267
7268 }
7269
7271 {
7273 }
7274
7276 {
7279 {
7284 }
7285 }
7286
7287 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7288 {
7290 {
7293 }
7294
7296 }
7297
7299 {
7305 }
7306
7308
7310 {
7312
7313 if (!action)
7314 {
7315 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7316 return;
7317 }
7318
7320 if (!ai)
7321 {
7323 return;
7324 }
7325
7327 if (!action_array)
7328 {
7329 action_array = new array<ActionBase_Basic>;
7331 }
7332 if (LogManager.IsActionLogEnable())
7333 {
7334 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7335 }
7336
7337 if (action_array.Find(action) != -1)
7338 {
7339 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7340 }
7341 else
7342 {
7343 action_array.Insert(action);
7344 }
7345 }
7346
7348 {
7350 ActionBase action = player.GetActionManager().GetAction(actionName);
7353
7354 if (action_array)
7355 {
7356 action_array.RemoveItem(action);
7357 }
7358 }
7359
7360
7361
7363 {
7364 ActionOverrideData overrideData = new ActionOverrideData();
7368
7370 if (!actionMap)
7371 {
7374 }
7375
7376 actionMap.Insert(this.
Type(), overrideData);
7377
7378 }
7379
7381
7383
7384
7386 {
7389
7392
7393 string config_to_search = "CfgVehicles";
7394 string muzzle_owner_config;
7395
7397 {
7398 if (IsInherited(Weapon))
7399 config_to_search = "CfgWeapons";
7400
7401 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7402
7403 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7404
7406
7407 if (config_OnFire_subclass_count > 0)
7408 {
7409 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7410
7411 for (int i = 0; i < config_OnFire_subclass_count; i++)
7412 {
7413 string particle_class = "";
7415 string config_OnFire_entry = config_OnFire_class + particle_class;
7416 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7417 WPOF_array.Insert(WPOF);
7418 }
7419
7420
7422 }
7423 }
7424
7426 {
7427 config_to_search = "CfgWeapons";
7428 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7429
7430 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7431
7433
7434 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7435 {
7436 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7437
7438 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7439 {
7440 string particle_class2 = "";
7442 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7443 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7444 WPOBE_array.Insert(WPOBE);
7445 }
7446
7447
7449 }
7450 }
7451 }
7452
7453
7455 {
7458
7460 {
7461 string config_to_search = "CfgVehicles";
7462
7463 if (IsInherited(Weapon))
7464 config_to_search = "CfgWeapons";
7465
7466 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7467 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7468
7469 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7470 {
7471
7473
7475 {
7477 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7479 return;
7480 }
7481
7484
7485
7486
7488 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7489
7490 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7491 {
7492 string particle_class = "";
7494 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7496
7497 if (entry_type == CT_CLASS)
7498 {
7499 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7500 WPOOH_array.Insert(WPOF);
7501 }
7502 }
7503
7504
7506 }
7507 }
7508 }
7509
7511 {
7513 }
7514
7516 {
7518 {
7520
7523
7526
7527 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7528 }
7529 }
7530
7532 {
7534 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7535
7537 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7538
7540 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7541
7543 {
7545 }
7546 }
7547
7549 {
7551 }
7552
7554 {
7557 else
7559
7561 {
7564 }
7565 else
7566 {
7569
7572 }
7573
7575 }
7576
7578 {
7580 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7581 }
7582
7584 {
7586 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7588 }
7589
7591 {
7593 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7594 }
7595
7597 {
7600
7601 OverheatingParticle OP = new OverheatingParticle();
7606
7608 }
7609
7611 {
7614
7615 return -1;
7616 }
7617
7619 {
7621 {
7624
7625 for (int i = count; i > 0; --i)
7626 {
7627 int id = i - 1;
7630
7633
7634 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7635 {
7636 if (p)
7637 {
7640 }
7641 }
7642 }
7643 }
7644 }
7645
7647 {
7649 {
7651 {
7652 int id = i - 1;
7654
7655 if (OP)
7656 {
7658
7659 if (p)
7660 {
7662 }
7663
7664 delete OP;
7665 }
7666 }
7667
7670 }
7671 }
7672
7675 {
7676 return 0.0;
7677 }
7678
7679
7681 {
7682 return 250;
7683 }
7684
7686 {
7687 return 0;
7688 }
7689
7692 {
7694 return true;
7695
7696 return false;
7697 }
7698
7701 {
7704
7706 {
7708 }
7709 else
7710 {
7711
7713 }
7714
7716 }
7717
7724 {
7725 return -1;
7726 }
7727
7728
7729
7730
7732 {
7734 {
7736 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7737
7738 if (r_index >= 0)
7739 {
7740 InventoryLocation r_il = new InventoryLocation;
7741 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7742
7743 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7746 {
7747 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7748 }
7750 {
7751 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7752 }
7753
7754 }
7755
7756 player.GetHumanInventory().ClearUserReservedLocation(this);
7757 }
7758
7761 }
7762
7763
7764
7765
7767 {
7768 return ItemBase.m_DebugActionsMask;
7769 }
7770
7772 {
7773 return ItemBase.m_DebugActionsMask & mask;
7774 }
7775
7777 {
7778 ItemBase.m_DebugActionsMask = mask;
7779 }
7780
7782 {
7783 ItemBase.m_DebugActionsMask |= mask;
7784 }
7785
7787 {
7788 ItemBase.m_DebugActionsMask &= ~mask;
7789 }
7790
7792 {
7794 {
7796 }
7797 else
7798 {
7800 }
7801 }
7802
7803
7805 {
7806 if (GetEconomyProfile())
7807 {
7808 float q_max = GetEconomyProfile().GetQuantityMax();
7809 if (q_max > 0)
7810 {
7811 float q_min = GetEconomyProfile().GetQuantityMin();
7812 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7813
7815 {
7816 ComponentEnergyManager comp = GetCompEM();
7818 {
7820 }
7821 }
7823 {
7825
7826 }
7827
7828 }
7829 }
7830 }
7831
7834 {
7835 EntityAI parent = GetHierarchyParent();
7836
7837 if (parent)
7838 {
7839 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7840 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7841 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7842 }
7843 }
7844
7847 {
7848 EntityAI parent = GetHierarchyParent();
7849
7850 if (parent)
7851 {
7852 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7853 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7854 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7855 }
7856 }
7857
7859 {
7860
7861
7862
7863
7865
7867 {
7868 if (ScriptInputUserData.CanStoreInputUserData())
7869 {
7870 ScriptInputUserData ctx = new ScriptInputUserData;
7876 ctx.
Write(use_stack_max);
7879
7881 {
7882 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7883 }
7884 }
7885 }
7886 else if (!
GetGame().IsMultiplayer())
7887 {
7889 }
7890 }
7891
7893 {
7895 }
7896
7898 {
7900 }
7901
7903 {
7905 }
7906
7908 {
7909
7910 return false;
7911 }
7912
7914 {
7915 return false;
7916 }
7917
7921 {
7922 return false;
7923 }
7924
7926 {
7927 return "";
7928 }
7929
7931
7933 {
7934 return false;
7935 }
7936
7938 {
7939 return true;
7940 }
7941
7942
7943
7945 {
7946 return true;
7947 }
7948
7950 {
7951 return true;
7952 }
7953
7955 {
7956 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7958 }
7959
7961 {
7963 }
7964
7966 {
7968 if (!is_being_placed)
7970 SetSynchDirty();
7971 }
7972
7973
7975
7977 {
7979 }
7980
7982 {
7984 }
7985
7987 {
7988 return 1;
7989 }
7990
7992 {
7993 return false;
7994 }
7995
7997 {
7999 SetSynchDirty();
8000 }
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8037 {
8038 super.OnMovedInsideCargo(container);
8039
8040 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8041 }
8042
8043 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8044 {
8045 super.EEItemLocationChanged(oldLoc,newLoc);
8046
8047 PlayerBase new_player = null;
8048 PlayerBase old_player = null;
8049
8050 if (newLoc.GetParent())
8051 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8052
8053 if (oldLoc.GetParent())
8054 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8055
8057 {
8058 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8059
8060 if (r_index >= 0)
8061 {
8062 InventoryLocation r_il = new InventoryLocation;
8063 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8064
8065 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8068 {
8069 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8070 }
8072 {
8073 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8074 }
8075
8076 }
8077 }
8078
8080 {
8081 if (new_player)
8082 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8083
8084 if (new_player == old_player)
8085 {
8086
8087 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8088 {
8090 {
8091 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8092 {
8093 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8094 }
8095 }
8096 else
8097 {
8098 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8099 }
8100 }
8101
8102 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8103 {
8104 int type = oldLoc.GetType();
8106 {
8107 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8108 }
8110 {
8111 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8112 }
8113 }
8114 if (!m_OldLocation)
8115 {
8116 m_OldLocation = new InventoryLocation;
8117 }
8118 m_OldLocation.Copy(oldLoc);
8119 }
8120 else
8121 {
8122 if (m_OldLocation)
8123 {
8124 m_OldLocation.Reset();
8125 }
8126 }
8127
8129 }
8130 else
8131 {
8132 if (new_player)
8133 {
8134 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8135 if (res_index >= 0)
8136 {
8137 InventoryLocation il = new InventoryLocation;
8138 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8140 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8143 {
8144 il.
GetParent().GetOnReleaseLock().Invoke(it);
8145 }
8147 {
8149 }
8150
8151 }
8152 }
8154 {
8155
8157 }
8158
8159 if (m_OldLocation)
8160 {
8161 m_OldLocation.Reset();
8162 }
8163 }
8164 }
8165
8166 override void EOnContact(IEntity other, Contact extra)
8167 {
8169 {
8170 int liquidType = -1;
8172 if (impactSpeed > 0.0)
8173 {
8175 #ifndef SERVER
8177 #else
8179 SetSynchDirty();
8180 #endif
8182 }
8183 }
8184
8185 #ifdef SERVER
8186 if (GetCompEM() && GetCompEM().IsPlugged())
8187 {
8188 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8189 GetCompEM().UnplugThis();
8190 }
8191 #endif
8192 }
8193
8195
8197 {
8199 }
8200
8202 {
8203
8204 }
8205
8207 {
8208 super.OnItemLocationChanged(old_owner, new_owner);
8209
8210 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8211 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8212
8213 if (!relatedPlayer && playerNew)
8214 relatedPlayer = playerNew;
8215
8216 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8217 {
8219 if (actionMgr)
8220 {
8221 ActionBase currentAction = actionMgr.GetRunningAction();
8222 if (currentAction)
8224 }
8225 }
8226
8227 Man ownerPlayerOld = null;
8228 Man ownerPlayerNew = null;
8229
8230 if (old_owner)
8231 {
8232 if (old_owner.
IsMan())
8233 {
8234 ownerPlayerOld = Man.Cast(old_owner);
8235 }
8236 else
8237 {
8238 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8239 }
8240 }
8241 else
8242 {
8244 {
8246
8247 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8248 {
8249 GetCompEM().UnplugThis();
8250 }
8251 }
8252 }
8253
8254 if (new_owner)
8255 {
8256 if (new_owner.
IsMan())
8257 {
8258 ownerPlayerNew = Man.Cast(new_owner);
8259 }
8260 else
8261 {
8262 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8263 }
8264 }
8265
8266 if (ownerPlayerOld != ownerPlayerNew)
8267 {
8268 if (ownerPlayerOld)
8269 {
8270 array<EntityAI> subItemsExit = new array<EntityAI>;
8272 for (int i = 0; i < subItemsExit.Count(); i++)
8273 {
8276 }
8277 }
8278
8279 if (ownerPlayerNew)
8280 {
8281 array<EntityAI> subItemsEnter = new array<EntityAI>;
8283 for (int j = 0; j < subItemsEnter.Count(); j++)
8284 {
8287 }
8288 }
8289 }
8290 else if (ownerPlayerNew != null)
8291 {
8292 PlayerBase nplayer;
8293 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8294 {
8295 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8297 for (int k = 0; k < subItemsUpdate.Count(); k++)
8298 {
8300 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8301 }
8302 }
8303 }
8304
8305 if (old_owner)
8306 old_owner.OnChildItemRemoved(this);
8307 if (new_owner)
8308 new_owner.OnChildItemReceived(this);
8309 }
8310
8311
8313 {
8314 super.EEDelete(parent);
8315 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8316 if (player)
8317 {
8319
8320 if (player.IsAlive())
8321 {
8322 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8323 if (r_index >= 0)
8324 {
8325 InventoryLocation r_il = new InventoryLocation;
8326 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8327
8328 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8331 {
8332 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8333 }
8335 {
8336 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8337 }
8338
8339 }
8340
8341 player.RemoveQuickBarEntityShortcut(this);
8342 }
8343 }
8344 }
8345
8347 {
8348 super.EEKilled(killer);
8349
8352 {
8353 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8354 {
8355 if (IsMagazine())
8356 {
8357 if (Magazine.Cast(this).GetAmmoCount() > 0)
8358 {
8360 }
8361 }
8362 else
8363 {
8365 }
8366 }
8367 }
8368 }
8369
8371 {
8372 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8373
8374 super.OnWasAttached(parent, slot_id);
8375
8378
8380 }
8381
8383 {
8384 super.OnWasDetached(parent, slot_id);
8385
8388 }
8389
8391 {
8392 int idx;
8395
8396 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8397 if (inventory_slots.Count() < 1)
8398 {
8399 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8400 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8401 }
8402 else
8403 {
8404 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8405 }
8406
8407 idx = inventory_slots.Find(slot);
8408 if (idx < 0)
8409 return "";
8410
8411 return attach_types.Get(idx);
8412 }
8413
8415 {
8416 int idx = -1;
8417 string slot;
8418
8421
8422 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8423 if (inventory_slots.Count() < 1)
8424 {
8425 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8426 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8427 }
8428 else
8429 {
8430 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8431 if (detach_types.Count() < 1)
8432 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8433 }
8434
8435 for (int i = 0; i < inventory_slots.Count(); i++)
8436 {
8437 slot = inventory_slots.Get(i);
8438 }
8439
8440 if (slot != "")
8441 {
8442 if (detach_types.Count() == 1)
8443 idx = 0;
8444 else
8445 idx = inventory_slots.Find(slot);
8446 }
8447 if (idx < 0)
8448 return "";
8449
8450 return detach_types.Get(idx);
8451 }
8452
8454 {
8455
8457
8458
8459 float min_time = 1;
8460 float max_time = 3;
8461 float delay = Math.RandomFloat(min_time, max_time);
8462
8463 explode_timer.Run(delay, this, "DoAmmoExplosion");
8464 }
8465
8467 {
8468 Magazine magazine = Magazine.Cast(this);
8469 int pop_sounds_count = 6;
8470 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8471
8472
8473 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8474 string sound_name = pop_sounds[ sound_idx ];
8476
8477
8478 magazine.ServerAddAmmoCount(-1);
8479
8480
8481 float min_temp_to_explode = 100;
8482
8483 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8484 {
8486 }
8487 }
8488
8489
8490 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8491 {
8492 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8493
8494 const int CHANCE_DAMAGE_CARGO = 4;
8495 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8496 const int CHANCE_DAMAGE_NOTHING = 2;
8497
8499 {
8500 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8501 int chances;
8502 int rnd;
8503
8504 if (GetInventory().GetCargo())
8505 {
8506 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8507 rnd = Math.RandomInt(0,chances);
8508
8509 if (rnd < CHANCE_DAMAGE_CARGO)
8510 {
8512 }
8513 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8514 {
8516 }
8517 }
8518 else
8519 {
8520 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8521 rnd = Math.RandomInt(0,chances);
8522
8523 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8524 {
8526 }
8527 }
8528 }
8529 }
8530
8532 {
8533 if (GetInventory().GetCargo())
8534 {
8535 int item_count = GetInventory().GetCargo().GetItemCount();
8536 if (item_count > 0)
8537 {
8538 int random_pick = Math.RandomInt(0, item_count);
8540 if (!item.IsExplosive())
8541 {
8542 item.AddHealth("","",damage);
8543 return true;
8544 }
8545 }
8546 }
8547 return false;
8548 }
8549
8551 {
8552 int attachment_count = GetInventory().AttachmentCount();
8553 if (attachment_count > 0)
8554 {
8555 int random_pick = Math.RandomInt(0, attachment_count);
8556 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8557 if (!attachment.IsExplosive())
8558 {
8559 attachment.AddHealth("","",damage);
8560 return true;
8561 }
8562 }
8563 return false;
8564 }
8565
8567 {
8569 }
8570
8572 {
8574 return GetInventory().CanRemoveEntity();
8575
8576 return false;
8577 }
8578
8580 {
8582 return;
8583
8585 {
8586 if (ScriptInputUserData.CanStoreInputUserData())
8587 {
8588 ScriptInputUserData ctx = new ScriptInputUserData;
8593 ctx.
Write(destination_entity);
8597 }
8598 }
8599 else if (!
GetGame().IsMultiplayer())
8600 {
8602 }
8603 }
8604
8606 {
8608 return;
8609
8610 float split_quantity_new;
8614 InventoryLocation loc = new InventoryLocation;
8615
8616 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8617 {
8619 split_quantity_new = stack_max;
8620 else
8622
8623 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8624 if (new_item)
8625 {
8626 new_item.SetResultOfSplit(true);
8627 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8629 new_item.SetQuantity(split_quantity_new);
8630 }
8631 }
8632 else if (destination_entity && slot_id == -1)
8633 {
8634 if (quantity > stack_max)
8635 split_quantity_new = stack_max;
8636 else
8637 split_quantity_new = quantity;
8638
8640 {
8643 }
8644
8645 if (new_item)
8646 {
8647 new_item.SetResultOfSplit(true);
8648 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8650 new_item.SetQuantity(split_quantity_new);
8651 }
8652 }
8653 else
8654 {
8655 if (stack_max != 0)
8656 {
8658 {
8660 }
8661
8662 if (split_quantity_new == 0)
8663 {
8664 if (!
GetGame().IsMultiplayer())
8665 player.PhysicalPredictiveDropItem(this);
8666 else
8667 player.ServerDropEntity(this);
8668 return;
8669 }
8670
8672
8673 if (new_item)
8674 {
8675 new_item.SetResultOfSplit(true);
8676 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8678 new_item.SetQuantity(stack_max);
8679 new_item.PlaceOnSurface();
8680 }
8681 }
8682 }
8683 }
8684
8686 {
8688 return;
8689
8690 float split_quantity_new;
8694 InventoryLocation loc = new InventoryLocation;
8695
8696 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8697 {
8699 split_quantity_new = stack_max;
8700 else
8702
8703 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8704 if (new_item)
8705 {
8706 new_item.SetResultOfSplit(true);
8707 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8709 new_item.SetQuantity(split_quantity_new);
8710 }
8711 }
8712 else if (destination_entity && slot_id == -1)
8713 {
8714 if (quantity > stack_max)
8715 split_quantity_new = stack_max;
8716 else
8717 split_quantity_new = quantity;
8718
8720 {
8723 }
8724
8725 if (new_item)
8726 {
8727 new_item.SetResultOfSplit(true);
8728 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8730 new_item.SetQuantity(split_quantity_new);
8731 }
8732 }
8733 else
8734 {
8735 if (stack_max != 0)
8736 {
8738 {
8740 }
8741
8743
8744 if (new_item)
8745 {
8746 new_item.SetResultOfSplit(true);
8747 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8749 new_item.SetQuantity(stack_max);
8750 new_item.PlaceOnSurface();
8751 }
8752 }
8753 }
8754 }
8755
8757 {
8759 return;
8760
8762 {
8763 if (ScriptInputUserData.CanStoreInputUserData())
8764 {
8765 ScriptInputUserData ctx = new ScriptInputUserData;
8770 dst.WriteToContext(ctx);
8772 }
8773 }
8774 else if (!
GetGame().IsMultiplayer())
8775 {
8777 }
8778 }
8779
8781 {
8783 return;
8784
8786 {
8787 if (ScriptInputUserData.CanStoreInputUserData())
8788 {
8789 ScriptInputUserData ctx = new ScriptInputUserData;
8794 ctx.
Write(destination_entity);
8800 }
8801 }
8802 else if (!
GetGame().IsMultiplayer())
8803 {
8805 }
8806 }
8807
8809 {
8811 }
8812
8814 {
8816 return this;
8817
8819 float split_quantity_new;
8821 if (dst.IsValid())
8822 {
8823 int slot_id = dst.GetSlot();
8825
8826 if (quantity > stack_max)
8827 split_quantity_new = stack_max;
8828 else
8829 split_quantity_new = quantity;
8830
8832
8833 if (new_item)
8834 {
8835 new_item.SetResultOfSplit(true);
8836 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8839 }
8840
8841 return new_item;
8842 }
8843
8844 return null;
8845 }
8846
8848 {
8850 return;
8851
8853 float split_quantity_new;
8855 if (destination_entity)
8856 {
8858 if (quantity > stackable)
8859 split_quantity_new = stackable;
8860 else
8861 split_quantity_new = quantity;
8862
8863 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8864 if (new_item)
8865 {
8866 new_item.SetResultOfSplit(true);
8867 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8869 new_item.SetQuantity(split_quantity_new);
8870 }
8871 }
8872 }
8873
8875 {
8877 return;
8878
8880 {
8881 if (ScriptInputUserData.CanStoreInputUserData())
8882 {
8883 ScriptInputUserData ctx = new ScriptInputUserData;
8888 ItemBase destination_entity =
this;
8889 ctx.
Write(destination_entity);
8893 }
8894 }
8895 else if (!
GetGame().IsMultiplayer())
8896 {
8898 }
8899 }
8900
8902 {
8904 return;
8905
8907 float split_quantity_new;
8909 if (player)
8910 {
8912 if (quantity > stackable)
8913 split_quantity_new = stackable;
8914 else
8915 split_quantity_new = quantity;
8916
8917 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8918 new_item =
ItemBase.Cast(in_hands);
8919 if (new_item)
8920 {
8921 new_item.SetResultOfSplit(true);
8922 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8924 new_item.SetQuantity(split_quantity_new);
8925 }
8926 }
8927 }
8928
8930 {
8932 return;
8933
8935 float split_quantity_new = Math.Floor(quantity * 0.5);
8936
8938
8939 if (new_item)
8940 {
8941 if (new_item.GetQuantityMax() < split_quantity_new)
8942 {
8943 split_quantity_new = new_item.GetQuantityMax();
8944 }
8945
8946 new_item.SetResultOfSplit(true);
8947 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8948
8950 {
8953 }
8954 else
8955 {
8958 }
8959 }
8960 }
8961
8963 {
8965 return;
8966
8968 float split_quantity_new = Math.Floor(quantity / 2);
8969
8970 InventoryLocation invloc = new InventoryLocation;
8972
8974 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8975
8976 if (new_item)
8977 {
8978 if (new_item.GetQuantityMax() < split_quantity_new)
8979 {
8980 split_quantity_new = new_item.GetQuantityMax();
8981 }
8983 {
8986 }
8987 else
8988 {
8991 }
8992 }
8993 }
8994
8997 {
8998 SetWeightDirty();
9000
9001 if (parent)
9002 parent.OnAttachmentQuantityChangedEx(this, delta);
9003
9005 {
9007 {
9009 }
9011 {
9012 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9014 }
9015 }
9016
9017 }
9018
9021 {
9022
9023 }
9024
9027 {
9029 }
9030
9032 {
9033 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9034
9036 {
9037 if (newLevel == GameConstants.STATE_RUINED)
9038 {
9040 EntityAI parent = GetHierarchyParent();
9041 if (parent && parent.IsFireplace())
9042 {
9043 CargoBase cargo = GetInventory().GetCargo();
9044 if (cargo)
9045 {
9047 {
9049 }
9050 }
9051 }
9052 }
9053
9055 {
9056
9058 return;
9059 }
9060
9061 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9062 {
9064 }
9065 }
9066 }
9067
9068
9070 {
9071 super.OnRightClick();
9072
9074 {
9076 {
9077 if (ScriptInputUserData.CanStoreInputUserData())
9078 {
9079 vector m4[4];
9081
9082 EntityAI root = GetHierarchyRoot();
9083
9084 InventoryLocation dst = new InventoryLocation;
9086 {
9087 if (root)
9088 {
9089 root.GetTransform(m4);
9091 }
9092 else
9093 GetInventory().GetCurrentInventoryLocation(dst);
9094 }
9095 else
9096 {
9098
9099
9100 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9101 {
9102 if (root)
9103 {
9104 root.GetTransform(m4);
9106 }
9107 else
9108 GetInventory().GetCurrentInventoryLocation(dst);
9109 }
9110 else
9111 {
9112 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9113 }
9114 }
9115
9116 ScriptInputUserData ctx = new ScriptInputUserData;
9124 }
9125 }
9126 else if (!
GetGame().IsMultiplayer())
9127 {
9129 }
9130 }
9131 }
9132
9133 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9134 {
9135
9136 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9137 return false;
9138
9139 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9140 return false;
9141
9142
9144 return false;
9145
9146
9147 Magazine mag = Magazine.Cast(this);
9148 if (mag)
9149 {
9150 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9151 return false;
9152
9153 if (stack_max_limit)
9154 {
9155 Magazine other_mag = Magazine.Cast(other_item);
9156 if (other_item)
9157 {
9158 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9159 return false;
9160 }
9161
9162 }
9163 }
9164 else
9165 {
9166
9168 return false;
9169
9171 return false;
9172 }
9173
9174 PlayerBase player = null;
9175 if (CastTo(player, GetHierarchyRootPlayer()))
9176 {
9177 if (player.GetInventory().HasAttachment(this))
9178 return false;
9179
9180 if (player.IsItemsToDelete())
9181 return false;
9182 }
9183
9184 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9185 return false;
9186
9187 int slotID;
9189 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9190 return false;
9191
9192 return true;
9193 }
9194
9196 {
9198 }
9199
9201 {
9202 return m_IsResultOfSplit;
9203 }
9204
9206 {
9207 m_IsResultOfSplit = value;
9208 }
9209
9211 {
9213 }
9214
9216 {
9217 float other_item_quantity = other_item.GetQuantity();
9218 float this_free_space;
9219
9221
9223
9224 if (other_item_quantity > this_free_space)
9225 {
9226 return this_free_space;
9227 }
9228 else
9229 {
9230 return other_item_quantity;
9231 }
9232 }
9233
9235 {
9237 }
9238
9240 {
9242 return;
9243
9244 if (!IsMagazine() && other_item)
9245 {
9247 if (quantity_used != 0)
9248 {
9249 float hp1 = GetHealth01("","");
9250 float hp2 = other_item.GetHealth01("","");
9251 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9252 hpResult = hpResult / (
GetQuantity() + quantity_used);
9253
9254 hpResult *= GetMaxHealth();
9255 Math.Round(hpResult);
9256 SetHealth("", "Health", hpResult);
9257
9259 other_item.AddQuantity(-quantity_used);
9260 }
9261 }
9263 }
9264
9266 {
9267 #ifdef SERVER
9268 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9269 GetHierarchyParent().IncreaseLifetimeUp();
9270 #endif
9271 };
9272
9274 {
9275 PlayerBase p = PlayerBase.Cast(player);
9276
9277 array<int> recipesIds = p.m_Recipes;
9278 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9279 if (moduleRecipesManager)
9280 {
9281 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9282 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9283 }
9284
9285 for (int i = 0;i < recipesIds.Count(); i++)
9286 {
9287 int key = recipesIds.Get(i);
9288 string recipeName = moduleRecipesManager.GetRecipeName(key);
9290 }
9291 }
9292
9293
9294 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9295 {
9296 super.GetDebugActions(outputList);
9297
9298
9303
9304
9308
9312
9313
9316
9317
9319 {
9322 }
9323
9325
9328
9332 }
9333
9334
9335
9336
9338 {
9339 super.OnAction(action_id, player, ctx);
9340 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9341 {
9342 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9343 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9344 PlayerBase p = PlayerBase.Cast(player);
9345 if (
EActions.RECIPES_RANGE_START < 1000)
9346 {
9347 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9348 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9349 }
9350 }
9351 #ifndef SERVER
9352 else if (action_id ==
EActions.WATCH_PLAYER)
9353 {
9354 PluginDeveloper.SetDeveloperItemClientEx(player);
9355 }
9356 #endif
9358 {
9359 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9360 {
9361 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9362 OnDebugButtonPressServer(id + 1);
9363 }
9364
9365 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9366 {
9367 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9369 }
9370
9371 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9372 {
9373 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9375 }
9376
9377 else if (action_id ==
EActions.ADD_QUANTITY)
9378 {
9379 if (IsMagazine())
9380 {
9381 Magazine mag = Magazine.Cast(this);
9382 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9383 }
9384 else
9385 {
9387 }
9388
9389 if (m_EM)
9390 {
9391 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9392 }
9393
9394 }
9395
9396 else if (action_id ==
EActions.REMOVE_QUANTITY)
9397 {
9398 if (IsMagazine())
9399 {
9400 Magazine mag2 = Magazine.Cast(this);
9401 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9402 }
9403 else
9404 {
9406 }
9407 if (m_EM)
9408 {
9409 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9410 }
9411
9412 }
9413
9414 else if (action_id ==
EActions.SET_QUANTITY_0)
9415 {
9417
9418 if (m_EM)
9419 {
9420 m_EM.SetEnergy(0);
9421 }
9422 }
9423
9424 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9425 {
9427
9428 if (m_EM)
9429 {
9430 m_EM.SetEnergy(m_EM.GetEnergyMax());
9431 }
9432 }
9433
9434 else if (action_id ==
EActions.ADD_HEALTH)
9435 {
9436 AddHealth("","",GetMaxHealth("","Health")/5);
9437 }
9438 else if (action_id ==
EActions.REMOVE_HEALTH)
9439 {
9440 AddHealth("","",-GetMaxHealth("","Health")/5);
9441 }
9442 else if (action_id ==
EActions.DESTROY_HEALTH)
9443 {
9444 SetHealth01("","",0);
9445 }
9446 else if (action_id ==
EActions.WATCH_ITEM)
9447 {
9449 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9450 #ifdef DEVELOPER
9451 SetDebugDeveloper_item(this);
9452 #endif
9453 }
9454
9455 else if (action_id ==
EActions.ADD_TEMPERATURE)
9456 {
9457 AddTemperature(20);
9458
9459 }
9460
9461 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9462 {
9463 AddTemperature(-20);
9464
9465 }
9466
9467 else if (action_id ==
EActions.FLIP_FROZEN)
9468 {
9469 SetFrozen(!GetIsFrozen());
9470
9471 }
9472
9473 else if (action_id ==
EActions.ADD_WETNESS)
9474 {
9476
9477 }
9478
9479 else if (action_id ==
EActions.REMOVE_WETNESS)
9480 {
9482
9483 }
9484
9485 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9486 {
9489
9490
9491 }
9492
9493 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9494 {
9497 }
9498
9499 else if (action_id ==
EActions.MAKE_SPECIAL)
9500 {
9501 auto debugParams = DebugSpawnParams.WithPlayer(player);
9502 OnDebugSpawnEx(debugParams);
9503 }
9504
9505 else if (action_id ==
EActions.DELETE)
9506 {
9507 Delete();
9508 }
9509
9510 }
9511
9512
9513 return false;
9514 }
9515
9516
9517
9518
9522
9525
9526
9527
9529 {
9530 return false;
9531 }
9532
9533
9535 {
9536 return true;
9537 }
9538
9539
9541 {
9542 return true;
9543 }
9544
9545
9546
9548 {
9549 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9551 }
9552
9555 {
9556 return null;
9557 }
9558
9560 {
9561 return false;
9562 }
9563
9565 {
9566 return false;
9567 }
9568
9572
9573
9575 {
9576 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9577 return module_repairing.CanRepair(this, item_repair_kit);
9578 }
9579
9580
9581 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9582 {
9583 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9584 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9585 }
9586
9587
9589 {
9590
9591
9592
9593
9594
9595
9596
9597
9598 return 1;
9599 }
9600
9601
9602
9604 {
9606 }
9607
9608
9609
9611 {
9613 }
9614
9615
9624 {
9625 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9626
9627 if (player)
9628 {
9629 player.MessageStatus(text);
9630 }
9631 }
9632
9633
9642 {
9643 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9644
9645 if (player)
9646 {
9647 player.MessageAction(text);
9648 }
9649 }
9650
9651
9660 {
9661 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9662
9663 if (player)
9664 {
9665 player.MessageFriendly(text);
9666 }
9667 }
9668
9669
9678 {
9679 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9680
9681 if (player)
9682 {
9683 player.MessageImportant(text);
9684 }
9685 }
9686
9688 {
9689 return true;
9690 }
9691
9692
9693 override bool KindOf(
string tag)
9694 {
9695 bool found = false;
9696 string item_name = this.
GetType();
9699
9700 int array_size = item_tag_array.Count();
9701 for (int i = 0; i < array_size; i++)
9702 {
9703 if (item_tag_array.Get(i) == tag)
9704 {
9705 found = true;
9706 break;
9707 }
9708 }
9709 return found;
9710 }
9711
9712
9714 {
9715
9716 super.OnRPC(sender, rpc_type,ctx);
9717
9718
9719 switch (rpc_type)
9720 {
9721 #ifndef SERVER
9722 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9723 Param2<bool, string> p = new Param2<bool, string>(false, "");
9724
9726 return;
9727
9728 bool play = p.param1;
9729 string soundSet = p.param2;
9730
9731 if (play)
9732 {
9734 {
9736 {
9738 }
9739 }
9740 else
9741 {
9743 }
9744 }
9745 else
9746 {
9748 }
9749
9750 break;
9751 #endif
9752
9753 }
9754
9756 {
9758 }
9759 }
9760
9761
9762
9763
9765 {
9766 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9767 return plugin.GetID(
name);
9768 }
9769
9771 {
9772 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9773 return plugin.GetName(id);
9774 }
9775
9778 {
9779
9780
9781 int varFlags;
9782 if (!ctx.
Read(varFlags))
9783 return;
9784
9785 if (varFlags & ItemVariableFlags.FLOAT)
9786 {
9788 }
9789 }
9790
9792 {
9793
9794 super.SerializeNumericalVars(floats_out);
9795
9796
9797
9799 {
9801 }
9802
9804 {
9806 }
9807
9809 {
9811 }
9812
9814 {
9819 }
9820
9822 {
9824 }
9825 }
9826
9828 {
9829
9830 super.DeSerializeNumericalVars(floats);
9831
9832
9833 int index = 0;
9834 int mask = Math.Round(floats.Get(index));
9835
9836 index++;
9837
9839 {
9841 {
9843 }
9844 else
9845 {
9846 float quantity = floats.Get(index);
9848 }
9849 index++;
9850 }
9851
9853 {
9854 float wet = floats.Get(index);
9856 index++;
9857 }
9858
9860 {
9861 int liquidtype = Math.Round(floats.Get(index));
9863 index++;
9864 }
9865
9867 {
9869 index++;
9871 index++;
9873 index++;
9875 index++;
9876 }
9877
9879 {
9880 int cleanness = Math.Round(floats.Get(index));
9882 index++;
9883 }
9884 }
9885
9887 {
9888 super.WriteVarsToCTX(ctx);
9889
9890
9892 {
9894 }
9895
9897 {
9899 }
9900
9902 {
9904 }
9905
9907 {
9908 int r,g,b,a;
9914 }
9915
9917 {
9919 }
9920 }
9921
9923 {
9924 if (!super.ReadVarsFromCTX(ctx,version))
9925 return false;
9926
9927 int intValue;
9928 float value;
9929
9930 if (version < 140)
9931 {
9932 if (!ctx.
Read(intValue))
9933 return false;
9934
9935 m_VariablesMask = intValue;
9936 }
9937
9939 {
9940 if (!ctx.
Read(value))
9941 return false;
9942
9944 {
9946 }
9947 else
9948 {
9950 }
9951 }
9952
9953 if (version < 140)
9954 {
9956 {
9957 if (!ctx.
Read(value))
9958 return false;
9959 SetTemperatureDirect(value);
9960 }
9961 }
9962
9964 {
9965 if (!ctx.
Read(value))
9966 return false;
9968 }
9969
9971 {
9972 if (!ctx.
Read(intValue))
9973 return false;
9975 }
9976
9978 {
9979 int r,g,b,a;
9981 return false;
9983 return false;
9985 return false;
9987 return false;
9988
9990 }
9991
9993 {
9994 if (!ctx.
Read(intValue))
9995 return false;
9997 }
9998
9999 if (version >= 138 && version < 140)
10000 {
10002 {
10003 if (!ctx.
Read(intValue))
10004 return false;
10005 SetFrozen(intValue);
10006 }
10007 }
10008
10009 return true;
10010 }
10011
10012
10014 {
10017 {
10019 }
10020
10021 if (!super.OnStoreLoad(ctx, version))
10022 {
10024 return false;
10025 }
10026
10027 if (version >= 114)
10028 {
10029 bool hasQuickBarIndexSaved;
10030
10031 if (!ctx.
Read(hasQuickBarIndexSaved))
10032 {
10034 return false;
10035 }
10036
10037 if (hasQuickBarIndexSaved)
10038 {
10039 int itmQBIndex;
10040
10041
10042 if (!ctx.
Read(itmQBIndex))
10043 {
10045 return false;
10046 }
10047
10048 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10049 if (itmQBIndex != -1 && parentPlayer)
10050 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10051 }
10052 }
10053 else
10054 {
10055
10056 PlayerBase player;
10057 int itemQBIndex;
10058 if (version ==
int.
MAX)
10059 {
10060 if (!ctx.
Read(itemQBIndex))
10061 {
10063 return false;
10064 }
10065 }
10066 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10067 {
10068
10069 if (!ctx.
Read(itemQBIndex))
10070 {
10072 return false;
10073 }
10074 if (itemQBIndex != -1 && player)
10075 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10076 }
10077 }
10078
10079 if (version < 140)
10080 {
10081
10082 if (!LoadVariables(ctx, version))
10083 {
10085 return false;
10086 }
10087 }
10088
10089
10091 {
10093 return false;
10094 }
10095 if (version >= 132)
10096 {
10098 if (raib)
10099 {
10101 {
10103 return false;
10104 }
10105 }
10106 }
10107
10109 return true;
10110 }
10111
10112
10113
10115 {
10116 super.OnStoreSave(ctx);
10117
10118 PlayerBase player;
10119 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10120 {
10122
10123 int itemQBIndex = -1;
10124 itemQBIndex = player.FindQuickBarEntityIndex(this);
10125 ctx.
Write(itemQBIndex);
10126 }
10127 else
10128 {
10130 }
10131
10133
10135 if (raib)
10136 {
10138 }
10139 }
10140
10141
10143 {
10144 super.AfterStoreLoad();
10145
10147 {
10149 }
10150
10152 {
10155 }
10156 }
10157
10159 {
10160 super.EEOnAfterLoad();
10161
10163 {
10165 }
10166
10169 }
10170
10172 {
10173 return false;
10174 }
10175
10176
10177
10179 {
10181 {
10182 #ifdef PLATFORM_CONSOLE
10183
10185 {
10187 if (menu)
10188 {
10190 }
10191 }
10192 #endif
10193 }
10194
10196 {
10199 }
10200
10202 {
10203 SetWeightDirty();
10205 }
10207 {
10210 }
10211
10213 {
10216 }
10218 {
10221 }
10222
10223 super.OnVariablesSynchronized();
10224 }
10225
10226
10227
10229 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10230 {
10231 if (!IsServerCheck(allow_client))
10232 return false;
10233
10235 return false;
10236
10239
10240 if (value <= (min + 0.001))
10241 value = min;
10242
10243 if (value == min)
10244 {
10245 if (destroy_config)
10246 {
10247 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10248 if (dstr)
10249 {
10251 this.Delete();
10252 return true;
10253 }
10254 }
10255 else if (destroy_forced)
10256 {
10258 this.Delete();
10259 return true;
10260 }
10261
10263 }
10264
10267
10269 {
10271
10272 if (delta)
10274 }
10275
10277
10278 return false;
10279 }
10280
10281
10283 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10284 {
10286 }
10287
10289 {
10292 }
10293
10295 {
10298 }
10299
10302 {
10303 float value_clamped = Math.Clamp(value, 0, 1);
10305 SetQuantity(result, destroy_config, destroy_forced);
10306 }
10307
10308
10311 {
10313 }
10314
10316 {
10318 }
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10330 {
10331 int slot = -1;
10332 if (GetInventory())
10333 {
10334 InventoryLocation il = new InventoryLocation;
10335 GetInventory().GetCurrentInventoryLocation(il);
10337 }
10338
10340 }
10341
10343 {
10344 float quantity_max = 0;
10345
10347 {
10348 if (attSlotID != -1)
10349 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10350
10351 if (quantity_max <= 0)
10353 }
10354
10355 if (quantity_max <= 0)
10357
10358 return quantity_max;
10359 }
10360
10362 {
10364 }
10365
10367 {
10369 }
10370
10371
10373 {
10375 }
10376
10378 {
10380 }
10381
10383 {
10385 }
10386
10387
10389 {
10390
10391 float weightEx = GetWeightEx();
10392 float special = GetInventoryAndCargoWeight();
10393 return weightEx - special;
10394 }
10395
10396
10398 {
10400 }
10401
10403 {
10405 {
10406 #ifdef DEVELOPER
10407 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10408 {
10409 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10411 }
10412 #endif
10413
10414 return GetQuantity() * GetConfigWeightModified();
10415 }
10416 else if (HasEnergyManager())
10417 {
10418 #ifdef DEVELOPER
10419 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10420 {
10421 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10422 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10423 }
10424 #endif
10425 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10426 }
10427 else
10428 {
10429 #ifdef DEVELOPER
10430 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10431 {
10432 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10433 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10434 }
10435 #endif
10436 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10437 }
10438 }
10439
10442 {
10443 int item_count = 0;
10445
10446 if (GetInventory().GetCargo() != NULL)
10447 {
10448 item_count = GetInventory().GetCargo().GetItemCount();
10449 }
10450
10451 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10452 {
10453 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10454 if (item)
10455 item_count += item.GetNumberOfItems();
10456 }
10457 return item_count;
10458 }
10459
10462 {
10463 float weight = 0;
10464 float wetness = 1;
10465 if (include_wetness)
10468 {
10469 weight = wetness * m_ConfigWeight;
10470 }
10472 {
10473 weight = 1;
10474 }
10475 return weight;
10476 }
10477
10478
10479
10481 {
10482 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10483 {
10484 GameInventory inv = GetInventory();
10485 array<EntityAI> items = new array<EntityAI>;
10487 for (int i = 0; i < items.Count(); i++)
10488 {
10490 if (item)
10491 {
10493 }
10494 }
10495 }
10496 }
10497
10498
10499
10500
10502 {
10503 float energy = 0;
10504 if (HasEnergyManager())
10505 {
10506 energy = GetCompEM().GetEnergy();
10507 }
10508 return energy;
10509 }
10510
10511
10513 {
10514 super.OnEnergyConsumed();
10515
10517 }
10518
10520 {
10521 super.OnEnergyAdded();
10522
10524 }
10525
10526
10528 {
10529 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10530 {
10532 {
10533 float energy_0to1 = GetCompEM().GetEnergy0To1();
10535 }
10536 }
10537 }
10538
10539
10541 {
10542 return ConfigGetFloat("heatIsolation");
10543 }
10544
10546 {
10548 }
10549
10551 {
10552 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10553 if (
GetGame().ConfigIsExisting(paramPath))
10555
10556 return 0.0;
10557 }
10558
10560 {
10561 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10562 if (
GetGame().ConfigIsExisting(paramPath))
10564
10565 return 0.0;
10566 }
10567
10568 override void SetWet(
float value,
bool allow_client =
false)
10569 {
10570 if (!IsServerCheck(allow_client))
10571 return;
10572
10575
10577
10578 m_VarWet = Math.Clamp(value, min, max);
10579
10581 {
10584 }
10585 }
10586
10587 override void AddWet(
float value)
10588 {
10590 }
10591
10593 {
10595 }
10596
10598 {
10600 }
10601
10603 {
10605 }
10606
10608 {
10610 }
10611
10613 {
10615 }
10616
10617 override void OnWetChanged(
float newVal,
float oldVal)
10618 {
10621 if (newLevel != oldLevel)
10622 {
10624 }
10625 }
10626
10628 {
10629 SetWeightDirty();
10630 }
10631
10633 {
10634 return GetWetLevelInternal(
m_VarWet);
10635 }
10636
10637
10638
10640 {
10642 }
10643
10645 {
10647 }
10648
10650 {
10652 }
10653
10655 {
10657 }
10658
10659
10660
10662 {
10663 if (ConfigIsExisting("itemModelLength"))
10664 {
10665 return ConfigGetFloat("itemModelLength");
10666 }
10667 return 0;
10668 }
10669
10671 {
10672 if (ConfigIsExisting("itemAttachOffset"))
10673 {
10674 return ConfigGetFloat("itemAttachOffset");
10675 }
10676 return 0;
10677 }
10678
10679 override void SetCleanness(
int value,
bool allow_client =
false)
10680 {
10681 if (!IsServerCheck(allow_client))
10682 return;
10683
10685
10687
10690 }
10691
10693 {
10695 }
10696
10698 {
10699 return true;
10700 }
10701
10702
10703
10704
10706 {
10708 }
10709
10711 {
10713 }
10714
10715
10716
10717
10718 override void SetColor(
int r,
int g,
int b,
int a)
10719 {
10725 }
10727 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10728 {
10733 }
10734
10736 {
10738 }
10739
10742 {
10743 int r,g,b,a;
10745 r = r/255;
10746 g = g/255;
10747 b = b/255;
10748 a = a/255;
10749 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10750 }
10751
10752
10753
10754 override void SetLiquidType(
int value,
bool allow_client =
false)
10755 {
10756 if (!IsServerCheck(allow_client))
10757 return;
10758
10763 }
10764
10766 {
10767 return ConfigGetInt("varLiquidTypeInit");
10768 }
10769
10771 {
10773 }
10774
10776 {
10778 SetFrozen(false);
10779 }
10780
10783 {
10784 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10785 }
10786
10787
10790 {
10791 PlayerBase nplayer;
10792 if (PlayerBase.CastTo(nplayer, player))
10793 {
10795
10796 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10797 }
10798 }
10799
10800
10803 {
10804 PlayerBase nplayer;
10805 if (PlayerBase.CastTo(nplayer,player))
10806 {
10807
10808 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10809
10810 }
10811
10812
10813 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10814
10815
10816 if (HasEnergyManager())
10817 {
10818 GetCompEM().UpdatePlugState();
10819 }
10820 }
10821
10822
10824 {
10825 super.OnPlacementStarted(player);
10826
10828 }
10829
10830 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10831 {
10833 {
10834 m_AdminLog.OnPlacementComplete(player,
this);
10835 }
10836
10837 super.OnPlacementComplete(player, position, orientation);
10838 }
10839
10840
10841
10842
10843
10845 {
10847 {
10848 return true;
10849 }
10850 else
10851 {
10852 return false;
10853 }
10854 }
10855
10856
10858 {
10860 {
10862 }
10863 }
10864
10865
10867 {
10869 }
10870
10872 {
10874 }
10875
10876 override void InsertAgent(
int agent,
float count = 1)
10877 {
10878 if (count < 1)
10879 return;
10880
10882 }
10883
10886 {
10888 }
10889
10890
10892 {
10894 }
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10938 {
10940 return false;
10941 return true;
10942 }
10943
10945 {
10946
10948 }
10949
10950
10953 {
10954 super.CheckForRoofLimited(timeTresholdMS);
10955
10957 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10958 {
10959 m_PreviousRoofTestTime = time;
10960 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10961 }
10962 }
10963
10964
10966 {
10968 {
10969 return 0;
10970 }
10971
10972 if (GetInventory().GetAttachmentSlotsCount() != 0)
10973 {
10974 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10975 if (filter)
10976 return filter.GetProtectionLevel(type, false, system);
10977 else
10978 return 0;
10979 }
10980
10981 string subclassPath, entryName;
10982
10983 switch (type)
10984 {
10986 entryName = "biological";
10987 break;
10989 entryName = "chemical";
10990 break;
10991 default:
10992 entryName = "biological";
10993 break;
10994 }
10995
10996 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10997
10999 }
11000
11001
11002
11005 {
11006 if (!IsMagazine())
11008
11010 }
11011
11012
11013
11014
11015
11020 {
11021 return true;
11022 }
11023
11025 {
11027 }
11028
11029
11030
11031
11032
11034 {
11035 if (parent)
11036 {
11037 if (parent.IsInherited(DayZInfected))
11038 return true;
11039
11040 if (!parent.IsRuined())
11041 return true;
11042 }
11043
11044 return true;
11045 }
11046
11048 {
11049 if (!super.CanPutAsAttachment(parent))
11050 {
11051 return false;
11052 }
11053
11054 if (!IsRuined() && !parent.IsRuined())
11055 {
11056 return true;
11057 }
11058
11059 return false;
11060 }
11061
11063 {
11064
11065
11066
11067
11068 return super.CanReceiveItemIntoCargo(item);
11069 }
11070
11072 {
11073
11074
11075
11076
11077 GameInventory attachmentInv = attachment.GetInventory();
11079 {
11080 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11081 return false;
11082 }
11083
11084 InventoryLocation loc = new InventoryLocation();
11085 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11086 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11087 return false;
11088
11089 return super.CanReceiveAttachment(attachment, slotId);
11090 }
11091
11093 {
11094 if (!super.CanReleaseAttachment(attachment))
11095 return false;
11096
11097 return GetInventory().AreChildrenAccessible();
11098 }
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11121 {
11122 int id = muzzle_owner.GetMuzzleID();
11123 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11124
11125 if (WPOF_array)
11126 {
11127 for (int i = 0; i < WPOF_array.Count(); i++)
11128 {
11129 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11130
11131 if (WPOF)
11132 {
11133 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11134 }
11135 }
11136 }
11137 }
11138
11139
11141 {
11142 int id = muzzle_owner.GetMuzzleID();
11144
11145 if (WPOBE_array)
11146 {
11147 for (int i = 0; i < WPOBE_array.Count(); i++)
11148 {
11149 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11150
11151 if (WPOBE)
11152 {
11153 WPOBE.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.OnActivate(weapon, 0, 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.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11194 }
11195 }
11196 }
11197 }
11198
11199
11201 {
11202 int id = muzzle_owner.GetMuzzleID();
11203 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11204
11205 if (WPOOH_array)
11206 {
11207 for (int i = 0; i < WPOOH_array.Count(); i++)
11208 {
11209 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11210
11211 if (WPOOH)
11212 {
11213 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11214 }
11215 }
11216 }
11217 }
11218
11219
11220
11222 {
11224 {
11225 return true;
11226 }
11227
11228 return false;
11229 }
11230
11232 {
11234 {
11235 return true;
11236 }
11237
11238 return false;
11239 }
11240
11242 {
11244 {
11245 return true;
11246 }
11247
11248 return false;
11249 }
11250
11252 {
11253 return false;
11254 }
11255
11258 {
11259 return UATimeSpent.DEFAULT_DEPLOY;
11260 }
11261
11262
11263
11264
11266 {
11268 SetSynchDirty();
11269 }
11270
11272 {
11274 }
11275
11276
11278 {
11279 return false;
11280 }
11281
11284 {
11285 string att_type = "None";
11286
11287 if (ConfigIsExisting("soundAttType"))
11288 {
11289 att_type = ConfigGetString("soundAttType");
11290 }
11291
11293 }
11294
11296 {
11298 }
11299
11300
11301
11302
11303
11307
11309 {
11312
11314 }
11315
11316
11318 {
11320 return;
11321
11323
11326
11329
11330 SoundParameters params = new SoundParameters();
11334 }
11335
11336
11338 {
11340 return;
11341
11343 SetSynchDirty();
11344
11347 }
11348
11349
11351 {
11353 return;
11354
11356 SetSynchDirty();
11357
11360 }
11361
11363 {
11365 }
11366
11368 {
11370 }
11371
11374 {
11375 if (!
GetGame().IsDedicatedServer())
11376 {
11377 if (ConfigIsExisting("attachSoundSet"))
11378 {
11379 string cfg_path = "";
11380 string soundset = "";
11381 string type_name =
GetType();
11382
11385 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11386 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11387
11388 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11389 {
11390 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11391 {
11392 if (cfg_slot_array[i] == slot_type)
11393 {
11394 soundset = cfg_soundset_array[i];
11395 break;
11396 }
11397 }
11398 }
11399
11400 if (soundset != "")
11401 {
11402 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11404 }
11405 }
11406 }
11407 }
11408
11410 {
11411
11412 }
11413
11414 void OnApply(PlayerBase player);
11415
11417 {
11418 return 1.0;
11419 };
11420
11422 {
11424 }
11425
11427 {
11429 }
11430
11432
11434 {
11435 SetDynamicPhysicsLifeTime(0.01);
11437 }
11438
11440 {
11441 array<string> zone_names = new array<string>;
11442 GetDamageZones(zone_names);
11443 for (int i = 0; i < zone_names.Count(); i++)
11444 {
11445 SetHealthMax(zone_names.Get(i),"Health");
11446 }
11447 SetHealthMax("","Health");
11448 }
11449
11452 {
11453 float global_health = GetHealth01("","Health");
11454 array<string> zones = new array<string>;
11455 GetDamageZones(zones);
11456
11457 for (int i = 0; i < zones.Count(); i++)
11458 {
11459 SetHealth01(zones.Get(i),"Health",global_health);
11460 }
11461 }
11462
11465 {
11466 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11467 }
11468
11470 {
11471 if (!hasRootAsPlayer)
11472 {
11473 if (refParentIB)
11474 {
11475
11476 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11477 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11478
11479 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11480 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11481
11484 }
11485 else
11486 {
11487
11490 }
11491 }
11492 }
11493
11495 {
11497 {
11498 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11499 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11500 {
11501 float heatPermCoef = 1.0;
11503 while (ent)
11504 {
11505 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11506 ent = ent.GetHierarchyParent();
11507 }
11508
11509 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11510 }
11511 }
11512 }
11513
11515 {
11516
11517 EntityAI parent = GetHierarchyParent();
11518 if (!parent)
11519 {
11520 hasParent = false;
11521 hasRootAsPlayer = false;
11522 }
11523 else
11524 {
11525 hasParent = true;
11526 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11527 refParentIB =
ItemBase.Cast(parent);
11528 }
11529 }
11530
11531 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11532 {
11533
11534 }
11535
11537 {
11538
11539 return false;
11540 }
11541
11543 {
11544
11545
11546 return false;
11547 }
11548
11550 {
11551
11552 return false;
11553 }
11554
11557 {
11558 return !GetIsFrozen() &&
IsOpen();
11559 }
11560
11562 {
11563 bool hasParent = false, hasRootAsPlayer = false;
11565
11566 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11567 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11568
11569 if (wwtu || foodDecay)
11570 {
11574
11575 if (processWetness || processTemperature || processDecay)
11576 {
11578
11579 if (processWetness)
11580 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11581
11582 if (processTemperature)
11584
11585 if (processDecay)
11586 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11587 }
11588 }
11589 }
11590
11593 {
11595 }
11596
11598 {
11601
11602 return super.GetTemperatureFreezeThreshold();
11603 }
11604
11606 {
11609
11610 return super.GetTemperatureThawThreshold();
11611 }
11612
11614 {
11617
11618 return super.GetItemOverheatThreshold();
11619 }
11620
11622 {
11624 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11625
11626 return super.GetTemperatureFreezeTime();
11627 }
11628
11630 {
11632 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11633
11634 return super.GetTemperatureThawTime();
11635 }
11636
11641
11643 {
11644 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11645 }
11646
11648 {
11649 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11650 }
11651
11654 {
11656 }
11657
11659 {
11661 }
11662
11664 {
11666 }
11667
11670 {
11671 return null;
11672 }
11673
11676 {
11677 return false;
11678 }
11679
11681 {
11683 {
11686 if (!trg)
11687 {
11689 explosive = this;
11690 }
11691
11692 explosive.PairRemote(trg);
11694
11695 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11696 trg.SetPersistentPairID(persistentID);
11697 explosive.SetPersistentPairID(persistentID);
11698
11699 return true;
11700 }
11701 return false;
11702 }
11703
11706 {
11707 float ret = 1.0;
11710 ret *= GetHealth01();
11711
11712 return ret;
11713 }
11714
11715 #ifdef DEVELOPER
11716 override void SetDebugItem()
11717 {
11718 super.SetDebugItem();
11719 _itemBase = this;
11720 }
11721
11723 {
11724 string text = super.GetDebugText();
11725
11727 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11728
11729 return text;
11730 }
11731 #endif
11732
11734 {
11735 return true;
11736 }
11737
11739
11741
11743 {
11746 }
11747
11748
11756
11772}
11773
11775{
11777 if (entity)
11778 {
11779 bool is_item = entity.IsInherited(
ItemBase);
11780 if (is_item && full_quantity)
11781 {
11784 }
11785 }
11786 else
11787 {
11789 return NULL;
11790 }
11791 return entity;
11792}
11793
11795{
11796 if (item)
11797 {
11798 if (health > 0)
11799 item.SetHealth("", "", health);
11800
11801 if (item.CanHaveTemperature())
11802 {
11804 if (item.CanFreeze())
11805 item.SetFrozen(false);
11806 }
11807
11808 if (item.HasEnergyManager())
11809 {
11810 if (quantity >= 0)
11811 {
11812 item.GetCompEM().SetEnergy0To1(quantity);
11813 }
11814 else
11815 {
11817 }
11818 }
11819 else if (item.IsMagazine())
11820 {
11821 Magazine mag = Magazine.Cast(item);
11822 if (quantity >= 0)
11823 {
11824 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11825 }
11826 else
11827 {
11829 }
11830
11831 }
11832 else
11833 {
11834 if (quantity >= 0)
11835 {
11836 item.SetQuantityNormalized(quantity, false);
11837 }
11838 else
11839 {
11841 }
11842
11843 }
11844 }
11845}
11846
11847#ifdef DEVELOPER
11849#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.