add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity reaches varQuantityMin or lower and the item config contains the varQuantityDestroyOnMin = true entry, the item gets destroyed. destroy_forced = true means item gets destroyed when quantity reaches varQuantityMin or lower regardless of config setting, returns true if the item gets deleted
8064{
8066 {
8067 return true;
8068 }
8069};
8070
8071
8072
8074{
8078
8080
8083
8084
8085
8086
8087
8096
8102
8107
8112
8133 protected bool m_IsResultOfSplit
8134
8136
8141
8142
8143
8145
8149
8150
8151
8153
8156
8157
8158
8164
8165
8173
8176
8177
8179
8180
8182
8183
8188
8189
8194
8195
8197
8198
8200 {
8205
8206 if (!
GetGame().IsDedicatedServer())
8207 {
8209 {
8211
8213 {
8215 }
8216 }
8217
8220 }
8221
8222 m_OldLocation = null;
8223
8225 {
8227 }
8228
8229 if (ConfigIsExisting("headSelectionsToHide"))
8230 {
8233 }
8234
8236 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8237 {
8239 }
8240
8242
8243 m_IsResultOfSplit = false;
8244
8246 }
8247
8249 {
8250 super.InitItemVariables();
8251
8257 m_Count = ConfigGetInt(
"count");
8258
8261
8266
8269
8274
8286
8290
8291
8294 if (ConfigIsExisting("canBeSplit"))
8295 {
8298 }
8299
8301 if (ConfigIsExisting("itemBehaviour"))
8303
8304
8307 RegisterNetSyncVariableInt("m_VarLiquidType");
8308 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8309
8310 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8311 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8312 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8313
8314 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8315 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8316 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8317 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8318
8319 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8320 RegisterNetSyncVariableBool("m_IsTakeable");
8321 RegisterNetSyncVariableBool("m_IsHologram");
8322
8325 {
8328 }
8329
8331
8333 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8335
8336 }
8337
8339 {
8341 }
8342
8344 {
8347 {
8352 }
8353 }
8354
8355 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8356 {
8358 {
8361 }
8362
8364 }
8365
8367 {
8373 }
8374
8376
8378 {
8380
8381 if (!action)
8382 {
8383 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8384 return;
8385 }
8386
8388 if (!ai)
8389 {
8391 return;
8392 }
8393
8395 if (!action_array)
8396 {
8397 action_array = new array<ActionBase_Basic>;
8399 }
8400 if (LogManager.IsActionLogEnable())
8401 {
8402 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8403 }
8404
8405 if (action_array.Find(action) != -1)
8406 {
8407 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8408 }
8409 else
8410 {
8411 action_array.Insert(action);
8412 }
8413 }
8414
8416 {
8418 ActionBase action = player.GetActionManager().GetAction(actionName);
8421
8422 if (action_array)
8423 {
8424 action_array.RemoveItem(action);
8425 }
8426 }
8427
8428
8429
8431 {
8432 ActionOverrideData overrideData = new ActionOverrideData();
8436
8438 if (!actionMap)
8439 {
8442 }
8443
8444 actionMap.Insert(this.
Type(), overrideData);
8445
8446 }
8447
8449
8451
8452
8454 {
8457
8460
8461 string config_to_search = "CfgVehicles";
8462 string muzzle_owner_config;
8463
8465 {
8466 if (IsInherited(Weapon))
8467 config_to_search = "CfgWeapons";
8468
8469 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8470
8471 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8472
8474
8475 if (config_OnFire_subclass_count > 0)
8476 {
8477 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8478
8479 for (int i = 0; i < config_OnFire_subclass_count; i++)
8480 {
8481 string particle_class = "";
8483 string config_OnFire_entry = config_OnFire_class + particle_class;
8484 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8485 WPOF_array.Insert(WPOF);
8486 }
8487
8488
8490 }
8491 }
8492
8494 {
8495 config_to_search = "CfgWeapons";
8496 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8497
8498 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8499
8501
8502 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8503 {
8504 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8505
8506 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8507 {
8508 string particle_class2 = "";
8510 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8511 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8512 WPOBE_array.Insert(WPOBE);
8513 }
8514
8515
8517 }
8518 }
8519 }
8520
8521
8523 {
8526
8528 {
8529 string config_to_search = "CfgVehicles";
8530
8531 if (IsInherited(Weapon))
8532 config_to_search = "CfgWeapons";
8533
8534 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8535 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8536
8537 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8538 {
8539
8541
8543 {
8545 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8547 return;
8548 }
8549
8552
8553
8554
8556 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8557
8558 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8559 {
8560 string particle_class = "";
8562 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8564
8565 if (entry_type == CT_CLASS)
8566 {
8567 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8568 WPOOH_array.Insert(WPOF);
8569 }
8570 }
8571
8572
8574 }
8575 }
8576 }
8577
8579 {
8581 }
8582
8584 {
8586 {
8588
8591
8594
8595 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8596 }
8597 }
8598
8600 {
8602 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8603
8605 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8606
8608 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8609
8611 {
8613 }
8614 }
8615
8617 {
8619 }
8620
8622 {
8625 else
8627
8629 {
8632 }
8633 else
8634 {
8637
8640 }
8641
8643 }
8644
8646 {
8648 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8649 }
8650
8652 {
8654 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8656 }
8657
8659 {
8661 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8662 }
8663
8665 {
8668
8669 OverheatingParticle OP = new OverheatingParticle();
8674
8676 }
8677
8679 {
8682
8683 return -1;
8684 }
8685
8687 {
8689 {
8692
8693 for (int i = count; i > 0; --i)
8694 {
8695 int id = i - 1;
8698
8701
8702 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8703 {
8704 if (p)
8705 {
8708 }
8709 }
8710 }
8711 }
8712 }
8713
8715 {
8717 {
8719 {
8720 int id = i - 1;
8722
8723 if (OP)
8724 {
8726
8727 if (p)
8728 {
8730 }
8731
8732 delete OP;
8733 }
8734 }
8735
8738 }
8739 }
8740
8743 {
8744 return 0.0;
8745 }
8746
8747
8749 {
8750 return 250;
8751 }
8752
8754 {
8755 return 0;
8756 }
8757
8760 {
8762 return true;
8763
8764 return false;
8765 }
8766
8769 {
8772
8774 {
8776 }
8777 else
8778 {
8779
8781 }
8782
8784 }
8785
8792 {
8793 return -1;
8794 }
8795
8796
8797
8798
8800 {
8802 {
8804 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8805
8806 if (r_index >= 0)
8807 {
8808 InventoryLocation r_il = new InventoryLocation;
8809 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8810
8811 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8814 {
8815 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8816 }
8818 {
8819 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8820 }
8821
8822 }
8823
8824 player.GetHumanInventory().ClearUserReservedLocation(this);
8825 }
8826
8829 }
8830
8831
8832
8833
8835 {
8836 return ItemBase.m_DebugActionsMask;
8837 }
8838
8840 {
8841 return ItemBase.m_DebugActionsMask & mask;
8842 }
8843
8845 {
8846 ItemBase.m_DebugActionsMask = mask;
8847 }
8848
8850 {
8851 ItemBase.m_DebugActionsMask |= mask;
8852 }
8853
8855 {
8856 ItemBase.m_DebugActionsMask &= ~mask;
8857 }
8858
8860 {
8862 {
8864 }
8865 else
8866 {
8868 }
8869 }
8870
8871
8873 {
8874 if (GetEconomyProfile())
8875 {
8876 float q_max = GetEconomyProfile().GetQuantityMax();
8877 if (q_max > 0)
8878 {
8879 float q_min = GetEconomyProfile().GetQuantityMin();
8880 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8881
8883 {
8884 ComponentEnergyManager comp = GetCompEM();
8886 {
8888 }
8889 }
8891 {
8893
8894 }
8895
8896 }
8897 }
8898 }
8899
8902 {
8903 EntityAI parent = GetHierarchyParent();
8904
8905 if (parent)
8906 {
8907 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8908 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8909 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8910 }
8911 }
8912
8915 {
8916 EntityAI parent = GetHierarchyParent();
8917
8918 if (parent)
8919 {
8920 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8921 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8922 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8923 }
8924 }
8925
8927 {
8928
8929
8930
8931
8933
8935 {
8936 if (ScriptInputUserData.CanStoreInputUserData())
8937 {
8938 ScriptInputUserData ctx = new ScriptInputUserData;
8944 ctx.
Write(use_stack_max);
8947
8949 {
8950 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8951 }
8952 }
8953 }
8954 else if (!
GetGame().IsMultiplayer())
8955 {
8957 }
8958 }
8959
8961 {
8963 }
8964
8966 {
8968 }
8969
8971 {
8973 }
8974
8976 {
8977
8978 return false;
8979 }
8980
8982 {
8983 return false;
8984 }
8985
8989 {
8990 return false;
8991 }
8992
8994 {
8995 return "";
8996 }
8997
8999
9001 {
9002 return false;
9003 }
9004
9006 {
9007 return true;
9008 }
9009
9010
9011
9013 {
9014 return true;
9015 }
9016
9018 {
9019 return true;
9020 }
9021
9023 {
9024 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9026 }
9027
9029 {
9031 }
9032
9034 {
9036 if (!is_being_placed)
9038 SetSynchDirty();
9039 }
9040
9041
9043
9045 {
9047 }
9048
9050 {
9052 }
9053
9055 {
9056 return 1;
9057 }
9058
9060 {
9061 return false;
9062 }
9063
9065 {
9067 SetSynchDirty();
9068 }
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
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
9105 {
9106 super.OnMovedInsideCargo(container);
9107
9108 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9109 }
9110
9111 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9112 {
9113 super.EEItemLocationChanged(oldLoc,newLoc);
9114
9115 PlayerBase new_player = null;
9116 PlayerBase old_player = null;
9117
9118 if (newLoc.GetParent())
9119 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9120
9121 if (oldLoc.GetParent())
9122 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9123
9125 {
9126 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9127
9128 if (r_index >= 0)
9129 {
9130 InventoryLocation r_il = new InventoryLocation;
9131 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9132
9133 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9136 {
9137 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9138 }
9140 {
9141 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9142 }
9143
9144 }
9145 }
9146
9148 {
9149 if (new_player)
9150 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9151
9152 if (new_player == old_player)
9153 {
9154
9155 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9156 {
9158 {
9159 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9160 {
9161 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9162 }
9163 }
9164 else
9165 {
9166 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9167 }
9168 }
9169
9170 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9171 {
9172 int type = oldLoc.GetType();
9174 {
9175 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9176 }
9178 {
9179 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9180 }
9181 }
9182 if (!m_OldLocation)
9183 {
9184 m_OldLocation = new InventoryLocation;
9185 }
9186 m_OldLocation.Copy(oldLoc);
9187 }
9188 else
9189 {
9190 if (m_OldLocation)
9191 {
9192 m_OldLocation.Reset();
9193 }
9194 }
9195
9197 }
9198 else
9199 {
9200 if (new_player)
9201 {
9202 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9203 if (res_index >= 0)
9204 {
9205 InventoryLocation il = new InventoryLocation;
9206 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9208 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9211 {
9212 il.
GetParent().GetOnReleaseLock().Invoke(it);
9213 }
9215 {
9217 }
9218
9219 }
9220 }
9222 {
9223
9225 }
9226
9227 if (m_OldLocation)
9228 {
9229 m_OldLocation.Reset();
9230 }
9231 }
9232 }
9233
9234 override void EOnContact(IEntity other, Contact extra)
9235 {
9237 {
9238 int liquidType = -1;
9240 if (impactSpeed > 0.0)
9241 {
9243 #ifndef SERVER
9245 #else
9247 SetSynchDirty();
9248 #endif
9250 }
9251 }
9252
9253 #ifdef SERVER
9254 if (GetCompEM() && GetCompEM().IsPlugged())
9255 {
9256 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9257 GetCompEM().UnplugThis();
9258 }
9259 #endif
9260 }
9261
9263
9265 {
9267 }
9268
9270 {
9271
9272 }
9273
9275 {
9276 super.OnItemLocationChanged(old_owner, new_owner);
9277
9278 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9279 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9280
9281 if (!relatedPlayer && playerNew)
9282 relatedPlayer = playerNew;
9283
9284 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9285 {
9287 if (actionMgr)
9288 {
9289 ActionBase currentAction = actionMgr.GetRunningAction();
9290 if (currentAction)
9292 }
9293 }
9294
9295 Man ownerPlayerOld = null;
9296 Man ownerPlayerNew = null;
9297
9298 if (old_owner)
9299 {
9300 if (old_owner.
IsMan())
9301 {
9302 ownerPlayerOld = Man.Cast(old_owner);
9303 }
9304 else
9305 {
9306 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9307 }
9308 }
9309 else
9310 {
9312 {
9314
9315 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9316 {
9317 GetCompEM().UnplugThis();
9318 }
9319 }
9320 }
9321
9322 if (new_owner)
9323 {
9324 if (new_owner.
IsMan())
9325 {
9326 ownerPlayerNew = Man.Cast(new_owner);
9327 }
9328 else
9329 {
9330 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9331 }
9332 }
9333
9334 if (ownerPlayerOld != ownerPlayerNew)
9335 {
9336 if (ownerPlayerOld)
9337 {
9338 array<EntityAI> subItemsExit = new array<EntityAI>;
9340 for (int i = 0; i < subItemsExit.Count(); i++)
9341 {
9344 }
9345 }
9346
9347 if (ownerPlayerNew)
9348 {
9349 array<EntityAI> subItemsEnter = new array<EntityAI>;
9351 for (int j = 0; j < subItemsEnter.Count(); j++)
9352 {
9355 }
9356 }
9357 }
9358 else if (ownerPlayerNew != null)
9359 {
9360 PlayerBase nplayer;
9361 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9362 {
9363 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9365 for (int k = 0; k < subItemsUpdate.Count(); k++)
9366 {
9368 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9369 }
9370 }
9371 }
9372
9373 if (old_owner)
9374 old_owner.OnChildItemRemoved(this);
9375 if (new_owner)
9376 new_owner.OnChildItemReceived(this);
9377 }
9378
9379
9381 {
9382 super.EEDelete(parent);
9383 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9384 if (player)
9385 {
9387
9388 if (player.IsAlive())
9389 {
9390 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9391 if (r_index >= 0)
9392 {
9393 InventoryLocation r_il = new InventoryLocation;
9394 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9395
9396 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9399 {
9400 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9401 }
9403 {
9404 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9405 }
9406
9407 }
9408
9409 player.RemoveQuickBarEntityShortcut(this);
9410 }
9411 }
9412 }
9413
9415 {
9416 super.EEKilled(killer);
9417
9420 {
9421 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9422 {
9423 if (IsMagazine())
9424 {
9425 if (Magazine.Cast(this).GetAmmoCount() > 0)
9426 {
9428 }
9429 }
9430 else
9431 {
9433 }
9434 }
9435 }
9436 }
9437
9439 {
9440 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9441
9442 super.OnWasAttached(parent, slot_id);
9443
9446
9448 }
9449
9451 {
9452 super.OnWasDetached(parent, slot_id);
9453
9456 }
9457
9459 {
9460 int idx;
9463
9464 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9465 if (inventory_slots.Count() < 1)
9466 {
9467 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9468 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9469 }
9470 else
9471 {
9472 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9473 }
9474
9475 idx = inventory_slots.Find(slot);
9476 if (idx < 0)
9477 return "";
9478
9479 return attach_types.Get(idx);
9480 }
9481
9483 {
9484 int idx = -1;
9485 string slot;
9486
9489
9490 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9491 if (inventory_slots.Count() < 1)
9492 {
9493 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9494 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9495 }
9496 else
9497 {
9498 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9499 if (detach_types.Count() < 1)
9500 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9501 }
9502
9503 for (int i = 0; i < inventory_slots.Count(); i++)
9504 {
9505 slot = inventory_slots.Get(i);
9506 }
9507
9508 if (slot != "")
9509 {
9510 if (detach_types.Count() == 1)
9511 idx = 0;
9512 else
9513 idx = inventory_slots.Find(slot);
9514 }
9515 if (idx < 0)
9516 return "";
9517
9518 return detach_types.Get(idx);
9519 }
9520
9522 {
9523
9525
9526
9527 float min_time = 1;
9528 float max_time = 3;
9529 float delay = Math.RandomFloat(min_time, max_time);
9530
9531 explode_timer.Run(delay, this, "DoAmmoExplosion");
9532 }
9533
9535 {
9536 Magazine magazine = Magazine.Cast(this);
9537 int pop_sounds_count = 6;
9538 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9539
9540
9541 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9542 string sound_name = pop_sounds[ sound_idx ];
9544
9545
9546 magazine.ServerAddAmmoCount(-1);
9547
9548
9549 float min_temp_to_explode = 100;
9550
9551 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9552 {
9554 }
9555 }
9556
9557
9558 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9559 {
9560 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9561
9562 const int CHANCE_DAMAGE_CARGO = 4;
9563 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9564 const int CHANCE_DAMAGE_NOTHING = 2;
9565
9567 {
9568 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9569 int chances;
9570 int rnd;
9571
9572 if (GetInventory().GetCargo())
9573 {
9574 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9575 rnd = Math.RandomInt(0,chances);
9576
9577 if (rnd < CHANCE_DAMAGE_CARGO)
9578 {
9580 }
9581 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9582 {
9584 }
9585 }
9586 else
9587 {
9588 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9589 rnd = Math.RandomInt(0,chances);
9590
9591 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9592 {
9594 }
9595 }
9596 }
9597 }
9598
9600 {
9601 if (GetInventory().GetCargo())
9602 {
9603 int item_count = GetInventory().GetCargo().GetItemCount();
9604 if (item_count > 0)
9605 {
9606 int random_pick = Math.RandomInt(0, item_count);
9608 if (!item.IsExplosive())
9609 {
9610 item.AddHealth("","",damage);
9611 return true;
9612 }
9613 }
9614 }
9615 return false;
9616 }
9617
9619 {
9620 int attachment_count = GetInventory().AttachmentCount();
9621 if (attachment_count > 0)
9622 {
9623 int random_pick = Math.RandomInt(0, attachment_count);
9624 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9625 if (!attachment.IsExplosive())
9626 {
9627 attachment.AddHealth("","",damage);
9628 return true;
9629 }
9630 }
9631 return false;
9632 }
9633
9635 {
9637 }
9638
9640 {
9642 return GetInventory().CanRemoveEntity();
9643
9644 return false;
9645 }
9646
9648 {
9650 return;
9651
9653 {
9654 if (ScriptInputUserData.CanStoreInputUserData())
9655 {
9656 ScriptInputUserData ctx = new ScriptInputUserData;
9661 ctx.
Write(destination_entity);
9665 }
9666 }
9667 else if (!
GetGame().IsMultiplayer())
9668 {
9670 }
9671 }
9672
9674 {
9676 return;
9677
9678 float split_quantity_new;
9682 InventoryLocation loc = new InventoryLocation;
9683
9684 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9685 {
9687 split_quantity_new = stack_max;
9688 else
9690
9691 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9692 if (new_item)
9693 {
9694 new_item.SetResultOfSplit(true);
9695 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9697 new_item.SetQuantity(split_quantity_new);
9698 }
9699 }
9700 else if (destination_entity && slot_id == -1)
9701 {
9702 if (quantity > stack_max)
9703 split_quantity_new = stack_max;
9704 else
9705 split_quantity_new = quantity;
9706
9708 {
9711 }
9712
9713 if (new_item)
9714 {
9715 new_item.SetResultOfSplit(true);
9716 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9718 new_item.SetQuantity(split_quantity_new);
9719 }
9720 }
9721 else
9722 {
9723 if (stack_max != 0)
9724 {
9726 {
9728 }
9729
9730 if (split_quantity_new == 0)
9731 {
9732 if (!
GetGame().IsMultiplayer())
9733 player.PhysicalPredictiveDropItem(this);
9734 else
9735 player.ServerDropEntity(this);
9736 return;
9737 }
9738
9740
9741 if (new_item)
9742 {
9743 new_item.SetResultOfSplit(true);
9744 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9746 new_item.SetQuantity(stack_max);
9747 new_item.PlaceOnSurface();
9748 }
9749 }
9750 }
9751 }
9752
9754 {
9756 return;
9757
9758 float split_quantity_new;
9762 InventoryLocation loc = new InventoryLocation;
9763
9764 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9765 {
9767 split_quantity_new = stack_max;
9768 else
9770
9771 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9772 if (new_item)
9773 {
9774 new_item.SetResultOfSplit(true);
9775 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9777 new_item.SetQuantity(split_quantity_new);
9778 }
9779 }
9780 else if (destination_entity && slot_id == -1)
9781 {
9782 if (quantity > stack_max)
9783 split_quantity_new = stack_max;
9784 else
9785 split_quantity_new = quantity;
9786
9788 {
9791 }
9792
9793 if (new_item)
9794 {
9795 new_item.SetResultOfSplit(true);
9796 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9798 new_item.SetQuantity(split_quantity_new);
9799 }
9800 }
9801 else
9802 {
9803 if (stack_max != 0)
9804 {
9806 {
9808 }
9809
9811
9812 if (new_item)
9813 {
9814 new_item.SetResultOfSplit(true);
9815 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9817 new_item.SetQuantity(stack_max);
9818 new_item.PlaceOnSurface();
9819 }
9820 }
9821 }
9822 }
9823
9825 {
9827 return;
9828
9830 {
9831 if (ScriptInputUserData.CanStoreInputUserData())
9832 {
9833 ScriptInputUserData ctx = new ScriptInputUserData;
9838 dst.WriteToContext(ctx);
9840 }
9841 }
9842 else if (!
GetGame().IsMultiplayer())
9843 {
9845 }
9846 }
9847
9849 {
9851 return;
9852
9854 {
9855 if (ScriptInputUserData.CanStoreInputUserData())
9856 {
9857 ScriptInputUserData ctx = new ScriptInputUserData;
9862 ctx.
Write(destination_entity);
9868 }
9869 }
9870 else if (!
GetGame().IsMultiplayer())
9871 {
9873 }
9874 }
9875
9877 {
9879 }
9880
9882 {
9884 return this;
9885
9887 float split_quantity_new;
9889 if (dst.IsValid())
9890 {
9891 int slot_id = dst.GetSlot();
9893
9894 if (quantity > stack_max)
9895 split_quantity_new = stack_max;
9896 else
9897 split_quantity_new = quantity;
9898
9900
9901 if (new_item)
9902 {
9903 new_item.SetResultOfSplit(true);
9904 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9907 }
9908
9909 return new_item;
9910 }
9911
9912 return null;
9913 }
9914
9916 {
9918 return;
9919
9921 float split_quantity_new;
9923 if (destination_entity)
9924 {
9926 if (quantity > stackable)
9927 split_quantity_new = stackable;
9928 else
9929 split_quantity_new = quantity;
9930
9931 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9932 if (new_item)
9933 {
9934 new_item.SetResultOfSplit(true);
9935 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9937 new_item.SetQuantity(split_quantity_new);
9938 }
9939 }
9940 }
9941
9943 {
9945 return;
9946
9948 {
9949 if (ScriptInputUserData.CanStoreInputUserData())
9950 {
9951 ScriptInputUserData ctx = new ScriptInputUserData;
9956 ItemBase destination_entity =
this;
9957 ctx.
Write(destination_entity);
9961 }
9962 }
9963 else if (!
GetGame().IsMultiplayer())
9964 {
9966 }
9967 }
9968
9970 {
9972 return;
9973
9975 float split_quantity_new;
9977 if (player)
9978 {
9980 if (quantity > stackable)
9981 split_quantity_new = stackable;
9982 else
9983 split_quantity_new = quantity;
9984
9985 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9986 new_item =
ItemBase.Cast(in_hands);
9987 if (new_item)
9988 {
9989 new_item.SetResultOfSplit(true);
9990 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9992 new_item.SetQuantity(split_quantity_new);
9993 }
9994 }
9995 }
9996
9998 {
10000 return;
10001
10003 float split_quantity_new = Math.Floor(quantity * 0.5);
10004
10006
10007 if (new_item)
10008 {
10009 if (new_item.GetQuantityMax() < split_quantity_new)
10010 {
10011 split_quantity_new = new_item.GetQuantityMax();
10012 }
10013
10014 new_item.SetResultOfSplit(true);
10015 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10016
10018 {
10021 }
10022 else
10023 {
10026 }
10027 }
10028 }
10029
10031 {
10033 return;
10034
10036 float split_quantity_new = Math.Floor(quantity / 2);
10037
10038 InventoryLocation invloc = new InventoryLocation;
10040
10042 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10043
10044 if (new_item)
10045 {
10046 if (new_item.GetQuantityMax() < split_quantity_new)
10047 {
10048 split_quantity_new = new_item.GetQuantityMax();
10049 }
10051 {
10054 }
10055 else
10056 {
10059 }
10060 }
10061 }
10062
10065 {
10066 SetWeightDirty();
10068
10069 if (parent)
10070 parent.OnAttachmentQuantityChangedEx(this, delta);
10071
10073 {
10075 {
10077 }
10079 {
10080 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10082 }
10083 }
10084
10085 }
10086
10089 {
10090
10091 }
10092
10095 {
10097 }
10098
10100 {
10101 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10102
10104 {
10105 if (newLevel == GameConstants.STATE_RUINED)
10106 {
10108 EntityAI parent = GetHierarchyParent();
10109 if (parent && parent.IsFireplace())
10110 {
10111 CargoBase cargo = GetInventory().GetCargo();
10112 if (cargo)
10113 {
10115 {
10117 }
10118 }
10119 }
10120 }
10121
10123 {
10124
10126 return;
10127 }
10128
10129 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10130 {
10132 }
10133 }
10134 }
10135
10136
10138 {
10139 super.OnRightClick();
10140
10142 {
10144 {
10145 if (ScriptInputUserData.CanStoreInputUserData())
10146 {
10147 vector m4[4];
10149
10150 EntityAI root = GetHierarchyRoot();
10151
10152 InventoryLocation dst = new InventoryLocation;
10154 {
10155 if (root)
10156 {
10157 root.GetTransform(m4);
10159 }
10160 else
10161 GetInventory().GetCurrentInventoryLocation(dst);
10162 }
10163 else
10164 {
10166
10167
10168 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10169 {
10170 if (root)
10171 {
10172 root.GetTransform(m4);
10174 }
10175 else
10176 GetInventory().GetCurrentInventoryLocation(dst);
10177 }
10178 else
10179 {
10180 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10181 }
10182 }
10183
10184 ScriptInputUserData ctx = new ScriptInputUserData;
10192 }
10193 }
10194 else if (!
GetGame().IsMultiplayer())
10195 {
10197 }
10198 }
10199 }
10200
10201 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10202 {
10203
10204 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10205 return false;
10206
10207 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10208 return false;
10209
10210
10212 return false;
10213
10214
10215 Magazine mag = Magazine.Cast(this);
10216 if (mag)
10217 {
10218 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10219 return false;
10220
10221 if (stack_max_limit)
10222 {
10223 Magazine other_mag = Magazine.Cast(other_item);
10224 if (other_item)
10225 {
10226 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10227 return false;
10228 }
10229
10230 }
10231 }
10232 else
10233 {
10234
10236 return false;
10237
10239 return false;
10240 }
10241
10242 PlayerBase player = null;
10243 if (CastTo(player, GetHierarchyRootPlayer()))
10244 {
10245 if (player.GetInventory().HasAttachment(this))
10246 return false;
10247
10248 if (player.IsItemsToDelete())
10249 return false;
10250 }
10251
10252 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10253 return false;
10254
10255 int slotID;
10257 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10258 return false;
10259
10260 return true;
10261 }
10262
10264 {
10266 }
10267
10269 {
10270 return m_IsResultOfSplit;
10271 }
10272
10274 {
10275 m_IsResultOfSplit = value;
10276 }
10277
10279 {
10281 }
10282
10284 {
10285 float other_item_quantity = other_item.GetQuantity();
10286 float this_free_space;
10287
10289
10291
10292 if (other_item_quantity > this_free_space)
10293 {
10294 return this_free_space;
10295 }
10296 else
10297 {
10298 return other_item_quantity;
10299 }
10300 }
10301
10303 {
10305 }
10306
10308 {
10310 return;
10311
10312 if (!IsMagazine() && other_item)
10313 {
10315 if (quantity_used != 0)
10316 {
10317 float hp1 = GetHealth01("","");
10318 float hp2 = other_item.GetHealth01("","");
10319 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10320 hpResult = hpResult / (
GetQuantity() + quantity_used);
10321
10322 hpResult *= GetMaxHealth();
10323 Math.Round(hpResult);
10324 SetHealth("", "Health", hpResult);
10325
10327 other_item.AddQuantity(-quantity_used);
10328 }
10329 }
10331 }
10332
10334 {
10335 #ifdef SERVER
10336 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10337 GetHierarchyParent().IncreaseLifetimeUp();
10338 #endif
10339 };
10340
10342 {
10343 PlayerBase p = PlayerBase.Cast(player);
10344
10345 array<int> recipesIds = p.m_Recipes;
10346 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10347 if (moduleRecipesManager)
10348 {
10349 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10350 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10351 }
10352
10353 for (int i = 0;i < recipesIds.Count(); i++)
10354 {
10355 int key = recipesIds.Get(i);
10356 string recipeName = moduleRecipesManager.GetRecipeName(key);
10358 }
10359 }
10360
10361
10362 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10363 {
10364 super.GetDebugActions(outputList);
10365
10366
10371
10372
10376
10380
10381
10384
10385
10387 {
10390 }
10391
10393
10396
10400 }
10401
10402
10403
10404
10406 {
10407 super.OnAction(action_id, player, ctx);
10408 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10409 {
10410 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10411 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10412 PlayerBase p = PlayerBase.Cast(player);
10413 if (
EActions.RECIPES_RANGE_START < 1000)
10414 {
10415 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10416 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10417 }
10418 }
10419 #ifndef SERVER
10420 else if (action_id ==
EActions.WATCH_PLAYER)
10421 {
10422 PluginDeveloper.SetDeveloperItemClientEx(player);
10423 }
10424 #endif
10426 {
10427 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10428 {
10429 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10430 OnDebugButtonPressServer(id + 1);
10431 }
10432
10433 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10434 {
10435 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10437 }
10438
10439 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10440 {
10441 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10443 }
10444
10445 else if (action_id ==
EActions.ADD_QUANTITY)
10446 {
10447 if (IsMagazine())
10448 {
10449 Magazine mag = Magazine.Cast(this);
10450 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10451 }
10452 else
10453 {
10455 }
10456
10457 if (m_EM)
10458 {
10459 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10460 }
10461
10462 }
10463
10464 else if (action_id ==
EActions.REMOVE_QUANTITY)
10465 {
10466 if (IsMagazine())
10467 {
10468 Magazine mag2 = Magazine.Cast(this);
10469 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10470 }
10471 else
10472 {
10474 }
10475 if (m_EM)
10476 {
10477 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10478 }
10479
10480 }
10481
10482 else if (action_id ==
EActions.SET_QUANTITY_0)
10483 {
10485
10486 if (m_EM)
10487 {
10488 m_EM.SetEnergy(0);
10489 }
10490 }
10491
10492 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10493 {
10495
10496 if (m_EM)
10497 {
10498 m_EM.SetEnergy(m_EM.GetEnergyMax());
10499 }
10500 }
10501
10502 else if (action_id ==
EActions.ADD_HEALTH)
10503 {
10504 AddHealth("","",GetMaxHealth("","Health")/5);
10505 }
10506 else if (action_id ==
EActions.REMOVE_HEALTH)
10507 {
10508 AddHealth("","",-GetMaxHealth("","Health")/5);
10509 }
10510 else if (action_id ==
EActions.DESTROY_HEALTH)
10511 {
10512 SetHealth01("","",0);
10513 }
10514 else if (action_id ==
EActions.WATCH_ITEM)
10515 {
10517 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10518 #ifdef DEVELOPER
10519 SetDebugDeveloper_item(this);
10520 #endif
10521 }
10522
10523 else if (action_id ==
EActions.ADD_TEMPERATURE)
10524 {
10525 AddTemperature(20);
10526
10527 }
10528
10529 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10530 {
10531 AddTemperature(-20);
10532
10533 }
10534
10535 else if (action_id ==
EActions.FLIP_FROZEN)
10536 {
10537 SetFrozen(!GetIsFrozen());
10538
10539 }
10540
10541 else if (action_id ==
EActions.ADD_WETNESS)
10542 {
10544
10545 }
10546
10547 else if (action_id ==
EActions.REMOVE_WETNESS)
10548 {
10550
10551 }
10552
10553 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10554 {
10557
10558
10559 }
10560
10561 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10562 {
10565 }
10566
10567 else if (action_id ==
EActions.MAKE_SPECIAL)
10568 {
10569 auto debugParams = DebugSpawnParams.WithPlayer(player);
10570 OnDebugSpawnEx(debugParams);
10571 }
10572
10573 else if (action_id ==
EActions.DELETE)
10574 {
10575 Delete();
10576 }
10577
10578 }
10579
10580
10581 return false;
10582 }
10583
10584
10585
10586
10590
10593
10594
10595
10597 {
10598 return false;
10599 }
10600
10601
10603 {
10604 return true;
10605 }
10606
10607
10609 {
10610 return true;
10611 }
10612
10613
10614
10616 {
10617 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10619 }
10620
10623 {
10624 return null;
10625 }
10626
10628 {
10629 return false;
10630 }
10631
10633 {
10634 return false;
10635 }
10636
10640
10641
10643 {
10644 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10645 return module_repairing.CanRepair(this, item_repair_kit);
10646 }
10647
10648
10649 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10650 {
10651 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10652 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10653 }
10654
10655
10657 {
10658
10659
10660
10661
10662
10663
10664
10665
10666 return 1;
10667 }
10668
10669
10670
10672 {
10674 }
10675
10676
10677
10679 {
10681 }
10682
10683
10692 {
10693 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10694
10695 if (player)
10696 {
10697 player.MessageStatus(text);
10698 }
10699 }
10700
10701
10710 {
10711 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10712
10713 if (player)
10714 {
10715 player.MessageAction(text);
10716 }
10717 }
10718
10719
10728 {
10729 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10730
10731 if (player)
10732 {
10733 player.MessageFriendly(text);
10734 }
10735 }
10736
10737
10746 {
10747 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10748
10749 if (player)
10750 {
10751 player.MessageImportant(text);
10752 }
10753 }
10754
10756 {
10757 return true;
10758 }
10759
10760
10761 override bool KindOf(
string tag)
10762 {
10763 bool found = false;
10764 string item_name = this.
GetType();
10767
10768 int array_size = item_tag_array.Count();
10769 for (int i = 0; i < array_size; i++)
10770 {
10771 if (item_tag_array.Get(i) == tag)
10772 {
10773 found = true;
10774 break;
10775 }
10776 }
10777 return found;
10778 }
10779
10780
10782 {
10783
10784 super.OnRPC(sender, rpc_type,ctx);
10785
10786
10787 switch (rpc_type)
10788 {
10789 #ifndef SERVER
10790 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10791 Param2<bool, string> p = new Param2<bool, string>(false, "");
10792
10794 return;
10795
10796 bool play = p.param1;
10797 string soundSet = p.param2;
10798
10799 if (play)
10800 {
10802 {
10804 {
10806 }
10807 }
10808 else
10809 {
10811 }
10812 }
10813 else
10814 {
10816 }
10817
10818 break;
10819 #endif
10820
10821 }
10822
10824 {
10826 }
10827 }
10828
10829
10830
10831
10833 {
10834 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10835 return plugin.GetID(
name);
10836 }
10837
10839 {
10840 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10841 return plugin.GetName(id);
10842 }
10843
10846 {
10847
10848
10849 int varFlags;
10850 if (!ctx.
Read(varFlags))
10851 return;
10852
10853 if (varFlags & ItemVariableFlags.FLOAT)
10854 {
10856 }
10857 }
10858
10860 {
10861
10862 super.SerializeNumericalVars(floats_out);
10863
10864
10865
10867 {
10869 }
10870
10872 {
10874 }
10875
10877 {
10879 }
10880
10882 {
10887 }
10888
10890 {
10892 }
10893 }
10894
10896 {
10897
10898 super.DeSerializeNumericalVars(floats);
10899
10900
10901 int index = 0;
10902 int mask = Math.Round(floats.Get(index));
10903
10904 index++;
10905
10907 {
10909 {
10911 }
10912 else
10913 {
10914 float quantity = floats.Get(index);
10915 SetQuantity(quantity,
true,
false,
false,
false);
10916 }
10917 index++;
10918 }
10919
10921 {
10922 float wet = floats.Get(index);
10924 index++;
10925 }
10926
10928 {
10929 int liquidtype = Math.Round(floats.Get(index));
10931 index++;
10932 }
10933
10935 {
10937 index++;
10939 index++;
10941 index++;
10943 index++;
10944 }
10945
10947 {
10948 int cleanness = Math.Round(floats.Get(index));
10950 index++;
10951 }
10952 }
10953
10955 {
10956 super.WriteVarsToCTX(ctx);
10957
10958
10960 {
10962 }
10963
10965 {
10967 }
10968
10970 {
10972 }
10973
10975 {
10976 int r,g,b,a;
10982 }
10983
10985 {
10987 }
10988 }
10989
10991 {
10992 if (!super.ReadVarsFromCTX(ctx,version))
10993 return false;
10994
10995 int intValue;
10996 float value;
10997
10998 if (version < 140)
10999 {
11000 if (!ctx.
Read(intValue))
11001 return false;
11002
11003 m_VariablesMask = intValue;
11004 }
11005
11007 {
11008 if (!ctx.
Read(value))
11009 return false;
11010
11012 {
11014 }
11015 else
11016 {
11018 }
11019 }
11020
11021 if (version < 140)
11022 {
11024 {
11025 if (!ctx.
Read(value))
11026 return false;
11027 SetTemperatureDirect(value);
11028 }
11029 }
11030
11032 {
11033 if (!ctx.
Read(value))
11034 return false;
11036 }
11037
11039 {
11040 if (!ctx.
Read(intValue))
11041 return false;
11043 }
11044
11046 {
11047 int r,g,b,a;
11049 return false;
11051 return false;
11053 return false;
11055 return false;
11056
11058 }
11059
11061 {
11062 if (!ctx.
Read(intValue))
11063 return false;
11065 }
11066
11067 if (version >= 138 && version < 140)
11068 {
11070 {
11071 if (!ctx.
Read(intValue))
11072 return false;
11073 SetFrozen(intValue);
11074 }
11075 }
11076
11077 return true;
11078 }
11079
11080
11082 {
11085 {
11087 }
11088
11089 if (!super.OnStoreLoad(ctx, version))
11090 {
11092 return false;
11093 }
11094
11095 if (version >= 114)
11096 {
11097 bool hasQuickBarIndexSaved;
11098
11099 if (!ctx.
Read(hasQuickBarIndexSaved))
11100 {
11102 return false;
11103 }
11104
11105 if (hasQuickBarIndexSaved)
11106 {
11107 int itmQBIndex;
11108
11109
11110 if (!ctx.
Read(itmQBIndex))
11111 {
11113 return false;
11114 }
11115
11116 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11117 if (itmQBIndex != -1 && parentPlayer)
11118 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11119 }
11120 }
11121 else
11122 {
11123
11124 PlayerBase player;
11125 int itemQBIndex;
11126 if (version ==
int.
MAX)
11127 {
11128 if (!ctx.
Read(itemQBIndex))
11129 {
11131 return false;
11132 }
11133 }
11134 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11135 {
11136
11137 if (!ctx.
Read(itemQBIndex))
11138 {
11140 return false;
11141 }
11142 if (itemQBIndex != -1 && player)
11143 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11144 }
11145 }
11146
11147 if (version < 140)
11148 {
11149
11150 if (!LoadVariables(ctx, version))
11151 {
11153 return false;
11154 }
11155 }
11156
11157
11159 {
11161 return false;
11162 }
11163 if (version >= 132)
11164 {
11166 if (raib)
11167 {
11169 {
11171 return false;
11172 }
11173 }
11174 }
11175
11177 return true;
11178 }
11179
11180
11181
11183 {
11184 super.OnStoreSave(ctx);
11185
11186 PlayerBase player;
11187 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11188 {
11190
11191 int itemQBIndex = -1;
11192 itemQBIndex = player.FindQuickBarEntityIndex(this);
11193 ctx.
Write(itemQBIndex);
11194 }
11195 else
11196 {
11198 }
11199
11201
11203 if (raib)
11204 {
11206 }
11207 }
11208
11209
11211 {
11212 super.AfterStoreLoad();
11213
11215 {
11217 }
11218
11220 {
11223 }
11224 }
11225
11227 {
11228 super.EEOnAfterLoad();
11229
11231 {
11233 }
11234
11237 }
11238
11240 {
11241 return false;
11242 }
11243
11244
11245
11247 {
11249 {
11250 #ifdef PLATFORM_CONSOLE
11251
11253 {
11255 if (menu)
11256 {
11258 }
11259 }
11260 #endif
11261 }
11262
11264 {
11267 }
11268
11270 {
11271 SetWeightDirty();
11273 }
11275 {
11278 }
11279
11281 {
11284 }
11286 {
11289 }
11290
11291 super.OnVariablesSynchronized();
11292 }
11293
11294
11295
11297 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11298 {
11299 if (!IsServerCheck(allow_client))
11300 return false;
11301
11303 return false;
11304
11307
11308 if (value <= (min + 0.001))
11309 value = min;
11310
11311 if (value == min)
11312 {
11313 if (destroy_config)
11314 {
11315 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11316 if (dstr)
11317 {
11319 this.Delete();
11320 return true;
11321 }
11322 }
11323 else if (destroy_forced)
11324 {
11326 this.Delete();
11327 return true;
11328 }
11329
11331 }
11332
11335
11337 {
11339
11340 if (delta)
11342 }
11343
11345
11346 return false;
11347 }
11348
11349
11351 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11352 {
11354 }
11355
11357 {
11360 }
11361
11363 {
11366 }
11367
11370 {
11371 float value_clamped = Math.Clamp(value, 0, 1);
11373 SetQuantity(result, destroy_config, destroy_forced);
11374 }
11375
11376
11379 {
11381 }
11382
11384 {
11386 }
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11398 {
11399 int slot = -1;
11400 if (GetInventory())
11401 {
11402 InventoryLocation il = new InventoryLocation;
11403 GetInventory().GetCurrentInventoryLocation(il);
11405 }
11406
11408 }
11409
11411 {
11412 float quantity_max = 0;
11413
11415 {
11416 if (attSlotID != -1)
11417 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11418
11419 if (quantity_max <= 0)
11421 }
11422
11423 if (quantity_max <= 0)
11425
11426 return quantity_max;
11427 }
11428
11430 {
11432 }
11433
11435 {
11437 }
11438
11439
11441 {
11443 }
11444
11446 {
11448 }
11449
11451 {
11453 }
11454
11455
11457 {
11458
11459 float weightEx = GetWeightEx();
11460 float special = GetInventoryAndCargoWeight();
11461 return weightEx - special;
11462 }
11463
11464
11466 {
11468 }
11469
11471 {
11473 {
11474 #ifdef DEVELOPER
11475 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11476 {
11477 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11479 }
11480 #endif
11481
11482 return GetQuantity() * GetConfigWeightModified();
11483 }
11484 else if (HasEnergyManager())
11485 {
11486 #ifdef DEVELOPER
11487 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11488 {
11489 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11490 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11491 }
11492 #endif
11493 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11494 }
11495 else
11496 {
11497 #ifdef DEVELOPER
11498 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11499 {
11500 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11501 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11502 }
11503 #endif
11504 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11505 }
11506 }
11507
11510 {
11511 int item_count = 0;
11513
11514 if (GetInventory().GetCargo() != NULL)
11515 {
11516 item_count = GetInventory().GetCargo().GetItemCount();
11517 }
11518
11519 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11520 {
11521 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11522 if (item)
11523 item_count += item.GetNumberOfItems();
11524 }
11525 return item_count;
11526 }
11527
11530 {
11531 float weight = 0;
11532 float wetness = 1;
11533 if (include_wetness)
11536 {
11537 weight = wetness * m_ConfigWeight;
11538 }
11540 {
11541 weight = 1;
11542 }
11543 return weight;
11544 }
11545
11546
11547
11549 {
11550 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11551 {
11552 GameInventory inv = GetInventory();
11553 array<EntityAI> items = new array<EntityAI>;
11555 for (int i = 0; i < items.Count(); i++)
11556 {
11558 if (item)
11559 {
11561 }
11562 }
11563 }
11564 }
11565
11566
11567
11568
11570 {
11571 float energy = 0;
11572 if (HasEnergyManager())
11573 {
11574 energy = GetCompEM().GetEnergy();
11575 }
11576 return energy;
11577 }
11578
11579
11581 {
11582 super.OnEnergyConsumed();
11583
11585 }
11586
11588 {
11589 super.OnEnergyAdded();
11590
11592 }
11593
11594
11596 {
11597 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11598 {
11600 {
11601 float energy_0to1 = GetCompEM().GetEnergy0To1();
11603 }
11604 }
11605 }
11606
11607
11609 {
11610 return ConfigGetFloat("heatIsolation");
11611 }
11612
11614 {
11616 }
11617
11619 {
11620 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11621 if (
GetGame().ConfigIsExisting(paramPath))
11623
11624 return 0.0;
11625 }
11626
11628 {
11629 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11630 if (
GetGame().ConfigIsExisting(paramPath))
11632
11633 return 0.0;
11634 }
11635
11636 override void SetWet(
float value,
bool allow_client =
false)
11637 {
11638 if (!IsServerCheck(allow_client))
11639 return;
11640
11643
11645
11646 m_VarWet = Math.Clamp(value, min, max);
11647
11649 {
11652 }
11653 }
11654
11655 override void AddWet(
float value)
11656 {
11658 }
11659
11661 {
11663 }
11664
11666 {
11668 }
11669
11671 {
11673 }
11674
11676 {
11678 }
11679
11681 {
11683 }
11684
11685 override void OnWetChanged(
float newVal,
float oldVal)
11686 {
11689 if (newLevel != oldLevel)
11690 {
11692 }
11693 }
11694
11696 {
11697 SetWeightDirty();
11698 }
11699
11701 {
11702 return GetWetLevelInternal(
m_VarWet);
11703 }
11704
11705
11706
11708 {
11710 }
11711
11713 {
11715 }
11716
11718 {
11720 }
11721
11723 {
11725 }
11726
11727
11728
11730 {
11731 if (ConfigIsExisting("itemModelLength"))
11732 {
11733 return ConfigGetFloat("itemModelLength");
11734 }
11735 return 0;
11736 }
11737
11739 {
11740 if (ConfigIsExisting("itemAttachOffset"))
11741 {
11742 return ConfigGetFloat("itemAttachOffset");
11743 }
11744 return 0;
11745 }
11746
11747 override void SetCleanness(
int value,
bool allow_client =
false)
11748 {
11749 if (!IsServerCheck(allow_client))
11750 return;
11751
11753
11755
11758 }
11759
11761 {
11763 }
11764
11766 {
11767 return true;
11768 }
11769
11770
11771
11772
11774 {
11776 }
11777
11779 {
11781 }
11782
11783
11784
11785
11786 override void SetColor(
int r,
int g,
int b,
int a)
11787 {
11793 }
11795 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11796 {
11801 }
11802
11804 {
11806 }
11807
11810 {
11811 int r,g,b,a;
11813 r = r/255;
11814 g = g/255;
11815 b = b/255;
11816 a = a/255;
11817 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11818 }
11819
11820
11821
11822 override void SetLiquidType(
int value,
bool allow_client =
false)
11823 {
11824 if (!IsServerCheck(allow_client))
11825 return;
11826
11831 }
11832
11834 {
11835 return ConfigGetInt("varLiquidTypeInit");
11836 }
11837
11839 {
11841 }
11842
11844 {
11846 SetFrozen(false);
11847 }
11848
11851 {
11852 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11853 }
11854
11855
11858 {
11859 PlayerBase nplayer;
11860 if (PlayerBase.CastTo(nplayer, player))
11861 {
11863
11864 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11865 }
11866 }
11867
11868
11871 {
11872 PlayerBase nplayer;
11873 if (PlayerBase.CastTo(nplayer,player))
11874 {
11875
11876 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11877
11878 }
11879
11880
11881 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11882
11883
11884 if (HasEnergyManager())
11885 {
11886 GetCompEM().UpdatePlugState();
11887 }
11888 }
11889
11890
11892 {
11893 super.OnPlacementStarted(player);
11894
11896 }
11897
11898 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11899 {
11901 {
11902 m_AdminLog.OnPlacementComplete(player,
this);
11903 }
11904
11905 super.OnPlacementComplete(player, position, orientation);
11906 }
11907
11908
11909
11910
11911
11913 {
11915 {
11916 return true;
11917 }
11918 else
11919 {
11920 return false;
11921 }
11922 }
11923
11924
11926 {
11928 {
11930 }
11931 }
11932
11933
11935 {
11937 }
11938
11940 {
11942 }
11943
11944 override void InsertAgent(
int agent,
float count = 1)
11945 {
11946 if (count < 1)
11947 return;
11948
11950 }
11951
11954 {
11956 }
11957
11958
11960 {
11962 }
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
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
12006 {
12008 return false;
12009 return true;
12010 }
12011
12013 {
12014
12016 }
12017
12018
12021 {
12022 super.CheckForRoofLimited(timeTresholdMS);
12023
12025 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12026 {
12027 m_PreviousRoofTestTime = time;
12028 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12029 }
12030 }
12031
12032
12034 {
12036 {
12037 return 0;
12038 }
12039
12040 if (GetInventory().GetAttachmentSlotsCount() != 0)
12041 {
12042 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12043 if (filter)
12044 return filter.GetProtectionLevel(type, false, system);
12045 else
12046 return 0;
12047 }
12048
12049 string subclassPath, entryName;
12050
12051 switch (type)
12052 {
12054 entryName = "biological";
12055 break;
12057 entryName = "chemical";
12058 break;
12059 default:
12060 entryName = "biological";
12061 break;
12062 }
12063
12064 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12065
12067 }
12068
12069
12070
12073 {
12074 if (!IsMagazine())
12076
12078 }
12079
12080
12081
12082
12083
12088 {
12089 return true;
12090 }
12091
12093 {
12095 }
12096
12097
12098
12099
12100
12102 {
12103 if (parent)
12104 {
12105 if (parent.IsInherited(DayZInfected))
12106 return true;
12107
12108 if (!parent.IsRuined())
12109 return true;
12110 }
12111
12112 return true;
12113 }
12114
12116 {
12117 if (!super.CanPutAsAttachment(parent))
12118 {
12119 return false;
12120 }
12121
12122 if (!IsRuined() && !parent.IsRuined())
12123 {
12124 return true;
12125 }
12126
12127 return false;
12128 }
12129
12131 {
12132
12133
12134
12135
12136 return super.CanReceiveItemIntoCargo(item);
12137 }
12138
12140 {
12141
12142
12143
12144
12145 GameInventory attachmentInv = attachment.GetInventory();
12147 {
12148 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12149 return false;
12150 }
12151
12152 InventoryLocation loc = new InventoryLocation();
12153 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12154 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12155 return false;
12156
12157 return super.CanReceiveAttachment(attachment, slotId);
12158 }
12159
12161 {
12162 if (!super.CanReleaseAttachment(attachment))
12163 return false;
12164
12165 return GetInventory().AreChildrenAccessible();
12166 }
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12189 {
12190 int id = muzzle_owner.GetMuzzleID();
12191 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12192
12193 if (WPOF_array)
12194 {
12195 for (int i = 0; i < WPOF_array.Count(); i++)
12196 {
12197 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12198
12199 if (WPOF)
12200 {
12201 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12202 }
12203 }
12204 }
12205 }
12206
12207
12209 {
12210 int id = muzzle_owner.GetMuzzleID();
12212
12213 if (WPOBE_array)
12214 {
12215 for (int i = 0; i < WPOBE_array.Count(); i++)
12216 {
12217 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12218
12219 if (WPOBE)
12220 {
12221 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12222 }
12223 }
12224 }
12225 }
12226
12227
12229 {
12230 int id = muzzle_owner.GetMuzzleID();
12231 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12232
12233 if (WPOOH_array)
12234 {
12235 for (int i = 0; i < WPOOH_array.Count(); i++)
12236 {
12237 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12238
12239 if (WPOOH)
12240 {
12241 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12242 }
12243 }
12244 }
12245 }
12246
12247
12249 {
12250 int id = muzzle_owner.GetMuzzleID();
12251 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12252
12253 if (WPOOH_array)
12254 {
12255 for (int i = 0; i < WPOOH_array.Count(); i++)
12256 {
12257 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12258
12259 if (WPOOH)
12260 {
12261 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12262 }
12263 }
12264 }
12265 }
12266
12267
12269 {
12270 int id = muzzle_owner.GetMuzzleID();
12271 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12272
12273 if (WPOOH_array)
12274 {
12275 for (int i = 0; i < WPOOH_array.Count(); i++)
12276 {
12277 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12278
12279 if (WPOOH)
12280 {
12281 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12282 }
12283 }
12284 }
12285 }
12286
12287
12288
12290 {
12292 {
12293 return true;
12294 }
12295
12296 return false;
12297 }
12298
12300 {
12302 {
12303 return true;
12304 }
12305
12306 return false;
12307 }
12308
12310 {
12312 {
12313 return true;
12314 }
12315
12316 return false;
12317 }
12318
12320 {
12321 return false;
12322 }
12323
12326 {
12327 return UATimeSpent.DEFAULT_DEPLOY;
12328 }
12329
12330
12331
12332
12334 {
12336 SetSynchDirty();
12337 }
12338
12340 {
12342 }
12343
12344
12346 {
12347 return false;
12348 }
12349
12352 {
12353 string att_type = "None";
12354
12355 if (ConfigIsExisting("soundAttType"))
12356 {
12357 att_type = ConfigGetString("soundAttType");
12358 }
12359
12361 }
12362
12364 {
12366 }
12367
12368
12369
12370
12371
12375
12377 {
12380
12382 }
12383
12384
12386 {
12388 return;
12389
12391
12394
12397
12398 SoundParameters params = new SoundParameters();
12402 }
12403
12404
12406 {
12408 return;
12409
12411 SetSynchDirty();
12412
12415 }
12416
12417
12419 {
12421 return;
12422
12424 SetSynchDirty();
12425
12428 }
12429
12431 {
12433 }
12434
12436 {
12438 }
12439
12442 {
12443 if (!
GetGame().IsDedicatedServer())
12444 {
12445 if (ConfigIsExisting("attachSoundSet"))
12446 {
12447 string cfg_path = "";
12448 string soundset = "";
12449 string type_name =
GetType();
12450
12453 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12454 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12455
12456 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12457 {
12458 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12459 {
12460 if (cfg_slot_array[i] == slot_type)
12461 {
12462 soundset = cfg_soundset_array[i];
12463 break;
12464 }
12465 }
12466 }
12467
12468 if (soundset != "")
12469 {
12470 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12472 }
12473 }
12474 }
12475 }
12476
12478 {
12479
12480 }
12481
12482 void OnApply(PlayerBase player);
12483
12485 {
12486 return 1.0;
12487 };
12488
12490 {
12492 }
12493
12495 {
12497 }
12498
12500
12502 {
12503 SetDynamicPhysicsLifeTime(0.01);
12505 }
12506
12508 {
12509 array<string> zone_names = new array<string>;
12510 GetDamageZones(zone_names);
12511 for (int i = 0; i < zone_names.Count(); i++)
12512 {
12513 SetHealthMax(zone_names.Get(i),"Health");
12514 }
12515 SetHealthMax("","Health");
12516 }
12517
12520 {
12521 float global_health = GetHealth01("","Health");
12522 array<string> zones = new array<string>;
12523 GetDamageZones(zones);
12524
12525 for (int i = 0; i < zones.Count(); i++)
12526 {
12527 SetHealth01(zones.Get(i),"Health",global_health);
12528 }
12529 }
12530
12533 {
12534 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12535 }
12536
12538 {
12539 if (!hasRootAsPlayer)
12540 {
12541 if (refParentIB)
12542 {
12543
12544 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12545 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12546
12547 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12548 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12549
12552 }
12553 else
12554 {
12555
12558 }
12559 }
12560 }
12561
12563 {
12565 {
12566 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12567 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12568 {
12569 float heatPermCoef = 1.0;
12571 while (ent)
12572 {
12573 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12574 ent = ent.GetHierarchyParent();
12575 }
12576
12577 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12578 }
12579 }
12580 }
12581
12583 {
12584
12585 EntityAI parent = GetHierarchyParent();
12586 if (!parent)
12587 {
12588 hasParent = false;
12589 hasRootAsPlayer = false;
12590 }
12591 else
12592 {
12593 hasParent = true;
12594 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12595 refParentIB =
ItemBase.Cast(parent);
12596 }
12597 }
12598
12599 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12600 {
12601
12602 }
12603
12605 {
12606
12607 return false;
12608 }
12609
12611 {
12612
12613
12614 return false;
12615 }
12616
12618 {
12619
12620 return false;
12621 }
12622
12625 {
12626 return !GetIsFrozen() &&
IsOpen();
12627 }
12628
12630 {
12631 bool hasParent = false, hasRootAsPlayer = false;
12633
12634 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12635 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12636
12637 if (wwtu || foodDecay)
12638 {
12642
12643 if (processWetness || processTemperature || processDecay)
12644 {
12646
12647 if (processWetness)
12648 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12649
12650 if (processTemperature)
12652
12653 if (processDecay)
12654 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12655 }
12656 }
12657 }
12658
12661 {
12663 }
12664
12666 {
12669
12670 return super.GetTemperatureFreezeThreshold();
12671 }
12672
12674 {
12677
12678 return super.GetTemperatureThawThreshold();
12679 }
12680
12682 {
12685
12686 return super.GetItemOverheatThreshold();
12687 }
12688
12690 {
12692 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12693
12694 return super.GetTemperatureFreezeTime();
12695 }
12696
12698 {
12700 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12701
12702 return super.GetTemperatureThawTime();
12703 }
12704
12709
12711 {
12712 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12713 }
12714
12716 {
12717 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12718 }
12719
12722 {
12724 }
12725
12727 {
12729 }
12730
12732 {
12734 }
12735
12738 {
12739 return null;
12740 }
12741
12744 {
12745 return false;
12746 }
12747
12749 {
12751 {
12754 if (!trg)
12755 {
12757 explosive = this;
12758 }
12759
12760 explosive.PairRemote(trg);
12762
12763 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12764 trg.SetPersistentPairID(persistentID);
12765 explosive.SetPersistentPairID(persistentID);
12766
12767 return true;
12768 }
12769 return false;
12770 }
12771
12774 {
12775 float ret = 1.0;
12778 ret *= GetHealth01();
12779
12780 return ret;
12781 }
12782
12783 #ifdef DEVELOPER
12784 override void SetDebugItem()
12785 {
12786 super.SetDebugItem();
12787 _itemBase = this;
12788 }
12789
12791 {
12792 string text = super.GetDebugText();
12793
12795 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12796
12797 return text;
12798 }
12799 #endif
12800
12802 {
12803 return true;
12804 }
12805
12807
12809
12811 {
12814 }
12815
12816
12824
12840}
12841
12843{
12845 if (entity)
12846 {
12847 bool is_item = entity.IsInherited(
ItemBase);
12848 if (is_item && full_quantity)
12849 {
12852 }
12853 }
12854 else
12855 {
12857 return NULL;
12858 }
12859 return entity;
12860}
12861
12863{
12864 if (item)
12865 {
12866 if (health > 0)
12867 item.SetHealth("", "", health);
12868
12869 if (item.CanHaveTemperature())
12870 {
12872 if (item.CanFreeze())
12873 item.SetFrozen(false);
12874 }
12875
12876 if (item.HasEnergyManager())
12877 {
12878 if (quantity >= 0)
12879 {
12880 item.GetCompEM().SetEnergy0To1(quantity);
12881 }
12882 else
12883 {
12885 }
12886 }
12887 else if (item.IsMagazine())
12888 {
12889 Magazine mag = Magazine.Cast(item);
12890 if (quantity >= 0)
12891 {
12892 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12893 }
12894 else
12895 {
12897 }
12898
12899 }
12900 else
12901 {
12902 if (quantity >= 0)
12903 {
12904 item.SetQuantityNormalized(quantity, false);
12905 }
12906 else
12907 {
12909 }
12910
12911 }
12912 }
12913}
12914
12915#ifdef DEVELOPER
12917#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.