8075{
8077 {
8078 return true;
8079 }
8080};
8081
8082
8083
8085{
8089
8091
8094
8095
8096
8097
8098
8107
8113
8118
8123
8144 protected bool m_IsResultOfSplit
8145
8147
8152
8153
8154
8156
8160
8161
8162
8164
8167
8168
8169
8175
8176
8184
8187
8188
8190
8191
8193
8194
8199
8200
8205
8206
8208
8209
8211 {
8216
8217 if (!
GetGame().IsDedicatedServer())
8218 {
8220 {
8222
8224 {
8226 }
8227 }
8228
8231 }
8232
8233 m_OldLocation = null;
8234
8236 {
8238 }
8239
8240 if (ConfigIsExisting("headSelectionsToHide"))
8241 {
8244 }
8245
8247 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8248 {
8250 }
8251
8253
8254 m_IsResultOfSplit = false;
8255
8257 }
8258
8260 {
8261 super.InitItemVariables();
8262
8268 m_Count = ConfigGetInt(
"count");
8269
8272
8277
8280
8285
8297
8301
8302
8305 if (ConfigIsExisting("canBeSplit"))
8306 {
8309 }
8310
8312 if (ConfigIsExisting("itemBehaviour"))
8314
8315
8318 RegisterNetSyncVariableInt("m_VarLiquidType");
8319 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8320
8321 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8322 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8323 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8324
8325 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8326 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8327 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8328 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8329
8330 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8331 RegisterNetSyncVariableBool("m_IsTakeable");
8332 RegisterNetSyncVariableBool("m_IsHologram");
8333
8336 {
8339 }
8340
8342
8344 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8346
8347 }
8348
8350 {
8352 }
8353
8355 {
8358 {
8363 }
8364 }
8365
8366 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8367 {
8369 {
8372 }
8373
8375 }
8376
8378 {
8384 }
8385
8387
8389 {
8391
8392 if (!action)
8393 {
8394 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8395 return;
8396 }
8397
8399 if (!ai)
8400 {
8402 return;
8403 }
8404
8406 if (!action_array)
8407 {
8408 action_array = new array<ActionBase_Basic>;
8410 }
8411 if (LogManager.IsActionLogEnable())
8412 {
8413 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8414 }
8415
8416 if (action_array.Find(action) != -1)
8417 {
8418 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8419 }
8420 else
8421 {
8422 action_array.Insert(action);
8423 }
8424 }
8425
8427 {
8429 ActionBase action = player.GetActionManager().GetAction(actionName);
8432
8433 if (action_array)
8434 {
8435 action_array.RemoveItem(action);
8436 }
8437 }
8438
8439
8440
8442 {
8443 ActionOverrideData overrideData = new ActionOverrideData();
8447
8449 if (!actionMap)
8450 {
8453 }
8454
8455 actionMap.Insert(this.
Type(), overrideData);
8456
8457 }
8458
8460
8462
8463
8465 {
8468
8471
8472 string config_to_search = "CfgVehicles";
8473 string muzzle_owner_config;
8474
8476 {
8477 if (IsInherited(Weapon))
8478 config_to_search = "CfgWeapons";
8479
8480 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8481
8482 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8483
8485
8486 if (config_OnFire_subclass_count > 0)
8487 {
8488 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8489
8490 for (int i = 0; i < config_OnFire_subclass_count; i++)
8491 {
8492 string particle_class = "";
8494 string config_OnFire_entry = config_OnFire_class + particle_class;
8495 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8496 WPOF_array.Insert(WPOF);
8497 }
8498
8499
8501 }
8502 }
8503
8505 {
8506 config_to_search = "CfgWeapons";
8507 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8508
8509 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8510
8512
8513 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8514 {
8515 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8516
8517 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8518 {
8519 string particle_class2 = "";
8521 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8522 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8523 WPOBE_array.Insert(WPOBE);
8524 }
8525
8526
8528 }
8529 }
8530 }
8531
8532
8534 {
8537
8539 {
8540 string config_to_search = "CfgVehicles";
8541
8542 if (IsInherited(Weapon))
8543 config_to_search = "CfgWeapons";
8544
8545 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8546 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8547
8548 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8549 {
8550
8552
8554 {
8556 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8558 return;
8559 }
8560
8563
8564
8565
8567 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8568
8569 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8570 {
8571 string particle_class = "";
8573 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8575
8576 if (entry_type == CT_CLASS)
8577 {
8578 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8579 WPOOH_array.Insert(WPOF);
8580 }
8581 }
8582
8583
8585 }
8586 }
8587 }
8588
8590 {
8592 }
8593
8595 {
8597 {
8599
8602
8605
8606 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8607 }
8608 }
8609
8611 {
8613 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8614
8616 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8617
8619 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8620
8622 {
8624 }
8625 }
8626
8628 {
8630 }
8631
8633 {
8636 else
8638
8640 {
8643 }
8644 else
8645 {
8648
8651 }
8652
8654 }
8655
8657 {
8659 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8660 }
8661
8663 {
8665 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8667 }
8668
8670 {
8672 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8673 }
8674
8676 {
8679
8680 OverheatingParticle OP = new OverheatingParticle();
8685
8687 }
8688
8690 {
8693
8694 return -1;
8695 }
8696
8698 {
8700 {
8703
8704 for (int i = count; i > 0; --i)
8705 {
8706 int id = i - 1;
8709
8712
8713 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8714 {
8715 if (p)
8716 {
8719 }
8720 }
8721 }
8722 }
8723 }
8724
8726 {
8728 {
8730 {
8731 int id = i - 1;
8733
8734 if (OP)
8735 {
8737
8738 if (p)
8739 {
8741 }
8742
8743 delete OP;
8744 }
8745 }
8746
8749 }
8750 }
8751
8754 {
8755 return 0.0;
8756 }
8757
8758
8760 {
8761 return 250;
8762 }
8763
8765 {
8766 return 0;
8767 }
8768
8771 {
8773 return true;
8774
8775 return false;
8776 }
8777
8780 {
8783
8785 {
8787 }
8788 else
8789 {
8790
8792 }
8793
8795 }
8796
8803 {
8804 return -1;
8805 }
8806
8807
8808
8809
8811 {
8813 {
8815 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8816
8817 if (r_index >= 0)
8818 {
8819 InventoryLocation r_il = new InventoryLocation;
8820 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8821
8822 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8825 {
8826 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8827 }
8829 {
8830 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8831 }
8832
8833 }
8834
8835 player.GetHumanInventory().ClearUserReservedLocation(this);
8836 }
8837
8840 }
8841
8842
8843
8844
8846 {
8847 return ItemBase.m_DebugActionsMask;
8848 }
8849
8851 {
8852 return ItemBase.m_DebugActionsMask & mask;
8853 }
8854
8856 {
8857 ItemBase.m_DebugActionsMask = mask;
8858 }
8859
8861 {
8862 ItemBase.m_DebugActionsMask |= mask;
8863 }
8864
8866 {
8867 ItemBase.m_DebugActionsMask &= ~mask;
8868 }
8869
8871 {
8873 {
8875 }
8876 else
8877 {
8879 }
8880 }
8881
8882
8884 {
8885 if (GetEconomyProfile())
8886 {
8887 float q_max = GetEconomyProfile().GetQuantityMax();
8888 if (q_max > 0)
8889 {
8890 float q_min = GetEconomyProfile().GetQuantityMin();
8891 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8892
8894 {
8895 ComponentEnergyManager comp = GetCompEM();
8897 {
8899 }
8900 }
8902 {
8904
8905 }
8906
8907 }
8908 }
8909 }
8910
8913 {
8914 EntityAI parent = GetHierarchyParent();
8915
8916 if (parent)
8917 {
8918 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8919 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8920 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8921 }
8922 }
8923
8926 {
8927 EntityAI parent = GetHierarchyParent();
8928
8929 if (parent)
8930 {
8931 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8932 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8933 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8934 }
8935 }
8936
8938 {
8939
8940
8941
8942
8944
8946 {
8947 if (ScriptInputUserData.CanStoreInputUserData())
8948 {
8949 ScriptInputUserData ctx = new ScriptInputUserData;
8955 ctx.
Write(use_stack_max);
8958
8960 {
8961 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8962 }
8963 }
8964 }
8965 else if (!
GetGame().IsMultiplayer())
8966 {
8968 }
8969 }
8970
8972 {
8974 }
8975
8977 {
8979 }
8980
8982 {
8984 }
8985
8987 {
8988
8989 return false;
8990 }
8991
8993 {
8994 return false;
8995 }
8996
9000 {
9001 return false;
9002 }
9003
9005 {
9006 return "";
9007 }
9008
9010
9012 {
9013 return false;
9014 }
9015
9017 {
9018 return true;
9019 }
9020
9021
9022
9024 {
9025 return true;
9026 }
9027
9029 {
9030 return true;
9031 }
9032
9034 {
9035 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9037 }
9038
9040 {
9042 }
9043
9045 {
9047 if (!is_being_placed)
9049 SetSynchDirty();
9050 }
9051
9052
9054
9056 {
9058 }
9059
9061 {
9063 }
9064
9066 {
9067 return 1;
9068 }
9069
9071 {
9072 return false;
9073 }
9074
9076 {
9078 SetSynchDirty();
9079 }
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9116 {
9117 super.OnMovedInsideCargo(container);
9118
9119 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9120 }
9121
9122 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9123 {
9124 super.EEItemLocationChanged(oldLoc,newLoc);
9125
9126 PlayerBase new_player = null;
9127 PlayerBase old_player = null;
9128
9129 if (newLoc.GetParent())
9130 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9131
9132 if (oldLoc.GetParent())
9133 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9134
9136 {
9137 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9138
9139 if (r_index >= 0)
9140 {
9141 InventoryLocation r_il = new InventoryLocation;
9142 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9143
9144 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9147 {
9148 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9149 }
9151 {
9152 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9153 }
9154
9155 }
9156 }
9157
9159 {
9160 if (new_player)
9161 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9162
9163 if (new_player == old_player)
9164 {
9165
9166 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9167 {
9169 {
9170 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9171 {
9172 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9173 }
9174 }
9175 else
9176 {
9177 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9178 }
9179 }
9180
9181 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9182 {
9183 int type = oldLoc.GetType();
9185 {
9186 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9187 }
9189 {
9190 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9191 }
9192 }
9193 if (!m_OldLocation)
9194 {
9195 m_OldLocation = new InventoryLocation;
9196 }
9197 m_OldLocation.Copy(oldLoc);
9198 }
9199 else
9200 {
9201 if (m_OldLocation)
9202 {
9203 m_OldLocation.Reset();
9204 }
9205 }
9206
9208 }
9209 else
9210 {
9211 if (new_player)
9212 {
9213 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9214 if (res_index >= 0)
9215 {
9216 InventoryLocation il = new InventoryLocation;
9217 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9219 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9222 {
9223 il.
GetParent().GetOnReleaseLock().Invoke(it);
9224 }
9226 {
9228 }
9229
9230 }
9231 }
9233 {
9234
9236 }
9237
9238 if (m_OldLocation)
9239 {
9240 m_OldLocation.Reset();
9241 }
9242 }
9243 }
9244
9245 override void EOnContact(IEntity other, Contact extra)
9246 {
9248 {
9249 int liquidType = -1;
9251 if (impactSpeed > 0.0)
9252 {
9254 #ifndef SERVER
9256 #else
9258 SetSynchDirty();
9259 #endif
9261 }
9262 }
9263
9264 #ifdef SERVER
9265 if (GetCompEM() && GetCompEM().IsPlugged())
9266 {
9267 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9268 GetCompEM().UnplugThis();
9269 }
9270 #endif
9271 }
9272
9274
9276 {
9278 }
9279
9281 {
9282
9283 }
9284
9286 {
9287 super.OnItemLocationChanged(old_owner, new_owner);
9288
9289 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9290 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9291
9292 if (!relatedPlayer && playerNew)
9293 relatedPlayer = playerNew;
9294
9295 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9296 {
9298 if (actionMgr)
9299 {
9300 ActionBase currentAction = actionMgr.GetRunningAction();
9301 if (currentAction)
9303 }
9304 }
9305
9306 Man ownerPlayerOld = null;
9307 Man ownerPlayerNew = null;
9308
9309 if (old_owner)
9310 {
9311 if (old_owner.
IsMan())
9312 {
9313 ownerPlayerOld = Man.Cast(old_owner);
9314 }
9315 else
9316 {
9317 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9318 }
9319 }
9320 else
9321 {
9323 {
9325
9326 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9327 {
9328 GetCompEM().UnplugThis();
9329 }
9330 }
9331 }
9332
9333 if (new_owner)
9334 {
9335 if (new_owner.
IsMan())
9336 {
9337 ownerPlayerNew = Man.Cast(new_owner);
9338 }
9339 else
9340 {
9341 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9342 }
9343 }
9344
9345 if (ownerPlayerOld != ownerPlayerNew)
9346 {
9347 if (ownerPlayerOld)
9348 {
9349 array<EntityAI> subItemsExit = new array<EntityAI>;
9351 for (int i = 0; i < subItemsExit.Count(); i++)
9352 {
9355 }
9356 }
9357
9358 if (ownerPlayerNew)
9359 {
9360 array<EntityAI> subItemsEnter = new array<EntityAI>;
9362 for (int j = 0; j < subItemsEnter.Count(); j++)
9363 {
9366 }
9367 }
9368 }
9369 else if (ownerPlayerNew != null)
9370 {
9371 PlayerBase nplayer;
9372 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9373 {
9374 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9376 for (int k = 0; k < subItemsUpdate.Count(); k++)
9377 {
9379 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9380 }
9381 }
9382 }
9383
9384 if (old_owner)
9385 old_owner.OnChildItemRemoved(this);
9386 if (new_owner)
9387 new_owner.OnChildItemReceived(this);
9388 }
9389
9390
9392 {
9393 super.EEDelete(parent);
9394 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9395 if (player)
9396 {
9398
9399 if (player.IsAlive())
9400 {
9401 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9402 if (r_index >= 0)
9403 {
9404 InventoryLocation r_il = new InventoryLocation;
9405 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9406
9407 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9410 {
9411 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9412 }
9414 {
9415 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9416 }
9417
9418 }
9419
9420 player.RemoveQuickBarEntityShortcut(this);
9421 }
9422 }
9423 }
9424
9426 {
9427 super.EEKilled(killer);
9428
9431 {
9432 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9433 {
9434 if (IsMagazine())
9435 {
9436 if (Magazine.Cast(this).GetAmmoCount() > 0)
9437 {
9439 }
9440 }
9441 else
9442 {
9444 }
9445 }
9446 }
9447 }
9448
9450 {
9451 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9452
9453 super.OnWasAttached(parent, slot_id);
9454
9457
9459 }
9460
9462 {
9463 super.OnWasDetached(parent, slot_id);
9464
9467 }
9468
9470 {
9471 int idx;
9474
9475 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9476 if (inventory_slots.Count() < 1)
9477 {
9478 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9479 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9480 }
9481 else
9482 {
9483 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9484 }
9485
9486 idx = inventory_slots.Find(slot);
9487 if (idx < 0)
9488 return "";
9489
9490 return attach_types.Get(idx);
9491 }
9492
9494 {
9495 int idx = -1;
9496 string slot;
9497
9500
9501 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9502 if (inventory_slots.Count() < 1)
9503 {
9504 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9505 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9506 }
9507 else
9508 {
9509 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9510 if (detach_types.Count() < 1)
9511 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9512 }
9513
9514 for (int i = 0; i < inventory_slots.Count(); i++)
9515 {
9516 slot = inventory_slots.Get(i);
9517 }
9518
9519 if (slot != "")
9520 {
9521 if (detach_types.Count() == 1)
9522 idx = 0;
9523 else
9524 idx = inventory_slots.Find(slot);
9525 }
9526 if (idx < 0)
9527 return "";
9528
9529 return detach_types.Get(idx);
9530 }
9531
9533 {
9534
9536
9537
9538 float min_time = 1;
9539 float max_time = 3;
9540 float delay = Math.RandomFloat(min_time, max_time);
9541
9542 explode_timer.Run(delay, this, "DoAmmoExplosion");
9543 }
9544
9546 {
9547 Magazine magazine = Magazine.Cast(this);
9548 int pop_sounds_count = 6;
9549 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9550
9551
9552 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9553 string sound_name = pop_sounds[ sound_idx ];
9555
9556
9557 magazine.ServerAddAmmoCount(-1);
9558
9559
9560 float min_temp_to_explode = 100;
9561
9562 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9563 {
9565 }
9566 }
9567
9568
9569 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9570 {
9571 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9572
9573 const int CHANCE_DAMAGE_CARGO = 4;
9574 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9575 const int CHANCE_DAMAGE_NOTHING = 2;
9576
9578 {
9579 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9580 int chances;
9581 int rnd;
9582
9583 if (GetInventory().GetCargo())
9584 {
9585 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9586 rnd = Math.RandomInt(0,chances);
9587
9588 if (rnd < CHANCE_DAMAGE_CARGO)
9589 {
9591 }
9592 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9593 {
9595 }
9596 }
9597 else
9598 {
9599 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9600 rnd = Math.RandomInt(0,chances);
9601
9602 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9603 {
9605 }
9606 }
9607 }
9608 }
9609
9611 {
9612 if (GetInventory().GetCargo())
9613 {
9614 int item_count = GetInventory().GetCargo().GetItemCount();
9615 if (item_count > 0)
9616 {
9617 int random_pick = Math.RandomInt(0, item_count);
9619 if (!item.IsExplosive())
9620 {
9621 item.AddHealth("","",damage);
9622 return true;
9623 }
9624 }
9625 }
9626 return false;
9627 }
9628
9630 {
9631 int attachment_count = GetInventory().AttachmentCount();
9632 if (attachment_count > 0)
9633 {
9634 int random_pick = Math.RandomInt(0, attachment_count);
9635 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9636 if (!attachment.IsExplosive())
9637 {
9638 attachment.AddHealth("","",damage);
9639 return true;
9640 }
9641 }
9642 return false;
9643 }
9644
9646 {
9648 }
9649
9651 {
9653 return GetInventory().CanRemoveEntity();
9654
9655 return false;
9656 }
9657
9659 {
9661 return;
9662
9664 {
9665 if (ScriptInputUserData.CanStoreInputUserData())
9666 {
9667 ScriptInputUserData ctx = new ScriptInputUserData;
9672 ctx.
Write(destination_entity);
9676 }
9677 }
9678 else if (!
GetGame().IsMultiplayer())
9679 {
9681 }
9682 }
9683
9685 {
9687 return;
9688
9689 float split_quantity_new;
9693 InventoryLocation loc = new InventoryLocation;
9694
9695 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9696 {
9698 split_quantity_new = stack_max;
9699 else
9701
9702 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9703 if (new_item)
9704 {
9705 new_item.SetResultOfSplit(true);
9706 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9708 new_item.SetQuantity(split_quantity_new);
9709 }
9710 }
9711 else if (destination_entity && slot_id == -1)
9712 {
9713 if (quantity > stack_max)
9714 split_quantity_new = stack_max;
9715 else
9716 split_quantity_new = quantity;
9717
9719 {
9722 }
9723
9724 if (new_item)
9725 {
9726 new_item.SetResultOfSplit(true);
9727 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9729 new_item.SetQuantity(split_quantity_new);
9730 }
9731 }
9732 else
9733 {
9734 if (stack_max != 0)
9735 {
9737 {
9739 }
9740
9741 if (split_quantity_new == 0)
9742 {
9743 if (!
GetGame().IsMultiplayer())
9744 player.PhysicalPredictiveDropItem(this);
9745 else
9746 player.ServerDropEntity(this);
9747 return;
9748 }
9749
9751
9752 if (new_item)
9753 {
9754 new_item.SetResultOfSplit(true);
9755 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9757 new_item.SetQuantity(stack_max);
9758 new_item.PlaceOnSurface();
9759 }
9760 }
9761 }
9762 }
9763
9765 {
9767 return;
9768
9769 float split_quantity_new;
9773 InventoryLocation loc = new InventoryLocation;
9774
9775 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9776 {
9778 split_quantity_new = stack_max;
9779 else
9781
9782 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9783 if (new_item)
9784 {
9785 new_item.SetResultOfSplit(true);
9786 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9788 new_item.SetQuantity(split_quantity_new);
9789 }
9790 }
9791 else if (destination_entity && slot_id == -1)
9792 {
9793 if (quantity > stack_max)
9794 split_quantity_new = stack_max;
9795 else
9796 split_quantity_new = quantity;
9797
9799 {
9802 }
9803
9804 if (new_item)
9805 {
9806 new_item.SetResultOfSplit(true);
9807 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9809 new_item.SetQuantity(split_quantity_new);
9810 }
9811 }
9812 else
9813 {
9814 if (stack_max != 0)
9815 {
9817 {
9819 }
9820
9822
9823 if (new_item)
9824 {
9825 new_item.SetResultOfSplit(true);
9826 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9828 new_item.SetQuantity(stack_max);
9829 new_item.PlaceOnSurface();
9830 }
9831 }
9832 }
9833 }
9834
9836 {
9838 return;
9839
9841 {
9842 if (ScriptInputUserData.CanStoreInputUserData())
9843 {
9844 ScriptInputUserData ctx = new ScriptInputUserData;
9849 dst.WriteToContext(ctx);
9851 }
9852 }
9853 else if (!
GetGame().IsMultiplayer())
9854 {
9856 }
9857 }
9858
9860 {
9862 return;
9863
9865 {
9866 if (ScriptInputUserData.CanStoreInputUserData())
9867 {
9868 ScriptInputUserData ctx = new ScriptInputUserData;
9873 ctx.
Write(destination_entity);
9879 }
9880 }
9881 else if (!
GetGame().IsMultiplayer())
9882 {
9884 }
9885 }
9886
9888 {
9890 }
9891
9893 {
9895 return this;
9896
9898 float split_quantity_new;
9900 if (dst.IsValid())
9901 {
9902 int slot_id = dst.GetSlot();
9904
9905 if (quantity > stack_max)
9906 split_quantity_new = stack_max;
9907 else
9908 split_quantity_new = quantity;
9909
9911
9912 if (new_item)
9913 {
9914 new_item.SetResultOfSplit(true);
9915 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9918 }
9919
9920 return new_item;
9921 }
9922
9923 return null;
9924 }
9925
9927 {
9929 return;
9930
9932 float split_quantity_new;
9934 if (destination_entity)
9935 {
9937 if (quantity > stackable)
9938 split_quantity_new = stackable;
9939 else
9940 split_quantity_new = quantity;
9941
9942 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9943 if (new_item)
9944 {
9945 new_item.SetResultOfSplit(true);
9946 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9948 new_item.SetQuantity(split_quantity_new);
9949 }
9950 }
9951 }
9952
9954 {
9956 return;
9957
9959 {
9960 if (ScriptInputUserData.CanStoreInputUserData())
9961 {
9962 ScriptInputUserData ctx = new ScriptInputUserData;
9967 ItemBase destination_entity =
this;
9968 ctx.
Write(destination_entity);
9972 }
9973 }
9974 else if (!
GetGame().IsMultiplayer())
9975 {
9977 }
9978 }
9979
9981 {
9983 return;
9984
9986 float split_quantity_new;
9988 if (player)
9989 {
9991 if (quantity > stackable)
9992 split_quantity_new = stackable;
9993 else
9994 split_quantity_new = quantity;
9995
9996 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9997 new_item =
ItemBase.Cast(in_hands);
9998 if (new_item)
9999 {
10000 new_item.SetResultOfSplit(true);
10001 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10003 new_item.SetQuantity(split_quantity_new);
10004 }
10005 }
10006 }
10007
10009 {
10011 return;
10012
10014 float split_quantity_new = Math.Floor(quantity * 0.5);
10015
10017
10018 if (new_item)
10019 {
10020 if (new_item.GetQuantityMax() < split_quantity_new)
10021 {
10022 split_quantity_new = new_item.GetQuantityMax();
10023 }
10024
10025 new_item.SetResultOfSplit(true);
10026 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10027
10029 {
10032 }
10033 else
10034 {
10037 }
10038 }
10039 }
10040
10042 {
10044 return;
10045
10047 float split_quantity_new = Math.Floor(quantity / 2);
10048
10049 InventoryLocation invloc = new InventoryLocation;
10051
10053 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10054
10055 if (new_item)
10056 {
10057 if (new_item.GetQuantityMax() < split_quantity_new)
10058 {
10059 split_quantity_new = new_item.GetQuantityMax();
10060 }
10062 {
10065 }
10066 else
10067 {
10070 }
10071 }
10072 }
10073
10076 {
10077 SetWeightDirty();
10079
10080 if (parent)
10081 parent.OnAttachmentQuantityChangedEx(this, delta);
10082
10084 {
10086 {
10088 }
10090 {
10091 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10093 }
10094 }
10095
10096 }
10097
10100 {
10101
10102 }
10103
10106 {
10108 }
10109
10111 {
10112 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10113
10115 {
10116 if (newLevel == GameConstants.STATE_RUINED)
10117 {
10119 EntityAI parent = GetHierarchyParent();
10120 if (parent && parent.IsFireplace())
10121 {
10122 CargoBase cargo = GetInventory().GetCargo();
10123 if (cargo)
10124 {
10126 {
10128 }
10129 }
10130 }
10131 }
10132
10134 {
10135
10137 return;
10138 }
10139
10140 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10141 {
10143 }
10144 }
10145 }
10146
10147
10149 {
10150 super.OnRightClick();
10151
10153 {
10155 {
10156 if (ScriptInputUserData.CanStoreInputUserData())
10157 {
10158 vector m4[4];
10160
10161 EntityAI root = GetHierarchyRoot();
10162
10163 InventoryLocation dst = new InventoryLocation;
10165 {
10166 if (root)
10167 {
10168 root.GetTransform(m4);
10170 }
10171 else
10172 GetInventory().GetCurrentInventoryLocation(dst);
10173 }
10174 else
10175 {
10177
10178
10179 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10180 {
10181 if (root)
10182 {
10183 root.GetTransform(m4);
10185 }
10186 else
10187 GetInventory().GetCurrentInventoryLocation(dst);
10188 }
10189 else
10190 {
10191 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10192 }
10193 }
10194
10195 ScriptInputUserData ctx = new ScriptInputUserData;
10203 }
10204 }
10205 else if (!
GetGame().IsMultiplayer())
10206 {
10208 }
10209 }
10210 }
10211
10212 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10213 {
10214
10215 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10216 return false;
10217
10218 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10219 return false;
10220
10221
10223 return false;
10224
10225
10226 Magazine mag = Magazine.Cast(this);
10227 if (mag)
10228 {
10229 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10230 return false;
10231
10232 if (stack_max_limit)
10233 {
10234 Magazine other_mag = Magazine.Cast(other_item);
10235 if (other_item)
10236 {
10237 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10238 return false;
10239 }
10240
10241 }
10242 }
10243 else
10244 {
10245
10247 return false;
10248
10250 return false;
10251 }
10252
10253 PlayerBase player = null;
10254 if (CastTo(player, GetHierarchyRootPlayer()))
10255 {
10256 if (player.GetInventory().HasAttachment(this))
10257 return false;
10258
10259 if (player.IsItemsToDelete())
10260 return false;
10261 }
10262
10263 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10264 return false;
10265
10266 int slotID;
10268 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10269 return false;
10270
10271 return true;
10272 }
10273
10275 {
10277 }
10278
10280 {
10281 return m_IsResultOfSplit;
10282 }
10283
10285 {
10286 m_IsResultOfSplit = value;
10287 }
10288
10290 {
10292 }
10293
10295 {
10296 float other_item_quantity = other_item.GetQuantity();
10297 float this_free_space;
10298
10300
10302
10303 if (other_item_quantity > this_free_space)
10304 {
10305 return this_free_space;
10306 }
10307 else
10308 {
10309 return other_item_quantity;
10310 }
10311 }
10312
10314 {
10316 }
10317
10319 {
10321 return;
10322
10323 if (!IsMagazine() && other_item)
10324 {
10326 if (quantity_used != 0)
10327 {
10328 float hp1 = GetHealth01("","");
10329 float hp2 = other_item.GetHealth01("","");
10330 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10331 hpResult = hpResult / (
GetQuantity() + quantity_used);
10332
10333 hpResult *= GetMaxHealth();
10334 Math.Round(hpResult);
10335 SetHealth("", "Health", hpResult);
10336
10338 other_item.AddQuantity(-quantity_used);
10339 }
10340 }
10342 }
10343
10345 {
10346 #ifdef SERVER
10347 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10348 GetHierarchyParent().IncreaseLifetimeUp();
10349 #endif
10350 };
10351
10353 {
10354 PlayerBase p = PlayerBase.Cast(player);
10355
10356 array<int> recipesIds = p.m_Recipes;
10357 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10358 if (moduleRecipesManager)
10359 {
10360 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10361 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10362 }
10363
10364 for (int i = 0;i < recipesIds.Count(); i++)
10365 {
10366 int key = recipesIds.Get(i);
10367 string recipeName = moduleRecipesManager.GetRecipeName(key);
10369 }
10370 }
10371
10372
10373 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10374 {
10375 super.GetDebugActions(outputList);
10376
10377
10382
10383
10387
10391
10392
10395
10396
10398 {
10401 }
10402
10404
10407
10411 }
10412
10413
10414
10415
10417 {
10418 super.OnAction(action_id, player, ctx);
10419 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10420 {
10421 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10422 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10423 PlayerBase p = PlayerBase.Cast(player);
10424 if (
EActions.RECIPES_RANGE_START < 1000)
10425 {
10426 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10427 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10428 }
10429 }
10430 #ifndef SERVER
10431 else if (action_id ==
EActions.WATCH_PLAYER)
10432 {
10433 PluginDeveloper.SetDeveloperItemClientEx(player);
10434 }
10435 #endif
10437 {
10438 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10439 {
10440 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10441 OnDebugButtonPressServer(id + 1);
10442 }
10443
10444 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10445 {
10446 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10448 }
10449
10450 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10451 {
10452 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10454 }
10455
10456 else if (action_id ==
EActions.ADD_QUANTITY)
10457 {
10458 if (IsMagazine())
10459 {
10460 Magazine mag = Magazine.Cast(this);
10461 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10462 }
10463 else
10464 {
10466 }
10467
10468 if (m_EM)
10469 {
10470 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10471 }
10472
10473 }
10474
10475 else if (action_id ==
EActions.REMOVE_QUANTITY)
10476 {
10477 if (IsMagazine())
10478 {
10479 Magazine mag2 = Magazine.Cast(this);
10480 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10481 }
10482 else
10483 {
10485 }
10486 if (m_EM)
10487 {
10488 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10489 }
10490
10491 }
10492
10493 else if (action_id ==
EActions.SET_QUANTITY_0)
10494 {
10496
10497 if (m_EM)
10498 {
10499 m_EM.SetEnergy(0);
10500 }
10501 }
10502
10503 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10504 {
10506
10507 if (m_EM)
10508 {
10509 m_EM.SetEnergy(m_EM.GetEnergyMax());
10510 }
10511 }
10512
10513 else if (action_id ==
EActions.ADD_HEALTH)
10514 {
10515 AddHealth("","",GetMaxHealth("","Health")/5);
10516 }
10517 else if (action_id ==
EActions.REMOVE_HEALTH)
10518 {
10519 AddHealth("","",-GetMaxHealth("","Health")/5);
10520 }
10521 else if (action_id ==
EActions.DESTROY_HEALTH)
10522 {
10523 SetHealth01("","",0);
10524 }
10525 else if (action_id ==
EActions.WATCH_ITEM)
10526 {
10528 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10529 #ifdef DEVELOPER
10530 SetDebugDeveloper_item(this);
10531 #endif
10532 }
10533
10534 else if (action_id ==
EActions.ADD_TEMPERATURE)
10535 {
10536 AddTemperature(20);
10537
10538 }
10539
10540 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10541 {
10542 AddTemperature(-20);
10543
10544 }
10545
10546 else if (action_id ==
EActions.FLIP_FROZEN)
10547 {
10548 SetFrozen(!GetIsFrozen());
10549
10550 }
10551
10552 else if (action_id ==
EActions.ADD_WETNESS)
10553 {
10555
10556 }
10557
10558 else if (action_id ==
EActions.REMOVE_WETNESS)
10559 {
10561
10562 }
10563
10564 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10565 {
10568
10569
10570 }
10571
10572 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10573 {
10576 }
10577
10578 else if (action_id ==
EActions.MAKE_SPECIAL)
10579 {
10580 auto debugParams = DebugSpawnParams.WithPlayer(player);
10581 OnDebugSpawnEx(debugParams);
10582 }
10583
10584 else if (action_id ==
EActions.DELETE)
10585 {
10586 Delete();
10587 }
10588
10589 }
10590
10591
10592 return false;
10593 }
10594
10595
10596
10597
10601
10604
10605
10606
10608 {
10609 return false;
10610 }
10611
10612
10614 {
10615 return true;
10616 }
10617
10618
10620 {
10621 return true;
10622 }
10623
10624
10625
10627 {
10628 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10630 }
10631
10634 {
10635 return null;
10636 }
10637
10639 {
10640 return false;
10641 }
10642
10644 {
10645 return false;
10646 }
10647
10651
10652
10654 {
10655 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10656 return module_repairing.CanRepair(this, item_repair_kit);
10657 }
10658
10659
10660 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10661 {
10662 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10663 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10664 }
10665
10666
10668 {
10669
10670
10671
10672
10673
10674
10675
10676
10677 return 1;
10678 }
10679
10680
10681
10683 {
10685 }
10686
10687
10688
10690 {
10692 }
10693
10694
10703 {
10704 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10705
10706 if (player)
10707 {
10708 player.MessageStatus(text);
10709 }
10710 }
10711
10712
10721 {
10722 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10723
10724 if (player)
10725 {
10726 player.MessageAction(text);
10727 }
10728 }
10729
10730
10739 {
10740 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10741
10742 if (player)
10743 {
10744 player.MessageFriendly(text);
10745 }
10746 }
10747
10748
10757 {
10758 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10759
10760 if (player)
10761 {
10762 player.MessageImportant(text);
10763 }
10764 }
10765
10767 {
10768 return true;
10769 }
10770
10771
10772 override bool KindOf(
string tag)
10773 {
10774 bool found = false;
10775 string item_name = this.
GetType();
10778
10779 int array_size = item_tag_array.Count();
10780 for (int i = 0; i < array_size; i++)
10781 {
10782 if (item_tag_array.Get(i) == tag)
10783 {
10784 found = true;
10785 break;
10786 }
10787 }
10788 return found;
10789 }
10790
10791
10793 {
10794
10795 super.OnRPC(sender, rpc_type,ctx);
10796
10797
10798 switch (rpc_type)
10799 {
10800 #ifndef SERVER
10801 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10802 Param2<bool, string> p = new Param2<bool, string>(false, "");
10803
10805 return;
10806
10807 bool play = p.param1;
10808 string soundSet = p.param2;
10809
10810 if (play)
10811 {
10813 {
10815 {
10817 }
10818 }
10819 else
10820 {
10822 }
10823 }
10824 else
10825 {
10827 }
10828
10829 break;
10830 #endif
10831
10832 }
10833
10835 {
10837 }
10838 }
10839
10840
10841
10842
10844 {
10845 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10846 return plugin.GetID(
name);
10847 }
10848
10850 {
10851 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10852 return plugin.GetName(id);
10853 }
10854
10857 {
10858
10859
10860 int varFlags;
10861 if (!ctx.
Read(varFlags))
10862 return;
10863
10864 if (varFlags & ItemVariableFlags.FLOAT)
10865 {
10867 }
10868 }
10869
10871 {
10872
10873 super.SerializeNumericalVars(floats_out);
10874
10875
10876
10878 {
10880 }
10881
10883 {
10885 }
10886
10888 {
10890 }
10891
10893 {
10898 }
10899
10901 {
10903 }
10904 }
10905
10907 {
10908
10909 super.DeSerializeNumericalVars(floats);
10910
10911
10912 int index = 0;
10913 int mask = Math.Round(floats.Get(index));
10914
10915 index++;
10916
10918 {
10920 {
10922 }
10923 else
10924 {
10925 float quantity = floats.Get(index);
10926 SetQuantity(quantity,
true,
false,
false,
false);
10927 }
10928 index++;
10929 }
10930
10932 {
10933 float wet = floats.Get(index);
10935 index++;
10936 }
10937
10939 {
10940 int liquidtype = Math.Round(floats.Get(index));
10942 index++;
10943 }
10944
10946 {
10948 index++;
10950 index++;
10952 index++;
10954 index++;
10955 }
10956
10958 {
10959 int cleanness = Math.Round(floats.Get(index));
10961 index++;
10962 }
10963 }
10964
10966 {
10967 super.WriteVarsToCTX(ctx);
10968
10969
10971 {
10973 }
10974
10976 {
10978 }
10979
10981 {
10983 }
10984
10986 {
10987 int r,g,b,a;
10993 }
10994
10996 {
10998 }
10999 }
11000
11002 {
11003 if (!super.ReadVarsFromCTX(ctx,version))
11004 return false;
11005
11006 int intValue;
11007 float value;
11008
11009 if (version < 140)
11010 {
11011 if (!ctx.
Read(intValue))
11012 return false;
11013
11014 m_VariablesMask = intValue;
11015 }
11016
11018 {
11019 if (!ctx.
Read(value))
11020 return false;
11021
11023 {
11025 }
11026 else
11027 {
11029 }
11030 }
11031
11032 if (version < 140)
11033 {
11035 {
11036 if (!ctx.
Read(value))
11037 return false;
11038 SetTemperatureDirect(value);
11039 }
11040 }
11041
11043 {
11044 if (!ctx.
Read(value))
11045 return false;
11047 }
11048
11050 {
11051 if (!ctx.
Read(intValue))
11052 return false;
11054 }
11055
11057 {
11058 int r,g,b,a;
11060 return false;
11062 return false;
11064 return false;
11066 return false;
11067
11069 }
11070
11072 {
11073 if (!ctx.
Read(intValue))
11074 return false;
11076 }
11077
11078 if (version >= 138 && version < 140)
11079 {
11081 {
11082 if (!ctx.
Read(intValue))
11083 return false;
11084 SetFrozen(intValue);
11085 }
11086 }
11087
11088 return true;
11089 }
11090
11091
11093 {
11096 {
11098 }
11099
11100 if (!super.OnStoreLoad(ctx, version))
11101 {
11103 return false;
11104 }
11105
11106 if (version >= 114)
11107 {
11108 bool hasQuickBarIndexSaved;
11109
11110 if (!ctx.
Read(hasQuickBarIndexSaved))
11111 {
11113 return false;
11114 }
11115
11116 if (hasQuickBarIndexSaved)
11117 {
11118 int itmQBIndex;
11119
11120
11121 if (!ctx.
Read(itmQBIndex))
11122 {
11124 return false;
11125 }
11126
11127 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11128 if (itmQBIndex != -1 && parentPlayer)
11129 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11130 }
11131 }
11132 else
11133 {
11134
11135 PlayerBase player;
11136 int itemQBIndex;
11137 if (version ==
int.
MAX)
11138 {
11139 if (!ctx.
Read(itemQBIndex))
11140 {
11142 return false;
11143 }
11144 }
11145 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11146 {
11147
11148 if (!ctx.
Read(itemQBIndex))
11149 {
11151 return false;
11152 }
11153 if (itemQBIndex != -1 && player)
11154 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11155 }
11156 }
11157
11158 if (version < 140)
11159 {
11160
11161 if (!LoadVariables(ctx, version))
11162 {
11164 return false;
11165 }
11166 }
11167
11168
11170 {
11172 return false;
11173 }
11174 if (version >= 132)
11175 {
11177 if (raib)
11178 {
11180 {
11182 return false;
11183 }
11184 }
11185 }
11186
11188 return true;
11189 }
11190
11191
11192
11194 {
11195 super.OnStoreSave(ctx);
11196
11197 PlayerBase player;
11198 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11199 {
11201
11202 int itemQBIndex = -1;
11203 itemQBIndex = player.FindQuickBarEntityIndex(this);
11204 ctx.
Write(itemQBIndex);
11205 }
11206 else
11207 {
11209 }
11210
11212
11214 if (raib)
11215 {
11217 }
11218 }
11219
11220
11222 {
11223 super.AfterStoreLoad();
11224
11226 {
11228 }
11229
11231 {
11234 }
11235 }
11236
11238 {
11239 super.EEOnAfterLoad();
11240
11242 {
11244 }
11245
11248 }
11249
11251 {
11252 return false;
11253 }
11254
11255
11256
11258 {
11260 {
11261 #ifdef PLATFORM_CONSOLE
11262
11264 {
11266 if (menu)
11267 {
11269 }
11270 }
11271 #endif
11272 }
11273
11275 {
11278 }
11279
11281 {
11282 SetWeightDirty();
11284 }
11286 {
11289 }
11290
11292 {
11295 }
11297 {
11300 }
11301
11302 super.OnVariablesSynchronized();
11303 }
11304
11305
11306
11308 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11309 {
11310 if (!IsServerCheck(allow_client))
11311 return false;
11312
11314 return false;
11315
11318
11319 if (value <= (min + 0.001))
11320 value = min;
11321
11322 if (value == min)
11323 {
11324 if (destroy_config)
11325 {
11326 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11327 if (dstr)
11328 {
11330 this.Delete();
11331 return true;
11332 }
11333 }
11334 else if (destroy_forced)
11335 {
11337 this.Delete();
11338 return true;
11339 }
11340
11342 }
11343
11346
11348 {
11350
11351 if (delta)
11353 }
11354
11356
11357 return false;
11358 }
11359
11360
11362 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11363 {
11365 }
11366
11368 {
11371 }
11372
11374 {
11377 }
11378
11381 {
11382 float value_clamped = Math.Clamp(value, 0, 1);
11384 SetQuantity(result, destroy_config, destroy_forced);
11385 }
11386
11387
11390 {
11392 }
11393
11395 {
11397 }
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11409 {
11410 int slot = -1;
11411 if (GetInventory())
11412 {
11413 InventoryLocation il = new InventoryLocation;
11414 GetInventory().GetCurrentInventoryLocation(il);
11416 }
11417
11419 }
11420
11422 {
11423 float quantity_max = 0;
11424
11426 {
11427 if (attSlotID != -1)
11428 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11429
11430 if (quantity_max <= 0)
11432 }
11433
11434 if (quantity_max <= 0)
11436
11437 return quantity_max;
11438 }
11439
11441 {
11443 }
11444
11446 {
11448 }
11449
11450
11452 {
11454 }
11455
11457 {
11459 }
11460
11462 {
11464 }
11465
11466
11468 {
11469
11470 float weightEx = GetWeightEx();
11471 float special = GetInventoryAndCargoWeight();
11472 return weightEx - special;
11473 }
11474
11475
11477 {
11479 }
11480
11482 {
11484 {
11485 #ifdef DEVELOPER
11486 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11487 {
11488 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11490 }
11491 #endif
11492
11493 return GetQuantity() * GetConfigWeightModified();
11494 }
11495 else if (HasEnergyManager())
11496 {
11497 #ifdef DEVELOPER
11498 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11499 {
11500 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11501 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11502 }
11503 #endif
11504 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11505 }
11506 else
11507 {
11508 #ifdef DEVELOPER
11509 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11510 {
11511 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11512 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11513 }
11514 #endif
11515 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11516 }
11517 }
11518
11521 {
11522 int item_count = 0;
11524
11525 if (GetInventory().GetCargo() != NULL)
11526 {
11527 item_count = GetInventory().GetCargo().GetItemCount();
11528 }
11529
11530 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11531 {
11532 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11533 if (item)
11534 item_count += item.GetNumberOfItems();
11535 }
11536 return item_count;
11537 }
11538
11541 {
11542 float weight = 0;
11543 float wetness = 1;
11544 if (include_wetness)
11547 {
11548 weight = wetness * m_ConfigWeight;
11549 }
11551 {
11552 weight = 1;
11553 }
11554 return weight;
11555 }
11556
11557
11558
11560 {
11561 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11562 {
11563 GameInventory inv = GetInventory();
11564 array<EntityAI> items = new array<EntityAI>;
11566 for (int i = 0; i < items.Count(); i++)
11567 {
11569 if (item)
11570 {
11572 }
11573 }
11574 }
11575 }
11576
11577
11578
11579
11581 {
11582 float energy = 0;
11583 if (HasEnergyManager())
11584 {
11585 energy = GetCompEM().GetEnergy();
11586 }
11587 return energy;
11588 }
11589
11590
11592 {
11593 super.OnEnergyConsumed();
11594
11596 }
11597
11599 {
11600 super.OnEnergyAdded();
11601
11603 }
11604
11605
11607 {
11608 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11609 {
11611 {
11612 float energy_0to1 = GetCompEM().GetEnergy0To1();
11614 }
11615 }
11616 }
11617
11618
11620 {
11621 return ConfigGetFloat("heatIsolation");
11622 }
11623
11625 {
11627 }
11628
11630 {
11631 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11632 if (
GetGame().ConfigIsExisting(paramPath))
11634
11635 return 0.0;
11636 }
11637
11639 {
11640 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11641 if (
GetGame().ConfigIsExisting(paramPath))
11643
11644 return 0.0;
11645 }
11646
11647 override void SetWet(
float value,
bool allow_client =
false)
11648 {
11649 if (!IsServerCheck(allow_client))
11650 return;
11651
11654
11656
11657 m_VarWet = Math.Clamp(value, min, max);
11658
11660 {
11663 }
11664 }
11665
11666 override void AddWet(
float value)
11667 {
11669 }
11670
11672 {
11674 }
11675
11677 {
11679 }
11680
11682 {
11684 }
11685
11687 {
11689 }
11690
11692 {
11694 }
11695
11696 override void OnWetChanged(
float newVal,
float oldVal)
11697 {
11700 if (newLevel != oldLevel)
11701 {
11703 }
11704 }
11705
11707 {
11708 SetWeightDirty();
11709 }
11710
11712 {
11713 return GetWetLevelInternal(
m_VarWet);
11714 }
11715
11716
11717
11719 {
11721 }
11722
11724 {
11726 }
11727
11729 {
11731 }
11732
11734 {
11736 }
11737
11738
11739
11741 {
11742 if (ConfigIsExisting("itemModelLength"))
11743 {
11744 return ConfigGetFloat("itemModelLength");
11745 }
11746 return 0;
11747 }
11748
11750 {
11751 if (ConfigIsExisting("itemAttachOffset"))
11752 {
11753 return ConfigGetFloat("itemAttachOffset");
11754 }
11755 return 0;
11756 }
11757
11758 override void SetCleanness(
int value,
bool allow_client =
false)
11759 {
11760 if (!IsServerCheck(allow_client))
11761 return;
11762
11764
11766
11769 }
11770
11772 {
11774 }
11775
11777 {
11778 return true;
11779 }
11780
11781
11782
11783
11785 {
11787 }
11788
11790 {
11792 }
11793
11794
11795
11796
11797 override void SetColor(
int r,
int g,
int b,
int a)
11798 {
11804 }
11806 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11807 {
11812 }
11813
11815 {
11817 }
11818
11821 {
11822 int r,g,b,a;
11824 r = r/255;
11825 g = g/255;
11826 b = b/255;
11827 a = a/255;
11828 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11829 }
11830
11831
11832
11833 override void SetLiquidType(
int value,
bool allow_client =
false)
11834 {
11835 if (!IsServerCheck(allow_client))
11836 return;
11837
11842 }
11843
11845 {
11846 return ConfigGetInt("varLiquidTypeInit");
11847 }
11848
11850 {
11852 }
11853
11855 {
11857 SetFrozen(false);
11858 }
11859
11862 {
11863 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11864 }
11865
11866
11869 {
11870 PlayerBase nplayer;
11871 if (PlayerBase.CastTo(nplayer, player))
11872 {
11874
11875 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11876 }
11877 }
11878
11879
11882 {
11883 PlayerBase nplayer;
11884 if (PlayerBase.CastTo(nplayer,player))
11885 {
11886
11887 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11888
11889 }
11890
11891
11892 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11893
11894
11895 if (HasEnergyManager())
11896 {
11897 GetCompEM().UpdatePlugState();
11898 }
11899 }
11900
11901
11903 {
11904 super.OnPlacementStarted(player);
11905
11907 }
11908
11909 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11910 {
11912 {
11913 m_AdminLog.OnPlacementComplete(player,
this);
11914 }
11915
11916 super.OnPlacementComplete(player, position, orientation);
11917 }
11918
11919
11920
11921
11922
11924 {
11926 {
11927 return true;
11928 }
11929 else
11930 {
11931 return false;
11932 }
11933 }
11934
11935
11937 {
11939 {
11941 }
11942 }
11943
11944
11946 {
11948 }
11949
11951 {
11953 }
11954
11955 override void InsertAgent(
int agent,
float count = 1)
11956 {
11957 if (count < 1)
11958 return;
11959
11961 }
11962
11965 {
11967 }
11968
11969
11971 {
11973 }
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12017 {
12019 return false;
12020 return true;
12021 }
12022
12024 {
12025
12027 }
12028
12029
12032 {
12033 super.CheckForRoofLimited(timeTresholdMS);
12034
12036 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12037 {
12038 m_PreviousRoofTestTime = time;
12039 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12040 }
12041 }
12042
12043
12045 {
12047 {
12048 return 0;
12049 }
12050
12051 if (GetInventory().GetAttachmentSlotsCount() != 0)
12052 {
12053 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12054 if (filter)
12055 return filter.GetProtectionLevel(type, false, system);
12056 else
12057 return 0;
12058 }
12059
12060 string subclassPath, entryName;
12061
12062 switch (type)
12063 {
12065 entryName = "biological";
12066 break;
12068 entryName = "chemical";
12069 break;
12070 default:
12071 entryName = "biological";
12072 break;
12073 }
12074
12075 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12076
12078 }
12079
12080
12081
12084 {
12085 if (!IsMagazine())
12087
12089 }
12090
12091
12092
12093
12094
12099 {
12100 return true;
12101 }
12102
12104 {
12106 }
12107
12108
12109
12110
12111
12113 {
12114 if (parent)
12115 {
12116 if (parent.IsInherited(DayZInfected))
12117 return true;
12118
12119 if (!parent.IsRuined())
12120 return true;
12121 }
12122
12123 return true;
12124 }
12125
12127 {
12128 if (!super.CanPutAsAttachment(parent))
12129 {
12130 return false;
12131 }
12132
12133 if (!IsRuined() && !parent.IsRuined())
12134 {
12135 return true;
12136 }
12137
12138 return false;
12139 }
12140
12142 {
12143
12144
12145
12146
12147 return super.CanReceiveItemIntoCargo(item);
12148 }
12149
12151 {
12152
12153
12154
12155
12156 GameInventory attachmentInv = attachment.GetInventory();
12158 {
12159 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12160 return false;
12161 }
12162
12163 InventoryLocation loc = new InventoryLocation();
12164 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12165 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12166 return false;
12167
12168 return super.CanReceiveAttachment(attachment, slotId);
12169 }
12170
12172 {
12173 if (!super.CanReleaseAttachment(attachment))
12174 return false;
12175
12176 return GetInventory().AreChildrenAccessible();
12177 }
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12200 {
12201 int id = muzzle_owner.GetMuzzleID();
12202 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12203
12204 if (WPOF_array)
12205 {
12206 for (int i = 0; i < WPOF_array.Count(); i++)
12207 {
12208 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12209
12210 if (WPOF)
12211 {
12212 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12213 }
12214 }
12215 }
12216 }
12217
12218
12220 {
12221 int id = muzzle_owner.GetMuzzleID();
12223
12224 if (WPOBE_array)
12225 {
12226 for (int i = 0; i < WPOBE_array.Count(); i++)
12227 {
12228 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12229
12230 if (WPOBE)
12231 {
12232 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12233 }
12234 }
12235 }
12236 }
12237
12238
12240 {
12241 int id = muzzle_owner.GetMuzzleID();
12242 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12243
12244 if (WPOOH_array)
12245 {
12246 for (int i = 0; i < WPOOH_array.Count(); i++)
12247 {
12248 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12249
12250 if (WPOOH)
12251 {
12252 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12253 }
12254 }
12255 }
12256 }
12257
12258
12260 {
12261 int id = muzzle_owner.GetMuzzleID();
12262 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12263
12264 if (WPOOH_array)
12265 {
12266 for (int i = 0; i < WPOOH_array.Count(); i++)
12267 {
12268 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12269
12270 if (WPOOH)
12271 {
12272 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12273 }
12274 }
12275 }
12276 }
12277
12278
12280 {
12281 int id = muzzle_owner.GetMuzzleID();
12282 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12283
12284 if (WPOOH_array)
12285 {
12286 for (int i = 0; i < WPOOH_array.Count(); i++)
12287 {
12288 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12289
12290 if (WPOOH)
12291 {
12292 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12293 }
12294 }
12295 }
12296 }
12297
12298
12299
12301 {
12303 {
12304 return true;
12305 }
12306
12307 return false;
12308 }
12309
12311 {
12313 {
12314 return true;
12315 }
12316
12317 return false;
12318 }
12319
12321 {
12323 {
12324 return true;
12325 }
12326
12327 return false;
12328 }
12329
12331 {
12332 return false;
12333 }
12334
12337 {
12338 return UATimeSpent.DEFAULT_DEPLOY;
12339 }
12340
12341
12342
12343
12345 {
12347 SetSynchDirty();
12348 }
12349
12351 {
12353 }
12354
12355
12357 {
12358 return false;
12359 }
12360
12363 {
12364 string att_type = "None";
12365
12366 if (ConfigIsExisting("soundAttType"))
12367 {
12368 att_type = ConfigGetString("soundAttType");
12369 }
12370
12372 }
12373
12375 {
12377 }
12378
12379
12380
12381
12382
12386
12388 {
12391
12393 }
12394
12395
12397 {
12399 return;
12400
12402
12405
12408
12409 SoundParameters params = new SoundParameters();
12413 }
12414
12415
12417 {
12419 return;
12420
12422 SetSynchDirty();
12423
12426 }
12427
12428
12430 {
12432 return;
12433
12435 SetSynchDirty();
12436
12439 }
12440
12442 {
12444 }
12445
12447 {
12449 }
12450
12453 {
12454 if (!
GetGame().IsDedicatedServer())
12455 {
12456 if (ConfigIsExisting("attachSoundSet"))
12457 {
12458 string cfg_path = "";
12459 string soundset = "";
12460 string type_name =
GetType();
12461
12464 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12465 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12466
12467 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12468 {
12469 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12470 {
12471 if (cfg_slot_array[i] == slot_type)
12472 {
12473 soundset = cfg_soundset_array[i];
12474 break;
12475 }
12476 }
12477 }
12478
12479 if (soundset != "")
12480 {
12481 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12483 }
12484 }
12485 }
12486 }
12487
12489 {
12490
12491 }
12492
12493 void OnApply(PlayerBase player);
12494
12496 {
12497 return 1.0;
12498 };
12499
12501 {
12503 }
12504
12506 {
12508 }
12509
12511
12513 {
12514 SetDynamicPhysicsLifeTime(0.01);
12516 }
12517
12519 {
12520 array<string> zone_names = new array<string>;
12521 GetDamageZones(zone_names);
12522 for (int i = 0; i < zone_names.Count(); i++)
12523 {
12524 SetHealthMax(zone_names.Get(i),"Health");
12525 }
12526 SetHealthMax("","Health");
12527 }
12528
12531 {
12532 float global_health = GetHealth01("","Health");
12533 array<string> zones = new array<string>;
12534 GetDamageZones(zones);
12535
12536 for (int i = 0; i < zones.Count(); i++)
12537 {
12538 SetHealth01(zones.Get(i),"Health",global_health);
12539 }
12540 }
12541
12544 {
12545 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12546 }
12547
12549 {
12550 if (!hasRootAsPlayer)
12551 {
12552 if (refParentIB)
12553 {
12554
12555 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12556 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12557
12558 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12559 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12560
12563 }
12564 else
12565 {
12566
12569 }
12570 }
12571 }
12572
12574 {
12576 {
12577 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12578 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12579 {
12580 float heatPermCoef = 1.0;
12582 while (ent)
12583 {
12584 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12585 ent = ent.GetHierarchyParent();
12586 }
12587
12588 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12589 }
12590 }
12591 }
12592
12594 {
12595
12596 EntityAI parent = GetHierarchyParent();
12597 if (!parent)
12598 {
12599 hasParent = false;
12600 hasRootAsPlayer = false;
12601 }
12602 else
12603 {
12604 hasParent = true;
12605 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12606 refParentIB =
ItemBase.Cast(parent);
12607 }
12608 }
12609
12610 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12611 {
12612
12613 }
12614
12616 {
12617
12618 return false;
12619 }
12620
12622 {
12623
12624
12625 return false;
12626 }
12627
12629 {
12630
12631 return false;
12632 }
12633
12636 {
12637 return !GetIsFrozen() &&
IsOpen();
12638 }
12639
12641 {
12642 bool hasParent = false, hasRootAsPlayer = false;
12644
12645 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12646 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12647
12648 if (wwtu || foodDecay)
12649 {
12653
12654 if (processWetness || processTemperature || processDecay)
12655 {
12657
12658 if (processWetness)
12659 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12660
12661 if (processTemperature)
12663
12664 if (processDecay)
12665 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12666 }
12667 }
12668 }
12669
12672 {
12674 }
12675
12677 {
12680
12681 return super.GetTemperatureFreezeThreshold();
12682 }
12683
12685 {
12688
12689 return super.GetTemperatureThawThreshold();
12690 }
12691
12693 {
12696
12697 return super.GetItemOverheatThreshold();
12698 }
12699
12701 {
12703 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12704
12705 return super.GetTemperatureFreezeTime();
12706 }
12707
12709 {
12711 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12712
12713 return super.GetTemperatureThawTime();
12714 }
12715
12720
12722 {
12723 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12724 }
12725
12727 {
12728 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12729 }
12730
12733 {
12735 }
12736
12738 {
12740 }
12741
12743 {
12745 }
12746
12749 {
12750 return null;
12751 }
12752
12755 {
12756 return false;
12757 }
12758
12760 {
12762 {
12765 if (!trg)
12766 {
12768 explosive = this;
12769 }
12770
12771 explosive.PairRemote(trg);
12773
12774 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12775 trg.SetPersistentPairID(persistentID);
12776 explosive.SetPersistentPairID(persistentID);
12777
12778 return true;
12779 }
12780 return false;
12781 }
12782
12785 {
12786 float ret = 1.0;
12789 ret *= GetHealth01();
12790
12791 return ret;
12792 }
12793
12794 #ifdef DEVELOPER
12795 override void SetDebugItem()
12796 {
12797 super.SetDebugItem();
12798 _itemBase = this;
12799 }
12800
12802 {
12803 string text = super.GetDebugText();
12804
12806 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12807
12808 return text;
12809 }
12810 #endif
12811
12813 {
12814 return true;
12815 }
12816
12818
12820
12822 {
12825 }
12826
12827
12835
12851}
12852
12854{
12856 if (entity)
12857 {
12858 bool is_item = entity.IsInherited(
ItemBase);
12859 if (is_item && full_quantity)
12860 {
12863 }
12864 }
12865 else
12866 {
12868 return NULL;
12869 }
12870 return entity;
12871}
12872
12874{
12875 if (item)
12876 {
12877 if (health > 0)
12878 item.SetHealth("", "", health);
12879
12880 if (item.CanHaveTemperature())
12881 {
12883 if (item.CanFreeze())
12884 item.SetFrozen(false);
12885 }
12886
12887 if (item.HasEnergyManager())
12888 {
12889 if (quantity >= 0)
12890 {
12891 item.GetCompEM().SetEnergy0To1(quantity);
12892 }
12893 else
12894 {
12896 }
12897 }
12898 else if (item.IsMagazine())
12899 {
12900 Magazine mag = Magazine.Cast(item);
12901 if (quantity >= 0)
12902 {
12903 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12904 }
12905 else
12906 {
12908 }
12909
12910 }
12911 else
12912 {
12913 if (quantity >= 0)
12914 {
12915 item.SetQuantityNormalized(quantity, false);
12916 }
12917 else
12918 {
12920 }
12921
12922 }
12923 }
12924}
12925
12926#ifdef DEVELOPER
12928#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.