8110{
8112 {
8113 return true;
8114 }
8115};
8116
8117
8118
8120{
8124
8126
8129
8130
8131
8132
8133
8142
8148
8153
8158
8179 protected bool m_IsResultOfSplit
8180
8182
8187
8188
8189
8191
8195
8196
8197
8199
8202
8203
8204
8210
8211
8219
8222
8223
8225
8226
8228
8229
8234
8235
8240
8241
8243
8244
8246 {
8251
8252 if (!
GetGame().IsDedicatedServer())
8253 {
8255 {
8257
8259 {
8261 }
8262 }
8263
8266 }
8267
8268 m_OldLocation = null;
8269
8271 {
8273 }
8274
8275 if (ConfigIsExisting("headSelectionsToHide"))
8276 {
8279 }
8280
8282 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8283 {
8285 }
8286
8288
8289 m_IsResultOfSplit = false;
8290
8292 }
8293
8295 {
8296 super.InitItemVariables();
8297
8303 m_Count = ConfigGetInt(
"count");
8304
8307
8312
8315
8320
8332
8336
8337
8340 if (ConfigIsExisting("canBeSplit"))
8341 {
8344 }
8345
8347 if (ConfigIsExisting("itemBehaviour"))
8349
8350
8353 RegisterNetSyncVariableInt("m_VarLiquidType");
8354 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8355
8356 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8357 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8358 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8359
8360 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8361 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8362 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8363 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8364
8365 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8366 RegisterNetSyncVariableBool("m_IsTakeable");
8367 RegisterNetSyncVariableBool("m_IsHologram");
8368
8371 {
8374 }
8375
8377
8379 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8381
8382 }
8383
8385 {
8387 }
8388
8390 {
8393 {
8398 }
8399 }
8400
8401 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8402 {
8404 {
8407 }
8408
8410 }
8411
8413 {
8419 }
8420
8422
8424 {
8426
8427 if (!action)
8428 {
8429 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8430 return;
8431 }
8432
8434 if (!ai)
8435 {
8437 return;
8438 }
8439
8441 if (!action_array)
8442 {
8443 action_array = new array<ActionBase_Basic>;
8445 }
8446 if (LogManager.IsActionLogEnable())
8447 {
8448 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8449 }
8450
8451 if (action_array.Find(action) != -1)
8452 {
8453 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8454 }
8455 else
8456 {
8457 action_array.Insert(action);
8458 }
8459 }
8460
8462 {
8464 ActionBase action = player.GetActionManager().GetAction(actionName);
8467
8468 if (action_array)
8469 {
8470 action_array.RemoveItem(action);
8471 }
8472 }
8473
8474
8475
8477 {
8478 ActionOverrideData overrideData = new ActionOverrideData();
8482
8484 if (!actionMap)
8485 {
8488 }
8489
8490 actionMap.Insert(this.
Type(), overrideData);
8491
8492 }
8493
8495
8497
8498
8500 {
8503
8506
8507 string config_to_search = "CfgVehicles";
8508 string muzzle_owner_config;
8509
8511 {
8512 if (IsInherited(Weapon))
8513 config_to_search = "CfgWeapons";
8514
8515 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8516
8517 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8518
8520
8521 if (config_OnFire_subclass_count > 0)
8522 {
8523 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8524
8525 for (int i = 0; i < config_OnFire_subclass_count; i++)
8526 {
8527 string particle_class = "";
8529 string config_OnFire_entry = config_OnFire_class + particle_class;
8530 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8531 WPOF_array.Insert(WPOF);
8532 }
8533
8534
8536 }
8537 }
8538
8540 {
8541 config_to_search = "CfgWeapons";
8542 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8543
8544 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8545
8547
8548 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8549 {
8550 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8551
8552 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8553 {
8554 string particle_class2 = "";
8556 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8557 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8558 WPOBE_array.Insert(WPOBE);
8559 }
8560
8561
8563 }
8564 }
8565 }
8566
8567
8569 {
8572
8574 {
8575 string config_to_search = "CfgVehicles";
8576
8577 if (IsInherited(Weapon))
8578 config_to_search = "CfgWeapons";
8579
8580 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8581 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8582
8583 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8584 {
8585
8587
8589 {
8591 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8593 return;
8594 }
8595
8598
8599
8600
8602 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8603
8604 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8605 {
8606 string particle_class = "";
8608 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8610
8611 if (entry_type == CT_CLASS)
8612 {
8613 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8614 WPOOH_array.Insert(WPOF);
8615 }
8616 }
8617
8618
8620 }
8621 }
8622 }
8623
8625 {
8627 }
8628
8630 {
8632 {
8634
8637
8640
8641 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8642 }
8643 }
8644
8646 {
8648 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8649
8651 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8652
8654 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8655
8657 {
8659 }
8660 }
8661
8663 {
8665 }
8666
8668 {
8671 else
8673
8675 {
8678 }
8679 else
8680 {
8683
8686 }
8687
8689 }
8690
8692 {
8694 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8695 }
8696
8698 {
8700 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8702 }
8703
8705 {
8707 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8708 }
8709
8711 {
8714
8715 OverheatingParticle OP = new OverheatingParticle();
8720
8722 }
8723
8725 {
8728
8729 return -1;
8730 }
8731
8733 {
8735 {
8738
8739 for (int i = count; i > 0; --i)
8740 {
8741 int id = i - 1;
8744
8747
8748 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8749 {
8750 if (p)
8751 {
8754 }
8755 }
8756 }
8757 }
8758 }
8759
8761 {
8763 {
8765 {
8766 int id = i - 1;
8768
8769 if (OP)
8770 {
8772
8773 if (p)
8774 {
8776 }
8777
8778 delete OP;
8779 }
8780 }
8781
8784 }
8785 }
8786
8789 {
8790 return 0.0;
8791 }
8792
8793
8795 {
8796 return 250;
8797 }
8798
8800 {
8801 return 0;
8802 }
8803
8806 {
8808 return true;
8809
8810 return false;
8811 }
8812
8815 {
8818
8820 {
8822 }
8823 else
8824 {
8825
8827 }
8828
8830 }
8831
8838 {
8839 return -1;
8840 }
8841
8842
8843
8844
8846 {
8848 {
8850 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8851
8852 if (r_index >= 0)
8853 {
8854 InventoryLocation r_il = new InventoryLocation;
8855 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8856
8857 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8860 {
8861 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8862 }
8864 {
8865 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8866 }
8867
8868 }
8869
8870 player.GetHumanInventory().ClearUserReservedLocation(this);
8871 }
8872
8875 }
8876
8877
8878
8879
8881 {
8882 return ItemBase.m_DebugActionsMask;
8883 }
8884
8886 {
8887 return ItemBase.m_DebugActionsMask & mask;
8888 }
8889
8891 {
8892 ItemBase.m_DebugActionsMask = mask;
8893 }
8894
8896 {
8897 ItemBase.m_DebugActionsMask |= mask;
8898 }
8899
8901 {
8902 ItemBase.m_DebugActionsMask &= ~mask;
8903 }
8904
8906 {
8908 {
8910 }
8911 else
8912 {
8914 }
8915 }
8916
8917
8919 {
8920 if (GetEconomyProfile())
8921 {
8922 float q_max = GetEconomyProfile().GetQuantityMax();
8923 if (q_max > 0)
8924 {
8925 float q_min = GetEconomyProfile().GetQuantityMin();
8926 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8927
8929 {
8930 ComponentEnergyManager comp = GetCompEM();
8932 {
8934 }
8935 }
8937 {
8939
8940 }
8941
8942 }
8943 }
8944 }
8945
8948 {
8949 EntityAI parent = GetHierarchyParent();
8950
8951 if (parent)
8952 {
8953 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8954 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8955 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8956 }
8957 }
8958
8961 {
8962 EntityAI parent = GetHierarchyParent();
8963
8964 if (parent)
8965 {
8966 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8967 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8968 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8969 }
8970 }
8971
8973 {
8974
8975
8976
8977
8979
8981 {
8982 if (ScriptInputUserData.CanStoreInputUserData())
8983 {
8984 ScriptInputUserData ctx = new ScriptInputUserData;
8990 ctx.
Write(use_stack_max);
8993
8995 {
8996 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8997 }
8998 }
8999 }
9000 else if (!
GetGame().IsMultiplayer())
9001 {
9003 }
9004 }
9005
9007 {
9009 }
9010
9012 {
9014 }
9015
9017 {
9019 }
9020
9022 {
9023
9024 return false;
9025 }
9026
9028 {
9029 return false;
9030 }
9031
9035 {
9036 return false;
9037 }
9038
9040 {
9041 return "";
9042 }
9043
9045
9047 {
9048 return false;
9049 }
9050
9052 {
9053 return true;
9054 }
9055
9056
9057
9059 {
9060 return true;
9061 }
9062
9064 {
9065 return true;
9066 }
9067
9069 {
9070 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9072 }
9073
9075 {
9077 }
9078
9080 {
9082 if (!is_being_placed)
9084 SetSynchDirty();
9085 }
9086
9087
9089
9091 {
9093 }
9094
9096 {
9098 }
9099
9101 {
9102 return 1;
9103 }
9104
9106 {
9107 return false;
9108 }
9109
9111 {
9113 SetSynchDirty();
9114 }
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9151 {
9152 super.OnMovedInsideCargo(container);
9153
9154 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9155 }
9156
9157 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9158 {
9159 super.EEItemLocationChanged(oldLoc,newLoc);
9160
9161 PlayerBase new_player = null;
9162 PlayerBase old_player = null;
9163
9164 if (newLoc.GetParent())
9165 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9166
9167 if (oldLoc.GetParent())
9168 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9169
9171 {
9172 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9173
9174 if (r_index >= 0)
9175 {
9176 InventoryLocation r_il = new InventoryLocation;
9177 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9178
9179 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9182 {
9183 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9184 }
9186 {
9187 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9188 }
9189
9190 }
9191 }
9192
9194 {
9195 if (new_player)
9196 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9197
9198 if (new_player == old_player)
9199 {
9200
9201 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9202 {
9204 {
9205 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9206 {
9207 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9208 }
9209 }
9210 else
9211 {
9212 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9213 }
9214 }
9215
9216 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9217 {
9218 int type = oldLoc.GetType();
9220 {
9221 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9222 }
9224 {
9225 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9226 }
9227 }
9228 if (!m_OldLocation)
9229 {
9230 m_OldLocation = new InventoryLocation;
9231 }
9232 m_OldLocation.Copy(oldLoc);
9233 }
9234 else
9235 {
9236 if (m_OldLocation)
9237 {
9238 m_OldLocation.Reset();
9239 }
9240 }
9241
9243 }
9244 else
9245 {
9246 if (new_player)
9247 {
9248 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9249 if (res_index >= 0)
9250 {
9251 InventoryLocation il = new InventoryLocation;
9252 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9254 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9257 {
9258 il.
GetParent().GetOnReleaseLock().Invoke(it);
9259 }
9261 {
9263 }
9264
9265 }
9266 }
9268 {
9269
9271 }
9272
9273 if (m_OldLocation)
9274 {
9275 m_OldLocation.Reset();
9276 }
9277 }
9278 }
9279
9280 override void EOnContact(IEntity other, Contact extra)
9281 {
9283 {
9284 int liquidType = -1;
9286 if (impactSpeed > 0.0)
9287 {
9289 #ifndef SERVER
9291 #else
9293 SetSynchDirty();
9294 #endif
9296 }
9297 }
9298
9299 #ifdef SERVER
9300 if (GetCompEM() && GetCompEM().IsPlugged())
9301 {
9302 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9303 GetCompEM().UnplugThis();
9304 }
9305 #endif
9306 }
9307
9309
9311 {
9313 }
9314
9316 {
9317
9318 }
9319
9321 {
9322 super.OnItemLocationChanged(old_owner, new_owner);
9323
9324 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9325 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9326
9327 if (!relatedPlayer && playerNew)
9328 relatedPlayer = playerNew;
9329
9330 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9331 {
9333 if (actionMgr)
9334 {
9335 ActionBase currentAction = actionMgr.GetRunningAction();
9336 if (currentAction)
9338 }
9339 }
9340
9341 Man ownerPlayerOld = null;
9342 Man ownerPlayerNew = null;
9343
9344 if (old_owner)
9345 {
9346 if (old_owner.
IsMan())
9347 {
9348 ownerPlayerOld = Man.Cast(old_owner);
9349 }
9350 else
9351 {
9352 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9353 }
9354 }
9355 else
9356 {
9358 {
9360
9361 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9362 {
9363 GetCompEM().UnplugThis();
9364 }
9365 }
9366 }
9367
9368 if (new_owner)
9369 {
9370 if (new_owner.
IsMan())
9371 {
9372 ownerPlayerNew = Man.Cast(new_owner);
9373 }
9374 else
9375 {
9376 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9377 }
9378 }
9379
9380 if (ownerPlayerOld != ownerPlayerNew)
9381 {
9382 if (ownerPlayerOld)
9383 {
9384 array<EntityAI> subItemsExit = new array<EntityAI>;
9386 for (int i = 0; i < subItemsExit.Count(); i++)
9387 {
9390 }
9391 }
9392
9393 if (ownerPlayerNew)
9394 {
9395 array<EntityAI> subItemsEnter = new array<EntityAI>;
9397 for (int j = 0; j < subItemsEnter.Count(); j++)
9398 {
9401 }
9402 }
9403 }
9404 else if (ownerPlayerNew != null)
9405 {
9406 PlayerBase nplayer;
9407 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9408 {
9409 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9411 for (int k = 0; k < subItemsUpdate.Count(); k++)
9412 {
9414 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9415 }
9416 }
9417 }
9418
9419 if (old_owner)
9420 old_owner.OnChildItemRemoved(this);
9421 if (new_owner)
9422 new_owner.OnChildItemReceived(this);
9423 }
9424
9425
9427 {
9428 super.EEDelete(parent);
9429 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9430 if (player)
9431 {
9433
9434 if (player.IsAlive())
9435 {
9436 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9437 if (r_index >= 0)
9438 {
9439 InventoryLocation r_il = new InventoryLocation;
9440 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9441
9442 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9445 {
9446 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9447 }
9449 {
9450 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9451 }
9452
9453 }
9454
9455 player.RemoveQuickBarEntityShortcut(this);
9456 }
9457 }
9458 }
9459
9461 {
9462 super.EEKilled(killer);
9463
9466 {
9467 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9468 {
9469 if (IsMagazine())
9470 {
9471 if (Magazine.Cast(this).GetAmmoCount() > 0)
9472 {
9474 }
9475 }
9476 else
9477 {
9479 }
9480 }
9481 }
9482 }
9483
9485 {
9486 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9487
9488 super.OnWasAttached(parent, slot_id);
9489
9492
9494 }
9495
9497 {
9498 super.OnWasDetached(parent, slot_id);
9499
9502 }
9503
9505 {
9506 int idx;
9509
9510 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9511 if (inventory_slots.Count() < 1)
9512 {
9513 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9514 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9515 }
9516 else
9517 {
9518 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9519 }
9520
9521 idx = inventory_slots.Find(slot);
9522 if (idx < 0)
9523 return "";
9524
9525 return attach_types.Get(idx);
9526 }
9527
9529 {
9530 int idx = -1;
9531 string slot;
9532
9535
9536 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9537 if (inventory_slots.Count() < 1)
9538 {
9539 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9540 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9541 }
9542 else
9543 {
9544 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9545 if (detach_types.Count() < 1)
9546 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9547 }
9548
9549 for (int i = 0; i < inventory_slots.Count(); i++)
9550 {
9551 slot = inventory_slots.Get(i);
9552 }
9553
9554 if (slot != "")
9555 {
9556 if (detach_types.Count() == 1)
9557 idx = 0;
9558 else
9559 idx = inventory_slots.Find(slot);
9560 }
9561 if (idx < 0)
9562 return "";
9563
9564 return detach_types.Get(idx);
9565 }
9566
9568 {
9569
9571
9572
9573 float min_time = 1;
9574 float max_time = 3;
9575 float delay = Math.RandomFloat(min_time, max_time);
9576
9577 explode_timer.Run(delay, this, "DoAmmoExplosion");
9578 }
9579
9581 {
9582 Magazine magazine = Magazine.Cast(this);
9583 int pop_sounds_count = 6;
9584 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9585
9586
9587 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9588 string sound_name = pop_sounds[ sound_idx ];
9590
9591
9592 magazine.ServerAddAmmoCount(-1);
9593
9594
9595 float min_temp_to_explode = 100;
9596
9597 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9598 {
9600 }
9601 }
9602
9603
9604 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9605 {
9606 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9607
9608 const int CHANCE_DAMAGE_CARGO = 4;
9609 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9610 const int CHANCE_DAMAGE_NOTHING = 2;
9611
9613 {
9614 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9615 int chances;
9616 int rnd;
9617
9618 if (GetInventory().GetCargo())
9619 {
9620 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9621 rnd = Math.RandomInt(0,chances);
9622
9623 if (rnd < CHANCE_DAMAGE_CARGO)
9624 {
9626 }
9627 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9628 {
9630 }
9631 }
9632 else
9633 {
9634 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9635 rnd = Math.RandomInt(0,chances);
9636
9637 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9638 {
9640 }
9641 }
9642 }
9643 }
9644
9646 {
9647 if (GetInventory().GetCargo())
9648 {
9649 int item_count = GetInventory().GetCargo().GetItemCount();
9650 if (item_count > 0)
9651 {
9652 int random_pick = Math.RandomInt(0, item_count);
9654 if (!item.IsExplosive())
9655 {
9656 item.AddHealth("","",damage);
9657 return true;
9658 }
9659 }
9660 }
9661 return false;
9662 }
9663
9665 {
9666 int attachment_count = GetInventory().AttachmentCount();
9667 if (attachment_count > 0)
9668 {
9669 int random_pick = Math.RandomInt(0, attachment_count);
9670 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9671 if (!attachment.IsExplosive())
9672 {
9673 attachment.AddHealth("","",damage);
9674 return true;
9675 }
9676 }
9677 return false;
9678 }
9679
9681 {
9683 }
9684
9686 {
9688 return GetInventory().CanRemoveEntity();
9689
9690 return false;
9691 }
9692
9694 {
9696 return;
9697
9699 {
9700 if (ScriptInputUserData.CanStoreInputUserData())
9701 {
9702 ScriptInputUserData ctx = new ScriptInputUserData;
9707 ctx.
Write(destination_entity);
9711 }
9712 }
9713 else if (!
GetGame().IsMultiplayer())
9714 {
9716 }
9717 }
9718
9720 {
9722 return;
9723
9724 float split_quantity_new;
9728 InventoryLocation loc = new InventoryLocation;
9729
9730 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9731 {
9733 split_quantity_new = stack_max;
9734 else
9736
9737 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9738 if (new_item)
9739 {
9740 new_item.SetResultOfSplit(true);
9741 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9743 new_item.SetQuantity(split_quantity_new);
9744 }
9745 }
9746 else if (destination_entity && slot_id == -1)
9747 {
9748 if (quantity > stack_max)
9749 split_quantity_new = stack_max;
9750 else
9751 split_quantity_new = quantity;
9752
9754 {
9757 }
9758
9759 if (new_item)
9760 {
9761 new_item.SetResultOfSplit(true);
9762 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9764 new_item.SetQuantity(split_quantity_new);
9765 }
9766 }
9767 else
9768 {
9769 if (stack_max != 0)
9770 {
9772 {
9774 }
9775
9776 if (split_quantity_new == 0)
9777 {
9778 if (!
GetGame().IsMultiplayer())
9779 player.PhysicalPredictiveDropItem(this);
9780 else
9781 player.ServerDropEntity(this);
9782 return;
9783 }
9784
9786
9787 if (new_item)
9788 {
9789 new_item.SetResultOfSplit(true);
9790 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9792 new_item.SetQuantity(stack_max);
9793 new_item.PlaceOnSurface();
9794 }
9795 }
9796 }
9797 }
9798
9800 {
9802 return;
9803
9804 float split_quantity_new;
9808 InventoryLocation loc = new InventoryLocation;
9809
9810 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9811 {
9813 split_quantity_new = stack_max;
9814 else
9816
9817 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9818 if (new_item)
9819 {
9820 new_item.SetResultOfSplit(true);
9821 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9823 new_item.SetQuantity(split_quantity_new);
9824 }
9825 }
9826 else if (destination_entity && slot_id == -1)
9827 {
9828 if (quantity > stack_max)
9829 split_quantity_new = stack_max;
9830 else
9831 split_quantity_new = quantity;
9832
9834 {
9837 }
9838
9839 if (new_item)
9840 {
9841 new_item.SetResultOfSplit(true);
9842 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9844 new_item.SetQuantity(split_quantity_new);
9845 }
9846 }
9847 else
9848 {
9849 if (stack_max != 0)
9850 {
9852 {
9854 }
9855
9857
9858 if (new_item)
9859 {
9860 new_item.SetResultOfSplit(true);
9861 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9863 new_item.SetQuantity(stack_max);
9864 new_item.PlaceOnSurface();
9865 }
9866 }
9867 }
9868 }
9869
9871 {
9873 return;
9874
9876 {
9877 if (ScriptInputUserData.CanStoreInputUserData())
9878 {
9879 ScriptInputUserData ctx = new ScriptInputUserData;
9884 dst.WriteToContext(ctx);
9886 }
9887 }
9888 else if (!
GetGame().IsMultiplayer())
9889 {
9891 }
9892 }
9893
9895 {
9897 return;
9898
9900 {
9901 if (ScriptInputUserData.CanStoreInputUserData())
9902 {
9903 ScriptInputUserData ctx = new ScriptInputUserData;
9908 ctx.
Write(destination_entity);
9914 }
9915 }
9916 else if (!
GetGame().IsMultiplayer())
9917 {
9919 }
9920 }
9921
9923 {
9925 }
9926
9928 {
9930 return this;
9931
9933 float split_quantity_new;
9935 if (dst.IsValid())
9936 {
9937 int slot_id = dst.GetSlot();
9939
9940 if (quantity > stack_max)
9941 split_quantity_new = stack_max;
9942 else
9943 split_quantity_new = quantity;
9944
9946
9947 if (new_item)
9948 {
9949 new_item.SetResultOfSplit(true);
9950 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9953 }
9954
9955 return new_item;
9956 }
9957
9958 return null;
9959 }
9960
9962 {
9964 return;
9965
9967 float split_quantity_new;
9969 if (destination_entity)
9970 {
9972 if (quantity > stackable)
9973 split_quantity_new = stackable;
9974 else
9975 split_quantity_new = quantity;
9976
9977 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9978 if (new_item)
9979 {
9980 new_item.SetResultOfSplit(true);
9981 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9983 new_item.SetQuantity(split_quantity_new);
9984 }
9985 }
9986 }
9987
9989 {
9991 return;
9992
9994 {
9995 if (ScriptInputUserData.CanStoreInputUserData())
9996 {
9997 ScriptInputUserData ctx = new ScriptInputUserData;
10002 ItemBase destination_entity =
this;
10003 ctx.
Write(destination_entity);
10007 }
10008 }
10009 else if (!
GetGame().IsMultiplayer())
10010 {
10012 }
10013 }
10014
10016 {
10018 return;
10019
10021 float split_quantity_new;
10023 if (player)
10024 {
10026 if (quantity > stackable)
10027 split_quantity_new = stackable;
10028 else
10029 split_quantity_new = quantity;
10030
10031 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10032 new_item =
ItemBase.Cast(in_hands);
10033 if (new_item)
10034 {
10035 new_item.SetResultOfSplit(true);
10036 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10038 new_item.SetQuantity(split_quantity_new);
10039 }
10040 }
10041 }
10042
10044 {
10046 return;
10047
10049 float split_quantity_new = Math.Floor(quantity * 0.5);
10050
10052
10053 if (new_item)
10054 {
10055 if (new_item.GetQuantityMax() < split_quantity_new)
10056 {
10057 split_quantity_new = new_item.GetQuantityMax();
10058 }
10059
10060 new_item.SetResultOfSplit(true);
10061 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10062
10064 {
10067 }
10068 else
10069 {
10072 }
10073 }
10074 }
10075
10077 {
10079 return;
10080
10082 float split_quantity_new = Math.Floor(quantity / 2);
10083
10084 InventoryLocation invloc = new InventoryLocation;
10086
10088 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10089
10090 if (new_item)
10091 {
10092 if (new_item.GetQuantityMax() < split_quantity_new)
10093 {
10094 split_quantity_new = new_item.GetQuantityMax();
10095 }
10097 {
10100 }
10101 else
10102 {
10105 }
10106 }
10107 }
10108
10111 {
10112 SetWeightDirty();
10114
10115 if (parent)
10116 parent.OnAttachmentQuantityChangedEx(this, delta);
10117
10119 {
10121 {
10123 }
10125 {
10126 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10128 }
10129 }
10130
10131 }
10132
10135 {
10136
10137 }
10138
10141 {
10143 }
10144
10146 {
10147 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10148
10150 {
10151 if (newLevel == GameConstants.STATE_RUINED)
10152 {
10154 EntityAI parent = GetHierarchyParent();
10155 if (parent && parent.IsFireplace())
10156 {
10157 CargoBase cargo = GetInventory().GetCargo();
10158 if (cargo)
10159 {
10161 {
10163 }
10164 }
10165 }
10166 }
10167
10169 {
10170
10172 return;
10173 }
10174
10175 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10176 {
10178 }
10179 }
10180 }
10181
10182
10184 {
10185 super.OnRightClick();
10186
10188 {
10190 {
10191 if (ScriptInputUserData.CanStoreInputUserData())
10192 {
10193 vector m4[4];
10195
10196 EntityAI root = GetHierarchyRoot();
10197
10198 InventoryLocation dst = new InventoryLocation;
10200 {
10201 if (root)
10202 {
10203 root.GetTransform(m4);
10205 }
10206 else
10207 GetInventory().GetCurrentInventoryLocation(dst);
10208 }
10209 else
10210 {
10212
10213
10214 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10215 {
10216 if (root)
10217 {
10218 root.GetTransform(m4);
10220 }
10221 else
10222 GetInventory().GetCurrentInventoryLocation(dst);
10223 }
10224 else
10225 {
10226 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10227 }
10228 }
10229
10230 ScriptInputUserData ctx = new ScriptInputUserData;
10238 }
10239 }
10240 else if (!
GetGame().IsMultiplayer())
10241 {
10243 }
10244 }
10245 }
10246
10247 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10248 {
10249
10250 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10251 return false;
10252
10253 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10254 return false;
10255
10256
10258 return false;
10259
10260
10261 Magazine mag = Magazine.Cast(this);
10262 if (mag)
10263 {
10264 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10265 return false;
10266
10267 if (stack_max_limit)
10268 {
10269 Magazine other_mag = Magazine.Cast(other_item);
10270 if (other_item)
10271 {
10272 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10273 return false;
10274 }
10275
10276 }
10277 }
10278 else
10279 {
10280
10282 return false;
10283
10285 return false;
10286 }
10287
10288 PlayerBase player = null;
10289 if (CastTo(player, GetHierarchyRootPlayer()))
10290 {
10291 if (player.GetInventory().HasAttachment(this))
10292 return false;
10293
10294 if (player.IsItemsToDelete())
10295 return false;
10296 }
10297
10298 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10299 return false;
10300
10301 int slotID;
10303 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10304 return false;
10305
10306 return true;
10307 }
10308
10310 {
10312 }
10313
10315 {
10316 return m_IsResultOfSplit;
10317 }
10318
10320 {
10321 m_IsResultOfSplit = value;
10322 }
10323
10325 {
10327 }
10328
10330 {
10331 float other_item_quantity = other_item.GetQuantity();
10332 float this_free_space;
10333
10335
10337
10338 if (other_item_quantity > this_free_space)
10339 {
10340 return this_free_space;
10341 }
10342 else
10343 {
10344 return other_item_quantity;
10345 }
10346 }
10347
10349 {
10351 }
10352
10354 {
10356 return;
10357
10358 if (!IsMagazine() && other_item)
10359 {
10361 if (quantity_used != 0)
10362 {
10363 float hp1 = GetHealth01("","");
10364 float hp2 = other_item.GetHealth01("","");
10365 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10366 hpResult = hpResult / (
GetQuantity() + quantity_used);
10367
10368 hpResult *= GetMaxHealth();
10369 Math.Round(hpResult);
10370 SetHealth("", "Health", hpResult);
10371
10373 other_item.AddQuantity(-quantity_used);
10374 }
10375 }
10377 }
10378
10380 {
10381 #ifdef SERVER
10382 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10383 GetHierarchyParent().IncreaseLifetimeUp();
10384 #endif
10385 };
10386
10388 {
10389 PlayerBase p = PlayerBase.Cast(player);
10390
10391 array<int> recipesIds = p.m_Recipes;
10392 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10393 if (moduleRecipesManager)
10394 {
10395 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10396 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10397 }
10398
10399 for (int i = 0;i < recipesIds.Count(); i++)
10400 {
10401 int key = recipesIds.Get(i);
10402 string recipeName = moduleRecipesManager.GetRecipeName(key);
10404 }
10405 }
10406
10407
10408 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10409 {
10410 super.GetDebugActions(outputList);
10411
10412
10417
10418
10422
10426
10427
10430
10431
10433 {
10436 }
10437
10439
10442
10446 }
10447
10448
10449
10450
10452 {
10453 super.OnAction(action_id, player, ctx);
10454 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10455 {
10456 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10457 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10458 PlayerBase p = PlayerBase.Cast(player);
10459 if (
EActions.RECIPES_RANGE_START < 1000)
10460 {
10461 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10462 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10463 }
10464 }
10465 #ifndef SERVER
10466 else if (action_id ==
EActions.WATCH_PLAYER)
10467 {
10468 PluginDeveloper.SetDeveloperItemClientEx(player);
10469 }
10470 #endif
10472 {
10473 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10474 {
10475 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10476 OnDebugButtonPressServer(id + 1);
10477 }
10478
10479 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10480 {
10481 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10483 }
10484
10485 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10486 {
10487 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10489 }
10490
10491 else if (action_id ==
EActions.ADD_QUANTITY)
10492 {
10493 if (IsMagazine())
10494 {
10495 Magazine mag = Magazine.Cast(this);
10496 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10497 }
10498 else
10499 {
10501 }
10502
10503 if (m_EM)
10504 {
10505 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10506 }
10507
10508 }
10509
10510 else if (action_id ==
EActions.REMOVE_QUANTITY)
10511 {
10512 if (IsMagazine())
10513 {
10514 Magazine mag2 = Magazine.Cast(this);
10515 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10516 }
10517 else
10518 {
10520 }
10521 if (m_EM)
10522 {
10523 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10524 }
10525
10526 }
10527
10528 else if (action_id ==
EActions.SET_QUANTITY_0)
10529 {
10531
10532 if (m_EM)
10533 {
10534 m_EM.SetEnergy(0);
10535 }
10536 }
10537
10538 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10539 {
10541
10542 if (m_EM)
10543 {
10544 m_EM.SetEnergy(m_EM.GetEnergyMax());
10545 }
10546 }
10547
10548 else if (action_id ==
EActions.ADD_HEALTH)
10549 {
10550 AddHealth("","",GetMaxHealth("","Health")/5);
10551 }
10552 else if (action_id ==
EActions.REMOVE_HEALTH)
10553 {
10554 AddHealth("","",-GetMaxHealth("","Health")/5);
10555 }
10556 else if (action_id ==
EActions.DESTROY_HEALTH)
10557 {
10558 SetHealth01("","",0);
10559 }
10560 else if (action_id ==
EActions.WATCH_ITEM)
10561 {
10563 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10564 #ifdef DEVELOPER
10565 SetDebugDeveloper_item(this);
10566 #endif
10567 }
10568
10569 else if (action_id ==
EActions.ADD_TEMPERATURE)
10570 {
10571 AddTemperature(20);
10572
10573 }
10574
10575 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10576 {
10577 AddTemperature(-20);
10578
10579 }
10580
10581 else if (action_id ==
EActions.FLIP_FROZEN)
10582 {
10583 SetFrozen(!GetIsFrozen());
10584
10585 }
10586
10587 else if (action_id ==
EActions.ADD_WETNESS)
10588 {
10590
10591 }
10592
10593 else if (action_id ==
EActions.REMOVE_WETNESS)
10594 {
10596
10597 }
10598
10599 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10600 {
10603
10604
10605 }
10606
10607 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10608 {
10611 }
10612
10613 else if (action_id ==
EActions.MAKE_SPECIAL)
10614 {
10615 auto debugParams = DebugSpawnParams.WithPlayer(player);
10616 OnDebugSpawnEx(debugParams);
10617 }
10618
10619 else if (action_id ==
EActions.DELETE)
10620 {
10621 Delete();
10622 }
10623
10624 }
10625
10626
10627 return false;
10628 }
10629
10630
10631
10632
10636
10639
10640
10641
10643 {
10644 return false;
10645 }
10646
10647
10649 {
10650 return true;
10651 }
10652
10653
10655 {
10656 return true;
10657 }
10658
10659
10660
10662 {
10663 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10665 }
10666
10669 {
10670 return null;
10671 }
10672
10674 {
10675 return false;
10676 }
10677
10679 {
10680 return false;
10681 }
10682
10686
10687
10689 {
10690 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10691 return module_repairing.CanRepair(this, item_repair_kit);
10692 }
10693
10694
10695 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10696 {
10697 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10698 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10699 }
10700
10701
10703 {
10704
10705
10706
10707
10708
10709
10710
10711
10712 return 1;
10713 }
10714
10715
10716
10718 {
10720 }
10721
10722
10723
10725 {
10727 }
10728
10729
10738 {
10739 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10740
10741 if (player)
10742 {
10743 player.MessageStatus(text);
10744 }
10745 }
10746
10747
10756 {
10757 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10758
10759 if (player)
10760 {
10761 player.MessageAction(text);
10762 }
10763 }
10764
10765
10774 {
10775 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10776
10777 if (player)
10778 {
10779 player.MessageFriendly(text);
10780 }
10781 }
10782
10783
10792 {
10793 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10794
10795 if (player)
10796 {
10797 player.MessageImportant(text);
10798 }
10799 }
10800
10802 {
10803 return true;
10804 }
10805
10806
10807 override bool KindOf(
string tag)
10808 {
10809 bool found = false;
10810 string item_name = this.
GetType();
10813
10814 int array_size = item_tag_array.Count();
10815 for (int i = 0; i < array_size; i++)
10816 {
10817 if (item_tag_array.Get(i) == tag)
10818 {
10819 found = true;
10820 break;
10821 }
10822 }
10823 return found;
10824 }
10825
10826
10828 {
10829
10830 super.OnRPC(sender, rpc_type,ctx);
10831
10832
10833 switch (rpc_type)
10834 {
10835 #ifndef SERVER
10836 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10837 Param2<bool, string> p = new Param2<bool, string>(false, "");
10838
10840 return;
10841
10842 bool play = p.param1;
10843 string soundSet = p.param2;
10844
10845 if (play)
10846 {
10848 {
10850 {
10852 }
10853 }
10854 else
10855 {
10857 }
10858 }
10859 else
10860 {
10862 }
10863
10864 break;
10865 #endif
10866
10867 }
10868
10870 {
10872 }
10873 }
10874
10875
10876
10877
10879 {
10880 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10881 return plugin.GetID(
name);
10882 }
10883
10885 {
10886 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10887 return plugin.GetName(id);
10888 }
10889
10892 {
10893
10894
10895 int varFlags;
10896 if (!ctx.
Read(varFlags))
10897 return;
10898
10899 if (varFlags & ItemVariableFlags.FLOAT)
10900 {
10902 }
10903 }
10904
10906 {
10907
10908 super.SerializeNumericalVars(floats_out);
10909
10910
10911
10913 {
10915 }
10916
10918 {
10920 }
10921
10923 {
10925 }
10926
10928 {
10933 }
10934
10936 {
10938 }
10939 }
10940
10942 {
10943
10944 super.DeSerializeNumericalVars(floats);
10945
10946
10947 int index = 0;
10948 int mask = Math.Round(floats.Get(index));
10949
10950 index++;
10951
10953 {
10955 {
10957 }
10958 else
10959 {
10960 float quantity = floats.Get(index);
10961 SetQuantity(quantity,
true,
false,
false,
false);
10962 }
10963 index++;
10964 }
10965
10967 {
10968 float wet = floats.Get(index);
10970 index++;
10971 }
10972
10974 {
10975 int liquidtype = Math.Round(floats.Get(index));
10977 index++;
10978 }
10979
10981 {
10983 index++;
10985 index++;
10987 index++;
10989 index++;
10990 }
10991
10993 {
10994 int cleanness = Math.Round(floats.Get(index));
10996 index++;
10997 }
10998 }
10999
11001 {
11002 super.WriteVarsToCTX(ctx);
11003
11004
11006 {
11008 }
11009
11011 {
11013 }
11014
11016 {
11018 }
11019
11021 {
11022 int r,g,b,a;
11028 }
11029
11031 {
11033 }
11034 }
11035
11037 {
11038 if (!super.ReadVarsFromCTX(ctx,version))
11039 return false;
11040
11041 int intValue;
11042 float value;
11043
11044 if (version < 140)
11045 {
11046 if (!ctx.
Read(intValue))
11047 return false;
11048
11049 m_VariablesMask = intValue;
11050 }
11051
11053 {
11054 if (!ctx.
Read(value))
11055 return false;
11056
11058 {
11060 }
11061 else
11062 {
11064 }
11065 }
11066
11067 if (version < 140)
11068 {
11070 {
11071 if (!ctx.
Read(value))
11072 return false;
11073 SetTemperatureDirect(value);
11074 }
11075 }
11076
11078 {
11079 if (!ctx.
Read(value))
11080 return false;
11082 }
11083
11085 {
11086 if (!ctx.
Read(intValue))
11087 return false;
11089 }
11090
11092 {
11093 int r,g,b,a;
11095 return false;
11097 return false;
11099 return false;
11101 return false;
11102
11104 }
11105
11107 {
11108 if (!ctx.
Read(intValue))
11109 return false;
11111 }
11112
11113 if (version >= 138 && version < 140)
11114 {
11116 {
11117 if (!ctx.
Read(intValue))
11118 return false;
11119 SetFrozen(intValue);
11120 }
11121 }
11122
11123 return true;
11124 }
11125
11126
11128 {
11131 {
11133 }
11134
11135 if (!super.OnStoreLoad(ctx, version))
11136 {
11138 return false;
11139 }
11140
11141 if (version >= 114)
11142 {
11143 bool hasQuickBarIndexSaved;
11144
11145 if (!ctx.
Read(hasQuickBarIndexSaved))
11146 {
11148 return false;
11149 }
11150
11151 if (hasQuickBarIndexSaved)
11152 {
11153 int itmQBIndex;
11154
11155
11156 if (!ctx.
Read(itmQBIndex))
11157 {
11159 return false;
11160 }
11161
11162 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11163 if (itmQBIndex != -1 && parentPlayer)
11164 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11165 }
11166 }
11167 else
11168 {
11169
11170 PlayerBase player;
11171 int itemQBIndex;
11172 if (version ==
int.
MAX)
11173 {
11174 if (!ctx.
Read(itemQBIndex))
11175 {
11177 return false;
11178 }
11179 }
11180 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11181 {
11182
11183 if (!ctx.
Read(itemQBIndex))
11184 {
11186 return false;
11187 }
11188 if (itemQBIndex != -1 && player)
11189 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11190 }
11191 }
11192
11193 if (version < 140)
11194 {
11195
11196 if (!LoadVariables(ctx, version))
11197 {
11199 return false;
11200 }
11201 }
11202
11203
11205 {
11207 return false;
11208 }
11209 if (version >= 132)
11210 {
11212 if (raib)
11213 {
11215 {
11217 return false;
11218 }
11219 }
11220 }
11221
11223 return true;
11224 }
11225
11226
11227
11229 {
11230 super.OnStoreSave(ctx);
11231
11232 PlayerBase player;
11233 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11234 {
11236
11237 int itemQBIndex = -1;
11238 itemQBIndex = player.FindQuickBarEntityIndex(this);
11239 ctx.
Write(itemQBIndex);
11240 }
11241 else
11242 {
11244 }
11245
11247
11249 if (raib)
11250 {
11252 }
11253 }
11254
11255
11257 {
11258 super.AfterStoreLoad();
11259
11261 {
11263 }
11264
11266 {
11269 }
11270 }
11271
11273 {
11274 super.EEOnAfterLoad();
11275
11277 {
11279 }
11280
11283 }
11284
11286 {
11287 return false;
11288 }
11289
11290
11291
11293 {
11295 {
11296 #ifdef PLATFORM_CONSOLE
11297
11299 {
11301 if (menu)
11302 {
11304 }
11305 }
11306 #endif
11307 }
11308
11310 {
11313 }
11314
11316 {
11317 SetWeightDirty();
11319 }
11321 {
11324 }
11325
11327 {
11330 }
11332 {
11335 }
11336
11337 super.OnVariablesSynchronized();
11338 }
11339
11340
11341
11343 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11344 {
11345 if (!IsServerCheck(allow_client))
11346 return false;
11347
11349 return false;
11350
11353
11354 if (value <= (min + 0.001))
11355 value = min;
11356
11357 if (value == min)
11358 {
11359 if (destroy_config)
11360 {
11361 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11362 if (dstr)
11363 {
11365 this.Delete();
11366 return true;
11367 }
11368 }
11369 else if (destroy_forced)
11370 {
11372 this.Delete();
11373 return true;
11374 }
11375
11377 }
11378
11381
11383 {
11385
11386 if (delta)
11388 }
11389
11391
11392 return false;
11393 }
11394
11395
11397 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11398 {
11400 }
11401
11403 {
11406 }
11407
11409 {
11412 }
11413
11416 {
11417 float value_clamped = Math.Clamp(value, 0, 1);
11419 SetQuantity(result, destroy_config, destroy_forced);
11420 }
11421
11422
11425 {
11427 }
11428
11430 {
11432 }
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11444 {
11445 int slot = -1;
11446 if (GetInventory())
11447 {
11448 InventoryLocation il = new InventoryLocation;
11449 GetInventory().GetCurrentInventoryLocation(il);
11451 }
11452
11454 }
11455
11457 {
11458 float quantity_max = 0;
11459
11461 {
11462 if (attSlotID != -1)
11463 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11464
11465 if (quantity_max <= 0)
11467 }
11468
11469 if (quantity_max <= 0)
11471
11472 return quantity_max;
11473 }
11474
11476 {
11478 }
11479
11481 {
11483 }
11484
11485
11487 {
11489 }
11490
11492 {
11494 }
11495
11497 {
11499 }
11500
11501
11503 {
11504
11505 float weightEx = GetWeightEx();
11506 float special = GetInventoryAndCargoWeight();
11507 return weightEx - special;
11508 }
11509
11510
11512 {
11514 }
11515
11517 {
11519 {
11520 #ifdef DEVELOPER
11521 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11522 {
11523 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11525 }
11526 #endif
11527
11528 return GetQuantity() * GetConfigWeightModified();
11529 }
11530 else if (HasEnergyManager())
11531 {
11532 #ifdef DEVELOPER
11533 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11534 {
11535 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11536 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11537 }
11538 #endif
11539 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11540 }
11541 else
11542 {
11543 #ifdef DEVELOPER
11544 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11545 {
11546 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11547 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11548 }
11549 #endif
11550 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11551 }
11552 }
11553
11556 {
11557 int item_count = 0;
11559
11560 if (GetInventory().GetCargo() != NULL)
11561 {
11562 item_count = GetInventory().GetCargo().GetItemCount();
11563 }
11564
11565 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11566 {
11567 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11568 if (item)
11569 item_count += item.GetNumberOfItems();
11570 }
11571 return item_count;
11572 }
11573
11576 {
11577 float weight = 0;
11578 float wetness = 1;
11579 if (include_wetness)
11582 {
11583 weight = wetness * m_ConfigWeight;
11584 }
11586 {
11587 weight = 1;
11588 }
11589 return weight;
11590 }
11591
11592
11593
11595 {
11596 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11597 {
11598 GameInventory inv = GetInventory();
11599 array<EntityAI> items = new array<EntityAI>;
11601 for (int i = 0; i < items.Count(); i++)
11602 {
11604 if (item)
11605 {
11607 }
11608 }
11609 }
11610 }
11611
11612
11613
11614
11616 {
11617 float energy = 0;
11618 if (HasEnergyManager())
11619 {
11620 energy = GetCompEM().GetEnergy();
11621 }
11622 return energy;
11623 }
11624
11625
11627 {
11628 super.OnEnergyConsumed();
11629
11631 }
11632
11634 {
11635 super.OnEnergyAdded();
11636
11638 }
11639
11640
11642 {
11643 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11644 {
11646 {
11647 float energy_0to1 = GetCompEM().GetEnergy0To1();
11649 }
11650 }
11651 }
11652
11653
11655 {
11656 return ConfigGetFloat("heatIsolation");
11657 }
11658
11660 {
11662 }
11663
11665 {
11666 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11667 if (
GetGame().ConfigIsExisting(paramPath))
11669
11670 return 0.0;
11671 }
11672
11674 {
11675 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11676 if (
GetGame().ConfigIsExisting(paramPath))
11678
11679 return 0.0;
11680 }
11681
11682 override void SetWet(
float value,
bool allow_client =
false)
11683 {
11684 if (!IsServerCheck(allow_client))
11685 return;
11686
11689
11691
11692 m_VarWet = Math.Clamp(value, min, max);
11693
11695 {
11698 }
11699 }
11700
11701 override void AddWet(
float value)
11702 {
11704 }
11705
11707 {
11709 }
11710
11712 {
11714 }
11715
11717 {
11719 }
11720
11722 {
11724 }
11725
11727 {
11729 }
11730
11731 override void OnWetChanged(
float newVal,
float oldVal)
11732 {
11735 if (newLevel != oldLevel)
11736 {
11738 }
11739 }
11740
11742 {
11743 SetWeightDirty();
11744 }
11745
11747 {
11748 return GetWetLevelInternal(
m_VarWet);
11749 }
11750
11751
11752
11754 {
11756 }
11757
11759 {
11761 }
11762
11764 {
11766 }
11767
11769 {
11771 }
11772
11773
11774
11776 {
11777 if (ConfigIsExisting("itemModelLength"))
11778 {
11779 return ConfigGetFloat("itemModelLength");
11780 }
11781 return 0;
11782 }
11783
11785 {
11786 if (ConfigIsExisting("itemAttachOffset"))
11787 {
11788 return ConfigGetFloat("itemAttachOffset");
11789 }
11790 return 0;
11791 }
11792
11793 override void SetCleanness(
int value,
bool allow_client =
false)
11794 {
11795 if (!IsServerCheck(allow_client))
11796 return;
11797
11799
11801
11804 }
11805
11807 {
11809 }
11810
11812 {
11813 return true;
11814 }
11815
11816
11817
11818
11820 {
11822 }
11823
11825 {
11827 }
11828
11829
11830
11831
11832 override void SetColor(
int r,
int g,
int b,
int a)
11833 {
11839 }
11841 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11842 {
11847 }
11848
11850 {
11852 }
11853
11856 {
11857 int r,g,b,a;
11859 r = r/255;
11860 g = g/255;
11861 b = b/255;
11862 a = a/255;
11863 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11864 }
11865
11866
11867
11868 override void SetLiquidType(
int value,
bool allow_client =
false)
11869 {
11870 if (!IsServerCheck(allow_client))
11871 return;
11872
11877 }
11878
11880 {
11881 return ConfigGetInt("varLiquidTypeInit");
11882 }
11883
11885 {
11887 }
11888
11890 {
11892 SetFrozen(false);
11893 }
11894
11897 {
11898 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11899 }
11900
11901
11904 {
11905 PlayerBase nplayer;
11906 if (PlayerBase.CastTo(nplayer, player))
11907 {
11909
11910 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11911 }
11912 }
11913
11914
11917 {
11918 PlayerBase nplayer;
11919 if (PlayerBase.CastTo(nplayer,player))
11920 {
11921
11922 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11923
11924 }
11925
11926
11927 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11928
11929
11930 if (HasEnergyManager())
11931 {
11932 GetCompEM().UpdatePlugState();
11933 }
11934 }
11935
11936
11938 {
11939 super.OnPlacementStarted(player);
11940
11942 }
11943
11944 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11945 {
11947 {
11948 m_AdminLog.OnPlacementComplete(player,
this);
11949 }
11950
11951 super.OnPlacementComplete(player, position, orientation);
11952 }
11953
11954
11955
11956
11957
11959 {
11961 {
11962 return true;
11963 }
11964 else
11965 {
11966 return false;
11967 }
11968 }
11969
11970
11972 {
11974 {
11976 }
11977 }
11978
11979
11981 {
11983 }
11984
11986 {
11988 }
11989
11990 override void InsertAgent(
int agent,
float count = 1)
11991 {
11992 if (count < 1)
11993 return;
11994
11996 }
11997
12000 {
12002 }
12003
12004
12006 {
12008 }
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12052 {
12054 return false;
12055 return true;
12056 }
12057
12059 {
12060
12062 }
12063
12064
12067 {
12068 super.CheckForRoofLimited(timeTresholdMS);
12069
12071 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12072 {
12073 m_PreviousRoofTestTime = time;
12074 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12075 }
12076 }
12077
12078
12080 {
12082 {
12083 return 0;
12084 }
12085
12086 if (GetInventory().GetAttachmentSlotsCount() != 0)
12087 {
12088 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12089 if (filter)
12090 return filter.GetProtectionLevel(type, false, system);
12091 else
12092 return 0;
12093 }
12094
12095 string subclassPath, entryName;
12096
12097 switch (type)
12098 {
12100 entryName = "biological";
12101 break;
12103 entryName = "chemical";
12104 break;
12105 default:
12106 entryName = "biological";
12107 break;
12108 }
12109
12110 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12111
12113 }
12114
12115
12116
12119 {
12120 if (!IsMagazine())
12122
12124 }
12125
12126
12127
12128
12129
12134 {
12135 return true;
12136 }
12137
12139 {
12141 }
12142
12143
12144
12145
12146
12148 {
12149 if (parent)
12150 {
12151 if (parent.IsInherited(DayZInfected))
12152 return true;
12153
12154 if (!parent.IsRuined())
12155 return true;
12156 }
12157
12158 return true;
12159 }
12160
12162 {
12163 if (!super.CanPutAsAttachment(parent))
12164 {
12165 return false;
12166 }
12167
12168 if (!IsRuined() && !parent.IsRuined())
12169 {
12170 return true;
12171 }
12172
12173 return false;
12174 }
12175
12177 {
12178
12179
12180
12181
12182 return super.CanReceiveItemIntoCargo(item);
12183 }
12184
12186 {
12187
12188
12189
12190
12191 GameInventory attachmentInv = attachment.GetInventory();
12193 {
12194 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12195 return false;
12196 }
12197
12198 InventoryLocation loc = new InventoryLocation();
12199 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12200 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12201 return false;
12202
12203 return super.CanReceiveAttachment(attachment, slotId);
12204 }
12205
12207 {
12208 if (!super.CanReleaseAttachment(attachment))
12209 return false;
12210
12211 return GetInventory().AreChildrenAccessible();
12212 }
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12235 {
12236 int id = muzzle_owner.GetMuzzleID();
12237 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12238
12239 if (WPOF_array)
12240 {
12241 for (int i = 0; i < WPOF_array.Count(); i++)
12242 {
12243 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12244
12245 if (WPOF)
12246 {
12247 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12248 }
12249 }
12250 }
12251 }
12252
12253
12255 {
12256 int id = muzzle_owner.GetMuzzleID();
12258
12259 if (WPOBE_array)
12260 {
12261 for (int i = 0; i < WPOBE_array.Count(); i++)
12262 {
12263 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12264
12265 if (WPOBE)
12266 {
12267 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12268 }
12269 }
12270 }
12271 }
12272
12273
12275 {
12276 int id = muzzle_owner.GetMuzzleID();
12277 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12278
12279 if (WPOOH_array)
12280 {
12281 for (int i = 0; i < WPOOH_array.Count(); i++)
12282 {
12283 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12284
12285 if (WPOOH)
12286 {
12287 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12288 }
12289 }
12290 }
12291 }
12292
12293
12295 {
12296 int id = muzzle_owner.GetMuzzleID();
12297 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12298
12299 if (WPOOH_array)
12300 {
12301 for (int i = 0; i < WPOOH_array.Count(); i++)
12302 {
12303 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12304
12305 if (WPOOH)
12306 {
12307 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12308 }
12309 }
12310 }
12311 }
12312
12313
12315 {
12316 int id = muzzle_owner.GetMuzzleID();
12317 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12318
12319 if (WPOOH_array)
12320 {
12321 for (int i = 0; i < WPOOH_array.Count(); i++)
12322 {
12323 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12324
12325 if (WPOOH)
12326 {
12327 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12328 }
12329 }
12330 }
12331 }
12332
12333
12334
12336 {
12338 {
12339 return true;
12340 }
12341
12342 return false;
12343 }
12344
12346 {
12348 {
12349 return true;
12350 }
12351
12352 return false;
12353 }
12354
12356 {
12358 {
12359 return true;
12360 }
12361
12362 return false;
12363 }
12364
12366 {
12367 return false;
12368 }
12369
12372 {
12373 return UATimeSpent.DEFAULT_DEPLOY;
12374 }
12375
12376
12377
12378
12380 {
12382 SetSynchDirty();
12383 }
12384
12386 {
12388 }
12389
12390
12392 {
12393 return false;
12394 }
12395
12398 {
12399 string att_type = "None";
12400
12401 if (ConfigIsExisting("soundAttType"))
12402 {
12403 att_type = ConfigGetString("soundAttType");
12404 }
12405
12407 }
12408
12410 {
12412 }
12413
12414
12415
12416
12417
12421
12423 {
12426
12428 }
12429
12430
12432 {
12434 return;
12435
12437
12440
12443
12444 SoundParameters params = new SoundParameters();
12448 }
12449
12450
12452 {
12454 return;
12455
12457 SetSynchDirty();
12458
12461 }
12462
12463
12465 {
12467 return;
12468
12470 SetSynchDirty();
12471
12474 }
12475
12477 {
12479 }
12480
12482 {
12484 }
12485
12488 {
12489 if (!
GetGame().IsDedicatedServer())
12490 {
12491 if (ConfigIsExisting("attachSoundSet"))
12492 {
12493 string cfg_path = "";
12494 string soundset = "";
12495 string type_name =
GetType();
12496
12499 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12500 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12501
12502 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12503 {
12504 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12505 {
12506 if (cfg_slot_array[i] == slot_type)
12507 {
12508 soundset = cfg_soundset_array[i];
12509 break;
12510 }
12511 }
12512 }
12513
12514 if (soundset != "")
12515 {
12516 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12518 }
12519 }
12520 }
12521 }
12522
12524 {
12525
12526 }
12527
12528 void OnApply(PlayerBase player);
12529
12531 {
12532 return 1.0;
12533 };
12534
12536 {
12538 }
12539
12541 {
12543 }
12544
12546
12548 {
12549 SetDynamicPhysicsLifeTime(0.01);
12551 }
12552
12554 {
12555 array<string> zone_names = new array<string>;
12556 GetDamageZones(zone_names);
12557 for (int i = 0; i < zone_names.Count(); i++)
12558 {
12559 SetHealthMax(zone_names.Get(i),"Health");
12560 }
12561 SetHealthMax("","Health");
12562 }
12563
12566 {
12567 float global_health = GetHealth01("","Health");
12568 array<string> zones = new array<string>;
12569 GetDamageZones(zones);
12570
12571 for (int i = 0; i < zones.Count(); i++)
12572 {
12573 SetHealth01(zones.Get(i),"Health",global_health);
12574 }
12575 }
12576
12579 {
12580 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12581 }
12582
12584 {
12585 if (!hasRootAsPlayer)
12586 {
12587 if (refParentIB)
12588 {
12589
12590 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12591 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12592
12593 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12594 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12595
12598 }
12599 else
12600 {
12601
12604 }
12605 }
12606 }
12607
12609 {
12611 {
12612 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12613 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12614 {
12615 float heatPermCoef = 1.0;
12617 while (ent)
12618 {
12619 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12620 ent = ent.GetHierarchyParent();
12621 }
12622
12623 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12624 }
12625 }
12626 }
12627
12629 {
12630
12631 EntityAI parent = GetHierarchyParent();
12632 if (!parent)
12633 {
12634 hasParent = false;
12635 hasRootAsPlayer = false;
12636 }
12637 else
12638 {
12639 hasParent = true;
12640 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12641 refParentIB =
ItemBase.Cast(parent);
12642 }
12643 }
12644
12645 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12646 {
12647
12648 }
12649
12651 {
12652
12653 return false;
12654 }
12655
12657 {
12658
12659
12660 return false;
12661 }
12662
12664 {
12665
12666 return false;
12667 }
12668
12671 {
12672 return !GetIsFrozen() &&
IsOpen();
12673 }
12674
12676 {
12677 bool hasParent = false, hasRootAsPlayer = false;
12679
12680 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12681 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12682
12683 if (wwtu || foodDecay)
12684 {
12688
12689 if (processWetness || processTemperature || processDecay)
12690 {
12692
12693 if (processWetness)
12694 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12695
12696 if (processTemperature)
12698
12699 if (processDecay)
12700 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12701 }
12702 }
12703 }
12704
12707 {
12709 }
12710
12712 {
12715
12716 return super.GetTemperatureFreezeThreshold();
12717 }
12718
12720 {
12723
12724 return super.GetTemperatureThawThreshold();
12725 }
12726
12728 {
12731
12732 return super.GetItemOverheatThreshold();
12733 }
12734
12736 {
12738 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12739
12740 return super.GetTemperatureFreezeTime();
12741 }
12742
12744 {
12746 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12747
12748 return super.GetTemperatureThawTime();
12749 }
12750
12755
12757 {
12758 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12759 }
12760
12762 {
12763 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12764 }
12765
12768 {
12770 }
12771
12773 {
12775 }
12776
12778 {
12780 }
12781
12784 {
12785 return null;
12786 }
12787
12790 {
12791 return false;
12792 }
12793
12795 {
12797 {
12800 if (!trg)
12801 {
12803 explosive = this;
12804 }
12805
12806 explosive.PairRemote(trg);
12808
12809 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12810 trg.SetPersistentPairID(persistentID);
12811 explosive.SetPersistentPairID(persistentID);
12812
12813 return true;
12814 }
12815 return false;
12816 }
12817
12820 {
12821 float ret = 1.0;
12824 ret *= GetHealth01();
12825
12826 return ret;
12827 }
12828
12829 #ifdef DEVELOPER
12830 override void SetDebugItem()
12831 {
12832 super.SetDebugItem();
12833 _itemBase = this;
12834 }
12835
12837 {
12838 string text = super.GetDebugText();
12839
12841 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12842
12843 return text;
12844 }
12845 #endif
12846
12848 {
12849 return true;
12850 }
12851
12853
12855
12857 {
12860 }
12861
12862
12870
12886}
12887
12889{
12891 if (entity)
12892 {
12893 bool is_item = entity.IsInherited(
ItemBase);
12894 if (is_item && full_quantity)
12895 {
12898 }
12899 }
12900 else
12901 {
12903 return NULL;
12904 }
12905 return entity;
12906}
12907
12909{
12910 if (item)
12911 {
12912 if (health > 0)
12913 item.SetHealth("", "", health);
12914
12915 if (item.CanHaveTemperature())
12916 {
12918 if (item.CanFreeze())
12919 item.SetFrozen(false);
12920 }
12921
12922 if (item.HasEnergyManager())
12923 {
12924 if (quantity >= 0)
12925 {
12926 item.GetCompEM().SetEnergy0To1(quantity);
12927 }
12928 else
12929 {
12931 }
12932 }
12933 else if (item.IsMagazine())
12934 {
12935 Magazine mag = Magazine.Cast(item);
12936 if (quantity >= 0)
12937 {
12938 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12939 }
12940 else
12941 {
12943 }
12944
12945 }
12946 else
12947 {
12948 if (quantity >= 0)
12949 {
12950 item.SetQuantityNormalized(quantity, false);
12951 }
12952 else
12953 {
12955 }
12956
12957 }
12958 }
12959}
12960
12961#ifdef DEVELOPER
12963#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.