8081{
8083 {
8084 return true;
8085 }
8086};
8087
8088
8089
8091{
8095
8097
8100
8101
8102
8103
8104
8113
8119
8124
8129
8150 protected bool m_IsResultOfSplit
8151
8153
8158
8159
8160
8162
8166
8167
8168
8170
8173
8174
8175
8181
8182
8190
8193
8194
8196
8197
8199
8200
8205
8206
8211
8212
8214
8215
8217 {
8222
8223 if (!
GetGame().IsDedicatedServer())
8224 {
8226 {
8228
8230 {
8232 }
8233 }
8234
8237 }
8238
8239 m_OldLocation = null;
8240
8242 {
8244 }
8245
8246 if (ConfigIsExisting("headSelectionsToHide"))
8247 {
8250 }
8251
8253 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8254 {
8256 }
8257
8259
8260 m_IsResultOfSplit = false;
8261
8263 }
8264
8266 {
8267 super.InitItemVariables();
8268
8274 m_Count = ConfigGetInt(
"count");
8275
8278
8283
8286
8291
8303
8307
8308
8311 if (ConfigIsExisting("canBeSplit"))
8312 {
8315 }
8316
8318 if (ConfigIsExisting("itemBehaviour"))
8320
8321
8324 RegisterNetSyncVariableInt("m_VarLiquidType");
8325 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8326
8327 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8328 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8329 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8330
8331 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8332 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8333 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8334 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8335
8336 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8337 RegisterNetSyncVariableBool("m_IsTakeable");
8338 RegisterNetSyncVariableBool("m_IsHologram");
8339
8342 {
8345 }
8346
8348
8350 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8352
8353 }
8354
8356 {
8358 }
8359
8361 {
8364 {
8369 }
8370 }
8371
8372 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8373 {
8375 {
8378 }
8379
8381 }
8382
8384 {
8390 }
8391
8393
8395 {
8397
8398 if (!action)
8399 {
8400 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8401 return;
8402 }
8403
8405 if (!ai)
8406 {
8408 return;
8409 }
8410
8412 if (!action_array)
8413 {
8414 action_array = new array<ActionBase_Basic>;
8416 }
8417 if (LogManager.IsActionLogEnable())
8418 {
8419 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8420 }
8421
8422 if (action_array.Find(action) != -1)
8423 {
8424 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8425 }
8426 else
8427 {
8428 action_array.Insert(action);
8429 }
8430 }
8431
8433 {
8435 ActionBase action = player.GetActionManager().GetAction(actionName);
8438
8439 if (action_array)
8440 {
8441 action_array.RemoveItem(action);
8442 }
8443 }
8444
8445
8446
8448 {
8449 ActionOverrideData overrideData = new ActionOverrideData();
8453
8455 if (!actionMap)
8456 {
8459 }
8460
8461 actionMap.Insert(this.
Type(), overrideData);
8462
8463 }
8464
8466
8468
8469
8471 {
8474
8477
8478 string config_to_search = "CfgVehicles";
8479 string muzzle_owner_config;
8480
8482 {
8483 if (IsInherited(Weapon))
8484 config_to_search = "CfgWeapons";
8485
8486 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8487
8488 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8489
8491
8492 if (config_OnFire_subclass_count > 0)
8493 {
8494 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8495
8496 for (int i = 0; i < config_OnFire_subclass_count; i++)
8497 {
8498 string particle_class = "";
8500 string config_OnFire_entry = config_OnFire_class + particle_class;
8501 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8502 WPOF_array.Insert(WPOF);
8503 }
8504
8505
8507 }
8508 }
8509
8511 {
8512 config_to_search = "CfgWeapons";
8513 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8514
8515 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8516
8518
8519 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8520 {
8521 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8522
8523 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8524 {
8525 string particle_class2 = "";
8527 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8528 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8529 WPOBE_array.Insert(WPOBE);
8530 }
8531
8532
8534 }
8535 }
8536 }
8537
8538
8540 {
8543
8545 {
8546 string config_to_search = "CfgVehicles";
8547
8548 if (IsInherited(Weapon))
8549 config_to_search = "CfgWeapons";
8550
8551 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8552 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8553
8554 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8555 {
8556
8558
8560 {
8562 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8564 return;
8565 }
8566
8569
8570
8571
8573 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8574
8575 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8576 {
8577 string particle_class = "";
8579 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8581
8582 if (entry_type == CT_CLASS)
8583 {
8584 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8585 WPOOH_array.Insert(WPOF);
8586 }
8587 }
8588
8589
8591 }
8592 }
8593 }
8594
8596 {
8598 }
8599
8601 {
8603 {
8605
8608
8611
8612 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8613 }
8614 }
8615
8617 {
8619 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8620
8622 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8623
8625 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8626
8628 {
8630 }
8631 }
8632
8634 {
8636 }
8637
8639 {
8642 else
8644
8646 {
8649 }
8650 else
8651 {
8654
8657 }
8658
8660 }
8661
8663 {
8665 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8666 }
8667
8669 {
8671 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8673 }
8674
8676 {
8678 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8679 }
8680
8682 {
8685
8686 OverheatingParticle OP = new OverheatingParticle();
8691
8693 }
8694
8696 {
8699
8700 return -1;
8701 }
8702
8704 {
8706 {
8709
8710 for (int i = count; i > 0; --i)
8711 {
8712 int id = i - 1;
8715
8718
8719 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8720 {
8721 if (p)
8722 {
8725 }
8726 }
8727 }
8728 }
8729 }
8730
8732 {
8734 {
8736 {
8737 int id = i - 1;
8739
8740 if (OP)
8741 {
8743
8744 if (p)
8745 {
8747 }
8748
8749 delete OP;
8750 }
8751 }
8752
8755 }
8756 }
8757
8760 {
8761 return 0.0;
8762 }
8763
8764
8766 {
8767 return 250;
8768 }
8769
8771 {
8772 return 0;
8773 }
8774
8777 {
8779 return true;
8780
8781 return false;
8782 }
8783
8786 {
8789
8791 {
8793 }
8794 else
8795 {
8796
8798 }
8799
8801 }
8802
8809 {
8810 return -1;
8811 }
8812
8813
8814
8815
8817 {
8819 {
8821 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8822
8823 if (r_index >= 0)
8824 {
8825 InventoryLocation r_il = new InventoryLocation;
8826 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8827
8828 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8831 {
8832 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8833 }
8835 {
8836 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8837 }
8838
8839 }
8840
8841 player.GetHumanInventory().ClearUserReservedLocation(this);
8842 }
8843
8846 }
8847
8848
8849
8850
8852 {
8853 return ItemBase.m_DebugActionsMask;
8854 }
8855
8857 {
8858 return ItemBase.m_DebugActionsMask & mask;
8859 }
8860
8862 {
8863 ItemBase.m_DebugActionsMask = mask;
8864 }
8865
8867 {
8868 ItemBase.m_DebugActionsMask |= mask;
8869 }
8870
8872 {
8873 ItemBase.m_DebugActionsMask &= ~mask;
8874 }
8875
8877 {
8879 {
8881 }
8882 else
8883 {
8885 }
8886 }
8887
8888
8890 {
8891 if (GetEconomyProfile())
8892 {
8893 float q_max = GetEconomyProfile().GetQuantityMax();
8894 if (q_max > 0)
8895 {
8896 float q_min = GetEconomyProfile().GetQuantityMin();
8897 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8898
8900 {
8901 ComponentEnergyManager comp = GetCompEM();
8903 {
8905 }
8906 }
8908 {
8910
8911 }
8912
8913 }
8914 }
8915 }
8916
8919 {
8920 EntityAI parent = GetHierarchyParent();
8921
8922 if (parent)
8923 {
8924 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8925 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8926 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8927 }
8928 }
8929
8932 {
8933 EntityAI parent = GetHierarchyParent();
8934
8935 if (parent)
8936 {
8937 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8938 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8939 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8940 }
8941 }
8942
8944 {
8945
8946
8947
8948
8950
8952 {
8953 if (ScriptInputUserData.CanStoreInputUserData())
8954 {
8955 ScriptInputUserData ctx = new ScriptInputUserData;
8961 ctx.
Write(use_stack_max);
8964
8966 {
8967 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8968 }
8969 }
8970 }
8971 else if (!
GetGame().IsMultiplayer())
8972 {
8974 }
8975 }
8976
8978 {
8980 }
8981
8983 {
8985 }
8986
8988 {
8990 }
8991
8993 {
8994
8995 return false;
8996 }
8997
8999 {
9000 return false;
9001 }
9002
9006 {
9007 return false;
9008 }
9009
9011 {
9012 return "";
9013 }
9014
9016
9018 {
9019 return false;
9020 }
9021
9023 {
9024 return true;
9025 }
9026
9027
9028
9030 {
9031 return true;
9032 }
9033
9035 {
9036 return true;
9037 }
9038
9040 {
9041 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9043 }
9044
9046 {
9048 }
9049
9051 {
9053 if (!is_being_placed)
9055 SetSynchDirty();
9056 }
9057
9058
9060
9062 {
9064 }
9065
9067 {
9069 }
9070
9072 {
9073 return 1;
9074 }
9075
9077 {
9078 return false;
9079 }
9080
9082 {
9084 SetSynchDirty();
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
9115
9116
9117
9118
9119
9120
9122 {
9123 super.OnMovedInsideCargo(container);
9124
9125 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9126 }
9127
9128 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9129 {
9130 super.EEItemLocationChanged(oldLoc,newLoc);
9131
9132 PlayerBase new_player = null;
9133 PlayerBase old_player = null;
9134
9135 if (newLoc.GetParent())
9136 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9137
9138 if (oldLoc.GetParent())
9139 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9140
9142 {
9143 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9144
9145 if (r_index >= 0)
9146 {
9147 InventoryLocation r_il = new InventoryLocation;
9148 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9149
9150 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9153 {
9154 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9155 }
9157 {
9158 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9159 }
9160
9161 }
9162 }
9163
9165 {
9166 if (new_player)
9167 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9168
9169 if (new_player == old_player)
9170 {
9171
9172 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9173 {
9175 {
9176 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9177 {
9178 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9179 }
9180 }
9181 else
9182 {
9183 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9184 }
9185 }
9186
9187 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9188 {
9189 int type = oldLoc.GetType();
9191 {
9192 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9193 }
9195 {
9196 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9197 }
9198 }
9199 if (!m_OldLocation)
9200 {
9201 m_OldLocation = new InventoryLocation;
9202 }
9203 m_OldLocation.Copy(oldLoc);
9204 }
9205 else
9206 {
9207 if (m_OldLocation)
9208 {
9209 m_OldLocation.Reset();
9210 }
9211 }
9212
9214 }
9215 else
9216 {
9217 if (new_player)
9218 {
9219 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9220 if (res_index >= 0)
9221 {
9222 InventoryLocation il = new InventoryLocation;
9223 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9225 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9228 {
9229 il.
GetParent().GetOnReleaseLock().Invoke(it);
9230 }
9232 {
9234 }
9235
9236 }
9237 }
9239 {
9240
9242 }
9243
9244 if (m_OldLocation)
9245 {
9246 m_OldLocation.Reset();
9247 }
9248 }
9249 }
9250
9251 override void EOnContact(IEntity other, Contact extra)
9252 {
9254 {
9255 int liquidType = -1;
9257 if (impactSpeed > 0.0)
9258 {
9260 #ifndef SERVER
9262 #else
9264 SetSynchDirty();
9265 #endif
9267 }
9268 }
9269
9270 #ifdef SERVER
9271 if (GetCompEM() && GetCompEM().IsPlugged())
9272 {
9273 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9274 GetCompEM().UnplugThis();
9275 }
9276 #endif
9277 }
9278
9280
9282 {
9284 }
9285
9287 {
9288
9289 }
9290
9292 {
9293 super.OnItemLocationChanged(old_owner, new_owner);
9294
9295 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9296 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9297
9298 if (!relatedPlayer && playerNew)
9299 relatedPlayer = playerNew;
9300
9301 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9302 {
9304 if (actionMgr)
9305 {
9306 ActionBase currentAction = actionMgr.GetRunningAction();
9307 if (currentAction)
9309 }
9310 }
9311
9312 Man ownerPlayerOld = null;
9313 Man ownerPlayerNew = null;
9314
9315 if (old_owner)
9316 {
9317 if (old_owner.
IsMan())
9318 {
9319 ownerPlayerOld = Man.Cast(old_owner);
9320 }
9321 else
9322 {
9323 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9324 }
9325 }
9326 else
9327 {
9329 {
9331
9332 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9333 {
9334 GetCompEM().UnplugThis();
9335 }
9336 }
9337 }
9338
9339 if (new_owner)
9340 {
9341 if (new_owner.
IsMan())
9342 {
9343 ownerPlayerNew = Man.Cast(new_owner);
9344 }
9345 else
9346 {
9347 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9348 }
9349 }
9350
9351 if (ownerPlayerOld != ownerPlayerNew)
9352 {
9353 if (ownerPlayerOld)
9354 {
9355 array<EntityAI> subItemsExit = new array<EntityAI>;
9357 for (int i = 0; i < subItemsExit.Count(); i++)
9358 {
9361 }
9362 }
9363
9364 if (ownerPlayerNew)
9365 {
9366 array<EntityAI> subItemsEnter = new array<EntityAI>;
9368 for (int j = 0; j < subItemsEnter.Count(); j++)
9369 {
9372 }
9373 }
9374 }
9375 else if (ownerPlayerNew != null)
9376 {
9377 PlayerBase nplayer;
9378 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9379 {
9380 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9382 for (int k = 0; k < subItemsUpdate.Count(); k++)
9383 {
9385 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9386 }
9387 }
9388 }
9389
9390 if (old_owner)
9391 old_owner.OnChildItemRemoved(this);
9392 if (new_owner)
9393 new_owner.OnChildItemReceived(this);
9394 }
9395
9396
9398 {
9399 super.EEDelete(parent);
9400 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9401 if (player)
9402 {
9404
9405 if (player.IsAlive())
9406 {
9407 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9408 if (r_index >= 0)
9409 {
9410 InventoryLocation r_il = new InventoryLocation;
9411 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9412
9413 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9416 {
9417 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9418 }
9420 {
9421 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9422 }
9423
9424 }
9425
9426 player.RemoveQuickBarEntityShortcut(this);
9427 }
9428 }
9429 }
9430
9432 {
9433 super.EEKilled(killer);
9434
9437 {
9438 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9439 {
9440 if (IsMagazine())
9441 {
9442 if (Magazine.Cast(this).GetAmmoCount() > 0)
9443 {
9445 }
9446 }
9447 else
9448 {
9450 }
9451 }
9452 }
9453 }
9454
9456 {
9457 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9458
9459 super.OnWasAttached(parent, slot_id);
9460
9463
9465 }
9466
9468 {
9469 super.OnWasDetached(parent, slot_id);
9470
9473 }
9474
9476 {
9477 int idx;
9480
9481 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9482 if (inventory_slots.Count() < 1)
9483 {
9484 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9485 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9486 }
9487 else
9488 {
9489 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9490 }
9491
9492 idx = inventory_slots.Find(slot);
9493 if (idx < 0)
9494 return "";
9495
9496 return attach_types.Get(idx);
9497 }
9498
9500 {
9501 int idx = -1;
9502 string slot;
9503
9506
9507 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9508 if (inventory_slots.Count() < 1)
9509 {
9510 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9511 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9512 }
9513 else
9514 {
9515 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9516 if (detach_types.Count() < 1)
9517 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9518 }
9519
9520 for (int i = 0; i < inventory_slots.Count(); i++)
9521 {
9522 slot = inventory_slots.Get(i);
9523 }
9524
9525 if (slot != "")
9526 {
9527 if (detach_types.Count() == 1)
9528 idx = 0;
9529 else
9530 idx = inventory_slots.Find(slot);
9531 }
9532 if (idx < 0)
9533 return "";
9534
9535 return detach_types.Get(idx);
9536 }
9537
9539 {
9540
9542
9543
9544 float min_time = 1;
9545 float max_time = 3;
9546 float delay = Math.RandomFloat(min_time, max_time);
9547
9548 explode_timer.Run(delay, this, "DoAmmoExplosion");
9549 }
9550
9552 {
9553 Magazine magazine = Magazine.Cast(this);
9554 int pop_sounds_count = 6;
9555 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9556
9557
9558 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9559 string sound_name = pop_sounds[ sound_idx ];
9561
9562
9563 magazine.ServerAddAmmoCount(-1);
9564
9565
9566 float min_temp_to_explode = 100;
9567
9568 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9569 {
9571 }
9572 }
9573
9574
9575 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9576 {
9577 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9578
9579 const int CHANCE_DAMAGE_CARGO = 4;
9580 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9581 const int CHANCE_DAMAGE_NOTHING = 2;
9582
9584 {
9585 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9586 int chances;
9587 int rnd;
9588
9589 if (GetInventory().GetCargo())
9590 {
9591 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9592 rnd = Math.RandomInt(0,chances);
9593
9594 if (rnd < CHANCE_DAMAGE_CARGO)
9595 {
9597 }
9598 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9599 {
9601 }
9602 }
9603 else
9604 {
9605 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9606 rnd = Math.RandomInt(0,chances);
9607
9608 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9609 {
9611 }
9612 }
9613 }
9614 }
9615
9617 {
9618 if (GetInventory().GetCargo())
9619 {
9620 int item_count = GetInventory().GetCargo().GetItemCount();
9621 if (item_count > 0)
9622 {
9623 int random_pick = Math.RandomInt(0, item_count);
9625 if (!item.IsExplosive())
9626 {
9627 item.AddHealth("","",damage);
9628 return true;
9629 }
9630 }
9631 }
9632 return false;
9633 }
9634
9636 {
9637 int attachment_count = GetInventory().AttachmentCount();
9638 if (attachment_count > 0)
9639 {
9640 int random_pick = Math.RandomInt(0, attachment_count);
9641 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9642 if (!attachment.IsExplosive())
9643 {
9644 attachment.AddHealth("","",damage);
9645 return true;
9646 }
9647 }
9648 return false;
9649 }
9650
9652 {
9654 }
9655
9657 {
9659 return GetInventory().CanRemoveEntity();
9660
9661 return false;
9662 }
9663
9665 {
9666
9668 return false;
9669
9670
9672 return false;
9673
9674
9675
9677 if (delta == 0)
9678 return false;
9679
9680
9681 return true;
9682 }
9683
9685 {
9687 {
9688 if (ScriptInputUserData.CanStoreInputUserData())
9689 {
9690 ScriptInputUserData ctx = new ScriptInputUserData;
9695 ctx.
Write(destination_entity);
9699 }
9700 }
9701 else if (!
GetGame().IsMultiplayer())
9702 {
9704 }
9705 }
9706
9708 {
9709 float split_quantity_new;
9713 InventoryLocation loc = new InventoryLocation;
9714
9715 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9716 {
9718 split_quantity_new = stack_max;
9719 else
9721
9723 {
9724 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9725 if (new_item)
9726 {
9727 new_item.SetResultOfSplit(true);
9728 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9730 new_item.
SetQuantity(split_quantity_new,
false,
true);
9731 }
9732 }
9733 }
9734 else if (destination_entity && slot_id == -1)
9735 {
9736 if (quantity > stack_max)
9737 split_quantity_new = stack_max;
9738 else
9739 split_quantity_new = quantity;
9740
9742 {
9744 {
9747 }
9748
9749 if (new_item)
9750 {
9751 new_item.SetResultOfSplit(true);
9752 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9754 new_item.
SetQuantity(split_quantity_new,
false,
true);
9755 }
9756 }
9757 }
9758 else
9759 {
9760 if (stack_max != 0)
9761 {
9763 {
9765 }
9766
9767 if (split_quantity_new == 0)
9768 {
9769 if (!
GetGame().IsMultiplayer())
9770 player.PhysicalPredictiveDropItem(this);
9771 else
9772 player.ServerDropEntity(this);
9773 return;
9774 }
9775
9777 {
9779
9780 if (new_item)
9781 {
9782 new_item.SetResultOfSplit(true);
9783 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9786 new_item.PlaceOnSurface();
9787 }
9788 }
9789 }
9790 }
9791 }
9792
9794 {
9795 float split_quantity_new;
9799 InventoryLocation loc = new InventoryLocation;
9800
9801 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9802 {
9804 split_quantity_new = stack_max;
9805 else
9807
9809 {
9810 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9811 if (new_item)
9812 {
9813 new_item.SetResultOfSplit(true);
9814 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9816 new_item.
SetQuantity(split_quantity_new,
false,
true);
9817 }
9818 }
9819 }
9820 else if (destination_entity && slot_id == -1)
9821 {
9822 if (quantity > stack_max)
9823 split_quantity_new = stack_max;
9824 else
9825 split_quantity_new = quantity;
9826
9828 {
9830 {
9833 }
9834
9835 if (new_item)
9836 {
9837 new_item.SetResultOfSplit(true);
9838 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9840 new_item.
SetQuantity(split_quantity_new,
false,
true);
9841 }
9842 }
9843 }
9844 else
9845 {
9846 if (stack_max != 0)
9847 {
9849 {
9851 }
9852
9854 {
9856
9857 if (new_item)
9858 {
9859 new_item.SetResultOfSplit(true);
9860 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9863 new_item.PlaceOnSurface();
9864 }
9865 }
9866 }
9867 }
9868 }
9869
9871 {
9873 {
9874 if (ScriptInputUserData.CanStoreInputUserData())
9875 {
9876 ScriptInputUserData ctx = new ScriptInputUserData;
9881 dst.WriteToContext(ctx);
9883 }
9884 }
9885 else if (!
GetGame().IsMultiplayer())
9886 {
9888 }
9889 }
9890
9892 {
9894 {
9895 if (ScriptInputUserData.CanStoreInputUserData())
9896 {
9897 ScriptInputUserData ctx = new ScriptInputUserData;
9902 ctx.
Write(destination_entity);
9908 }
9909 }
9910 else if (!
GetGame().IsMultiplayer())
9911 {
9913 }
9914 }
9915
9917 {
9919 }
9920
9922 {
9924 float split_quantity_new;
9926 if (dst.IsValid())
9927 {
9928 int slot_id = dst.GetSlot();
9930
9931 if (quantity > stack_max)
9932 split_quantity_new = stack_max;
9933 else
9934 split_quantity_new = quantity;
9935
9937 {
9939
9940 if (new_item)
9941 {
9942 new_item.SetResultOfSplit(true);
9943 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9945 new_item.
SetQuantity(split_quantity_new,
false,
true);
9946 }
9947
9948 return new_item;
9949 }
9950 }
9951
9952 return null;
9953 }
9954
9956 {
9958 float split_quantity_new;
9960 if (destination_entity)
9961 {
9963 if (quantity > stackable)
9964 split_quantity_new = stackable;
9965 else
9966 split_quantity_new = quantity;
9967
9969 {
9970 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9971 if (new_item)
9972 {
9973 new_item.SetResultOfSplit(true);
9974 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9976 new_item.
SetQuantity(split_quantity_new,
false,
true);
9977 }
9978 }
9979 }
9980 }
9981
9983 {
9985 {
9986 if (ScriptInputUserData.CanStoreInputUserData())
9987 {
9988 ScriptInputUserData ctx = new ScriptInputUserData;
9993 ItemBase destination_entity =
this;
9994 ctx.
Write(destination_entity);
9998 }
9999 }
10000 else if (!
GetGame().IsMultiplayer())
10001 {
10003 }
10004 }
10005
10007 {
10009 float split_quantity_new;
10011 if (player)
10012 {
10014 if (quantity > stackable)
10015 split_quantity_new = stackable;
10016 else
10017 split_quantity_new = quantity;
10018
10020 {
10021 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10022 new_item =
ItemBase.Cast(in_hands);
10023 if (new_item)
10024 {
10025 new_item.SetResultOfSplit(true);
10026 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10028 new_item.SetQuantity(split_quantity_new, false, true);
10029 }
10030 }
10031 }
10032 }
10033
10035 {
10037 float split_quantity_new = Math.Floor(quantity * 0.5);
10038
10040 return;
10041
10043
10044 if (new_item)
10045 {
10046 if (new_item.GetQuantityMax() < split_quantity_new)
10047 {
10048 split_quantity_new = new_item.GetQuantityMax();
10049 }
10050
10051 new_item.SetResultOfSplit(true);
10052 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10053
10055 {
10058 }
10059 else
10060 {
10062 new_item.
SetQuantity(split_quantity_new,
false,
true);
10063 }
10064 }
10065 }
10066
10068 {
10070 float split_quantity_new = Math.Floor(quantity / 2);
10071
10073 return;
10074
10075 InventoryLocation invloc = new InventoryLocation;
10077
10079 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10080
10081 if (new_item)
10082 {
10083 if (new_item.GetQuantityMax() < split_quantity_new)
10084 {
10085 split_quantity_new = new_item.GetQuantityMax();
10086 }
10088 {
10091 }
10092 else if (split_quantity_new > 1)
10093 {
10095 new_item.
SetQuantity(split_quantity_new,
false,
true);
10096 }
10097 }
10098 }
10099
10102 {
10103 SetWeightDirty();
10105
10106 if (parent)
10107 parent.OnAttachmentQuantityChangedEx(this, delta);
10108
10110 {
10112 {
10114 }
10116 {
10117 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10119 }
10120 }
10121
10122 }
10123
10126 {
10127
10128 }
10129
10132 {
10134 }
10135
10137 {
10138 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10139
10141 {
10142 if (newLevel == GameConstants.STATE_RUINED)
10143 {
10145 EntityAI parent = GetHierarchyParent();
10146 if (parent && parent.IsFireplace())
10147 {
10148 CargoBase cargo = GetInventory().GetCargo();
10149 if (cargo)
10150 {
10152 {
10154 }
10155 }
10156 }
10157 }
10158
10160 {
10161
10163 return;
10164 }
10165
10166 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10167 {
10169 }
10170 }
10171 }
10172
10173
10175 {
10176 super.OnRightClick();
10177
10179 {
10181 {
10182 if (ScriptInputUserData.CanStoreInputUserData())
10183 {
10184 EntityAI root = GetHierarchyRoot();
10185 Man playerOwner = GetHierarchyRootPlayer();
10186 InventoryLocation dst = new InventoryLocation;
10187
10188
10189 if (!playerOwner && root && root == this)
10190 {
10192 }
10193 else
10194 {
10195
10196 GetInventory().GetCurrentInventoryLocation(dst);
10198 {
10201 {
10203 }
10204 else
10205 {
10207
10208
10209 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10210 {
10212 }
10213 else
10214 {
10215 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10216 }
10217 }
10218 }
10219 }
10220
10221 ScriptInputUserData ctx = new ScriptInputUserData;
10229 }
10230 }
10231 else if (!
GetGame().IsMultiplayer())
10232 {
10234 }
10235 }
10236 }
10237
10239 {
10240 if (root)
10241 {
10242 vector m4[4];
10243 root.GetTransform(m4);
10244 dst.SetGround(this, m4);
10245 }
10246 else
10247 {
10248 GetInventory().GetCurrentInventoryLocation(dst);
10249 }
10250 }
10251
10252 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10253 {
10254
10255 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10256 return false;
10257
10258 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10259 return false;
10260
10261
10263 return false;
10264
10265
10266 Magazine mag = Magazine.Cast(this);
10267 if (mag)
10268 {
10269 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10270 return false;
10271
10272 if (stack_max_limit)
10273 {
10274 Magazine other_mag = Magazine.Cast(other_item);
10275 if (other_item)
10276 {
10277 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10278 return false;
10279 }
10280
10281 }
10282 }
10283 else
10284 {
10285
10287 return false;
10288
10290 return false;
10291 }
10292
10293 PlayerBase player = null;
10294 if (CastTo(player, GetHierarchyRootPlayer()))
10295 {
10296 if (player.GetInventory().HasAttachment(this))
10297 return false;
10298
10299 if (player.IsItemsToDelete())
10300 return false;
10301 }
10302
10303 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10304 return false;
10305
10306 int slotID;
10308 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10309 return false;
10310
10311 return true;
10312 }
10313
10315 {
10317 }
10318
10320 {
10321 return m_IsResultOfSplit;
10322 }
10323
10325 {
10326 m_IsResultOfSplit = value;
10327 }
10328
10330 {
10332 }
10333
10335 {
10336 float other_item_quantity = other_item.GetQuantity();
10337 float this_free_space;
10338
10340
10342
10343 if (other_item_quantity > this_free_space)
10344 {
10345 return this_free_space;
10346 }
10347 else
10348 {
10349 return other_item_quantity;
10350 }
10351 }
10352
10354 {
10356 }
10357
10359 {
10361 return;
10362
10363 if (!IsMagazine() && other_item)
10364 {
10366 if (quantity_used != 0)
10367 {
10368 float hp1 = GetHealth01("","");
10369 float hp2 = other_item.GetHealth01("","");
10370 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10371 hpResult = hpResult / (
GetQuantity() + quantity_used);
10372
10373 hpResult *= GetMaxHealth();
10374 Math.Round(hpResult);
10375 SetHealth("", "Health", hpResult);
10376
10378 other_item.AddQuantity(-quantity_used);
10379 }
10380 }
10382 }
10383
10385 {
10386 #ifdef SERVER
10387 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10388 GetHierarchyParent().IncreaseLifetimeUp();
10389 #endif
10390 };
10391
10393 {
10394 PlayerBase p = PlayerBase.Cast(player);
10395
10396 array<int> recipesIds = p.m_Recipes;
10397 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10398 if (moduleRecipesManager)
10399 {
10400 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10401 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10402 }
10403
10404 for (int i = 0;i < recipesIds.Count(); i++)
10405 {
10406 int key = recipesIds.Get(i);
10407 string recipeName = moduleRecipesManager.GetRecipeName(key);
10409 }
10410 }
10411
10412
10413 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10414 {
10415 super.GetDebugActions(outputList);
10416
10417
10423
10424
10429
10434
10435
10439
10440
10442 {
10446 }
10447
10450
10451
10455
10457
10458 InventoryLocation loc = new InventoryLocation();
10459 GetInventory().GetCurrentInventoryLocation(loc);
10461 {
10462 if (Gizmo_IsSupported())
10465 }
10466
10468 }
10469
10470
10471
10472
10474 {
10475 super.OnAction(action_id, player, ctx);
10476
10478 {
10479 switch (action_id)
10480 {
10483 return true;
10486 return true;
10487 }
10488 }
10489
10491 {
10492 switch (action_id)
10493 {
10495 Delete();
10496 return true;
10497 }
10498 }
10499
10500 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10501 {
10502 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10503 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10504 PlayerBase p = PlayerBase.Cast(player);
10505 if (
EActions.RECIPES_RANGE_START < 1000)
10506 {
10507 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10508 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10509 }
10510 }
10511 #ifndef SERVER
10512 else if (action_id ==
EActions.WATCH_PLAYER)
10513 {
10514 PluginDeveloper.SetDeveloperItemClientEx(player);
10515 }
10516 #endif
10518 {
10519 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10520 {
10521 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10522 OnDebugButtonPressServer(id + 1);
10523 }
10524
10525 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10526 {
10527 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10529 }
10530
10531 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10532 {
10533 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10535 }
10536
10537 else if (action_id ==
EActions.ADD_QUANTITY)
10538 {
10539 if (IsMagazine())
10540 {
10541 Magazine mag = Magazine.Cast(this);
10542 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10543 }
10544 else
10545 {
10547 }
10548
10549 if (m_EM)
10550 {
10551 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10552 }
10553
10554 }
10555
10556 else if (action_id ==
EActions.REMOVE_QUANTITY)
10557 {
10558 if (IsMagazine())
10559 {
10560 Magazine mag2 = Magazine.Cast(this);
10561 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10562 }
10563 else
10564 {
10566 }
10567 if (m_EM)
10568 {
10569 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10570 }
10571
10572 }
10573
10574 else if (action_id ==
EActions.SET_QUANTITY_0)
10575 {
10577
10578 if (m_EM)
10579 {
10580 m_EM.SetEnergy(0);
10581 }
10582 }
10583
10584 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10585 {
10587
10588 if (m_EM)
10589 {
10590 m_EM.SetEnergy(m_EM.GetEnergyMax());
10591 }
10592 }
10593
10594 else if (action_id ==
EActions.ADD_HEALTH)
10595 {
10596 AddHealth("","",GetMaxHealth("","Health")/5);
10597 }
10598 else if (action_id ==
EActions.REMOVE_HEALTH)
10599 {
10600 AddHealth("","",-GetMaxHealth("","Health")/5);
10601 }
10602 else if (action_id ==
EActions.DESTROY_HEALTH)
10603 {
10604 SetHealth01("","",0);
10605 }
10606 else if (action_id ==
EActions.WATCH_ITEM)
10607 {
10609 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10610 #ifdef DEVELOPER
10611 SetDebugDeveloper_item(this);
10612 #endif
10613 }
10614
10615 else if (action_id ==
EActions.ADD_TEMPERATURE)
10616 {
10617 AddTemperature(20);
10618
10619 }
10620
10621 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10622 {
10623 AddTemperature(-20);
10624
10625 }
10626
10627 else if (action_id ==
EActions.FLIP_FROZEN)
10628 {
10629 SetFrozen(!GetIsFrozen());
10630
10631 }
10632
10633 else if (action_id ==
EActions.ADD_WETNESS)
10634 {
10636
10637 }
10638
10639 else if (action_id ==
EActions.REMOVE_WETNESS)
10640 {
10642
10643 }
10644
10645 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10646 {
10649
10650
10651 }
10652
10653 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10654 {
10657 }
10658
10659 else if (action_id ==
EActions.MAKE_SPECIAL)
10660 {
10661 auto debugParams = DebugSpawnParams.WithPlayer(player);
10662 OnDebugSpawnEx(debugParams);
10663 }
10664
10665 }
10666
10667
10668 return false;
10669 }
10670
10671
10672
10673
10677
10680
10681
10682
10684 {
10685 return false;
10686 }
10687
10688
10690 {
10691 return true;
10692 }
10693
10694
10696 {
10697 return true;
10698 }
10699
10700
10701
10703 {
10704 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10706 }
10707
10710 {
10711 return null;
10712 }
10713
10715 {
10716 return false;
10717 }
10718
10720 {
10721 return false;
10722 }
10723
10727
10728
10730 {
10731 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10732 return module_repairing.CanRepair(this, item_repair_kit);
10733 }
10734
10735
10736 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10737 {
10738 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10739 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10740 }
10741
10742
10744 {
10745
10746
10747
10748
10749
10750
10751
10752
10753 return 1;
10754 }
10755
10756
10757
10759 {
10761 }
10762
10763
10764
10766 {
10768 }
10769
10770
10779 {
10780 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10781
10782 if (player)
10783 {
10784 player.MessageStatus(text);
10785 }
10786 }
10787
10788
10797 {
10798 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10799
10800 if (player)
10801 {
10802 player.MessageAction(text);
10803 }
10804 }
10805
10806
10815 {
10816 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10817
10818 if (player)
10819 {
10820 player.MessageFriendly(text);
10821 }
10822 }
10823
10824
10833 {
10834 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10835
10836 if (player)
10837 {
10838 player.MessageImportant(text);
10839 }
10840 }
10841
10843 {
10844 return true;
10845 }
10846
10847
10848 override bool KindOf(
string tag)
10849 {
10850 bool found = false;
10851 string item_name = this.
GetType();
10854
10855 int array_size = item_tag_array.Count();
10856 for (int i = 0; i < array_size; i++)
10857 {
10858 if (item_tag_array.Get(i) == tag)
10859 {
10860 found = true;
10861 break;
10862 }
10863 }
10864 return found;
10865 }
10866
10867
10869 {
10870
10871 super.OnRPC(sender, rpc_type,ctx);
10872
10873
10874 switch (rpc_type)
10875 {
10876 #ifndef SERVER
10877 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10878 Param2<bool, string> p = new Param2<bool, string>(false, "");
10879
10881 return;
10882
10883 bool play = p.param1;
10884 string soundSet = p.param2;
10885
10886 if (play)
10887 {
10889 {
10891 {
10893 }
10894 }
10895 else
10896 {
10898 }
10899 }
10900 else
10901 {
10903 }
10904
10905 break;
10906 #endif
10907
10908 }
10909
10911 {
10913 }
10914 }
10915
10916
10917
10918
10920 {
10921 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10922 return plugin.GetID(
name);
10923 }
10924
10926 {
10927 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10928 return plugin.GetName(id);
10929 }
10930
10933 {
10934
10935
10936 int varFlags;
10937 if (!ctx.
Read(varFlags))
10938 return;
10939
10940 if (varFlags & ItemVariableFlags.FLOAT)
10941 {
10943 }
10944 }
10945
10947 {
10948
10949 super.SerializeNumericalVars(floats_out);
10950
10951
10952
10954 {
10956 }
10957
10959 {
10961 }
10962
10964 {
10966 }
10967
10969 {
10974 }
10975
10977 {
10979 }
10980 }
10981
10983 {
10984
10985 super.DeSerializeNumericalVars(floats);
10986
10987
10988 int index = 0;
10989 int mask = Math.Round(floats.Get(index));
10990
10991 index++;
10992
10994 {
10996 {
10998 }
10999 else
11000 {
11001 float quantity = floats.Get(index);
11002 SetQuantity(quantity,
true,
false,
false,
false);
11003 }
11004 index++;
11005 }
11006
11008 {
11009 float wet = floats.Get(index);
11011 index++;
11012 }
11013
11015 {
11016 int liquidtype = Math.Round(floats.Get(index));
11018 index++;
11019 }
11020
11022 {
11024 index++;
11026 index++;
11028 index++;
11030 index++;
11031 }
11032
11034 {
11035 int cleanness = Math.Round(floats.Get(index));
11037 index++;
11038 }
11039 }
11040
11042 {
11043 super.WriteVarsToCTX(ctx);
11044
11045
11047 {
11049 }
11050
11052 {
11054 }
11055
11057 {
11059 }
11060
11062 {
11063 int r,g,b,a;
11069 }
11070
11072 {
11074 }
11075 }
11076
11078 {
11079 if (!super.ReadVarsFromCTX(ctx,version))
11080 return false;
11081
11082 int intValue;
11083 float value;
11084
11085 if (version < 140)
11086 {
11087 if (!ctx.
Read(intValue))
11088 return false;
11089
11090 m_VariablesMask = intValue;
11091 }
11092
11094 {
11095 if (!ctx.
Read(value))
11096 return false;
11097
11099 {
11101 }
11102 else
11103 {
11105 }
11106 }
11107
11108 if (version < 140)
11109 {
11111 {
11112 if (!ctx.
Read(value))
11113 return false;
11114 SetTemperatureDirect(value);
11115 }
11116 }
11117
11119 {
11120 if (!ctx.
Read(value))
11121 return false;
11123 }
11124
11126 {
11127 if (!ctx.
Read(intValue))
11128 return false;
11130 }
11131
11133 {
11134 int r,g,b,a;
11136 return false;
11138 return false;
11140 return false;
11142 return false;
11143
11145 }
11146
11148 {
11149 if (!ctx.
Read(intValue))
11150 return false;
11152 }
11153
11154 if (version >= 138 && version < 140)
11155 {
11157 {
11158 if (!ctx.
Read(intValue))
11159 return false;
11160 SetFrozen(intValue);
11161 }
11162 }
11163
11164 return true;
11165 }
11166
11167
11169 {
11172 {
11174 }
11175
11176 if (!super.OnStoreLoad(ctx, version))
11177 {
11179 return false;
11180 }
11181
11182 if (version >= 114)
11183 {
11184 bool hasQuickBarIndexSaved;
11185
11186 if (!ctx.
Read(hasQuickBarIndexSaved))
11187 {
11189 return false;
11190 }
11191
11192 if (hasQuickBarIndexSaved)
11193 {
11194 int itmQBIndex;
11195
11196
11197 if (!ctx.
Read(itmQBIndex))
11198 {
11200 return false;
11201 }
11202
11203 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11204 if (itmQBIndex != -1 && parentPlayer)
11205 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11206 }
11207 }
11208 else
11209 {
11210
11211 PlayerBase player;
11212 int itemQBIndex;
11213 if (version ==
int.
MAX)
11214 {
11215 if (!ctx.
Read(itemQBIndex))
11216 {
11218 return false;
11219 }
11220 }
11221 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11222 {
11223
11224 if (!ctx.
Read(itemQBIndex))
11225 {
11227 return false;
11228 }
11229 if (itemQBIndex != -1 && player)
11230 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11231 }
11232 }
11233
11234 if (version < 140)
11235 {
11236
11237 if (!LoadVariables(ctx, version))
11238 {
11240 return false;
11241 }
11242 }
11243
11244
11246 {
11248 return false;
11249 }
11250 if (version >= 132)
11251 {
11253 if (raib)
11254 {
11256 {
11258 return false;
11259 }
11260 }
11261 }
11262
11264 return true;
11265 }
11266
11267
11268
11270 {
11271 super.OnStoreSave(ctx);
11272
11273 PlayerBase player;
11274 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11275 {
11277
11278 int itemQBIndex = -1;
11279 itemQBIndex = player.FindQuickBarEntityIndex(this);
11280 ctx.
Write(itemQBIndex);
11281 }
11282 else
11283 {
11285 }
11286
11288
11290 if (raib)
11291 {
11293 }
11294 }
11295
11296
11298 {
11299 super.AfterStoreLoad();
11300
11302 {
11304 }
11305
11307 {
11310 }
11311 }
11312
11314 {
11315 super.EEOnAfterLoad();
11316
11318 {
11320 }
11321
11324 }
11325
11327 {
11328 return false;
11329 }
11330
11331
11332
11334 {
11336 {
11337 #ifdef PLATFORM_CONSOLE
11338
11340 {
11342 if (menu)
11343 {
11345 }
11346 }
11347 #endif
11348 }
11349
11351 {
11354 }
11355
11357 {
11358 SetWeightDirty();
11360 }
11362 {
11365 }
11366
11368 {
11371 }
11373 {
11376 }
11377
11378 super.OnVariablesSynchronized();
11379 }
11380
11381
11382
11384 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11385 {
11386 if (!IsServerCheck(allow_client))
11387 return false;
11388
11390 return false;
11391
11394
11395 if (value <= (min + 0.001))
11396 value = min;
11397
11398 if (value == min)
11399 {
11400 if (destroy_config)
11401 {
11402 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11403 if (dstr)
11404 {
11406 this.Delete();
11407 return true;
11408 }
11409 }
11410 else if (destroy_forced)
11411 {
11413 this.Delete();
11414 return true;
11415 }
11416
11418 }
11419
11422
11424 {
11426
11427 if (delta)
11429 }
11430
11432
11433 return false;
11434 }
11435
11436
11438 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11439 {
11441 }
11442
11444 {
11447 }
11448
11450 {
11453 }
11454
11456 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11457 {
11458 float value_clamped = Math.Clamp(value, 0, 1);
11460 SetQuantity(result, destroy_config, destroy_forced);
11461 }
11462
11463
11466 {
11468 }
11469
11471 {
11473 }
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11485 {
11486 int slot = -1;
11487 if (GetInventory())
11488 {
11489 InventoryLocation il = new InventoryLocation;
11490 GetInventory().GetCurrentInventoryLocation(il);
11492 }
11493
11495 }
11496
11498 {
11499 float quantity_max = 0;
11500
11502 {
11503 if (attSlotID != -1)
11504 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11505
11506 if (quantity_max <= 0)
11508 }
11509
11510 if (quantity_max <= 0)
11512
11513 return quantity_max;
11514 }
11515
11517 {
11519 }
11520
11522 {
11524 }
11525
11526
11528 {
11530 }
11531
11533 {
11535 }
11536
11538 {
11540 }
11541
11542
11544 {
11545
11546 float weightEx = GetWeightEx();
11547 float special = GetInventoryAndCargoWeight();
11548 return weightEx - special;
11549 }
11550
11551
11553 {
11555 }
11556
11558 {
11560 {
11561 #ifdef DEVELOPER
11562 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11563 {
11564 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11566 }
11567 #endif
11568
11569 return GetQuantity() * GetConfigWeightModified();
11570 }
11571 else if (HasEnergyManager())
11572 {
11573 #ifdef DEVELOPER
11574 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11575 {
11576 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11577 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11578 }
11579 #endif
11580 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11581 }
11582 else
11583 {
11584 #ifdef DEVELOPER
11585 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11586 {
11587 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11588 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11589 }
11590 #endif
11591 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11592 }
11593 }
11594
11597 {
11598 int item_count = 0;
11600
11601 if (GetInventory().GetCargo() != NULL)
11602 {
11603 item_count = GetInventory().GetCargo().GetItemCount();
11604 }
11605
11606 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11607 {
11608 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11609 if (item)
11610 item_count += item.GetNumberOfItems();
11611 }
11612 return item_count;
11613 }
11614
11617 {
11618 float weight = 0;
11619 float wetness = 1;
11620 if (include_wetness)
11623 {
11624 weight = wetness * m_ConfigWeight;
11625 }
11627 {
11628 weight = 1;
11629 }
11630 return weight;
11631 }
11632
11633
11634
11636 {
11637 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11638 {
11639 GameInventory inv = GetInventory();
11640 array<EntityAI> items = new array<EntityAI>;
11642 for (int i = 0; i < items.Count(); i++)
11643 {
11645 if (item)
11646 {
11648 }
11649 }
11650 }
11651 }
11652
11653
11654
11655
11657 {
11658 float energy = 0;
11659 if (HasEnergyManager())
11660 {
11661 energy = GetCompEM().GetEnergy();
11662 }
11663 return energy;
11664 }
11665
11666
11668 {
11669 super.OnEnergyConsumed();
11670
11672 }
11673
11675 {
11676 super.OnEnergyAdded();
11677
11679 }
11680
11681
11683 {
11684 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11685 {
11687 {
11688 float energy_0to1 = GetCompEM().GetEnergy0To1();
11690 }
11691 }
11692 }
11693
11694
11696 {
11697 return ConfigGetFloat("heatIsolation");
11698 }
11699
11701 {
11703 }
11704
11706 {
11707 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11708 if (
GetGame().ConfigIsExisting(paramPath))
11710
11711 return 0.0;
11712 }
11713
11715 {
11716 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11717 if (
GetGame().ConfigIsExisting(paramPath))
11719
11720 return 0.0;
11721 }
11722
11723 override void SetWet(
float value,
bool allow_client =
false)
11724 {
11725 if (!IsServerCheck(allow_client))
11726 return;
11727
11730
11732
11733 m_VarWet = Math.Clamp(value, min, max);
11734
11736 {
11739 }
11740 }
11741
11742 override void AddWet(
float value)
11743 {
11745 }
11746
11748 {
11750 }
11751
11753 {
11755 }
11756
11758 {
11760 }
11761
11763 {
11765 }
11766
11768 {
11770 }
11771
11772 override void OnWetChanged(
float newVal,
float oldVal)
11773 {
11776 if (newLevel != oldLevel)
11777 {
11779 }
11780 }
11781
11783 {
11784 SetWeightDirty();
11785 }
11786
11788 {
11789 return GetWetLevelInternal(
m_VarWet);
11790 }
11791
11792
11793
11795 {
11797 }
11798
11800 {
11802 }
11803
11805 {
11807 }
11808
11810 {
11812 }
11813
11814
11815
11817 {
11818 if (ConfigIsExisting("itemModelLength"))
11819 {
11820 return ConfigGetFloat("itemModelLength");
11821 }
11822 return 0;
11823 }
11824
11826 {
11827 if (ConfigIsExisting("itemAttachOffset"))
11828 {
11829 return ConfigGetFloat("itemAttachOffset");
11830 }
11831 return 0;
11832 }
11833
11834 override void SetCleanness(
int value,
bool allow_client =
false)
11835 {
11836 if (!IsServerCheck(allow_client))
11837 return;
11838
11840
11842
11845 }
11846
11848 {
11850 }
11851
11853 {
11854 return true;
11855 }
11856
11857
11858
11859
11861 {
11863 }
11864
11866 {
11868 }
11869
11870
11871
11872
11873 override void SetColor(
int r,
int g,
int b,
int a)
11874 {
11880 }
11882 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11883 {
11888 }
11889
11891 {
11893 }
11894
11897 {
11898 int r,g,b,a;
11900 r = r/255;
11901 g = g/255;
11902 b = b/255;
11903 a = a/255;
11904 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11905 }
11906
11907
11908
11909 override void SetLiquidType(
int value,
bool allow_client =
false)
11910 {
11911 if (!IsServerCheck(allow_client))
11912 return;
11913
11918 }
11919
11921 {
11922 return ConfigGetInt("varLiquidTypeInit");
11923 }
11924
11926 {
11928 }
11929
11931 {
11933 SetFrozen(false);
11934 }
11935
11938 {
11939 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11940 }
11941
11942
11945 {
11946 PlayerBase nplayer;
11947 if (PlayerBase.CastTo(nplayer, player))
11948 {
11950
11951 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11952 }
11953 }
11954
11955
11958 {
11959 PlayerBase nplayer;
11960 if (PlayerBase.CastTo(nplayer,player))
11961 {
11962
11963 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11964
11965 }
11966
11967
11968 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11969
11970
11971 if (HasEnergyManager())
11972 {
11973 GetCompEM().UpdatePlugState();
11974 }
11975 }
11976
11977
11979 {
11980 super.OnPlacementStarted(player);
11981
11983 }
11984
11985 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11986 {
11988 {
11989 m_AdminLog.OnPlacementComplete(player,
this);
11990 }
11991
11992 super.OnPlacementComplete(player, position, orientation);
11993 }
11994
11995
11996
11997
11998
12000 {
12002 {
12003 return true;
12004 }
12005 else
12006 {
12007 return false;
12008 }
12009 }
12010
12011
12013 {
12015 {
12017 }
12018 }
12019
12020
12022 {
12024 }
12025
12027 {
12029 }
12030
12031 override void InsertAgent(
int agent,
float count = 1)
12032 {
12033 if (count < 1)
12034 return;
12035
12037 }
12038
12041 {
12043 }
12044
12045
12047 {
12049 }
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12093 {
12095 return false;
12096 return true;
12097 }
12098
12100 {
12101
12103 }
12104
12105
12108 {
12109 super.CheckForRoofLimited(timeTresholdMS);
12110
12112 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12113 {
12114 m_PreviousRoofTestTime = time;
12115 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12116 }
12117 }
12118
12119
12121 {
12123 {
12124 return 0;
12125 }
12126
12127 if (GetInventory().GetAttachmentSlotsCount() != 0)
12128 {
12129 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12130 if (filter)
12131 return filter.GetProtectionLevel(type, false, system);
12132 else
12133 return 0;
12134 }
12135
12136 string subclassPath, entryName;
12137
12138 switch (type)
12139 {
12141 entryName = "biological";
12142 break;
12144 entryName = "chemical";
12145 break;
12146 default:
12147 entryName = "biological";
12148 break;
12149 }
12150
12151 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12152
12154 }
12155
12156
12157
12160 {
12161 if (!IsMagazine())
12163
12165 }
12166
12167
12168
12169
12170
12175 {
12176 return true;
12177 }
12178
12180 {
12182 }
12183
12184
12185
12186
12187
12189 {
12190 if (parent)
12191 {
12192 if (parent.IsInherited(DayZInfected))
12193 return true;
12194
12195 if (!parent.IsRuined())
12196 return true;
12197 }
12198
12199 return true;
12200 }
12201
12203 {
12204 if (!super.CanPutAsAttachment(parent))
12205 {
12206 return false;
12207 }
12208
12209 if (!IsRuined() && !parent.IsRuined())
12210 {
12211 return true;
12212 }
12213
12214 return false;
12215 }
12216
12218 {
12219
12220
12221
12222
12223 return super.CanReceiveItemIntoCargo(item);
12224 }
12225
12227 {
12228
12229
12230
12231
12232 GameInventory attachmentInv = attachment.GetInventory();
12234 {
12235 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12236 return false;
12237 }
12238
12239 InventoryLocation loc = new InventoryLocation();
12240 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12241 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12242 return false;
12243
12244 return super.CanReceiveAttachment(attachment, slotId);
12245 }
12246
12248 {
12249 if (!super.CanReleaseAttachment(attachment))
12250 return false;
12251
12252 return GetInventory().AreChildrenAccessible();
12253 }
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12276 {
12277 int id = muzzle_owner.GetMuzzleID();
12278 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12279
12280 if (WPOF_array)
12281 {
12282 for (int i = 0; i < WPOF_array.Count(); i++)
12283 {
12284 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12285
12286 if (WPOF)
12287 {
12288 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12289 }
12290 }
12291 }
12292 }
12293
12294
12296 {
12297 int id = muzzle_owner.GetMuzzleID();
12299
12300 if (WPOBE_array)
12301 {
12302 for (int i = 0; i < WPOBE_array.Count(); i++)
12303 {
12304 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12305
12306 if (WPOBE)
12307 {
12308 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12309 }
12310 }
12311 }
12312 }
12313
12314
12316 {
12317 int id = muzzle_owner.GetMuzzleID();
12318 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12319
12320 if (WPOOH_array)
12321 {
12322 for (int i = 0; i < WPOOH_array.Count(); i++)
12323 {
12324 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12325
12326 if (WPOOH)
12327 {
12328 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12329 }
12330 }
12331 }
12332 }
12333
12334
12336 {
12337 int id = muzzle_owner.GetMuzzleID();
12338 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12339
12340 if (WPOOH_array)
12341 {
12342 for (int i = 0; i < WPOOH_array.Count(); i++)
12343 {
12344 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12345
12346 if (WPOOH)
12347 {
12348 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12349 }
12350 }
12351 }
12352 }
12353
12354
12356 {
12357 int id = muzzle_owner.GetMuzzleID();
12358 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12359
12360 if (WPOOH_array)
12361 {
12362 for (int i = 0; i < WPOOH_array.Count(); i++)
12363 {
12364 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12365
12366 if (WPOOH)
12367 {
12368 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12369 }
12370 }
12371 }
12372 }
12373
12374
12375
12377 {
12379 {
12380 return true;
12381 }
12382
12383 return false;
12384 }
12385
12387 {
12389 {
12390 return true;
12391 }
12392
12393 return false;
12394 }
12395
12397 {
12399 {
12400 return true;
12401 }
12402
12403 return false;
12404 }
12405
12407 {
12408 return false;
12409 }
12410
12413 {
12414 return UATimeSpent.DEFAULT_DEPLOY;
12415 }
12416
12417
12418
12419
12421 {
12423 SetSynchDirty();
12424 }
12425
12427 {
12429 }
12430
12431
12433 {
12434 return false;
12435 }
12436
12439 {
12440 string att_type = "None";
12441
12442 if (ConfigIsExisting("soundAttType"))
12443 {
12444 att_type = ConfigGetString("soundAttType");
12445 }
12446
12448 }
12449
12451 {
12453 }
12454
12455
12456
12457
12458
12464
12466 {
12469
12471 }
12472
12473
12475 {
12477 return;
12478
12480
12483
12486
12487 SoundParameters params = new SoundParameters();
12491 }
12492
12493
12495 {
12497 return;
12498
12500 SetSynchDirty();
12501
12504 }
12505
12506
12508 {
12510 return;
12511
12513 SetSynchDirty();
12514
12517 }
12518
12520 {
12522 }
12523
12525 {
12527 }
12528
12531 {
12532 if (!
GetGame().IsDedicatedServer())
12533 {
12534 if (ConfigIsExisting("attachSoundSet"))
12535 {
12536 string cfg_path = "";
12537 string soundset = "";
12538 string type_name =
GetType();
12539
12542 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12543 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12544
12545 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12546 {
12547 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12548 {
12549 if (cfg_slot_array[i] == slot_type)
12550 {
12551 soundset = cfg_soundset_array[i];
12552 break;
12553 }
12554 }
12555 }
12556
12557 if (soundset != "")
12558 {
12559 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12561 }
12562 }
12563 }
12564 }
12565
12567 {
12568
12569 }
12570
12571 void OnApply(PlayerBase player);
12572
12574 {
12575 return 1.0;
12576 };
12577
12579 {
12581 }
12582
12584 {
12586 }
12587
12589
12591 {
12592 SetDynamicPhysicsLifeTime(0.01);
12594 }
12595
12597 {
12598 array<string> zone_names = new array<string>;
12599 GetDamageZones(zone_names);
12600 for (int i = 0; i < zone_names.Count(); i++)
12601 {
12602 SetHealthMax(zone_names.Get(i),"Health");
12603 }
12604 SetHealthMax("","Health");
12605 }
12606
12609 {
12610 float global_health = GetHealth01("","Health");
12611 array<string> zones = new array<string>;
12612 GetDamageZones(zones);
12613
12614 for (int i = 0; i < zones.Count(); i++)
12615 {
12616 SetHealth01(zones.Get(i),"Health",global_health);
12617 }
12618 }
12619
12622 {
12623 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12624 }
12625
12627 {
12628 if (!hasRootAsPlayer)
12629 {
12630 if (refParentIB)
12631 {
12632
12633 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12634 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12635
12636 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12637 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12638
12641 }
12642 else
12643 {
12644
12647 }
12648 }
12649 }
12650
12652 {
12654 {
12655 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12656 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12657 {
12658 float heatPermCoef = 1.0;
12660 while (ent)
12661 {
12662 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12663 ent = ent.GetHierarchyParent();
12664 }
12665
12666 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12667 }
12668 }
12669 }
12670
12672 {
12673
12674 EntityAI parent = GetHierarchyParent();
12675 if (!parent)
12676 {
12677 hasParent = false;
12678 hasRootAsPlayer = false;
12679 }
12680 else
12681 {
12682 hasParent = true;
12683 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12684 refParentIB =
ItemBase.Cast(parent);
12685 }
12686 }
12687
12688 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12689 {
12690
12691 }
12692
12694 {
12695
12696 return false;
12697 }
12698
12700 {
12701
12702
12703 return false;
12704 }
12705
12707 {
12708
12709 return false;
12710 }
12711
12714 {
12715 return !GetIsFrozen() &&
IsOpen();
12716 }
12717
12719 {
12720 bool hasParent = false, hasRootAsPlayer = false;
12722
12723 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12724 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12725
12726 if (wwtu || foodDecay)
12727 {
12731
12732 if (processWetness || processTemperature || processDecay)
12733 {
12735
12736 if (processWetness)
12737 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12738
12739 if (processTemperature)
12741
12742 if (processDecay)
12743 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12744 }
12745 }
12746 }
12747
12750 {
12752 }
12753
12755 {
12758
12759 return super.GetTemperatureFreezeThreshold();
12760 }
12761
12763 {
12766
12767 return super.GetTemperatureThawThreshold();
12768 }
12769
12771 {
12774
12775 return super.GetItemOverheatThreshold();
12776 }
12777
12779 {
12781 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12782
12783 return super.GetTemperatureFreezeTime();
12784 }
12785
12787 {
12789 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12790
12791 return super.GetTemperatureThawTime();
12792 }
12793
12798
12800 {
12801 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12802 }
12803
12805 {
12806 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12807 }
12808
12811 {
12813 }
12814
12816 {
12818 }
12819
12821 {
12823 }
12824
12827 {
12828 return null;
12829 }
12830
12833 {
12834 return false;
12835 }
12836
12838 {
12840 {
12843 if (!trg)
12844 {
12846 explosive = this;
12847 }
12848
12849 explosive.PairRemote(trg);
12851
12852 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12853 trg.SetPersistentPairID(persistentID);
12854 explosive.SetPersistentPairID(persistentID);
12855
12856 return true;
12857 }
12858 return false;
12859 }
12860
12863 {
12864 float ret = 1.0;
12867 ret *= GetHealth01();
12868
12869 return ret;
12870 }
12871
12872 #ifdef DEVELOPER
12873 override void SetDebugItem()
12874 {
12875 super.SetDebugItem();
12876 _itemBase = this;
12877 }
12878
12880 {
12881 string text = super.GetDebugText();
12882
12884 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12885
12886 return text;
12887 }
12888 #endif
12889
12891 {
12892 return true;
12893 }
12894
12896
12898
12900 {
12903 }
12904
12905
12913
12929}
12930
12932{
12934 if (entity)
12935 {
12936 bool is_item = entity.IsInherited(
ItemBase);
12937 if (is_item && full_quantity)
12938 {
12941 }
12942 }
12943 else
12944 {
12946 return NULL;
12947 }
12948 return entity;
12949}
12950
12952{
12953 if (item)
12954 {
12955 if (health > 0)
12956 item.SetHealth("", "", health);
12957
12958 if (item.CanHaveTemperature())
12959 {
12961 if (item.CanFreeze())
12962 item.SetFrozen(false);
12963 }
12964
12965 if (item.HasEnergyManager())
12966 {
12967 if (quantity >= 0)
12968 {
12969 item.GetCompEM().SetEnergy0To1(quantity);
12970 }
12971 else
12972 {
12974 }
12975 }
12976 else if (item.IsMagazine())
12977 {
12978 Magazine mag = Magazine.Cast(item);
12979 if (quantity >= 0)
12980 {
12981 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12982 }
12983 else
12984 {
12986 }
12987
12988 }
12989 else
12990 {
12991 if (quantity >= 0)
12992 {
12993 item.SetQuantityNormalized(quantity, false);
12994 }
12995 else
12996 {
12998 }
12999
13000 }
13001 }
13002}
13003
13004#ifdef DEVELOPER
13006#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.