7936{
7938 {
7939 return true;
7940 }
7941};
7942
7943
7944
7946{
7950
7952
7955
7956
7957
7958
7959
7968
7974
7979
7984
8005 protected bool m_IsResultOfSplit
8006
8008
8013
8014
8015
8017
8021
8022
8023
8025
8028
8029
8030
8036
8037
8045
8048
8049
8051
8052
8054
8055
8060
8061
8066
8067
8069
8070
8072 {
8077
8078 if (!
GetGame().IsDedicatedServer())
8079 {
8081 {
8083
8085 {
8087 }
8088 }
8089
8092 }
8093
8094 m_OldLocation = null;
8095
8097 {
8099 }
8100
8101 if (ConfigIsExisting("headSelectionsToHide"))
8102 {
8105 }
8106
8108 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8109 {
8111 }
8112
8114
8115 m_IsResultOfSplit = false;
8116
8118 }
8119
8121 {
8122 super.InitItemVariables();
8123
8129 m_Count = ConfigGetInt(
"count");
8130
8133
8138
8141
8146
8158
8162
8163
8166 if (ConfigIsExisting("canBeSplit"))
8167 {
8170 }
8171
8173 if (ConfigIsExisting("itemBehaviour"))
8175
8176
8179 RegisterNetSyncVariableInt("m_VarLiquidType");
8180 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8181
8182 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8183 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8184 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8185
8186 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8187 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8188 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8189 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8190
8191 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8192 RegisterNetSyncVariableBool("m_IsTakeable");
8193 RegisterNetSyncVariableBool("m_IsHologram");
8194
8197 {
8200 }
8201
8203
8205 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8207
8208 }
8209
8211 {
8213 }
8214
8216 {
8219 {
8224 }
8225 }
8226
8227 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8228 {
8230 {
8233 }
8234
8236 }
8237
8239 {
8245 }
8246
8248
8250 {
8252
8253 if (!action)
8254 {
8255 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8256 return;
8257 }
8258
8260 if (!ai)
8261 {
8263 return;
8264 }
8265
8267 if (!action_array)
8268 {
8269 action_array = new array<ActionBase_Basic>;
8271 }
8272 if (LogManager.IsActionLogEnable())
8273 {
8274 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8275 }
8276
8277 if (action_array.Find(action) != -1)
8278 {
8279 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8280 }
8281 else
8282 {
8283 action_array.Insert(action);
8284 }
8285 }
8286
8288 {
8290 ActionBase action = player.GetActionManager().GetAction(actionName);
8293
8294 if (action_array)
8295 {
8296 action_array.RemoveItem(action);
8297 }
8298 }
8299
8300
8301
8303 {
8304 ActionOverrideData overrideData = new ActionOverrideData();
8308
8310 if (!actionMap)
8311 {
8314 }
8315
8316 actionMap.Insert(this.
Type(), overrideData);
8317
8318 }
8319
8321
8323
8324
8326 {
8329
8332
8333 string config_to_search = "CfgVehicles";
8334 string muzzle_owner_config;
8335
8337 {
8338 if (IsInherited(Weapon))
8339 config_to_search = "CfgWeapons";
8340
8341 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8342
8343 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8344
8346
8347 if (config_OnFire_subclass_count > 0)
8348 {
8349 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8350
8351 for (int i = 0; i < config_OnFire_subclass_count; i++)
8352 {
8353 string particle_class = "";
8355 string config_OnFire_entry = config_OnFire_class + particle_class;
8356 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8357 WPOF_array.Insert(WPOF);
8358 }
8359
8360
8362 }
8363 }
8364
8366 {
8367 config_to_search = "CfgWeapons";
8368 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8369
8370 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8371
8373
8374 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8375 {
8376 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8377
8378 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8379 {
8380 string particle_class2 = "";
8382 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8383 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8384 WPOBE_array.Insert(WPOBE);
8385 }
8386
8387
8389 }
8390 }
8391 }
8392
8393
8395 {
8398
8400 {
8401 string config_to_search = "CfgVehicles";
8402
8403 if (IsInherited(Weapon))
8404 config_to_search = "CfgWeapons";
8405
8406 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8407 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8408
8409 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8410 {
8411
8413
8415 {
8417 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8419 return;
8420 }
8421
8424
8425
8426
8428 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8429
8430 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8431 {
8432 string particle_class = "";
8434 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8436
8437 if (entry_type == CT_CLASS)
8438 {
8439 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8440 WPOOH_array.Insert(WPOF);
8441 }
8442 }
8443
8444
8446 }
8447 }
8448 }
8449
8451 {
8453 }
8454
8456 {
8458 {
8460
8463
8466
8467 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8468 }
8469 }
8470
8472 {
8474 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8475
8477 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8478
8480 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8481
8483 {
8485 }
8486 }
8487
8489 {
8491 }
8492
8494 {
8497 else
8499
8501 {
8504 }
8505 else
8506 {
8509
8512 }
8513
8515 }
8516
8518 {
8520 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8521 }
8522
8524 {
8526 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8528 }
8529
8531 {
8533 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8534 }
8535
8537 {
8540
8541 OverheatingParticle OP = new OverheatingParticle();
8546
8548 }
8549
8551 {
8554
8555 return -1;
8556 }
8557
8559 {
8561 {
8564
8565 for (int i = count; i > 0; --i)
8566 {
8567 int id = i - 1;
8570
8573
8574 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8575 {
8576 if (p)
8577 {
8580 }
8581 }
8582 }
8583 }
8584 }
8585
8587 {
8589 {
8591 {
8592 int id = i - 1;
8594
8595 if (OP)
8596 {
8598
8599 if (p)
8600 {
8602 }
8603
8604 delete OP;
8605 }
8606 }
8607
8610 }
8611 }
8612
8615 {
8616 return 0.0;
8617 }
8618
8619
8621 {
8622 return 250;
8623 }
8624
8626 {
8627 return 0;
8628 }
8629
8632 {
8634 return true;
8635
8636 return false;
8637 }
8638
8641 {
8644
8646 {
8648 }
8649 else
8650 {
8651
8653 }
8654
8656 }
8657
8664 {
8665 return -1;
8666 }
8667
8668
8669
8670
8672 {
8674 {
8676 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8677
8678 if (r_index >= 0)
8679 {
8680 InventoryLocation r_il = new InventoryLocation;
8681 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8682
8683 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8686 {
8687 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8688 }
8690 {
8691 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8692 }
8693
8694 }
8695
8696 player.GetHumanInventory().ClearUserReservedLocation(this);
8697 }
8698
8701 }
8702
8703
8704
8705
8707 {
8708 return ItemBase.m_DebugActionsMask;
8709 }
8710
8712 {
8713 return ItemBase.m_DebugActionsMask & mask;
8714 }
8715
8717 {
8718 ItemBase.m_DebugActionsMask = mask;
8719 }
8720
8722 {
8723 ItemBase.m_DebugActionsMask |= mask;
8724 }
8725
8727 {
8728 ItemBase.m_DebugActionsMask &= ~mask;
8729 }
8730
8732 {
8734 {
8736 }
8737 else
8738 {
8740 }
8741 }
8742
8743
8745 {
8746 if (GetEconomyProfile())
8747 {
8748 float q_max = GetEconomyProfile().GetQuantityMax();
8749 if (q_max > 0)
8750 {
8751 float q_min = GetEconomyProfile().GetQuantityMin();
8752 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8753
8755 {
8756 ComponentEnergyManager comp = GetCompEM();
8758 {
8760 }
8761 }
8763 {
8765
8766 }
8767
8768 }
8769 }
8770 }
8771
8774 {
8775 EntityAI parent = GetHierarchyParent();
8776
8777 if (parent)
8778 {
8779 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8780 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8781 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8782 }
8783 }
8784
8787 {
8788 EntityAI parent = GetHierarchyParent();
8789
8790 if (parent)
8791 {
8792 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8793 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8794 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8795 }
8796 }
8797
8799 {
8800
8801
8802
8803
8805
8807 {
8808 if (ScriptInputUserData.CanStoreInputUserData())
8809 {
8810 ScriptInputUserData ctx = new ScriptInputUserData;
8816 ctx.
Write(use_stack_max);
8819
8821 {
8822 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8823 }
8824 }
8825 }
8826 else if (!
GetGame().IsMultiplayer())
8827 {
8829 }
8830 }
8831
8833 {
8835 }
8836
8838 {
8840 }
8841
8843 {
8845 }
8846
8848 {
8849
8850 return false;
8851 }
8852
8854 {
8855 return false;
8856 }
8857
8861 {
8862 return false;
8863 }
8864
8866 {
8867 return "";
8868 }
8869
8871
8873 {
8874 return false;
8875 }
8876
8878 {
8879 return true;
8880 }
8881
8882
8883
8885 {
8886 return true;
8887 }
8888
8890 {
8891 return true;
8892 }
8893
8895 {
8896 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8898 }
8899
8901 {
8903 }
8904
8906 {
8908 if (!is_being_placed)
8910 SetSynchDirty();
8911 }
8912
8913
8915
8917 {
8919 }
8920
8922 {
8924 }
8925
8927 {
8928 return 1;
8929 }
8930
8932 {
8933 return false;
8934 }
8935
8937 {
8939 SetSynchDirty();
8940 }
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8977 {
8978 super.OnMovedInsideCargo(container);
8979
8980 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8981 }
8982
8983 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8984 {
8985 super.EEItemLocationChanged(oldLoc,newLoc);
8986
8987 PlayerBase new_player = null;
8988 PlayerBase old_player = null;
8989
8990 if (newLoc.GetParent())
8991 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8992
8993 if (oldLoc.GetParent())
8994 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8995
8997 {
8998 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8999
9000 if (r_index >= 0)
9001 {
9002 InventoryLocation r_il = new InventoryLocation;
9003 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9004
9005 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9008 {
9009 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9010 }
9012 {
9013 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9014 }
9015
9016 }
9017 }
9018
9020 {
9021 if (new_player)
9022 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9023
9024 if (new_player == old_player)
9025 {
9026
9027 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9028 {
9030 {
9031 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9032 {
9033 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9034 }
9035 }
9036 else
9037 {
9038 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9039 }
9040 }
9041
9042 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9043 {
9044 int type = oldLoc.GetType();
9046 {
9047 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9048 }
9050 {
9051 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9052 }
9053 }
9054 if (!m_OldLocation)
9055 {
9056 m_OldLocation = new InventoryLocation;
9057 }
9058 m_OldLocation.Copy(oldLoc);
9059 }
9060 else
9061 {
9062 if (m_OldLocation)
9063 {
9064 m_OldLocation.Reset();
9065 }
9066 }
9067
9069 }
9070 else
9071 {
9072 if (new_player)
9073 {
9074 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9075 if (res_index >= 0)
9076 {
9077 InventoryLocation il = new InventoryLocation;
9078 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9080 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9083 {
9084 il.
GetParent().GetOnReleaseLock().Invoke(it);
9085 }
9087 {
9089 }
9090
9091 }
9092 }
9094 {
9095
9097 }
9098
9099 if (m_OldLocation)
9100 {
9101 m_OldLocation.Reset();
9102 }
9103 }
9104 }
9105
9106 override void EOnContact(IEntity other, Contact extra)
9107 {
9109 {
9110 int liquidType = -1;
9112 if (impactSpeed > 0.0)
9113 {
9115 #ifndef SERVER
9117 #else
9119 SetSynchDirty();
9120 #endif
9122 }
9123 }
9124
9125 #ifdef SERVER
9126 if (GetCompEM() && GetCompEM().IsPlugged())
9127 {
9128 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9129 GetCompEM().UnplugThis();
9130 }
9131 #endif
9132 }
9133
9135
9137 {
9139 }
9140
9142 {
9143
9144 }
9145
9147 {
9148 super.OnItemLocationChanged(old_owner, new_owner);
9149
9150 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9151 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9152
9153 if (!relatedPlayer && playerNew)
9154 relatedPlayer = playerNew;
9155
9156 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9157 {
9159 if (actionMgr)
9160 {
9161 ActionBase currentAction = actionMgr.GetRunningAction();
9162 if (currentAction)
9164 }
9165 }
9166
9167 Man ownerPlayerOld = null;
9168 Man ownerPlayerNew = null;
9169
9170 if (old_owner)
9171 {
9172 if (old_owner.
IsMan())
9173 {
9174 ownerPlayerOld = Man.Cast(old_owner);
9175 }
9176 else
9177 {
9178 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9179 }
9180 }
9181 else
9182 {
9184 {
9186
9187 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9188 {
9189 GetCompEM().UnplugThis();
9190 }
9191 }
9192 }
9193
9194 if (new_owner)
9195 {
9196 if (new_owner.
IsMan())
9197 {
9198 ownerPlayerNew = Man.Cast(new_owner);
9199 }
9200 else
9201 {
9202 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9203 }
9204 }
9205
9206 if (ownerPlayerOld != ownerPlayerNew)
9207 {
9208 if (ownerPlayerOld)
9209 {
9210 array<EntityAI> subItemsExit = new array<EntityAI>;
9212 for (int i = 0; i < subItemsExit.Count(); i++)
9213 {
9216 }
9217 }
9218
9219 if (ownerPlayerNew)
9220 {
9221 array<EntityAI> subItemsEnter = new array<EntityAI>;
9223 for (int j = 0; j < subItemsEnter.Count(); j++)
9224 {
9227 }
9228 }
9229 }
9230 else if (ownerPlayerNew != null)
9231 {
9232 PlayerBase nplayer;
9233 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9234 {
9235 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9237 for (int k = 0; k < subItemsUpdate.Count(); k++)
9238 {
9240 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9241 }
9242 }
9243 }
9244
9245 if (old_owner)
9246 old_owner.OnChildItemRemoved(this);
9247 if (new_owner)
9248 new_owner.OnChildItemReceived(this);
9249 }
9250
9251
9253 {
9254 super.EEDelete(parent);
9255 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9256 if (player)
9257 {
9259
9260 if (player.IsAlive())
9261 {
9262 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9263 if (r_index >= 0)
9264 {
9265 InventoryLocation r_il = new InventoryLocation;
9266 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9267
9268 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9271 {
9272 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9273 }
9275 {
9276 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9277 }
9278
9279 }
9280
9281 player.RemoveQuickBarEntityShortcut(this);
9282 }
9283 }
9284 }
9285
9287 {
9288 super.EEKilled(killer);
9289
9292 {
9293 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9294 {
9295 if (IsMagazine())
9296 {
9297 if (Magazine.Cast(this).GetAmmoCount() > 0)
9298 {
9300 }
9301 }
9302 else
9303 {
9305 }
9306 }
9307 }
9308 }
9309
9311 {
9312 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9313
9314 super.OnWasAttached(parent, slot_id);
9315
9318
9320 }
9321
9323 {
9324 super.OnWasDetached(parent, slot_id);
9325
9328 }
9329
9331 {
9332 int idx;
9335
9336 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9337 if (inventory_slots.Count() < 1)
9338 {
9339 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9340 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9341 }
9342 else
9343 {
9344 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9345 }
9346
9347 idx = inventory_slots.Find(slot);
9348 if (idx < 0)
9349 return "";
9350
9351 return attach_types.Get(idx);
9352 }
9353
9355 {
9356 int idx = -1;
9357 string slot;
9358
9361
9362 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9363 if (inventory_slots.Count() < 1)
9364 {
9365 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9366 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9367 }
9368 else
9369 {
9370 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9371 if (detach_types.Count() < 1)
9372 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9373 }
9374
9375 for (int i = 0; i < inventory_slots.Count(); i++)
9376 {
9377 slot = inventory_slots.Get(i);
9378 }
9379
9380 if (slot != "")
9381 {
9382 if (detach_types.Count() == 1)
9383 idx = 0;
9384 else
9385 idx = inventory_slots.Find(slot);
9386 }
9387 if (idx < 0)
9388 return "";
9389
9390 return detach_types.Get(idx);
9391 }
9392
9394 {
9395
9397
9398
9399 float min_time = 1;
9400 float max_time = 3;
9401 float delay = Math.RandomFloat(min_time, max_time);
9402
9403 explode_timer.Run(delay, this, "DoAmmoExplosion");
9404 }
9405
9407 {
9408 Magazine magazine = Magazine.Cast(this);
9409 int pop_sounds_count = 6;
9410 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9411
9412
9413 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9414 string sound_name = pop_sounds[ sound_idx ];
9416
9417
9418 magazine.ServerAddAmmoCount(-1);
9419
9420
9421 float min_temp_to_explode = 100;
9422
9423 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9424 {
9426 }
9427 }
9428
9429
9430 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9431 {
9432 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9433
9434 const int CHANCE_DAMAGE_CARGO = 4;
9435 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9436 const int CHANCE_DAMAGE_NOTHING = 2;
9437
9439 {
9440 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9441 int chances;
9442 int rnd;
9443
9444 if (GetInventory().GetCargo())
9445 {
9446 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9447 rnd = Math.RandomInt(0,chances);
9448
9449 if (rnd < CHANCE_DAMAGE_CARGO)
9450 {
9452 }
9453 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9454 {
9456 }
9457 }
9458 else
9459 {
9460 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9461 rnd = Math.RandomInt(0,chances);
9462
9463 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9464 {
9466 }
9467 }
9468 }
9469 }
9470
9472 {
9473 if (GetInventory().GetCargo())
9474 {
9475 int item_count = GetInventory().GetCargo().GetItemCount();
9476 if (item_count > 0)
9477 {
9478 int random_pick = Math.RandomInt(0, item_count);
9480 if (!item.IsExplosive())
9481 {
9482 item.AddHealth("","",damage);
9483 return true;
9484 }
9485 }
9486 }
9487 return false;
9488 }
9489
9491 {
9492 int attachment_count = GetInventory().AttachmentCount();
9493 if (attachment_count > 0)
9494 {
9495 int random_pick = Math.RandomInt(0, attachment_count);
9496 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9497 if (!attachment.IsExplosive())
9498 {
9499 attachment.AddHealth("","",damage);
9500 return true;
9501 }
9502 }
9503 return false;
9504 }
9505
9507 {
9509 }
9510
9512 {
9514 return GetInventory().CanRemoveEntity();
9515
9516 return false;
9517 }
9518
9520 {
9521
9523 return false;
9524
9525
9527 return false;
9528
9529
9530
9532 if (delta == 0)
9533 return false;
9534
9535
9536 return true;
9537 }
9538
9540 {
9542 {
9543 if (ScriptInputUserData.CanStoreInputUserData())
9544 {
9545 ScriptInputUserData ctx = new ScriptInputUserData;
9550 ctx.
Write(destination_entity);
9554 }
9555 }
9556 else if (!
GetGame().IsMultiplayer())
9557 {
9559 }
9560 }
9561
9563 {
9564 float split_quantity_new;
9568 InventoryLocation loc = new InventoryLocation;
9569
9570 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9571 {
9573 split_quantity_new = stack_max;
9574 else
9576
9578 {
9579 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9580 if (new_item)
9581 {
9582 new_item.SetResultOfSplit(true);
9583 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9585 new_item.
SetQuantity(split_quantity_new,
false,
true);
9586 }
9587 }
9588 }
9589 else if (destination_entity && slot_id == -1)
9590 {
9591 if (quantity > stack_max)
9592 split_quantity_new = stack_max;
9593 else
9594 split_quantity_new = quantity;
9595
9597 {
9599 {
9602 }
9603
9604 if (new_item)
9605 {
9606 new_item.SetResultOfSplit(true);
9607 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9609 new_item.
SetQuantity(split_quantity_new,
false,
true);
9610 }
9611 }
9612 }
9613 else
9614 {
9615 if (stack_max != 0)
9616 {
9618 {
9620 }
9621
9622 if (split_quantity_new == 0)
9623 {
9624 if (!
GetGame().IsMultiplayer())
9625 player.PhysicalPredictiveDropItem(this);
9626 else
9627 player.ServerDropEntity(this);
9628 return;
9629 }
9630
9632 {
9634
9635 if (new_item)
9636 {
9637 new_item.SetResultOfSplit(true);
9638 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9641 new_item.PlaceOnSurface();
9642 }
9643 }
9644 }
9645 }
9646 }
9647
9649 {
9650 float split_quantity_new;
9654 InventoryLocation loc = new InventoryLocation;
9655
9656 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9657 {
9659 split_quantity_new = stack_max;
9660 else
9662
9664 {
9665 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9666 if (new_item)
9667 {
9668 new_item.SetResultOfSplit(true);
9669 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9671 new_item.
SetQuantity(split_quantity_new,
false,
true);
9672 }
9673 }
9674 }
9675 else if (destination_entity && slot_id == -1)
9676 {
9677 if (quantity > stack_max)
9678 split_quantity_new = stack_max;
9679 else
9680 split_quantity_new = quantity;
9681
9683 {
9685 {
9688 }
9689
9690 if (new_item)
9691 {
9692 new_item.SetResultOfSplit(true);
9693 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9695 new_item.
SetQuantity(split_quantity_new,
false,
true);
9696 }
9697 }
9698 }
9699 else
9700 {
9701 if (stack_max != 0)
9702 {
9704 {
9706 }
9707
9709 {
9711
9712 if (new_item)
9713 {
9714 new_item.SetResultOfSplit(true);
9715 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9718 new_item.PlaceOnSurface();
9719 }
9720 }
9721 }
9722 }
9723 }
9724
9726 {
9728 {
9729 if (ScriptInputUserData.CanStoreInputUserData())
9730 {
9731 ScriptInputUserData ctx = new ScriptInputUserData;
9736 dst.WriteToContext(ctx);
9738 }
9739 }
9740 else if (!
GetGame().IsMultiplayer())
9741 {
9743 }
9744 }
9745
9747 {
9749 {
9750 if (ScriptInputUserData.CanStoreInputUserData())
9751 {
9752 ScriptInputUserData ctx = new ScriptInputUserData;
9757 ctx.
Write(destination_entity);
9763 }
9764 }
9765 else if (!
GetGame().IsMultiplayer())
9766 {
9768 }
9769 }
9770
9772 {
9774 }
9775
9777 {
9779 float split_quantity_new;
9781 if (dst.IsValid())
9782 {
9783 int slot_id = dst.GetSlot();
9785
9786 if (quantity > stack_max)
9787 split_quantity_new = stack_max;
9788 else
9789 split_quantity_new = quantity;
9790
9792 {
9794
9795 if (new_item)
9796 {
9797 new_item.SetResultOfSplit(true);
9798 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9800 new_item.
SetQuantity(split_quantity_new,
false,
true);
9801 }
9802
9803 return new_item;
9804 }
9805 }
9806
9807 return null;
9808 }
9809
9811 {
9813 float split_quantity_new;
9815 if (destination_entity)
9816 {
9818 if (quantity > stackable)
9819 split_quantity_new = stackable;
9820 else
9821 split_quantity_new = quantity;
9822
9824 {
9825 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9826 if (new_item)
9827 {
9828 new_item.SetResultOfSplit(true);
9829 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9831 new_item.
SetQuantity(split_quantity_new,
false,
true);
9832 }
9833 }
9834 }
9835 }
9836
9838 {
9840 {
9841 if (ScriptInputUserData.CanStoreInputUserData())
9842 {
9843 ScriptInputUserData ctx = new ScriptInputUserData;
9848 ItemBase destination_entity =
this;
9849 ctx.
Write(destination_entity);
9853 }
9854 }
9855 else if (!
GetGame().IsMultiplayer())
9856 {
9858 }
9859 }
9860
9862 {
9864 float split_quantity_new;
9866 if (player)
9867 {
9869 if (quantity > stackable)
9870 split_quantity_new = stackable;
9871 else
9872 split_quantity_new = quantity;
9873
9875 {
9876 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9877 new_item =
ItemBase.Cast(in_hands);
9878 if (new_item)
9879 {
9880 new_item.SetResultOfSplit(true);
9881 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9883 new_item.SetQuantity(split_quantity_new, false, true);
9884 }
9885 }
9886 }
9887 }
9888
9890 {
9892 float split_quantity_new = Math.Floor(quantity * 0.5);
9893
9895 return;
9896
9898
9899 if (new_item)
9900 {
9901 if (new_item.GetQuantityMax() < split_quantity_new)
9902 {
9903 split_quantity_new = new_item.GetQuantityMax();
9904 }
9905
9906 new_item.SetResultOfSplit(true);
9907 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9908
9910 {
9913 }
9914 else
9915 {
9917 new_item.
SetQuantity(split_quantity_new,
false,
true);
9918 }
9919 }
9920 }
9921
9923 {
9925 float split_quantity_new = Math.Floor(quantity / 2);
9926
9928 return;
9929
9930 InventoryLocation invloc = new InventoryLocation;
9932
9934 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9935
9936 if (new_item)
9937 {
9938 if (new_item.GetQuantityMax() < split_quantity_new)
9939 {
9940 split_quantity_new = new_item.GetQuantityMax();
9941 }
9943 {
9946 }
9947 else if (split_quantity_new > 1)
9948 {
9950 new_item.
SetQuantity(split_quantity_new,
false,
true);
9951 }
9952 }
9953 }
9954
9957 {
9958 SetWeightDirty();
9960
9961 if (parent)
9962 parent.OnAttachmentQuantityChangedEx(this, delta);
9963
9965 {
9967 {
9969 }
9971 {
9972 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9974 }
9975 }
9976
9977 }
9978
9981 {
9982
9983 }
9984
9987 {
9989 }
9990
9992 {
9993 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9994
9996 {
9997 if (newLevel == GameConstants.STATE_RUINED)
9998 {
10000 EntityAI parent = GetHierarchyParent();
10001 if (parent && parent.IsFireplace())
10002 {
10003 CargoBase cargo = GetInventory().GetCargo();
10004 if (cargo)
10005 {
10007 {
10009 }
10010 }
10011 }
10012 }
10013
10015 {
10016
10018 return;
10019 }
10020
10021 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10022 {
10024 }
10025 }
10026 }
10027
10028
10030 {
10031 super.OnRightClick();
10032
10034 {
10036 {
10037 if (ScriptInputUserData.CanStoreInputUserData())
10038 {
10039 EntityAI root = GetHierarchyRoot();
10040 Man playerOwner = GetHierarchyRootPlayer();
10041 InventoryLocation dst = new InventoryLocation;
10042
10043
10044 if (!playerOwner && root && root == this)
10045 {
10047 }
10048 else
10049 {
10050
10051 GetInventory().GetCurrentInventoryLocation(dst);
10053 {
10056 {
10058 }
10059 else
10060 {
10062
10063
10064 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10065 {
10067 }
10068 else
10069 {
10070 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10071 }
10072 }
10073 }
10074 }
10075
10076 ScriptInputUserData ctx = new ScriptInputUserData;
10084 }
10085 }
10086 else if (!
GetGame().IsMultiplayer())
10087 {
10089 }
10090 }
10091 }
10092
10094 {
10095 if (root)
10096 {
10097 vector m4[4];
10098 root.GetTransform(m4);
10099 dst.SetGround(this, m4);
10100 }
10101 else
10102 {
10103 GetInventory().GetCurrentInventoryLocation(dst);
10104 }
10105 }
10106
10107 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10108 {
10109
10110 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10111 return false;
10112
10113 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10114 return false;
10115
10116
10118 return false;
10119
10120
10121 Magazine mag = Magazine.Cast(this);
10122 if (mag)
10123 {
10124 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10125 return false;
10126
10127 if (stack_max_limit)
10128 {
10129 Magazine other_mag = Magazine.Cast(other_item);
10130 if (other_item)
10131 {
10132 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10133 return false;
10134 }
10135
10136 }
10137 }
10138 else
10139 {
10140
10142 return false;
10143
10145 return false;
10146 }
10147
10148 PlayerBase player = null;
10149 if (CastTo(player, GetHierarchyRootPlayer()))
10150 {
10151 if (player.GetInventory().HasAttachment(this))
10152 return false;
10153
10154 if (player.IsItemsToDelete())
10155 return false;
10156 }
10157
10158 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10159 return false;
10160
10161 int slotID;
10163 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10164 return false;
10165
10166 return true;
10167 }
10168
10170 {
10172 }
10173
10175 {
10176 return m_IsResultOfSplit;
10177 }
10178
10180 {
10181 m_IsResultOfSplit = value;
10182 }
10183
10185 {
10187 }
10188
10190 {
10191 float other_item_quantity = other_item.GetQuantity();
10192 float this_free_space;
10193
10195
10197
10198 if (other_item_quantity > this_free_space)
10199 {
10200 return this_free_space;
10201 }
10202 else
10203 {
10204 return other_item_quantity;
10205 }
10206 }
10207
10209 {
10211 }
10212
10214 {
10216 return;
10217
10218 if (!IsMagazine() && other_item)
10219 {
10221 if (quantity_used != 0)
10222 {
10223 float hp1 = GetHealth01("","");
10224 float hp2 = other_item.GetHealth01("","");
10225 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10226 hpResult = hpResult / (
GetQuantity() + quantity_used);
10227
10228 hpResult *= GetMaxHealth();
10229 Math.Round(hpResult);
10230 SetHealth("", "Health", hpResult);
10231
10233 other_item.AddQuantity(-quantity_used);
10234 }
10235 }
10237 }
10238
10240 {
10241 #ifdef SERVER
10242 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10243 GetHierarchyParent().IncreaseLifetimeUp();
10244 #endif
10245 };
10246
10248 {
10249 PlayerBase p = PlayerBase.Cast(player);
10250
10251 array<int> recipesIds = p.m_Recipes;
10252 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10253 if (moduleRecipesManager)
10254 {
10255 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10256 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10257 }
10258
10259 for (int i = 0;i < recipesIds.Count(); i++)
10260 {
10261 int key = recipesIds.Get(i);
10262 string recipeName = moduleRecipesManager.GetRecipeName(key);
10264 }
10265 }
10266
10267
10268 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10269 {
10270 super.GetDebugActions(outputList);
10271
10272
10278
10279
10284
10289
10290
10294
10295
10297 {
10301 }
10302
10305
10306
10310
10312
10313 InventoryLocation loc = new InventoryLocation();
10314 GetInventory().GetCurrentInventoryLocation(loc);
10316 {
10317 if (Gizmo_IsSupported())
10320 }
10321
10323 }
10324
10325
10326
10327
10329 {
10330 super.OnAction(action_id, player, ctx);
10331
10333 {
10334 switch (action_id)
10335 {
10338 return true;
10341 return true;
10342 }
10343 }
10344
10346 {
10347 switch (action_id)
10348 {
10350 Delete();
10351 return true;
10352 }
10353 }
10354
10355 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10356 {
10357 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10358 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10359 PlayerBase p = PlayerBase.Cast(player);
10360 if (
EActions.RECIPES_RANGE_START < 1000)
10361 {
10362 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10363 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10364 }
10365 }
10366 #ifndef SERVER
10367 else if (action_id ==
EActions.WATCH_PLAYER)
10368 {
10369 PluginDeveloper.SetDeveloperItemClientEx(player);
10370 }
10371 #endif
10373 {
10374 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10375 {
10376 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10377 OnDebugButtonPressServer(id + 1);
10378 }
10379
10380 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10381 {
10382 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10384 }
10385
10386 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10387 {
10388 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10390 }
10391
10392 else if (action_id ==
EActions.ADD_QUANTITY)
10393 {
10394 if (IsMagazine())
10395 {
10396 Magazine mag = Magazine.Cast(this);
10397 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10398 }
10399 else
10400 {
10402 }
10403
10404 if (m_EM)
10405 {
10406 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10407 }
10408
10409 }
10410
10411 else if (action_id ==
EActions.REMOVE_QUANTITY)
10412 {
10413 if (IsMagazine())
10414 {
10415 Magazine mag2 = Magazine.Cast(this);
10416 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10417 }
10418 else
10419 {
10421 }
10422 if (m_EM)
10423 {
10424 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10425 }
10426
10427 }
10428
10429 else if (action_id ==
EActions.SET_QUANTITY_0)
10430 {
10432
10433 if (m_EM)
10434 {
10435 m_EM.SetEnergy(0);
10436 }
10437 }
10438
10439 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10440 {
10442
10443 if (m_EM)
10444 {
10445 m_EM.SetEnergy(m_EM.GetEnergyMax());
10446 }
10447 }
10448
10449 else if (action_id ==
EActions.ADD_HEALTH)
10450 {
10451 AddHealth("","",GetMaxHealth("","Health")/5);
10452 }
10453 else if (action_id ==
EActions.REMOVE_HEALTH)
10454 {
10455 AddHealth("","",-GetMaxHealth("","Health")/5);
10456 }
10457 else if (action_id ==
EActions.DESTROY_HEALTH)
10458 {
10459 SetHealth01("","",0);
10460 }
10461 else if (action_id ==
EActions.WATCH_ITEM)
10462 {
10464 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10465 #ifdef DEVELOPER
10466 SetDebugDeveloper_item(this);
10467 #endif
10468 }
10469
10470 else if (action_id ==
EActions.ADD_TEMPERATURE)
10471 {
10472 AddTemperature(20);
10473
10474 }
10475
10476 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10477 {
10478 AddTemperature(-20);
10479
10480 }
10481
10482 else if (action_id ==
EActions.FLIP_FROZEN)
10483 {
10484 SetFrozen(!GetIsFrozen());
10485
10486 }
10487
10488 else if (action_id ==
EActions.ADD_WETNESS)
10489 {
10491
10492 }
10493
10494 else if (action_id ==
EActions.REMOVE_WETNESS)
10495 {
10497
10498 }
10499
10500 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10501 {
10504
10505
10506 }
10507
10508 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10509 {
10512 }
10513
10514 else if (action_id ==
EActions.MAKE_SPECIAL)
10515 {
10516 auto debugParams = DebugSpawnParams.WithPlayer(player);
10517 OnDebugSpawnEx(debugParams);
10518 }
10519
10520 }
10521
10522
10523 return false;
10524 }
10525
10526
10527
10528
10532
10535
10536
10537
10539 {
10540 return false;
10541 }
10542
10543
10545 {
10546 return true;
10547 }
10548
10549
10551 {
10552 return true;
10553 }
10554
10555
10556
10558 {
10559 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10561 }
10562
10565 {
10566 return null;
10567 }
10568
10570 {
10571 return false;
10572 }
10573
10575 {
10576 return false;
10577 }
10578
10582
10583
10585 {
10586 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10587 return module_repairing.CanRepair(this, item_repair_kit);
10588 }
10589
10590
10591 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10592 {
10593 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10594 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10595 }
10596
10597
10599 {
10600
10601
10602
10603
10604
10605
10606
10607
10608 return 1;
10609 }
10610
10611
10612
10614 {
10616 }
10617
10618
10619
10621 {
10623 }
10624
10625
10634 {
10635 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10636
10637 if (player)
10638 {
10639 player.MessageStatus(text);
10640 }
10641 }
10642
10643
10652 {
10653 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10654
10655 if (player)
10656 {
10657 player.MessageAction(text);
10658 }
10659 }
10660
10661
10670 {
10671 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10672
10673 if (player)
10674 {
10675 player.MessageFriendly(text);
10676 }
10677 }
10678
10679
10688 {
10689 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10690
10691 if (player)
10692 {
10693 player.MessageImportant(text);
10694 }
10695 }
10696
10698 {
10699 return true;
10700 }
10701
10702
10703 override bool KindOf(
string tag)
10704 {
10705 bool found = false;
10706 string item_name = this.
GetType();
10709
10710 int array_size = item_tag_array.Count();
10711 for (int i = 0; i < array_size; i++)
10712 {
10713 if (item_tag_array.Get(i) == tag)
10714 {
10715 found = true;
10716 break;
10717 }
10718 }
10719 return found;
10720 }
10721
10722
10724 {
10725
10726 super.OnRPC(sender, rpc_type,ctx);
10727
10728
10729 switch (rpc_type)
10730 {
10731 #ifndef SERVER
10732 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10733 Param2<bool, string> p = new Param2<bool, string>(false, "");
10734
10736 return;
10737
10738 bool play = p.param1;
10739 string soundSet = p.param2;
10740
10741 if (play)
10742 {
10744 {
10746 {
10748 }
10749 }
10750 else
10751 {
10753 }
10754 }
10755 else
10756 {
10758 }
10759
10760 break;
10761 #endif
10762
10763 }
10764
10766 {
10768 }
10769 }
10770
10771
10772
10773
10775 {
10776 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10777 return plugin.GetID(
name);
10778 }
10779
10781 {
10782 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10783 return plugin.GetName(id);
10784 }
10785
10788 {
10789
10790
10791 int varFlags;
10792 if (!ctx.
Read(varFlags))
10793 return;
10794
10795 if (varFlags & ItemVariableFlags.FLOAT)
10796 {
10798 }
10799 }
10800
10802 {
10803
10804 super.SerializeNumericalVars(floats_out);
10805
10806
10807
10809 {
10811 }
10812
10814 {
10816 }
10817
10819 {
10821 }
10822
10824 {
10829 }
10830
10832 {
10834 }
10835 }
10836
10838 {
10839
10840 super.DeSerializeNumericalVars(floats);
10841
10842
10843 int index = 0;
10844 int mask = Math.Round(floats.Get(index));
10845
10846 index++;
10847
10849 {
10851 {
10853 }
10854 else
10855 {
10856 float quantity = floats.Get(index);
10857 SetQuantity(quantity,
true,
false,
false,
false);
10858 }
10859 index++;
10860 }
10861
10863 {
10864 float wet = floats.Get(index);
10866 index++;
10867 }
10868
10870 {
10871 int liquidtype = Math.Round(floats.Get(index));
10873 index++;
10874 }
10875
10877 {
10879 index++;
10881 index++;
10883 index++;
10885 index++;
10886 }
10887
10889 {
10890 int cleanness = Math.Round(floats.Get(index));
10892 index++;
10893 }
10894 }
10895
10897 {
10898 super.WriteVarsToCTX(ctx);
10899
10900
10902 {
10904 }
10905
10907 {
10909 }
10910
10912 {
10914 }
10915
10917 {
10918 int r,g,b,a;
10924 }
10925
10927 {
10929 }
10930 }
10931
10933 {
10934 if (!super.ReadVarsFromCTX(ctx,version))
10935 return false;
10936
10937 int intValue;
10938 float value;
10939
10940 if (version < 140)
10941 {
10942 if (!ctx.
Read(intValue))
10943 return false;
10944
10945 m_VariablesMask = intValue;
10946 }
10947
10949 {
10950 if (!ctx.
Read(value))
10951 return false;
10952
10954 {
10956 }
10957 else
10958 {
10960 }
10961 }
10962
10963 if (version < 140)
10964 {
10966 {
10967 if (!ctx.
Read(value))
10968 return false;
10969 SetTemperatureDirect(value);
10970 }
10971 }
10972
10974 {
10975 if (!ctx.
Read(value))
10976 return false;
10978 }
10979
10981 {
10982 if (!ctx.
Read(intValue))
10983 return false;
10985 }
10986
10988 {
10989 int r,g,b,a;
10991 return false;
10993 return false;
10995 return false;
10997 return false;
10998
11000 }
11001
11003 {
11004 if (!ctx.
Read(intValue))
11005 return false;
11007 }
11008
11009 if (version >= 138 && version < 140)
11010 {
11012 {
11013 if (!ctx.
Read(intValue))
11014 return false;
11015 SetFrozen(intValue);
11016 }
11017 }
11018
11019 return true;
11020 }
11021
11022
11024 {
11027 {
11029 }
11030
11031 if (!super.OnStoreLoad(ctx, version))
11032 {
11034 return false;
11035 }
11036
11037 if (version >= 114)
11038 {
11039 bool hasQuickBarIndexSaved;
11040
11041 if (!ctx.
Read(hasQuickBarIndexSaved))
11042 {
11044 return false;
11045 }
11046
11047 if (hasQuickBarIndexSaved)
11048 {
11049 int itmQBIndex;
11050
11051
11052 if (!ctx.
Read(itmQBIndex))
11053 {
11055 return false;
11056 }
11057
11058 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11059 if (itmQBIndex != -1 && parentPlayer)
11060 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11061 }
11062 }
11063 else
11064 {
11065
11066 PlayerBase player;
11067 int itemQBIndex;
11068 if (version ==
int.
MAX)
11069 {
11070 if (!ctx.
Read(itemQBIndex))
11071 {
11073 return false;
11074 }
11075 }
11076 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11077 {
11078
11079 if (!ctx.
Read(itemQBIndex))
11080 {
11082 return false;
11083 }
11084 if (itemQBIndex != -1 && player)
11085 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11086 }
11087 }
11088
11089 if (version < 140)
11090 {
11091
11092 if (!LoadVariables(ctx, version))
11093 {
11095 return false;
11096 }
11097 }
11098
11099
11101 {
11103 return false;
11104 }
11105 if (version >= 132)
11106 {
11108 if (raib)
11109 {
11111 {
11113 return false;
11114 }
11115 }
11116 }
11117
11119 return true;
11120 }
11121
11122
11123
11125 {
11126 super.OnStoreSave(ctx);
11127
11128 PlayerBase player;
11129 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11130 {
11132
11133 int itemQBIndex = -1;
11134 itemQBIndex = player.FindQuickBarEntityIndex(this);
11135 ctx.
Write(itemQBIndex);
11136 }
11137 else
11138 {
11140 }
11141
11143
11145 if (raib)
11146 {
11148 }
11149 }
11150
11151
11153 {
11154 super.AfterStoreLoad();
11155
11157 {
11159 }
11160
11162 {
11165 }
11166 }
11167
11169 {
11170 super.EEOnAfterLoad();
11171
11173 {
11175 }
11176
11179 }
11180
11182 {
11183 return false;
11184 }
11185
11186
11187
11189 {
11191 {
11192 #ifdef PLATFORM_CONSOLE
11193
11195 {
11197 if (menu)
11198 {
11200 }
11201 }
11202 #endif
11203 }
11204
11206 {
11209 }
11210
11212 {
11213 SetWeightDirty();
11215 }
11217 {
11220 }
11221
11223 {
11226 }
11228 {
11231 }
11232
11233 super.OnVariablesSynchronized();
11234 }
11235
11236
11237
11239 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11240 {
11241 if (!IsServerCheck(allow_client))
11242 return false;
11243
11245 return false;
11246
11249
11250 if (value <= (min + 0.001))
11251 value = min;
11252
11253 if (value == min)
11254 {
11255 if (destroy_config)
11256 {
11257 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11258 if (dstr)
11259 {
11261 this.Delete();
11262 return true;
11263 }
11264 }
11265 else if (destroy_forced)
11266 {
11268 this.Delete();
11269 return true;
11270 }
11271
11273 }
11274
11277
11279 {
11281
11282 if (delta)
11284 }
11285
11287
11288 return false;
11289 }
11290
11291
11293 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11294 {
11296 }
11297
11299 {
11302 }
11303
11305 {
11308 }
11309
11311 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11312 {
11313 float value_clamped = Math.Clamp(value, 0, 1);
11315 SetQuantity(result, destroy_config, destroy_forced);
11316 }
11317
11318
11321 {
11323 }
11324
11326 {
11328 }
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11340 {
11341 int slot = -1;
11342 if (GetInventory())
11343 {
11344 InventoryLocation il = new InventoryLocation;
11345 GetInventory().GetCurrentInventoryLocation(il);
11347 }
11348
11350 }
11351
11353 {
11354 float quantity_max = 0;
11355
11357 {
11358 if (attSlotID != -1)
11359 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11360
11361 if (quantity_max <= 0)
11363 }
11364
11365 if (quantity_max <= 0)
11367
11368 return quantity_max;
11369 }
11370
11372 {
11374 }
11375
11377 {
11379 }
11380
11381
11383 {
11385 }
11386
11388 {
11390 }
11391
11393 {
11395 }
11396
11397
11399 {
11400
11401 float weightEx = GetWeightEx();
11402 float special = GetInventoryAndCargoWeight();
11403 return weightEx - special;
11404 }
11405
11406
11408 {
11410 }
11411
11413 {
11415 {
11416 #ifdef DEVELOPER
11417 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11418 {
11419 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11421 }
11422 #endif
11423
11424 return GetQuantity() * GetConfigWeightModified();
11425 }
11426 else if (HasEnergyManager())
11427 {
11428 #ifdef DEVELOPER
11429 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11430 {
11431 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11432 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11433 }
11434 #endif
11435 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11436 }
11437 else
11438 {
11439 #ifdef DEVELOPER
11440 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11441 {
11442 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11443 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11444 }
11445 #endif
11446 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11447 }
11448 }
11449
11452 {
11453 int item_count = 0;
11455
11456 if (GetInventory().GetCargo() != NULL)
11457 {
11458 item_count = GetInventory().GetCargo().GetItemCount();
11459 }
11460
11461 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11462 {
11463 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11464 if (item)
11465 item_count += item.GetNumberOfItems();
11466 }
11467 return item_count;
11468 }
11469
11472 {
11473 float weight = 0;
11474 float wetness = 1;
11475 if (include_wetness)
11478 {
11479 weight = wetness * m_ConfigWeight;
11480 }
11482 {
11483 weight = 1;
11484 }
11485 return weight;
11486 }
11487
11488
11489
11491 {
11492 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11493 {
11494 GameInventory inv = GetInventory();
11495 array<EntityAI> items = new array<EntityAI>;
11497 for (int i = 0; i < items.Count(); i++)
11498 {
11500 if (item)
11501 {
11503 }
11504 }
11505 }
11506 }
11507
11508
11509
11510
11512 {
11513 float energy = 0;
11514 if (HasEnergyManager())
11515 {
11516 energy = GetCompEM().GetEnergy();
11517 }
11518 return energy;
11519 }
11520
11521
11523 {
11524 super.OnEnergyConsumed();
11525
11527 }
11528
11530 {
11531 super.OnEnergyAdded();
11532
11534 }
11535
11536
11538 {
11539 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11540 {
11542 {
11543 float energy_0to1 = GetCompEM().GetEnergy0To1();
11545 }
11546 }
11547 }
11548
11549
11551 {
11552 return ConfigGetFloat("heatIsolation");
11553 }
11554
11556 {
11558 }
11559
11561 {
11562 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11563 if (
GetGame().ConfigIsExisting(paramPath))
11565
11566 return 0.0;
11567 }
11568
11570 {
11571 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11572 if (
GetGame().ConfigIsExisting(paramPath))
11574
11575 return 0.0;
11576 }
11577
11578 override void SetWet(
float value,
bool allow_client =
false)
11579 {
11580 if (!IsServerCheck(allow_client))
11581 return;
11582
11585
11587
11588 m_VarWet = Math.Clamp(value, min, max);
11589
11591 {
11594 }
11595 }
11596
11597 override void AddWet(
float value)
11598 {
11600 }
11601
11603 {
11605 }
11606
11608 {
11610 }
11611
11613 {
11615 }
11616
11618 {
11620 }
11621
11623 {
11625 }
11626
11627 override void OnWetChanged(
float newVal,
float oldVal)
11628 {
11631 if (newLevel != oldLevel)
11632 {
11634 }
11635 }
11636
11638 {
11639 SetWeightDirty();
11640 }
11641
11643 {
11644 return GetWetLevelInternal(
m_VarWet);
11645 }
11646
11647
11648
11650 {
11652 }
11653
11655 {
11657 }
11658
11660 {
11662 }
11663
11665 {
11667 }
11668
11669
11670
11672 {
11673 if (ConfigIsExisting("itemModelLength"))
11674 {
11675 return ConfigGetFloat("itemModelLength");
11676 }
11677 return 0;
11678 }
11679
11681 {
11682 if (ConfigIsExisting("itemAttachOffset"))
11683 {
11684 return ConfigGetFloat("itemAttachOffset");
11685 }
11686 return 0;
11687 }
11688
11689 override void SetCleanness(
int value,
bool allow_client =
false)
11690 {
11691 if (!IsServerCheck(allow_client))
11692 return;
11693
11695
11697
11700 }
11701
11703 {
11705 }
11706
11708 {
11709 return true;
11710 }
11711
11712
11713
11714
11716 {
11718 }
11719
11721 {
11723 }
11724
11725
11726
11727
11728 override void SetColor(
int r,
int g,
int b,
int a)
11729 {
11735 }
11737 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11738 {
11743 }
11744
11746 {
11748 }
11749
11752 {
11753 int r,g,b,a;
11755 r = r/255;
11756 g = g/255;
11757 b = b/255;
11758 a = a/255;
11759 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11760 }
11761
11762
11763
11764 override void SetLiquidType(
int value,
bool allow_client =
false)
11765 {
11766 if (!IsServerCheck(allow_client))
11767 return;
11768
11773 }
11774
11776 {
11777 return ConfigGetInt("varLiquidTypeInit");
11778 }
11779
11781 {
11783 }
11784
11786 {
11788 SetFrozen(false);
11789 }
11790
11793 {
11794 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11795 }
11796
11797
11800 {
11801 PlayerBase nplayer;
11802 if (PlayerBase.CastTo(nplayer, player))
11803 {
11805
11806 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11807 }
11808 }
11809
11810
11813 {
11814 PlayerBase nplayer;
11815 if (PlayerBase.CastTo(nplayer,player))
11816 {
11817
11818 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11819
11820 }
11821
11822
11823 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11824
11825
11826 if (HasEnergyManager())
11827 {
11828 GetCompEM().UpdatePlugState();
11829 }
11830 }
11831
11832
11834 {
11835 super.OnPlacementStarted(player);
11836
11838 }
11839
11840 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11841 {
11843 {
11844 m_AdminLog.OnPlacementComplete(player,
this);
11845 }
11846
11847 super.OnPlacementComplete(player, position, orientation);
11848 }
11849
11850
11851
11852
11853
11855 {
11857 {
11858 return true;
11859 }
11860 else
11861 {
11862 return false;
11863 }
11864 }
11865
11866
11868 {
11870 {
11872 }
11873 }
11874
11875
11877 {
11879 }
11880
11882 {
11884 }
11885
11886 override void InsertAgent(
int agent,
float count = 1)
11887 {
11888 if (count < 1)
11889 return;
11890
11892 }
11893
11896 {
11898 }
11899
11900
11902 {
11904 }
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11948 {
11950 return false;
11951 return true;
11952 }
11953
11955 {
11956
11958 }
11959
11960
11963 {
11964 super.CheckForRoofLimited(timeTresholdMS);
11965
11967 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11968 {
11969 m_PreviousRoofTestTime = time;
11970 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11971 }
11972 }
11973
11974
11976 {
11978 {
11979 return 0;
11980 }
11981
11982 if (GetInventory().GetAttachmentSlotsCount() != 0)
11983 {
11984 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11985 if (filter)
11986 return filter.GetProtectionLevel(type, false, system);
11987 else
11988 return 0;
11989 }
11990
11991 string subclassPath, entryName;
11992
11993 switch (type)
11994 {
11996 entryName = "biological";
11997 break;
11999 entryName = "chemical";
12000 break;
12001 default:
12002 entryName = "biological";
12003 break;
12004 }
12005
12006 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12007
12009 }
12010
12011
12012
12015 {
12016 if (!IsMagazine())
12018
12020 }
12021
12022
12023
12024
12025
12030 {
12031 return true;
12032 }
12033
12035 {
12037 }
12038
12039
12040
12041
12042
12044 {
12045 if (parent)
12046 {
12047 if (parent.IsInherited(DayZInfected))
12048 return true;
12049
12050 if (!parent.IsRuined())
12051 return true;
12052 }
12053
12054 return true;
12055 }
12056
12058 {
12059 if (!super.CanPutAsAttachment(parent))
12060 {
12061 return false;
12062 }
12063
12064 if (!IsRuined() && !parent.IsRuined())
12065 {
12066 return true;
12067 }
12068
12069 return false;
12070 }
12071
12073 {
12074
12075
12076
12077
12078 return super.CanReceiveItemIntoCargo(item);
12079 }
12080
12082 {
12083
12084
12085
12086
12087 GameInventory attachmentInv = attachment.GetInventory();
12089 {
12090 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12091 return false;
12092 }
12093
12094 InventoryLocation loc = new InventoryLocation();
12095 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12096 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12097 return false;
12098
12099 return super.CanReceiveAttachment(attachment, slotId);
12100 }
12101
12103 {
12104 if (!super.CanReleaseAttachment(attachment))
12105 return false;
12106
12107 return GetInventory().AreChildrenAccessible();
12108 }
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12131 {
12132 int id = muzzle_owner.GetMuzzleID();
12133 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12134
12135 if (WPOF_array)
12136 {
12137 for (int i = 0; i < WPOF_array.Count(); i++)
12138 {
12139 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12140
12141 if (WPOF)
12142 {
12143 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12144 }
12145 }
12146 }
12147 }
12148
12149
12151 {
12152 int id = muzzle_owner.GetMuzzleID();
12154
12155 if (WPOBE_array)
12156 {
12157 for (int i = 0; i < WPOBE_array.Count(); i++)
12158 {
12159 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12160
12161 if (WPOBE)
12162 {
12163 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12164 }
12165 }
12166 }
12167 }
12168
12169
12171 {
12172 int id = muzzle_owner.GetMuzzleID();
12173 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12174
12175 if (WPOOH_array)
12176 {
12177 for (int i = 0; i < WPOOH_array.Count(); i++)
12178 {
12179 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12180
12181 if (WPOOH)
12182 {
12183 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12184 }
12185 }
12186 }
12187 }
12188
12189
12191 {
12192 int id = muzzle_owner.GetMuzzleID();
12193 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12194
12195 if (WPOOH_array)
12196 {
12197 for (int i = 0; i < WPOOH_array.Count(); i++)
12198 {
12199 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12200
12201 if (WPOOH)
12202 {
12203 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12204 }
12205 }
12206 }
12207 }
12208
12209
12211 {
12212 int id = muzzle_owner.GetMuzzleID();
12213 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12214
12215 if (WPOOH_array)
12216 {
12217 for (int i = 0; i < WPOOH_array.Count(); i++)
12218 {
12219 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12220
12221 if (WPOOH)
12222 {
12223 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12224 }
12225 }
12226 }
12227 }
12228
12229
12230
12232 {
12234 {
12235 return true;
12236 }
12237
12238 return false;
12239 }
12240
12242 {
12244 {
12245 return true;
12246 }
12247
12248 return false;
12249 }
12250
12252 {
12254 {
12255 return true;
12256 }
12257
12258 return false;
12259 }
12260
12262 {
12263 return false;
12264 }
12265
12268 {
12269 return UATimeSpent.DEFAULT_DEPLOY;
12270 }
12271
12272
12273
12274
12276 {
12278 SetSynchDirty();
12279 }
12280
12282 {
12284 }
12285
12286
12288 {
12289 return false;
12290 }
12291
12294 {
12295 string att_type = "None";
12296
12297 if (ConfigIsExisting("soundAttType"))
12298 {
12299 att_type = ConfigGetString("soundAttType");
12300 }
12301
12303 }
12304
12306 {
12308 }
12309
12310
12311
12312
12313
12319
12321 {
12324
12326 }
12327
12328
12330 {
12332 return;
12333
12335
12338
12341
12342 SoundParameters params = new SoundParameters();
12346 }
12347
12348
12350 {
12352 return;
12353
12355 SetSynchDirty();
12356
12359 }
12360
12361
12363 {
12365 return;
12366
12368 SetSynchDirty();
12369
12372 }
12373
12375 {
12377 }
12378
12380 {
12382 }
12383
12386 {
12387 if (!
GetGame().IsDedicatedServer())
12388 {
12389 if (ConfigIsExisting("attachSoundSet"))
12390 {
12391 string cfg_path = "";
12392 string soundset = "";
12393 string type_name =
GetType();
12394
12397 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12398 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12399
12400 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12401 {
12402 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12403 {
12404 if (cfg_slot_array[i] == slot_type)
12405 {
12406 soundset = cfg_soundset_array[i];
12407 break;
12408 }
12409 }
12410 }
12411
12412 if (soundset != "")
12413 {
12414 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12416 }
12417 }
12418 }
12419 }
12420
12422 {
12423
12424 }
12425
12426 void OnApply(PlayerBase player);
12427
12429 {
12430 return 1.0;
12431 };
12432
12434 {
12436 }
12437
12439 {
12441 }
12442
12444
12446 {
12447 SetDynamicPhysicsLifeTime(0.01);
12449 }
12450
12452 {
12453 array<string> zone_names = new array<string>;
12454 GetDamageZones(zone_names);
12455 for (int i = 0; i < zone_names.Count(); i++)
12456 {
12457 SetHealthMax(zone_names.Get(i),"Health");
12458 }
12459 SetHealthMax("","Health");
12460 }
12461
12464 {
12465 float global_health = GetHealth01("","Health");
12466 array<string> zones = new array<string>;
12467 GetDamageZones(zones);
12468
12469 for (int i = 0; i < zones.Count(); i++)
12470 {
12471 SetHealth01(zones.Get(i),"Health",global_health);
12472 }
12473 }
12474
12477 {
12478 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12479 }
12480
12482 {
12483 if (!hasRootAsPlayer)
12484 {
12485 if (refParentIB)
12486 {
12487
12488 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12489 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12490
12491 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12492 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12493
12496 }
12497 else
12498 {
12499
12502 }
12503 }
12504 }
12505
12507 {
12509 {
12510 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12511 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12512 {
12513 float heatPermCoef = 1.0;
12515 while (ent)
12516 {
12517 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12518 ent = ent.GetHierarchyParent();
12519 }
12520
12521 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12522 }
12523 }
12524 }
12525
12527 {
12528
12529 EntityAI parent = GetHierarchyParent();
12530 if (!parent)
12531 {
12532 hasParent = false;
12533 hasRootAsPlayer = false;
12534 }
12535 else
12536 {
12537 hasParent = true;
12538 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12539 refParentIB =
ItemBase.Cast(parent);
12540 }
12541 }
12542
12543 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12544 {
12545
12546 }
12547
12549 {
12550
12551 return false;
12552 }
12553
12555 {
12556
12557
12558 return false;
12559 }
12560
12562 {
12563
12564 return false;
12565 }
12566
12569 {
12570 return !GetIsFrozen() &&
IsOpen();
12571 }
12572
12574 {
12575 bool hasParent = false, hasRootAsPlayer = false;
12577
12578 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12579 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12580
12581 if (wwtu || foodDecay)
12582 {
12586
12587 if (processWetness || processTemperature || processDecay)
12588 {
12590
12591 if (processWetness)
12592 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12593
12594 if (processTemperature)
12596
12597 if (processDecay)
12598 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12599 }
12600 }
12601 }
12602
12605 {
12607 }
12608
12610 {
12613
12614 return super.GetTemperatureFreezeThreshold();
12615 }
12616
12618 {
12621
12622 return super.GetTemperatureThawThreshold();
12623 }
12624
12626 {
12629
12630 return super.GetItemOverheatThreshold();
12631 }
12632
12634 {
12636 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12637
12638 return super.GetTemperatureFreezeTime();
12639 }
12640
12642 {
12644 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12645
12646 return super.GetTemperatureThawTime();
12647 }
12648
12653
12655 {
12656 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12657 }
12658
12660 {
12661 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12662 }
12663
12666 {
12668 }
12669
12671 {
12673 }
12674
12676 {
12678 }
12679
12682 {
12683 return null;
12684 }
12685
12688 {
12689 return false;
12690 }
12691
12693 {
12695 {
12698 if (!trg)
12699 {
12701 explosive = this;
12702 }
12703
12704 explosive.PairRemote(trg);
12706
12707 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12708 trg.SetPersistentPairID(persistentID);
12709 explosive.SetPersistentPairID(persistentID);
12710
12711 return true;
12712 }
12713 return false;
12714 }
12715
12718 {
12719 float ret = 1.0;
12722 ret *= GetHealth01();
12723
12724 return ret;
12725 }
12726
12727 #ifdef DEVELOPER
12728 override void SetDebugItem()
12729 {
12730 super.SetDebugItem();
12731 _itemBase = this;
12732 }
12733
12735 {
12736 string text = super.GetDebugText();
12737
12739 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12740
12741 return text;
12742 }
12743 #endif
12744
12746 {
12747 return true;
12748 }
12749
12751
12753
12755 {
12758 }
12759
12760
12768
12784}
12785
12787{
12789 if (entity)
12790 {
12791 bool is_item = entity.IsInherited(
ItemBase);
12792 if (is_item && full_quantity)
12793 {
12796 }
12797 }
12798 else
12799 {
12801 return NULL;
12802 }
12803 return entity;
12804}
12805
12807{
12808 if (item)
12809 {
12810 if (health > 0)
12811 item.SetHealth("", "", health);
12812
12813 if (item.CanHaveTemperature())
12814 {
12816 if (item.CanFreeze())
12817 item.SetFrozen(false);
12818 }
12819
12820 if (item.HasEnergyManager())
12821 {
12822 if (quantity >= 0)
12823 {
12824 item.GetCompEM().SetEnergy0To1(quantity);
12825 }
12826 else
12827 {
12829 }
12830 }
12831 else if (item.IsMagazine())
12832 {
12833 Magazine mag = Magazine.Cast(item);
12834 if (quantity >= 0)
12835 {
12836 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12837 }
12838 else
12839 {
12841 }
12842
12843 }
12844 else
12845 {
12846 if (quantity >= 0)
12847 {
12848 item.SetQuantityNormalized(quantity, false);
12849 }
12850 else
12851 {
12853 }
12854
12855 }
12856 }
12857}
12858
12859#ifdef DEVELOPER
12861#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.