7923{
7925 {
7926 return true;
7927 }
7928};
7929
7930
7931
7933{
7937
7939
7942
7943
7944
7945
7946
7955
7961
7966
7971
7992 protected bool m_IsResultOfSplit
7993
7995
8000
8001
8002
8004
8008
8009
8010
8012
8015
8016
8017
8023
8024
8032
8035
8036
8038
8039
8041
8042
8047
8048
8053
8054
8056
8057
8059 {
8064
8065 if (!
GetGame().IsDedicatedServer())
8066 {
8068 {
8070
8072 {
8074 }
8075 }
8076
8079 }
8080
8081 m_OldLocation = null;
8082
8084 {
8086 }
8087
8088 if (ConfigIsExisting("headSelectionsToHide"))
8089 {
8092 }
8093
8095 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8096 {
8098 }
8099
8101
8102 m_IsResultOfSplit = false;
8103
8105 }
8106
8108 {
8109 super.InitItemVariables();
8110
8116 m_Count = ConfigGetInt(
"count");
8117
8120
8125
8128
8133
8145
8149
8150
8153 if (ConfigIsExisting("canBeSplit"))
8154 {
8157 }
8158
8160 if (ConfigIsExisting("itemBehaviour"))
8162
8163
8166 RegisterNetSyncVariableInt("m_VarLiquidType");
8167 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8168
8169 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8170 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8171 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8172
8173 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8174 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8175 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8176 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8177
8178 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8179 RegisterNetSyncVariableBool("m_IsTakeable");
8180 RegisterNetSyncVariableBool("m_IsHologram");
8181
8184 {
8187 }
8188
8190
8192 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8194
8195 }
8196
8198 {
8200 }
8201
8203 {
8206 {
8211 }
8212 }
8213
8214 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8215 {
8217 {
8220 }
8221
8223 }
8224
8226 {
8232 }
8233
8235
8237 {
8239
8240 if (!action)
8241 {
8242 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8243 return;
8244 }
8245
8247 if (!ai)
8248 {
8250 return;
8251 }
8252
8254 if (!action_array)
8255 {
8256 action_array = new array<ActionBase_Basic>;
8258 }
8259 if (LogManager.IsActionLogEnable())
8260 {
8261 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8262 }
8263
8264 if (action_array.Find(action) != -1)
8265 {
8266 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8267 }
8268 else
8269 {
8270 action_array.Insert(action);
8271 }
8272 }
8273
8275 {
8277 ActionBase action = player.GetActionManager().GetAction(actionName);
8280
8281 if (action_array)
8282 {
8283 action_array.RemoveItem(action);
8284 }
8285 }
8286
8287
8288
8290 {
8291 ActionOverrideData overrideData = new ActionOverrideData();
8295
8297 if (!actionMap)
8298 {
8301 }
8302
8303 actionMap.Insert(this.
Type(), overrideData);
8304
8305 }
8306
8308
8310
8311
8313 {
8316
8319
8320 string config_to_search = "CfgVehicles";
8321 string muzzle_owner_config;
8322
8324 {
8325 if (IsInherited(Weapon))
8326 config_to_search = "CfgWeapons";
8327
8328 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8329
8330 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8331
8333
8334 if (config_OnFire_subclass_count > 0)
8335 {
8336 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8337
8338 for (int i = 0; i < config_OnFire_subclass_count; i++)
8339 {
8340 string particle_class = "";
8342 string config_OnFire_entry = config_OnFire_class + particle_class;
8343 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8344 WPOF_array.Insert(WPOF);
8345 }
8346
8347
8349 }
8350 }
8351
8353 {
8354 config_to_search = "CfgWeapons";
8355 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8356
8357 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8358
8360
8361 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8362 {
8363 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8364
8365 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8366 {
8367 string particle_class2 = "";
8369 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8370 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8371 WPOBE_array.Insert(WPOBE);
8372 }
8373
8374
8376 }
8377 }
8378 }
8379
8380
8382 {
8385
8387 {
8388 string config_to_search = "CfgVehicles";
8389
8390 if (IsInherited(Weapon))
8391 config_to_search = "CfgWeapons";
8392
8393 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8394 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8395
8396 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8397 {
8398
8400
8402 {
8404 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8406 return;
8407 }
8408
8411
8412
8413
8415 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8416
8417 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8418 {
8419 string particle_class = "";
8421 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8423
8424 if (entry_type == CT_CLASS)
8425 {
8426 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8427 WPOOH_array.Insert(WPOF);
8428 }
8429 }
8430
8431
8433 }
8434 }
8435 }
8436
8438 {
8440 }
8441
8443 {
8445 {
8447
8450
8453
8454 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8455 }
8456 }
8457
8459 {
8461 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8462
8464 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8465
8467 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8468
8470 {
8472 }
8473 }
8474
8476 {
8478 }
8479
8481 {
8484 else
8486
8488 {
8491 }
8492 else
8493 {
8496
8499 }
8500
8502 }
8503
8505 {
8507 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8508 }
8509
8511 {
8513 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8515 }
8516
8518 {
8520 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8521 }
8522
8524 {
8527
8528 OverheatingParticle OP = new OverheatingParticle();
8533
8535 }
8536
8538 {
8541
8542 return -1;
8543 }
8544
8546 {
8548 {
8551
8552 for (int i = count; i > 0; --i)
8553 {
8554 int id = i - 1;
8557
8560
8561 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8562 {
8563 if (p)
8564 {
8567 }
8568 }
8569 }
8570 }
8571 }
8572
8574 {
8576 {
8578 {
8579 int id = i - 1;
8581
8582 if (OP)
8583 {
8585
8586 if (p)
8587 {
8589 }
8590
8591 delete OP;
8592 }
8593 }
8594
8597 }
8598 }
8599
8602 {
8603 return 0.0;
8604 }
8605
8606
8608 {
8609 return 250;
8610 }
8611
8613 {
8614 return 0;
8615 }
8616
8619 {
8621 return true;
8622
8623 return false;
8624 }
8625
8628 {
8631
8633 {
8635 }
8636 else
8637 {
8638
8640 }
8641
8643 }
8644
8651 {
8652 return -1;
8653 }
8654
8655
8656
8657
8659 {
8661 {
8663 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8664
8665 if (r_index >= 0)
8666 {
8667 InventoryLocation r_il = new InventoryLocation;
8668 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8669
8670 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8673 {
8674 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8675 }
8677 {
8678 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8679 }
8680
8681 }
8682
8683 player.GetHumanInventory().ClearUserReservedLocation(this);
8684 }
8685
8688 }
8689
8690
8691
8692
8694 {
8695 return ItemBase.m_DebugActionsMask;
8696 }
8697
8699 {
8700 return ItemBase.m_DebugActionsMask & mask;
8701 }
8702
8704 {
8705 ItemBase.m_DebugActionsMask = mask;
8706 }
8707
8709 {
8710 ItemBase.m_DebugActionsMask |= mask;
8711 }
8712
8714 {
8715 ItemBase.m_DebugActionsMask &= ~mask;
8716 }
8717
8719 {
8721 {
8723 }
8724 else
8725 {
8727 }
8728 }
8729
8730
8732 {
8733 if (GetEconomyProfile())
8734 {
8735 float q_max = GetEconomyProfile().GetQuantityMax();
8736 if (q_max > 0)
8737 {
8738 float q_min = GetEconomyProfile().GetQuantityMin();
8739 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8740
8742 {
8743 ComponentEnergyManager comp = GetCompEM();
8745 {
8747 }
8748 }
8750 {
8752
8753 }
8754
8755 }
8756 }
8757 }
8758
8761 {
8762 EntityAI parent = GetHierarchyParent();
8763
8764 if (parent)
8765 {
8766 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8767 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8768 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8769 }
8770 }
8771
8774 {
8775 EntityAI parent = GetHierarchyParent();
8776
8777 if (parent)
8778 {
8779 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8780 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8781 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8782 }
8783 }
8784
8786 {
8787
8788
8789
8790
8792
8794 {
8795 if (ScriptInputUserData.CanStoreInputUserData())
8796 {
8797 ScriptInputUserData ctx = new ScriptInputUserData;
8803 ctx.
Write(use_stack_max);
8806
8808 {
8809 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8810 }
8811 }
8812 }
8813 else if (!
GetGame().IsMultiplayer())
8814 {
8816 }
8817 }
8818
8820 {
8822 }
8823
8825 {
8827 }
8828
8830 {
8832 }
8833
8835 {
8836
8837 return false;
8838 }
8839
8841 {
8842 return false;
8843 }
8844
8848 {
8849 return false;
8850 }
8851
8853 {
8854 return "";
8855 }
8856
8858
8860 {
8861 return false;
8862 }
8863
8865 {
8866 return true;
8867 }
8868
8869
8870
8872 {
8873 return true;
8874 }
8875
8877 {
8878 return true;
8879 }
8880
8882 {
8883 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8885 }
8886
8888 {
8890 }
8891
8893 {
8895 if (!is_being_placed)
8897 SetSynchDirty();
8898 }
8899
8900
8902
8904 {
8906 }
8907
8909 {
8911 }
8912
8914 {
8915 return 1;
8916 }
8917
8919 {
8920 return false;
8921 }
8922
8924 {
8926 SetSynchDirty();
8927 }
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8964 {
8965 super.OnMovedInsideCargo(container);
8966
8967 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8968 }
8969
8970 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8971 {
8972 super.EEItemLocationChanged(oldLoc,newLoc);
8973
8974 PlayerBase new_player = null;
8975 PlayerBase old_player = null;
8976
8977 if (newLoc.GetParent())
8978 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8979
8980 if (oldLoc.GetParent())
8981 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8982
8984 {
8985 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8986
8987 if (r_index >= 0)
8988 {
8989 InventoryLocation r_il = new InventoryLocation;
8990 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8991
8992 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8995 {
8996 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8997 }
8999 {
9000 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9001 }
9002
9003 }
9004 }
9005
9007 {
9008 if (new_player)
9009 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9010
9011 if (new_player == old_player)
9012 {
9013
9014 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9015 {
9017 {
9018 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9019 {
9020 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9021 }
9022 }
9023 else
9024 {
9025 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9026 }
9027 }
9028
9029 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9030 {
9031 int type = oldLoc.GetType();
9033 {
9034 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9035 }
9037 {
9038 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9039 }
9040 }
9041 if (!m_OldLocation)
9042 {
9043 m_OldLocation = new InventoryLocation;
9044 }
9045 m_OldLocation.Copy(oldLoc);
9046 }
9047 else
9048 {
9049 if (m_OldLocation)
9050 {
9051 m_OldLocation.Reset();
9052 }
9053 }
9054
9056 }
9057 else
9058 {
9059 if (new_player)
9060 {
9061 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9062 if (res_index >= 0)
9063 {
9064 InventoryLocation il = new InventoryLocation;
9065 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9067 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9070 {
9071 il.
GetParent().GetOnReleaseLock().Invoke(it);
9072 }
9074 {
9076 }
9077
9078 }
9079 }
9081 {
9082
9084 }
9085
9086 if (m_OldLocation)
9087 {
9088 m_OldLocation.Reset();
9089 }
9090 }
9091 }
9092
9093 override void EOnContact(IEntity other, Contact extra)
9094 {
9096 {
9097 int liquidType = -1;
9099 if (impactSpeed > 0.0)
9100 {
9102 #ifndef SERVER
9104 #else
9106 SetSynchDirty();
9107 #endif
9109 }
9110 }
9111
9112 #ifdef SERVER
9113 if (GetCompEM() && GetCompEM().IsPlugged())
9114 {
9115 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9116 GetCompEM().UnplugThis();
9117 }
9118 #endif
9119 }
9120
9122
9124 {
9126 }
9127
9129 {
9130
9131 }
9132
9134 {
9135 super.OnItemLocationChanged(old_owner, new_owner);
9136
9137 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9138 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9139
9140 if (!relatedPlayer && playerNew)
9141 relatedPlayer = playerNew;
9142
9143 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9144 {
9146 if (actionMgr)
9147 {
9148 ActionBase currentAction = actionMgr.GetRunningAction();
9149 if (currentAction)
9151 }
9152 }
9153
9154 Man ownerPlayerOld = null;
9155 Man ownerPlayerNew = null;
9156
9157 if (old_owner)
9158 {
9159 if (old_owner.
IsMan())
9160 {
9161 ownerPlayerOld = Man.Cast(old_owner);
9162 }
9163 else
9164 {
9165 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9166 }
9167 }
9168 else
9169 {
9171 {
9173
9174 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9175 {
9176 GetCompEM().UnplugThis();
9177 }
9178 }
9179 }
9180
9181 if (new_owner)
9182 {
9183 if (new_owner.
IsMan())
9184 {
9185 ownerPlayerNew = Man.Cast(new_owner);
9186 }
9187 else
9188 {
9189 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9190 }
9191 }
9192
9193 if (ownerPlayerOld != ownerPlayerNew)
9194 {
9195 if (ownerPlayerOld)
9196 {
9197 array<EntityAI> subItemsExit = new array<EntityAI>;
9199 for (int i = 0; i < subItemsExit.Count(); i++)
9200 {
9203 }
9204 }
9205
9206 if (ownerPlayerNew)
9207 {
9208 array<EntityAI> subItemsEnter = new array<EntityAI>;
9210 for (int j = 0; j < subItemsEnter.Count(); j++)
9211 {
9214 }
9215 }
9216 }
9217 else if (ownerPlayerNew != null)
9218 {
9219 PlayerBase nplayer;
9220 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9221 {
9222 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9224 for (int k = 0; k < subItemsUpdate.Count(); k++)
9225 {
9227 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9228 }
9229 }
9230 }
9231
9232 if (old_owner)
9233 old_owner.OnChildItemRemoved(this);
9234 if (new_owner)
9235 new_owner.OnChildItemReceived(this);
9236 }
9237
9238
9240 {
9241 super.EEDelete(parent);
9242 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9243 if (player)
9244 {
9246
9247 if (player.IsAlive())
9248 {
9249 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9250 if (r_index >= 0)
9251 {
9252 InventoryLocation r_il = new InventoryLocation;
9253 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9254
9255 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9258 {
9259 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9260 }
9262 {
9263 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9264 }
9265
9266 }
9267
9268 player.RemoveQuickBarEntityShortcut(this);
9269 }
9270 }
9271 }
9272
9274 {
9275 super.EEKilled(killer);
9276
9279 {
9280 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9281 {
9282 if (IsMagazine())
9283 {
9284 if (Magazine.Cast(this).GetAmmoCount() > 0)
9285 {
9287 }
9288 }
9289 else
9290 {
9292 }
9293 }
9294 }
9295 }
9296
9298 {
9299 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9300
9301 super.OnWasAttached(parent, slot_id);
9302
9305
9307 }
9308
9310 {
9311 super.OnWasDetached(parent, slot_id);
9312
9315 }
9316
9318 {
9319 int idx;
9322
9323 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9324 if (inventory_slots.Count() < 1)
9325 {
9326 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9327 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9328 }
9329 else
9330 {
9331 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9332 }
9333
9334 idx = inventory_slots.Find(slot);
9335 if (idx < 0)
9336 return "";
9337
9338 return attach_types.Get(idx);
9339 }
9340
9342 {
9343 int idx = -1;
9344 string slot;
9345
9348
9349 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9350 if (inventory_slots.Count() < 1)
9351 {
9352 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9353 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9354 }
9355 else
9356 {
9357 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9358 if (detach_types.Count() < 1)
9359 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9360 }
9361
9362 for (int i = 0; i < inventory_slots.Count(); i++)
9363 {
9364 slot = inventory_slots.Get(i);
9365 }
9366
9367 if (slot != "")
9368 {
9369 if (detach_types.Count() == 1)
9370 idx = 0;
9371 else
9372 idx = inventory_slots.Find(slot);
9373 }
9374 if (idx < 0)
9375 return "";
9376
9377 return detach_types.Get(idx);
9378 }
9379
9381 {
9382
9384
9385
9386 float min_time = 1;
9387 float max_time = 3;
9388 float delay = Math.RandomFloat(min_time, max_time);
9389
9390 explode_timer.Run(delay, this, "DoAmmoExplosion");
9391 }
9392
9394 {
9395 Magazine magazine = Magazine.Cast(this);
9396 int pop_sounds_count = 6;
9397 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9398
9399
9400 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9401 string sound_name = pop_sounds[ sound_idx ];
9403
9404
9405 magazine.ServerAddAmmoCount(-1);
9406
9407
9408 float min_temp_to_explode = 100;
9409
9410 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9411 {
9413 }
9414 }
9415
9416
9417 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9418 {
9419 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9420
9421 const int CHANCE_DAMAGE_CARGO = 4;
9422 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9423 const int CHANCE_DAMAGE_NOTHING = 2;
9424
9426 {
9427 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9428 int chances;
9429 int rnd;
9430
9431 if (GetInventory().GetCargo())
9432 {
9433 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9434 rnd = Math.RandomInt(0,chances);
9435
9436 if (rnd < CHANCE_DAMAGE_CARGO)
9437 {
9439 }
9440 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9441 {
9443 }
9444 }
9445 else
9446 {
9447 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9448 rnd = Math.RandomInt(0,chances);
9449
9450 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9451 {
9453 }
9454 }
9455 }
9456 }
9457
9459 {
9460 if (GetInventory().GetCargo())
9461 {
9462 int item_count = GetInventory().GetCargo().GetItemCount();
9463 if (item_count > 0)
9464 {
9465 int random_pick = Math.RandomInt(0, item_count);
9467 if (!item.IsExplosive())
9468 {
9469 item.AddHealth("","",damage);
9470 return true;
9471 }
9472 }
9473 }
9474 return false;
9475 }
9476
9478 {
9479 int attachment_count = GetInventory().AttachmentCount();
9480 if (attachment_count > 0)
9481 {
9482 int random_pick = Math.RandomInt(0, attachment_count);
9483 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9484 if (!attachment.IsExplosive())
9485 {
9486 attachment.AddHealth("","",damage);
9487 return true;
9488 }
9489 }
9490 return false;
9491 }
9492
9494 {
9496 }
9497
9499 {
9501 return GetInventory().CanRemoveEntity();
9502
9503 return false;
9504 }
9505
9507 {
9509 return;
9510
9512 {
9513 if (ScriptInputUserData.CanStoreInputUserData())
9514 {
9515 ScriptInputUserData ctx = new ScriptInputUserData;
9520 ctx.
Write(destination_entity);
9524 }
9525 }
9526 else if (!
GetGame().IsMultiplayer())
9527 {
9529 }
9530 }
9531
9533 {
9535 return;
9536
9537 float split_quantity_new;
9541 InventoryLocation loc = new InventoryLocation;
9542
9543 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9544 {
9546 split_quantity_new = stack_max;
9547 else
9549
9550 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9551 if (new_item)
9552 {
9553 new_item.SetResultOfSplit(true);
9554 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9556 new_item.SetQuantity(split_quantity_new);
9557 }
9558 }
9559 else if (destination_entity && slot_id == -1)
9560 {
9561 if (quantity > stack_max)
9562 split_quantity_new = stack_max;
9563 else
9564 split_quantity_new = quantity;
9565
9567 {
9570 }
9571
9572 if (new_item)
9573 {
9574 new_item.SetResultOfSplit(true);
9575 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9577 new_item.SetQuantity(split_quantity_new);
9578 }
9579 }
9580 else
9581 {
9582 if (stack_max != 0)
9583 {
9585 {
9587 }
9588
9589 if (split_quantity_new == 0)
9590 {
9591 if (!
GetGame().IsMultiplayer())
9592 player.PhysicalPredictiveDropItem(this);
9593 else
9594 player.ServerDropEntity(this);
9595 return;
9596 }
9597
9599
9600 if (new_item)
9601 {
9602 new_item.SetResultOfSplit(true);
9603 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9605 new_item.SetQuantity(stack_max);
9606 new_item.PlaceOnSurface();
9607 }
9608 }
9609 }
9610 }
9611
9613 {
9615 return;
9616
9617 float split_quantity_new;
9621 InventoryLocation loc = new InventoryLocation;
9622
9623 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9624 {
9626 split_quantity_new = stack_max;
9627 else
9629
9630 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9631 if (new_item)
9632 {
9633 new_item.SetResultOfSplit(true);
9634 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9636 new_item.SetQuantity(split_quantity_new);
9637 }
9638 }
9639 else if (destination_entity && slot_id == -1)
9640 {
9641 if (quantity > stack_max)
9642 split_quantity_new = stack_max;
9643 else
9644 split_quantity_new = quantity;
9645
9647 {
9650 }
9651
9652 if (new_item)
9653 {
9654 new_item.SetResultOfSplit(true);
9655 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9657 new_item.SetQuantity(split_quantity_new);
9658 }
9659 }
9660 else
9661 {
9662 if (stack_max != 0)
9663 {
9665 {
9667 }
9668
9670
9671 if (new_item)
9672 {
9673 new_item.SetResultOfSplit(true);
9674 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9676 new_item.SetQuantity(stack_max);
9677 new_item.PlaceOnSurface();
9678 }
9679 }
9680 }
9681 }
9682
9684 {
9686 return;
9687
9689 {
9690 if (ScriptInputUserData.CanStoreInputUserData())
9691 {
9692 ScriptInputUserData ctx = new ScriptInputUserData;
9697 dst.WriteToContext(ctx);
9699 }
9700 }
9701 else if (!
GetGame().IsMultiplayer())
9702 {
9704 }
9705 }
9706
9708 {
9710 return;
9711
9713 {
9714 if (ScriptInputUserData.CanStoreInputUserData())
9715 {
9716 ScriptInputUserData ctx = new ScriptInputUserData;
9721 ctx.
Write(destination_entity);
9727 }
9728 }
9729 else if (!
GetGame().IsMultiplayer())
9730 {
9732 }
9733 }
9734
9736 {
9738 }
9739
9741 {
9743 return this;
9744
9746 float split_quantity_new;
9748 if (dst.IsValid())
9749 {
9750 int slot_id = dst.GetSlot();
9752
9753 if (quantity > stack_max)
9754 split_quantity_new = stack_max;
9755 else
9756 split_quantity_new = quantity;
9757
9759
9760 if (new_item)
9761 {
9762 new_item.SetResultOfSplit(true);
9763 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9766 }
9767
9768 return new_item;
9769 }
9770
9771 return null;
9772 }
9773
9775 {
9777 return;
9778
9780 float split_quantity_new;
9782 if (destination_entity)
9783 {
9785 if (quantity > stackable)
9786 split_quantity_new = stackable;
9787 else
9788 split_quantity_new = quantity;
9789
9790 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9791 if (new_item)
9792 {
9793 new_item.SetResultOfSplit(true);
9794 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9796 new_item.SetQuantity(split_quantity_new);
9797 }
9798 }
9799 }
9800
9802 {
9804 return;
9805
9807 {
9808 if (ScriptInputUserData.CanStoreInputUserData())
9809 {
9810 ScriptInputUserData ctx = new ScriptInputUserData;
9815 ItemBase destination_entity =
this;
9816 ctx.
Write(destination_entity);
9820 }
9821 }
9822 else if (!
GetGame().IsMultiplayer())
9823 {
9825 }
9826 }
9827
9829 {
9831 return;
9832
9834 float split_quantity_new;
9836 if (player)
9837 {
9839 if (quantity > stackable)
9840 split_quantity_new = stackable;
9841 else
9842 split_quantity_new = quantity;
9843
9844 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9845 new_item =
ItemBase.Cast(in_hands);
9846 if (new_item)
9847 {
9848 new_item.SetResultOfSplit(true);
9849 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9851 new_item.SetQuantity(split_quantity_new);
9852 }
9853 }
9854 }
9855
9857 {
9859 return;
9860
9862 float split_quantity_new = Math.Floor(quantity * 0.5);
9863
9865
9866 if (new_item)
9867 {
9868 if (new_item.GetQuantityMax() < split_quantity_new)
9869 {
9870 split_quantity_new = new_item.GetQuantityMax();
9871 }
9872
9873 new_item.SetResultOfSplit(true);
9874 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9875
9877 {
9880 }
9881 else
9882 {
9885 }
9886 }
9887 }
9888
9890 {
9892 return;
9893
9895 float split_quantity_new = Math.Floor(quantity / 2);
9896
9897 InventoryLocation invloc = new InventoryLocation;
9899
9901 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9902
9903 if (new_item)
9904 {
9905 if (new_item.GetQuantityMax() < split_quantity_new)
9906 {
9907 split_quantity_new = new_item.GetQuantityMax();
9908 }
9910 {
9913 }
9914 else
9915 {
9918 }
9919 }
9920 }
9921
9924 {
9925 SetWeightDirty();
9927
9928 if (parent)
9929 parent.OnAttachmentQuantityChangedEx(this, delta);
9930
9932 {
9934 {
9936 }
9938 {
9939 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9941 }
9942 }
9943
9944 }
9945
9948 {
9949
9950 }
9951
9954 {
9956 }
9957
9959 {
9960 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9961
9963 {
9964 if (newLevel == GameConstants.STATE_RUINED)
9965 {
9967 EntityAI parent = GetHierarchyParent();
9968 if (parent && parent.IsFireplace())
9969 {
9970 CargoBase cargo = GetInventory().GetCargo();
9971 if (cargo)
9972 {
9974 {
9976 }
9977 }
9978 }
9979 }
9980
9982 {
9983
9985 return;
9986 }
9987
9988 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9989 {
9991 }
9992 }
9993 }
9994
9995
9997 {
9998 super.OnRightClick();
9999
10001 {
10003 {
10004 if (ScriptInputUserData.CanStoreInputUserData())
10005 {
10006 vector m4[4];
10008
10009 EntityAI root = GetHierarchyRoot();
10010
10011 InventoryLocation dst = new InventoryLocation;
10013 {
10014 if (root)
10015 {
10016 root.GetTransform(m4);
10018 }
10019 else
10020 GetInventory().GetCurrentInventoryLocation(dst);
10021 }
10022 else
10023 {
10025
10026
10027 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10028 {
10029 if (root)
10030 {
10031 root.GetTransform(m4);
10033 }
10034 else
10035 GetInventory().GetCurrentInventoryLocation(dst);
10036 }
10037 else
10038 {
10039 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10040 }
10041 }
10042
10043 ScriptInputUserData ctx = new ScriptInputUserData;
10051 }
10052 }
10053 else if (!
GetGame().IsMultiplayer())
10054 {
10056 }
10057 }
10058 }
10059
10060 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10061 {
10062
10063 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10064 return false;
10065
10066 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10067 return false;
10068
10069
10071 return false;
10072
10073
10074 Magazine mag = Magazine.Cast(this);
10075 if (mag)
10076 {
10077 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10078 return false;
10079
10080 if (stack_max_limit)
10081 {
10082 Magazine other_mag = Magazine.Cast(other_item);
10083 if (other_item)
10084 {
10085 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10086 return false;
10087 }
10088
10089 }
10090 }
10091 else
10092 {
10093
10095 return false;
10096
10098 return false;
10099 }
10100
10101 PlayerBase player = null;
10102 if (CastTo(player, GetHierarchyRootPlayer()))
10103 {
10104 if (player.GetInventory().HasAttachment(this))
10105 return false;
10106
10107 if (player.IsItemsToDelete())
10108 return false;
10109 }
10110
10111 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10112 return false;
10113
10114 int slotID;
10116 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10117 return false;
10118
10119 return true;
10120 }
10121
10123 {
10125 }
10126
10128 {
10129 return m_IsResultOfSplit;
10130 }
10131
10133 {
10134 m_IsResultOfSplit = value;
10135 }
10136
10138 {
10140 }
10141
10143 {
10144 float other_item_quantity = other_item.GetQuantity();
10145 float this_free_space;
10146
10148
10150
10151 if (other_item_quantity > this_free_space)
10152 {
10153 return this_free_space;
10154 }
10155 else
10156 {
10157 return other_item_quantity;
10158 }
10159 }
10160
10162 {
10164 }
10165
10167 {
10169 return;
10170
10171 if (!IsMagazine() && other_item)
10172 {
10174 if (quantity_used != 0)
10175 {
10176 float hp1 = GetHealth01("","");
10177 float hp2 = other_item.GetHealth01("","");
10178 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10179 hpResult = hpResult / (
GetQuantity() + quantity_used);
10180
10181 hpResult *= GetMaxHealth();
10182 Math.Round(hpResult);
10183 SetHealth("", "Health", hpResult);
10184
10186 other_item.AddQuantity(-quantity_used);
10187 }
10188 }
10190 }
10191
10193 {
10194 #ifdef SERVER
10195 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10196 GetHierarchyParent().IncreaseLifetimeUp();
10197 #endif
10198 };
10199
10201 {
10202 PlayerBase p = PlayerBase.Cast(player);
10203
10204 array<int> recipesIds = p.m_Recipes;
10205 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10206 if (moduleRecipesManager)
10207 {
10208 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10209 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10210 }
10211
10212 for (int i = 0;i < recipesIds.Count(); i++)
10213 {
10214 int key = recipesIds.Get(i);
10215 string recipeName = moduleRecipesManager.GetRecipeName(key);
10217 }
10218 }
10219
10220
10221 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10222 {
10223 super.GetDebugActions(outputList);
10224
10225
10230
10231
10235
10239
10240
10243
10244
10246 {
10249 }
10250
10252
10255
10259 }
10260
10261
10262
10263
10265 {
10266 super.OnAction(action_id, player, ctx);
10267 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10268 {
10269 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10270 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10271 PlayerBase p = PlayerBase.Cast(player);
10272 if (
EActions.RECIPES_RANGE_START < 1000)
10273 {
10274 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10275 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10276 }
10277 }
10278 #ifndef SERVER
10279 else if (action_id ==
EActions.WATCH_PLAYER)
10280 {
10281 PluginDeveloper.SetDeveloperItemClientEx(player);
10282 }
10283 #endif
10285 {
10286 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10287 {
10288 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10289 OnDebugButtonPressServer(id + 1);
10290 }
10291
10292 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10293 {
10294 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10296 }
10297
10298 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10299 {
10300 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10302 }
10303
10304 else if (action_id ==
EActions.ADD_QUANTITY)
10305 {
10306 if (IsMagazine())
10307 {
10308 Magazine mag = Magazine.Cast(this);
10309 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10310 }
10311 else
10312 {
10314 }
10315
10316 if (m_EM)
10317 {
10318 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10319 }
10320
10321 }
10322
10323 else if (action_id ==
EActions.REMOVE_QUANTITY)
10324 {
10325 if (IsMagazine())
10326 {
10327 Magazine mag2 = Magazine.Cast(this);
10328 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10329 }
10330 else
10331 {
10333 }
10334 if (m_EM)
10335 {
10336 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10337 }
10338
10339 }
10340
10341 else if (action_id ==
EActions.SET_QUANTITY_0)
10342 {
10344
10345 if (m_EM)
10346 {
10347 m_EM.SetEnergy(0);
10348 }
10349 }
10350
10351 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10352 {
10354
10355 if (m_EM)
10356 {
10357 m_EM.SetEnergy(m_EM.GetEnergyMax());
10358 }
10359 }
10360
10361 else if (action_id ==
EActions.ADD_HEALTH)
10362 {
10363 AddHealth("","",GetMaxHealth("","Health")/5);
10364 }
10365 else if (action_id ==
EActions.REMOVE_HEALTH)
10366 {
10367 AddHealth("","",-GetMaxHealth("","Health")/5);
10368 }
10369 else if (action_id ==
EActions.DESTROY_HEALTH)
10370 {
10371 SetHealth01("","",0);
10372 }
10373 else if (action_id ==
EActions.WATCH_ITEM)
10374 {
10376 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10377 #ifdef DEVELOPER
10378 SetDebugDeveloper_item(this);
10379 #endif
10380 }
10381
10382 else if (action_id ==
EActions.ADD_TEMPERATURE)
10383 {
10384 AddTemperature(20);
10385
10386 }
10387
10388 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10389 {
10390 AddTemperature(-20);
10391
10392 }
10393
10394 else if (action_id ==
EActions.FLIP_FROZEN)
10395 {
10396 SetFrozen(!GetIsFrozen());
10397
10398 }
10399
10400 else if (action_id ==
EActions.ADD_WETNESS)
10401 {
10403
10404 }
10405
10406 else if (action_id ==
EActions.REMOVE_WETNESS)
10407 {
10409
10410 }
10411
10412 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10413 {
10416
10417
10418 }
10419
10420 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10421 {
10424 }
10425
10426 else if (action_id ==
EActions.MAKE_SPECIAL)
10427 {
10428 auto debugParams = DebugSpawnParams.WithPlayer(player);
10429 OnDebugSpawnEx(debugParams);
10430 }
10431
10432 else if (action_id ==
EActions.DELETE)
10433 {
10434 Delete();
10435 }
10436
10437 }
10438
10439
10440 return false;
10441 }
10442
10443
10444
10445
10449
10452
10453
10454
10456 {
10457 return false;
10458 }
10459
10460
10462 {
10463 return true;
10464 }
10465
10466
10468 {
10469 return true;
10470 }
10471
10472
10473
10475 {
10476 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10478 }
10479
10482 {
10483 return null;
10484 }
10485
10487 {
10488 return false;
10489 }
10490
10492 {
10493 return false;
10494 }
10495
10499
10500
10502 {
10503 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10504 return module_repairing.CanRepair(this, item_repair_kit);
10505 }
10506
10507
10508 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10509 {
10510 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10511 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10512 }
10513
10514
10516 {
10517
10518
10519
10520
10521
10522
10523
10524
10525 return 1;
10526 }
10527
10528
10529
10531 {
10533 }
10534
10535
10536
10538 {
10540 }
10541
10542
10551 {
10552 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10553
10554 if (player)
10555 {
10556 player.MessageStatus(text);
10557 }
10558 }
10559
10560
10569 {
10570 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10571
10572 if (player)
10573 {
10574 player.MessageAction(text);
10575 }
10576 }
10577
10578
10587 {
10588 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10589
10590 if (player)
10591 {
10592 player.MessageFriendly(text);
10593 }
10594 }
10595
10596
10605 {
10606 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10607
10608 if (player)
10609 {
10610 player.MessageImportant(text);
10611 }
10612 }
10613
10615 {
10616 return true;
10617 }
10618
10619
10620 override bool KindOf(
string tag)
10621 {
10622 bool found = false;
10623 string item_name = this.
GetType();
10626
10627 int array_size = item_tag_array.Count();
10628 for (int i = 0; i < array_size; i++)
10629 {
10630 if (item_tag_array.Get(i) == tag)
10631 {
10632 found = true;
10633 break;
10634 }
10635 }
10636 return found;
10637 }
10638
10639
10641 {
10642
10643 super.OnRPC(sender, rpc_type,ctx);
10644
10645
10646 switch (rpc_type)
10647 {
10648 #ifndef SERVER
10649 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10650 Param2<bool, string> p = new Param2<bool, string>(false, "");
10651
10653 return;
10654
10655 bool play = p.param1;
10656 string soundSet = p.param2;
10657
10658 if (play)
10659 {
10661 {
10663 {
10665 }
10666 }
10667 else
10668 {
10670 }
10671 }
10672 else
10673 {
10675 }
10676
10677 break;
10678 #endif
10679
10680 }
10681
10683 {
10685 }
10686 }
10687
10688
10689
10690
10692 {
10693 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10694 return plugin.GetID(
name);
10695 }
10696
10698 {
10699 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10700 return plugin.GetName(id);
10701 }
10702
10705 {
10706
10707
10708 int varFlags;
10709 if (!ctx.
Read(varFlags))
10710 return;
10711
10712 if (varFlags & ItemVariableFlags.FLOAT)
10713 {
10715 }
10716 }
10717
10719 {
10720
10721 super.SerializeNumericalVars(floats_out);
10722
10723
10724
10726 {
10728 }
10729
10731 {
10733 }
10734
10736 {
10738 }
10739
10741 {
10746 }
10747
10749 {
10751 }
10752 }
10753
10755 {
10756
10757 super.DeSerializeNumericalVars(floats);
10758
10759
10760 int index = 0;
10761 int mask = Math.Round(floats.Get(index));
10762
10763 index++;
10764
10766 {
10768 {
10770 }
10771 else
10772 {
10773 float quantity = floats.Get(index);
10774 SetQuantity(quantity,
true,
false,
false,
false);
10775 }
10776 index++;
10777 }
10778
10780 {
10781 float wet = floats.Get(index);
10783 index++;
10784 }
10785
10787 {
10788 int liquidtype = Math.Round(floats.Get(index));
10790 index++;
10791 }
10792
10794 {
10796 index++;
10798 index++;
10800 index++;
10802 index++;
10803 }
10804
10806 {
10807 int cleanness = Math.Round(floats.Get(index));
10809 index++;
10810 }
10811 }
10812
10814 {
10815 super.WriteVarsToCTX(ctx);
10816
10817
10819 {
10821 }
10822
10824 {
10826 }
10827
10829 {
10831 }
10832
10834 {
10835 int r,g,b,a;
10841 }
10842
10844 {
10846 }
10847 }
10848
10850 {
10851 if (!super.ReadVarsFromCTX(ctx,version))
10852 return false;
10853
10854 int intValue;
10855 float value;
10856
10857 if (version < 140)
10858 {
10859 if (!ctx.
Read(intValue))
10860 return false;
10861
10862 m_VariablesMask = intValue;
10863 }
10864
10866 {
10867 if (!ctx.
Read(value))
10868 return false;
10869
10871 {
10873 }
10874 else
10875 {
10877 }
10878 }
10879
10880 if (version < 140)
10881 {
10883 {
10884 if (!ctx.
Read(value))
10885 return false;
10886 SetTemperatureDirect(value);
10887 }
10888 }
10889
10891 {
10892 if (!ctx.
Read(value))
10893 return false;
10895 }
10896
10898 {
10899 if (!ctx.
Read(intValue))
10900 return false;
10902 }
10903
10905 {
10906 int r,g,b,a;
10908 return false;
10910 return false;
10912 return false;
10914 return false;
10915
10917 }
10918
10920 {
10921 if (!ctx.
Read(intValue))
10922 return false;
10924 }
10925
10926 if (version >= 138 && version < 140)
10927 {
10929 {
10930 if (!ctx.
Read(intValue))
10931 return false;
10932 SetFrozen(intValue);
10933 }
10934 }
10935
10936 return true;
10937 }
10938
10939
10941 {
10944 {
10946 }
10947
10948 if (!super.OnStoreLoad(ctx, version))
10949 {
10951 return false;
10952 }
10953
10954 if (version >= 114)
10955 {
10956 bool hasQuickBarIndexSaved;
10957
10958 if (!ctx.
Read(hasQuickBarIndexSaved))
10959 {
10961 return false;
10962 }
10963
10964 if (hasQuickBarIndexSaved)
10965 {
10966 int itmQBIndex;
10967
10968
10969 if (!ctx.
Read(itmQBIndex))
10970 {
10972 return false;
10973 }
10974
10975 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10976 if (itmQBIndex != -1 && parentPlayer)
10977 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10978 }
10979 }
10980 else
10981 {
10982
10983 PlayerBase player;
10984 int itemQBIndex;
10985 if (version ==
int.
MAX)
10986 {
10987 if (!ctx.
Read(itemQBIndex))
10988 {
10990 return false;
10991 }
10992 }
10993 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10994 {
10995
10996 if (!ctx.
Read(itemQBIndex))
10997 {
10999 return false;
11000 }
11001 if (itemQBIndex != -1 && player)
11002 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11003 }
11004 }
11005
11006 if (version < 140)
11007 {
11008
11009 if (!LoadVariables(ctx, version))
11010 {
11012 return false;
11013 }
11014 }
11015
11016
11018 {
11020 return false;
11021 }
11022 if (version >= 132)
11023 {
11025 if (raib)
11026 {
11028 {
11030 return false;
11031 }
11032 }
11033 }
11034
11036 return true;
11037 }
11038
11039
11040
11042 {
11043 super.OnStoreSave(ctx);
11044
11045 PlayerBase player;
11046 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11047 {
11049
11050 int itemQBIndex = -1;
11051 itemQBIndex = player.FindQuickBarEntityIndex(this);
11052 ctx.
Write(itemQBIndex);
11053 }
11054 else
11055 {
11057 }
11058
11060
11062 if (raib)
11063 {
11065 }
11066 }
11067
11068
11070 {
11071 super.AfterStoreLoad();
11072
11074 {
11076 }
11077
11079 {
11082 }
11083 }
11084
11086 {
11087 super.EEOnAfterLoad();
11088
11090 {
11092 }
11093
11096 }
11097
11099 {
11100 return false;
11101 }
11102
11103
11104
11106 {
11108 {
11109 #ifdef PLATFORM_CONSOLE
11110
11112 {
11114 if (menu)
11115 {
11117 }
11118 }
11119 #endif
11120 }
11121
11123 {
11126 }
11127
11129 {
11130 SetWeightDirty();
11132 }
11134 {
11137 }
11138
11140 {
11143 }
11145 {
11148 }
11149
11150 super.OnVariablesSynchronized();
11151 }
11152
11153
11154
11156 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11157 {
11158 if (!IsServerCheck(allow_client))
11159 return false;
11160
11162 return false;
11163
11166
11167 if (value <= (min + 0.001))
11168 value = min;
11169
11170 if (value == min)
11171 {
11172 if (destroy_config)
11173 {
11174 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11175 if (dstr)
11176 {
11178 this.Delete();
11179 return true;
11180 }
11181 }
11182 else if (destroy_forced)
11183 {
11185 this.Delete();
11186 return true;
11187 }
11188
11190 }
11191
11194
11196 {
11198
11199 if (delta)
11201 }
11202
11204
11205 return false;
11206 }
11207
11208
11210 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11211 {
11213 }
11214
11216 {
11219 }
11220
11222 {
11225 }
11226
11229 {
11230 float value_clamped = Math.Clamp(value, 0, 1);
11232 SetQuantity(result, destroy_config, destroy_forced);
11233 }
11234
11235
11238 {
11240 }
11241
11243 {
11245 }
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11257 {
11258 int slot = -1;
11259 if (GetInventory())
11260 {
11261 InventoryLocation il = new InventoryLocation;
11262 GetInventory().GetCurrentInventoryLocation(il);
11264 }
11265
11267 }
11268
11270 {
11271 float quantity_max = 0;
11272
11274 {
11275 if (attSlotID != -1)
11276 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11277
11278 if (quantity_max <= 0)
11280 }
11281
11282 if (quantity_max <= 0)
11284
11285 return quantity_max;
11286 }
11287
11289 {
11291 }
11292
11294 {
11296 }
11297
11298
11300 {
11302 }
11303
11305 {
11307 }
11308
11310 {
11312 }
11313
11314
11316 {
11317
11318 float weightEx = GetWeightEx();
11319 float special = GetInventoryAndCargoWeight();
11320 return weightEx - special;
11321 }
11322
11323
11325 {
11327 }
11328
11330 {
11332 {
11333 #ifdef DEVELOPER
11334 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11335 {
11336 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11338 }
11339 #endif
11340
11341 return GetQuantity() * GetConfigWeightModified();
11342 }
11343 else if (HasEnergyManager())
11344 {
11345 #ifdef DEVELOPER
11346 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11347 {
11348 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11349 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11350 }
11351 #endif
11352 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11353 }
11354 else
11355 {
11356 #ifdef DEVELOPER
11357 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11358 {
11359 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11360 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11361 }
11362 #endif
11363 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11364 }
11365 }
11366
11369 {
11370 int item_count = 0;
11372
11373 if (GetInventory().GetCargo() != NULL)
11374 {
11375 item_count = GetInventory().GetCargo().GetItemCount();
11376 }
11377
11378 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11379 {
11380 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11381 if (item)
11382 item_count += item.GetNumberOfItems();
11383 }
11384 return item_count;
11385 }
11386
11389 {
11390 float weight = 0;
11391 float wetness = 1;
11392 if (include_wetness)
11395 {
11396 weight = wetness * m_ConfigWeight;
11397 }
11399 {
11400 weight = 1;
11401 }
11402 return weight;
11403 }
11404
11405
11406
11408 {
11409 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11410 {
11411 GameInventory inv = GetInventory();
11412 array<EntityAI> items = new array<EntityAI>;
11414 for (int i = 0; i < items.Count(); i++)
11415 {
11417 if (item)
11418 {
11420 }
11421 }
11422 }
11423 }
11424
11425
11426
11427
11429 {
11430 float energy = 0;
11431 if (HasEnergyManager())
11432 {
11433 energy = GetCompEM().GetEnergy();
11434 }
11435 return energy;
11436 }
11437
11438
11440 {
11441 super.OnEnergyConsumed();
11442
11444 }
11445
11447 {
11448 super.OnEnergyAdded();
11449
11451 }
11452
11453
11455 {
11456 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11457 {
11459 {
11460 float energy_0to1 = GetCompEM().GetEnergy0To1();
11462 }
11463 }
11464 }
11465
11466
11468 {
11469 return ConfigGetFloat("heatIsolation");
11470 }
11471
11473 {
11475 }
11476
11478 {
11479 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11480 if (
GetGame().ConfigIsExisting(paramPath))
11482
11483 return 0.0;
11484 }
11485
11487 {
11488 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11489 if (
GetGame().ConfigIsExisting(paramPath))
11491
11492 return 0.0;
11493 }
11494
11495 override void SetWet(
float value,
bool allow_client =
false)
11496 {
11497 if (!IsServerCheck(allow_client))
11498 return;
11499
11502
11504
11505 m_VarWet = Math.Clamp(value, min, max);
11506
11508 {
11511 }
11512 }
11513
11514 override void AddWet(
float value)
11515 {
11517 }
11518
11520 {
11522 }
11523
11525 {
11527 }
11528
11530 {
11532 }
11533
11535 {
11537 }
11538
11540 {
11542 }
11543
11544 override void OnWetChanged(
float newVal,
float oldVal)
11545 {
11548 if (newLevel != oldLevel)
11549 {
11551 }
11552 }
11553
11555 {
11556 SetWeightDirty();
11557 }
11558
11560 {
11561 return GetWetLevelInternal(
m_VarWet);
11562 }
11563
11564
11565
11567 {
11569 }
11570
11572 {
11574 }
11575
11577 {
11579 }
11580
11582 {
11584 }
11585
11586
11587
11589 {
11590 if (ConfigIsExisting("itemModelLength"))
11591 {
11592 return ConfigGetFloat("itemModelLength");
11593 }
11594 return 0;
11595 }
11596
11598 {
11599 if (ConfigIsExisting("itemAttachOffset"))
11600 {
11601 return ConfigGetFloat("itemAttachOffset");
11602 }
11603 return 0;
11604 }
11605
11606 override void SetCleanness(
int value,
bool allow_client =
false)
11607 {
11608 if (!IsServerCheck(allow_client))
11609 return;
11610
11612
11614
11617 }
11618
11620 {
11622 }
11623
11625 {
11626 return true;
11627 }
11628
11629
11630
11631
11633 {
11635 }
11636
11638 {
11640 }
11641
11642
11643
11644
11645 override void SetColor(
int r,
int g,
int b,
int a)
11646 {
11652 }
11654 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11655 {
11660 }
11661
11663 {
11665 }
11666
11669 {
11670 int r,g,b,a;
11672 r = r/255;
11673 g = g/255;
11674 b = b/255;
11675 a = a/255;
11676 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11677 }
11678
11679
11680
11681 override void SetLiquidType(
int value,
bool allow_client =
false)
11682 {
11683 if (!IsServerCheck(allow_client))
11684 return;
11685
11690 }
11691
11693 {
11694 return ConfigGetInt("varLiquidTypeInit");
11695 }
11696
11698 {
11700 }
11701
11703 {
11705 SetFrozen(false);
11706 }
11707
11710 {
11711 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11712 }
11713
11714
11717 {
11718 PlayerBase nplayer;
11719 if (PlayerBase.CastTo(nplayer, player))
11720 {
11722
11723 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11724 }
11725 }
11726
11727
11730 {
11731 PlayerBase nplayer;
11732 if (PlayerBase.CastTo(nplayer,player))
11733 {
11734
11735 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11736
11737 }
11738
11739
11740 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11741
11742
11743 if (HasEnergyManager())
11744 {
11745 GetCompEM().UpdatePlugState();
11746 }
11747 }
11748
11749
11751 {
11752 super.OnPlacementStarted(player);
11753
11755 }
11756
11757 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11758 {
11760 {
11761 m_AdminLog.OnPlacementComplete(player,
this);
11762 }
11763
11764 super.OnPlacementComplete(player, position, orientation);
11765 }
11766
11767
11768
11769
11770
11772 {
11774 {
11775 return true;
11776 }
11777 else
11778 {
11779 return false;
11780 }
11781 }
11782
11783
11785 {
11787 {
11789 }
11790 }
11791
11792
11794 {
11796 }
11797
11799 {
11801 }
11802
11803 override void InsertAgent(
int agent,
float count = 1)
11804 {
11805 if (count < 1)
11806 return;
11807
11809 }
11810
11813 {
11815 }
11816
11817
11819 {
11821 }
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11865 {
11867 return false;
11868 return true;
11869 }
11870
11872 {
11873
11875 }
11876
11877
11880 {
11881 super.CheckForRoofLimited(timeTresholdMS);
11882
11884 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11885 {
11886 m_PreviousRoofTestTime = time;
11887 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11888 }
11889 }
11890
11891
11893 {
11895 {
11896 return 0;
11897 }
11898
11899 if (GetInventory().GetAttachmentSlotsCount() != 0)
11900 {
11901 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11902 if (filter)
11903 return filter.GetProtectionLevel(type, false, system);
11904 else
11905 return 0;
11906 }
11907
11908 string subclassPath, entryName;
11909
11910 switch (type)
11911 {
11913 entryName = "biological";
11914 break;
11916 entryName = "chemical";
11917 break;
11918 default:
11919 entryName = "biological";
11920 break;
11921 }
11922
11923 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11924
11926 }
11927
11928
11929
11932 {
11933 if (!IsMagazine())
11935
11937 }
11938
11939
11940
11941
11942
11947 {
11948 return true;
11949 }
11950
11952 {
11954 }
11955
11956
11957
11958
11959
11961 {
11962 if (parent)
11963 {
11964 if (parent.IsInherited(DayZInfected))
11965 return true;
11966
11967 if (!parent.IsRuined())
11968 return true;
11969 }
11970
11971 return true;
11972 }
11973
11975 {
11976 if (!super.CanPutAsAttachment(parent))
11977 {
11978 return false;
11979 }
11980
11981 if (!IsRuined() && !parent.IsRuined())
11982 {
11983 return true;
11984 }
11985
11986 return false;
11987 }
11988
11990 {
11991
11992
11993
11994
11995 return super.CanReceiveItemIntoCargo(item);
11996 }
11997
11999 {
12000
12001
12002
12003
12004 GameInventory attachmentInv = attachment.GetInventory();
12006 {
12007 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12008 return false;
12009 }
12010
12011 InventoryLocation loc = new InventoryLocation();
12012 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12013 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12014 return false;
12015
12016 return super.CanReceiveAttachment(attachment, slotId);
12017 }
12018
12020 {
12021 if (!super.CanReleaseAttachment(attachment))
12022 return false;
12023
12024 return GetInventory().AreChildrenAccessible();
12025 }
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12048 {
12049 int id = muzzle_owner.GetMuzzleID();
12050 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12051
12052 if (WPOF_array)
12053 {
12054 for (int i = 0; i < WPOF_array.Count(); i++)
12055 {
12056 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12057
12058 if (WPOF)
12059 {
12060 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12061 }
12062 }
12063 }
12064 }
12065
12066
12068 {
12069 int id = muzzle_owner.GetMuzzleID();
12071
12072 if (WPOBE_array)
12073 {
12074 for (int i = 0; i < WPOBE_array.Count(); i++)
12075 {
12076 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12077
12078 if (WPOBE)
12079 {
12080 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12081 }
12082 }
12083 }
12084 }
12085
12086
12088 {
12089 int id = muzzle_owner.GetMuzzleID();
12090 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12091
12092 if (WPOOH_array)
12093 {
12094 for (int i = 0; i < WPOOH_array.Count(); i++)
12095 {
12096 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12097
12098 if (WPOOH)
12099 {
12100 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12101 }
12102 }
12103 }
12104 }
12105
12106
12108 {
12109 int id = muzzle_owner.GetMuzzleID();
12110 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12111
12112 if (WPOOH_array)
12113 {
12114 for (int i = 0; i < WPOOH_array.Count(); i++)
12115 {
12116 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12117
12118 if (WPOOH)
12119 {
12120 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12121 }
12122 }
12123 }
12124 }
12125
12126
12128 {
12129 int id = muzzle_owner.GetMuzzleID();
12130 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12131
12132 if (WPOOH_array)
12133 {
12134 for (int i = 0; i < WPOOH_array.Count(); i++)
12135 {
12136 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12137
12138 if (WPOOH)
12139 {
12140 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12141 }
12142 }
12143 }
12144 }
12145
12146
12147
12149 {
12151 {
12152 return true;
12153 }
12154
12155 return false;
12156 }
12157
12159 {
12161 {
12162 return true;
12163 }
12164
12165 return false;
12166 }
12167
12169 {
12171 {
12172 return true;
12173 }
12174
12175 return false;
12176 }
12177
12179 {
12180 return false;
12181 }
12182
12185 {
12186 return UATimeSpent.DEFAULT_DEPLOY;
12187 }
12188
12189
12190
12191
12193 {
12195 SetSynchDirty();
12196 }
12197
12199 {
12201 }
12202
12203
12205 {
12206 return false;
12207 }
12208
12211 {
12212 string att_type = "None";
12213
12214 if (ConfigIsExisting("soundAttType"))
12215 {
12216 att_type = ConfigGetString("soundAttType");
12217 }
12218
12220 }
12221
12223 {
12225 }
12226
12227
12228
12229
12230
12234
12236 {
12239
12241 }
12242
12243
12245 {
12247 return;
12248
12250
12253
12256
12257 SoundParameters params = new SoundParameters();
12261 }
12262
12263
12265 {
12267 return;
12268
12270 SetSynchDirty();
12271
12274 }
12275
12276
12278 {
12280 return;
12281
12283 SetSynchDirty();
12284
12287 }
12288
12290 {
12292 }
12293
12295 {
12297 }
12298
12301 {
12302 if (!
GetGame().IsDedicatedServer())
12303 {
12304 if (ConfigIsExisting("attachSoundSet"))
12305 {
12306 string cfg_path = "";
12307 string soundset = "";
12308 string type_name =
GetType();
12309
12312 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12313 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12314
12315 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12316 {
12317 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12318 {
12319 if (cfg_slot_array[i] == slot_type)
12320 {
12321 soundset = cfg_soundset_array[i];
12322 break;
12323 }
12324 }
12325 }
12326
12327 if (soundset != "")
12328 {
12329 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12331 }
12332 }
12333 }
12334 }
12335
12337 {
12338
12339 }
12340
12341 void OnApply(PlayerBase player);
12342
12344 {
12345 return 1.0;
12346 };
12347
12349 {
12351 }
12352
12354 {
12356 }
12357
12359
12361 {
12362 SetDynamicPhysicsLifeTime(0.01);
12364 }
12365
12367 {
12368 array<string> zone_names = new array<string>;
12369 GetDamageZones(zone_names);
12370 for (int i = 0; i < zone_names.Count(); i++)
12371 {
12372 SetHealthMax(zone_names.Get(i),"Health");
12373 }
12374 SetHealthMax("","Health");
12375 }
12376
12379 {
12380 float global_health = GetHealth01("","Health");
12381 array<string> zones = new array<string>;
12382 GetDamageZones(zones);
12383
12384 for (int i = 0; i < zones.Count(); i++)
12385 {
12386 SetHealth01(zones.Get(i),"Health",global_health);
12387 }
12388 }
12389
12392 {
12393 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12394 }
12395
12397 {
12398 if (!hasRootAsPlayer)
12399 {
12400 if (refParentIB)
12401 {
12402
12403 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12404 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12405
12406 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12407 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12408
12411 }
12412 else
12413 {
12414
12417 }
12418 }
12419 }
12420
12422 {
12424 {
12425 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12426 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12427 {
12428 float heatPermCoef = 1.0;
12430 while (ent)
12431 {
12432 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12433 ent = ent.GetHierarchyParent();
12434 }
12435
12436 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12437 }
12438 }
12439 }
12440
12442 {
12443
12444 EntityAI parent = GetHierarchyParent();
12445 if (!parent)
12446 {
12447 hasParent = false;
12448 hasRootAsPlayer = false;
12449 }
12450 else
12451 {
12452 hasParent = true;
12453 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12454 refParentIB =
ItemBase.Cast(parent);
12455 }
12456 }
12457
12458 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12459 {
12460
12461 }
12462
12464 {
12465
12466 return false;
12467 }
12468
12470 {
12471
12472
12473 return false;
12474 }
12475
12477 {
12478
12479 return false;
12480 }
12481
12484 {
12485 return !GetIsFrozen() &&
IsOpen();
12486 }
12487
12489 {
12490 bool hasParent = false, hasRootAsPlayer = false;
12492
12493 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12494 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12495
12496 if (wwtu || foodDecay)
12497 {
12501
12502 if (processWetness || processTemperature || processDecay)
12503 {
12505
12506 if (processWetness)
12507 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12508
12509 if (processTemperature)
12511
12512 if (processDecay)
12513 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12514 }
12515 }
12516 }
12517
12520 {
12522 }
12523
12525 {
12528
12529 return super.GetTemperatureFreezeThreshold();
12530 }
12531
12533 {
12536
12537 return super.GetTemperatureThawThreshold();
12538 }
12539
12541 {
12544
12545 return super.GetItemOverheatThreshold();
12546 }
12547
12549 {
12551 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12552
12553 return super.GetTemperatureFreezeTime();
12554 }
12555
12557 {
12559 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12560
12561 return super.GetTemperatureThawTime();
12562 }
12563
12568
12570 {
12571 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12572 }
12573
12575 {
12576 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12577 }
12578
12581 {
12583 }
12584
12586 {
12588 }
12589
12591 {
12593 }
12594
12597 {
12598 return null;
12599 }
12600
12603 {
12604 return false;
12605 }
12606
12608 {
12610 {
12613 if (!trg)
12614 {
12616 explosive = this;
12617 }
12618
12619 explosive.PairRemote(trg);
12621
12622 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12623 trg.SetPersistentPairID(persistentID);
12624 explosive.SetPersistentPairID(persistentID);
12625
12626 return true;
12627 }
12628 return false;
12629 }
12630
12633 {
12634 float ret = 1.0;
12637 ret *= GetHealth01();
12638
12639 return ret;
12640 }
12641
12642 #ifdef DEVELOPER
12643 override void SetDebugItem()
12644 {
12645 super.SetDebugItem();
12646 _itemBase = this;
12647 }
12648
12650 {
12651 string text = super.GetDebugText();
12652
12654 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12655
12656 return text;
12657 }
12658 #endif
12659
12661 {
12662 return true;
12663 }
12664
12666
12668
12670 {
12673 }
12674
12675
12683
12699}
12700
12702{
12704 if (entity)
12705 {
12706 bool is_item = entity.IsInherited(
ItemBase);
12707 if (is_item && full_quantity)
12708 {
12711 }
12712 }
12713 else
12714 {
12716 return NULL;
12717 }
12718 return entity;
12719}
12720
12722{
12723 if (item)
12724 {
12725 if (health > 0)
12726 item.SetHealth("", "", health);
12727
12728 if (item.CanHaveTemperature())
12729 {
12731 if (item.CanFreeze())
12732 item.SetFrozen(false);
12733 }
12734
12735 if (item.HasEnergyManager())
12736 {
12737 if (quantity >= 0)
12738 {
12739 item.GetCompEM().SetEnergy0To1(quantity);
12740 }
12741 else
12742 {
12744 }
12745 }
12746 else if (item.IsMagazine())
12747 {
12748 Magazine mag = Magazine.Cast(item);
12749 if (quantity >= 0)
12750 {
12751 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12752 }
12753 else
12754 {
12756 }
12757
12758 }
12759 else
12760 {
12761 if (quantity >= 0)
12762 {
12763 item.SetQuantityNormalized(quantity, false);
12764 }
12765 else
12766 {
12768 }
12769
12770 }
12771 }
12772}
12773
12774#ifdef DEVELOPER
12776#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.