8252{
8254 {
8255 return true;
8256 }
8257};
8258
8259
8260
8262{
8266
8268
8271
8272
8273
8274
8275
8284
8290
8295
8300
8321 protected bool m_IsResultOfSplit
8322
8324
8329
8330
8331
8333
8337
8338
8339
8341
8344
8345
8346
8352
8353
8361
8364
8365
8367
8368
8370
8371
8376
8377
8382
8383
8385
8386
8388 {
8393
8394 if (!
GetGame().IsDedicatedServer())
8395 {
8397 {
8399
8401 {
8403 }
8404 }
8405
8408 }
8409
8410 m_OldLocation = null;
8411
8413 {
8415 }
8416
8417 if (ConfigIsExisting("headSelectionsToHide"))
8418 {
8421 }
8422
8424 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8425 {
8427 }
8428
8430
8431 m_IsResultOfSplit = false;
8432
8434 }
8435
8437 {
8438 super.InitItemVariables();
8439
8445 m_Count = ConfigGetInt(
"count");
8446
8449
8454
8457
8462
8474
8478
8479
8482 if (ConfigIsExisting("canBeSplit"))
8483 {
8486 }
8487
8489 if (ConfigIsExisting("itemBehaviour"))
8491
8492
8495 RegisterNetSyncVariableInt("m_VarLiquidType");
8496 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8497
8498 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8499 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8500 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8501
8502 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8503 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8504 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8505 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8506
8507 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8508 RegisterNetSyncVariableBool("m_IsTakeable");
8509 RegisterNetSyncVariableBool("m_IsHologram");
8510
8513 {
8516 }
8517
8519
8521 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8523
8524 }
8525
8527 {
8529 }
8530
8532 {
8535 {
8540 }
8541 }
8542
8543 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8544 {
8546 {
8549 }
8550
8552 }
8553
8555 {
8561 }
8562
8564
8566 {
8568
8569 if (!action)
8570 {
8571 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8572 return;
8573 }
8574
8576 if (!ai)
8577 {
8579 return;
8580 }
8581
8583 if (!action_array)
8584 {
8585 action_array = new array<ActionBase_Basic>;
8587 }
8588 if (LogManager.IsActionLogEnable())
8589 {
8590 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8591 }
8592
8593 if (action_array.Find(action) != -1)
8594 {
8595 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8596 }
8597 else
8598 {
8599 action_array.Insert(action);
8600 }
8601 }
8602
8604 {
8606 ActionBase action = player.GetActionManager().GetAction(actionName);
8609
8610 if (action_array)
8611 {
8612 action_array.RemoveItem(action);
8613 }
8614 }
8615
8616
8617
8619 {
8620 ActionOverrideData overrideData = new ActionOverrideData();
8624
8626 if (!actionMap)
8627 {
8630 }
8631
8632 actionMap.Insert(this.
Type(), overrideData);
8633
8634 }
8635
8637
8639
8640
8642 {
8645
8648
8649 string config_to_search = "CfgVehicles";
8650 string muzzle_owner_config;
8651
8653 {
8654 if (IsInherited(Weapon))
8655 config_to_search = "CfgWeapons";
8656
8657 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8658
8659 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8660
8662
8663 if (config_OnFire_subclass_count > 0)
8664 {
8665 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8666
8667 for (int i = 0; i < config_OnFire_subclass_count; i++)
8668 {
8669 string particle_class = "";
8671 string config_OnFire_entry = config_OnFire_class + particle_class;
8672 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8673 WPOF_array.Insert(WPOF);
8674 }
8675
8676
8678 }
8679 }
8680
8682 {
8683 config_to_search = "CfgWeapons";
8684 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8685
8686 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8687
8689
8690 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8691 {
8692 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8693
8694 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8695 {
8696 string particle_class2 = "";
8698 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8699 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8700 WPOBE_array.Insert(WPOBE);
8701 }
8702
8703
8705 }
8706 }
8707 }
8708
8709
8711 {
8714
8716 {
8717 string config_to_search = "CfgVehicles";
8718
8719 if (IsInherited(Weapon))
8720 config_to_search = "CfgWeapons";
8721
8722 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8723 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8724
8725 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8726 {
8727
8729
8731 {
8733 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8735 return;
8736 }
8737
8740
8741
8742
8744 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8745
8746 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8747 {
8748 string particle_class = "";
8750 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8752
8753 if (entry_type == CT_CLASS)
8754 {
8755 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8756 WPOOH_array.Insert(WPOF);
8757 }
8758 }
8759
8760
8762 }
8763 }
8764 }
8765
8767 {
8769 }
8770
8772 {
8774 {
8776
8779
8782
8783 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8784 }
8785 }
8786
8788 {
8790 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8791
8793 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8794
8796 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8797
8799 {
8801 }
8802 }
8803
8805 {
8807 }
8808
8810 {
8813 else
8815
8817 {
8820 }
8821 else
8822 {
8825
8828 }
8829
8831 }
8832
8834 {
8836 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8837 }
8838
8840 {
8842 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8844 }
8845
8847 {
8849 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8850 }
8851
8853 {
8856
8857 OverheatingParticle OP = new OverheatingParticle();
8862
8864 }
8865
8867 {
8870
8871 return -1;
8872 }
8873
8875 {
8877 {
8880
8881 for (int i = count; i > 0; --i)
8882 {
8883 int id = i - 1;
8886
8889
8890 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8891 {
8892 if (p)
8893 {
8896 }
8897 }
8898 }
8899 }
8900 }
8901
8903 {
8905 {
8907 {
8908 int id = i - 1;
8910
8911 if (OP)
8912 {
8914
8915 if (p)
8916 {
8918 }
8919
8920 delete OP;
8921 }
8922 }
8923
8926 }
8927 }
8928
8931 {
8932 return 0.0;
8933 }
8934
8935
8937 {
8938 return 250;
8939 }
8940
8942 {
8943 return 0;
8944 }
8945
8948 {
8950 return true;
8951
8952 return false;
8953 }
8954
8957 {
8960
8962 {
8964 }
8965 else
8966 {
8967
8969 }
8970
8972 }
8973
8980 {
8981 return -1;
8982 }
8983
8984
8985
8986
8988 {
8990 {
8992 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8993
8994 if (r_index >= 0)
8995 {
8996 InventoryLocation r_il = new InventoryLocation;
8997 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8998
8999 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9002 {
9003 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9004 }
9006 {
9007 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9008 }
9009
9010 }
9011
9012 player.GetHumanInventory().ClearUserReservedLocation(this);
9013 }
9014
9017 }
9018
9019
9020
9021
9023 {
9024 return ItemBase.m_DebugActionsMask;
9025 }
9026
9028 {
9029 return ItemBase.m_DebugActionsMask & mask;
9030 }
9031
9033 {
9034 ItemBase.m_DebugActionsMask = mask;
9035 }
9036
9038 {
9039 ItemBase.m_DebugActionsMask |= mask;
9040 }
9041
9043 {
9044 ItemBase.m_DebugActionsMask &= ~mask;
9045 }
9046
9048 {
9050 {
9052 }
9053 else
9054 {
9056 }
9057 }
9058
9059
9061 {
9062 if (GetEconomyProfile())
9063 {
9064 float q_max = GetEconomyProfile().GetQuantityMax();
9065 if (q_max > 0)
9066 {
9067 float q_min = GetEconomyProfile().GetQuantityMin();
9068 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9069
9071 {
9072 ComponentEnergyManager comp = GetCompEM();
9074 {
9076 }
9077 }
9079 {
9081
9082 }
9083
9084 }
9085 }
9086 }
9087
9090 {
9091 EntityAI parent = GetHierarchyParent();
9092
9093 if (parent)
9094 {
9095 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9096 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9097 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9098 }
9099 }
9100
9103 {
9104 EntityAI parent = GetHierarchyParent();
9105
9106 if (parent)
9107 {
9108 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9109 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9110 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9111 }
9112 }
9113
9115 {
9116
9117
9118
9119
9121
9123 {
9124 if (ScriptInputUserData.CanStoreInputUserData())
9125 {
9126 ScriptInputUserData ctx = new ScriptInputUserData;
9132 ctx.
Write(use_stack_max);
9135
9137 {
9138 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9139 }
9140 }
9141 }
9142 else if (!
GetGame().IsMultiplayer())
9143 {
9145 }
9146 }
9147
9149 {
9151 }
9152
9154 {
9156 }
9157
9159 {
9161 }
9162
9164 {
9165
9166 return false;
9167 }
9168
9170 {
9171 return false;
9172 }
9173
9177 {
9178 return false;
9179 }
9180
9182 {
9183 return "";
9184 }
9185
9187
9189 {
9190 return false;
9191 }
9192
9194 {
9195 return true;
9196 }
9197
9198
9199
9201 {
9202 return true;
9203 }
9204
9206 {
9207 return true;
9208 }
9209
9211 {
9212 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9214 }
9215
9217 {
9219 }
9220
9222 {
9224 if (!is_being_placed)
9226 SetSynchDirty();
9227 }
9228
9229
9231
9233 {
9235 }
9236
9238 {
9240 }
9241
9243 {
9244 return 1;
9245 }
9246
9248 {
9249 return false;
9250 }
9251
9253 {
9255 SetSynchDirty();
9256 }
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9293 {
9294 super.OnMovedInsideCargo(container);
9295
9296 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9297 }
9298
9299 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9300 {
9301 super.EEItemLocationChanged(oldLoc,newLoc);
9302
9303 PlayerBase new_player = null;
9304 PlayerBase old_player = null;
9305
9306 if (newLoc.GetParent())
9307 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9308
9309 if (oldLoc.GetParent())
9310 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9311
9313 {
9314 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9315
9316 if (r_index >= 0)
9317 {
9318 InventoryLocation r_il = new InventoryLocation;
9319 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9320
9321 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9324 {
9325 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9326 }
9328 {
9329 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9330 }
9331
9332 }
9333 }
9334
9336 {
9337 if (new_player)
9338 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9339
9340 if (new_player == old_player)
9341 {
9342
9343 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9344 {
9346 {
9347 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9348 {
9349 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9350 }
9351 }
9352 else
9353 {
9354 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9355 }
9356 }
9357
9358 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9359 {
9360 int type = oldLoc.GetType();
9362 {
9363 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9364 }
9366 {
9367 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9368 }
9369 }
9370 if (!m_OldLocation)
9371 {
9372 m_OldLocation = new InventoryLocation;
9373 }
9374 m_OldLocation.Copy(oldLoc);
9375 }
9376 else
9377 {
9378 if (m_OldLocation)
9379 {
9380 m_OldLocation.Reset();
9381 }
9382 }
9383
9385 }
9386 else
9387 {
9388 if (new_player)
9389 {
9390 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9391 if (res_index >= 0)
9392 {
9393 InventoryLocation il = new InventoryLocation;
9394 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9396 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9399 {
9400 il.
GetParent().GetOnReleaseLock().Invoke(it);
9401 }
9403 {
9405 }
9406
9407 }
9408 }
9410 {
9411
9413 }
9414
9415 if (m_OldLocation)
9416 {
9417 m_OldLocation.Reset();
9418 }
9419 }
9420 }
9421
9422 override void EOnContact(IEntity other, Contact extra)
9423 {
9425 {
9426 int liquidType = -1;
9428 if (impactSpeed > 0.0)
9429 {
9431 #ifndef SERVER
9433 #else
9435 SetSynchDirty();
9436 #endif
9438 }
9439 }
9440
9441 #ifdef SERVER
9442 if (GetCompEM() && GetCompEM().IsPlugged())
9443 {
9444 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9445 GetCompEM().UnplugThis();
9446 }
9447 #endif
9448 }
9449
9451
9453 {
9455 }
9456
9458 {
9459
9460 }
9461
9463 {
9464 super.OnItemLocationChanged(old_owner, new_owner);
9465
9466 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9467 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9468
9469 if (!relatedPlayer && playerNew)
9470 relatedPlayer = playerNew;
9471
9472 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9473 {
9475 if (actionMgr)
9476 {
9477 ActionBase currentAction = actionMgr.GetRunningAction();
9478 if (currentAction)
9480 }
9481 }
9482
9483 Man ownerPlayerOld = null;
9484 Man ownerPlayerNew = null;
9485
9486 if (old_owner)
9487 {
9488 if (old_owner.
IsMan())
9489 {
9490 ownerPlayerOld = Man.Cast(old_owner);
9491 }
9492 else
9493 {
9494 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9495 }
9496 }
9497 else
9498 {
9500 {
9502
9503 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9504 {
9505 GetCompEM().UnplugThis();
9506 }
9507 }
9508 }
9509
9510 if (new_owner)
9511 {
9512 if (new_owner.
IsMan())
9513 {
9514 ownerPlayerNew = Man.Cast(new_owner);
9515 }
9516 else
9517 {
9518 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9519 }
9520 }
9521
9522 if (ownerPlayerOld != ownerPlayerNew)
9523 {
9524 if (ownerPlayerOld)
9525 {
9526 array<EntityAI> subItemsExit = new array<EntityAI>;
9528 for (int i = 0; i < subItemsExit.Count(); i++)
9529 {
9532 }
9533 }
9534
9535 if (ownerPlayerNew)
9536 {
9537 array<EntityAI> subItemsEnter = new array<EntityAI>;
9539 for (int j = 0; j < subItemsEnter.Count(); j++)
9540 {
9543 }
9544 }
9545 }
9546 else if (ownerPlayerNew != null)
9547 {
9548 PlayerBase nplayer;
9549 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9550 {
9551 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9553 for (int k = 0; k < subItemsUpdate.Count(); k++)
9554 {
9556 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9557 }
9558 }
9559 }
9560
9561 if (old_owner)
9562 old_owner.OnChildItemRemoved(this);
9563 if (new_owner)
9564 new_owner.OnChildItemReceived(this);
9565 }
9566
9567
9569 {
9570 super.EEDelete(parent);
9571 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9572 if (player)
9573 {
9575
9576 if (player.IsAlive())
9577 {
9578 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9579 if (r_index >= 0)
9580 {
9581 InventoryLocation r_il = new InventoryLocation;
9582 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9583
9584 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9587 {
9588 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9589 }
9591 {
9592 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9593 }
9594
9595 }
9596
9597 player.RemoveQuickBarEntityShortcut(this);
9598 }
9599 }
9600 }
9601
9603 {
9604 super.EEKilled(killer);
9605
9608 {
9609 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9610 {
9611 if (IsMagazine())
9612 {
9613 if (Magazine.Cast(this).GetAmmoCount() > 0)
9614 {
9616 }
9617 }
9618 else
9619 {
9621 }
9622 }
9623 }
9624 }
9625
9627 {
9628 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9629
9630 super.OnWasAttached(parent, slot_id);
9631
9634
9636 }
9637
9639 {
9640 super.OnWasDetached(parent, slot_id);
9641
9644 }
9645
9647 {
9648 int idx;
9651
9652 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9653 if (inventory_slots.Count() < 1)
9654 {
9655 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9656 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9657 }
9658 else
9659 {
9660 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9661 }
9662
9663 idx = inventory_slots.Find(slot);
9664 if (idx < 0)
9665 return "";
9666
9667 return attach_types.Get(idx);
9668 }
9669
9671 {
9672 int idx = -1;
9673 string slot;
9674
9677
9678 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9679 if (inventory_slots.Count() < 1)
9680 {
9681 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9682 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9683 }
9684 else
9685 {
9686 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9687 if (detach_types.Count() < 1)
9688 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9689 }
9690
9691 for (int i = 0; i < inventory_slots.Count(); i++)
9692 {
9693 slot = inventory_slots.Get(i);
9694 }
9695
9696 if (slot != "")
9697 {
9698 if (detach_types.Count() == 1)
9699 idx = 0;
9700 else
9701 idx = inventory_slots.Find(slot);
9702 }
9703 if (idx < 0)
9704 return "";
9705
9706 return detach_types.Get(idx);
9707 }
9708
9710 {
9711
9713
9714
9715 float min_time = 1;
9716 float max_time = 3;
9717 float delay = Math.RandomFloat(min_time, max_time);
9718
9719 explode_timer.Run(delay, this, "DoAmmoExplosion");
9720 }
9721
9723 {
9724 Magazine magazine = Magazine.Cast(this);
9725 int pop_sounds_count = 6;
9726 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9727
9728
9729 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9730 string sound_name = pop_sounds[ sound_idx ];
9732
9733
9734 magazine.ServerAddAmmoCount(-1);
9735
9736
9737 float min_temp_to_explode = 100;
9738
9739 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9740 {
9742 }
9743 }
9744
9745
9746 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9747 {
9748 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9749
9750 const int CHANCE_DAMAGE_CARGO = 4;
9751 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9752 const int CHANCE_DAMAGE_NOTHING = 2;
9753
9755 {
9756 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9757 int chances;
9758 int rnd;
9759
9760 if (GetInventory().GetCargo())
9761 {
9762 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9763 rnd = Math.RandomInt(0,chances);
9764
9765 if (rnd < CHANCE_DAMAGE_CARGO)
9766 {
9768 }
9769 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9770 {
9772 }
9773 }
9774 else
9775 {
9776 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9777 rnd = Math.RandomInt(0,chances);
9778
9779 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9780 {
9782 }
9783 }
9784 }
9785 }
9786
9788 {
9789 if (GetInventory().GetCargo())
9790 {
9791 int item_count = GetInventory().GetCargo().GetItemCount();
9792 if (item_count > 0)
9793 {
9794 int random_pick = Math.RandomInt(0, item_count);
9796 if (!item.IsExplosive())
9797 {
9798 item.AddHealth("","",damage);
9799 return true;
9800 }
9801 }
9802 }
9803 return false;
9804 }
9805
9807 {
9808 int attachment_count = GetInventory().AttachmentCount();
9809 if (attachment_count > 0)
9810 {
9811 int random_pick = Math.RandomInt(0, attachment_count);
9812 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9813 if (!attachment.IsExplosive())
9814 {
9815 attachment.AddHealth("","",damage);
9816 return true;
9817 }
9818 }
9819 return false;
9820 }
9821
9823 {
9825 }
9826
9828 {
9830 return GetInventory().CanRemoveEntity();
9831
9832 return false;
9833 }
9834
9836 {
9837
9839 return false;
9840
9841
9843 return false;
9844
9845
9846
9848 if (delta == 0)
9849 return false;
9850
9851
9852 return true;
9853 }
9854
9856 {
9858 {
9859 if (ScriptInputUserData.CanStoreInputUserData())
9860 {
9861 ScriptInputUserData ctx = new ScriptInputUserData;
9866 ctx.
Write(destination_entity);
9870 }
9871 }
9872 else if (!
GetGame().IsMultiplayer())
9873 {
9875 }
9876 }
9877
9879 {
9880 float split_quantity_new;
9884 InventoryLocation loc = new InventoryLocation;
9885
9886 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9887 {
9889 split_quantity_new = stack_max;
9890 else
9892
9894 {
9895 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9896 if (new_item)
9897 {
9898 new_item.SetResultOfSplit(true);
9899 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9901 new_item.
SetQuantity(split_quantity_new,
false,
true);
9902 }
9903 }
9904 }
9905 else if (destination_entity && slot_id == -1)
9906 {
9907 if (quantity > stack_max)
9908 split_quantity_new = stack_max;
9909 else
9910 split_quantity_new = quantity;
9911
9913 {
9915 {
9918 }
9919
9920 if (new_item)
9921 {
9922 new_item.SetResultOfSplit(true);
9923 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9925 new_item.
SetQuantity(split_quantity_new,
false,
true);
9926 }
9927 }
9928 }
9929 else
9930 {
9931 if (stack_max != 0)
9932 {
9934 {
9936 }
9937
9938 if (split_quantity_new == 0)
9939 {
9940 if (!
GetGame().IsMultiplayer())
9941 player.PhysicalPredictiveDropItem(this);
9942 else
9943 player.ServerDropEntity(this);
9944 return;
9945 }
9946
9948 {
9950
9951 if (new_item)
9952 {
9953 new_item.SetResultOfSplit(true);
9954 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9957 new_item.PlaceOnSurface();
9958 }
9959 }
9960 }
9961 }
9962 }
9963
9965 {
9966 float split_quantity_new;
9970 InventoryLocation loc = new InventoryLocation;
9971
9972 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9973 {
9975 split_quantity_new = stack_max;
9976 else
9978
9980 {
9981 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9982 if (new_item)
9983 {
9984 new_item.SetResultOfSplit(true);
9985 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9987 new_item.
SetQuantity(split_quantity_new,
false,
true);
9988 }
9989 }
9990 }
9991 else if (destination_entity && slot_id == -1)
9992 {
9993 if (quantity > stack_max)
9994 split_quantity_new = stack_max;
9995 else
9996 split_quantity_new = quantity;
9997
9999 {
10001 {
10004 }
10005
10006 if (new_item)
10007 {
10008 new_item.SetResultOfSplit(true);
10009 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10011 new_item.
SetQuantity(split_quantity_new,
false,
true);
10012 }
10013 }
10014 }
10015 else
10016 {
10017 if (stack_max != 0)
10018 {
10020 {
10022 }
10023
10025 {
10027
10028 if (new_item)
10029 {
10030 new_item.SetResultOfSplit(true);
10031 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10034 new_item.PlaceOnSurface();
10035 }
10036 }
10037 }
10038 }
10039 }
10040
10042 {
10044 {
10045 if (ScriptInputUserData.CanStoreInputUserData())
10046 {
10047 ScriptInputUserData ctx = new ScriptInputUserData;
10052 dst.WriteToContext(ctx);
10054 }
10055 }
10056 else if (!
GetGame().IsMultiplayer())
10057 {
10059 }
10060 }
10061
10063 {
10065 {
10066 if (ScriptInputUserData.CanStoreInputUserData())
10067 {
10068 ScriptInputUserData ctx = new ScriptInputUserData;
10073 ctx.
Write(destination_entity);
10079 }
10080 }
10081 else if (!
GetGame().IsMultiplayer())
10082 {
10084 }
10085 }
10086
10088 {
10090 }
10091
10093 {
10095 float split_quantity_new;
10097 if (dst.IsValid())
10098 {
10099 int slot_id = dst.GetSlot();
10101
10102 if (quantity > stack_max)
10103 split_quantity_new = stack_max;
10104 else
10105 split_quantity_new = quantity;
10106
10108 {
10110
10111 if (new_item)
10112 {
10113 new_item.SetResultOfSplit(true);
10114 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10116 new_item.
SetQuantity(split_quantity_new,
false,
true);
10117 }
10118
10119 return new_item;
10120 }
10121 }
10122
10123 return null;
10124 }
10125
10127 {
10129 float split_quantity_new;
10131 if (destination_entity)
10132 {
10134 if (quantity > stackable)
10135 split_quantity_new = stackable;
10136 else
10137 split_quantity_new = quantity;
10138
10140 {
10141 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10142 if (new_item)
10143 {
10144 new_item.SetResultOfSplit(true);
10145 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10147 new_item.
SetQuantity(split_quantity_new,
false,
true);
10148 }
10149 }
10150 }
10151 }
10152
10154 {
10156 {
10157 if (ScriptInputUserData.CanStoreInputUserData())
10158 {
10159 ScriptInputUserData ctx = new ScriptInputUserData;
10164 ItemBase destination_entity =
this;
10165 ctx.
Write(destination_entity);
10169 }
10170 }
10171 else if (!
GetGame().IsMultiplayer())
10172 {
10174 }
10175 }
10176
10178 {
10180 float split_quantity_new;
10182 if (player)
10183 {
10185 if (quantity > stackable)
10186 split_quantity_new = stackable;
10187 else
10188 split_quantity_new = quantity;
10189
10191 {
10192 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10193 new_item =
ItemBase.Cast(in_hands);
10194 if (new_item)
10195 {
10196 new_item.SetResultOfSplit(true);
10197 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10199 new_item.SetQuantity(split_quantity_new, false, true);
10200 }
10201 }
10202 }
10203 }
10204
10206 {
10208 float split_quantity_new = Math.Floor(quantity * 0.5);
10209
10211 return;
10212
10214
10215 if (new_item)
10216 {
10217 if (new_item.GetQuantityMax() < split_quantity_new)
10218 {
10219 split_quantity_new = new_item.GetQuantityMax();
10220 }
10221
10222 new_item.SetResultOfSplit(true);
10223 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10224
10226 {
10229 }
10230 else
10231 {
10233 new_item.
SetQuantity(split_quantity_new,
false,
true);
10234 }
10235 }
10236 }
10237
10239 {
10241 float split_quantity_new = Math.Floor(quantity / 2);
10242
10244 return;
10245
10246 InventoryLocation invloc = new InventoryLocation;
10248
10250 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10251
10252 if (new_item)
10253 {
10254 if (new_item.GetQuantityMax() < split_quantity_new)
10255 {
10256 split_quantity_new = new_item.GetQuantityMax();
10257 }
10259 {
10262 }
10263 else if (split_quantity_new > 1)
10264 {
10266 new_item.
SetQuantity(split_quantity_new,
false,
true);
10267 }
10268 }
10269 }
10270
10273 {
10274 SetWeightDirty();
10276
10277 if (parent)
10278 parent.OnAttachmentQuantityChangedEx(this, delta);
10279
10281 {
10283 {
10285 }
10287 {
10288 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10290 }
10291 }
10292
10293 }
10294
10297 {
10298
10299 }
10300
10303 {
10305 }
10306
10308 {
10309 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10310
10312 {
10313 if (newLevel == GameConstants.STATE_RUINED)
10314 {
10316 EntityAI parent = GetHierarchyParent();
10317 if (parent && parent.IsFireplace())
10318 {
10319 CargoBase cargo = GetInventory().GetCargo();
10320 if (cargo)
10321 {
10323 {
10325 }
10326 }
10327 }
10328 }
10329
10331 {
10332
10334 return;
10335 }
10336
10337 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10338 {
10340 }
10341 }
10342 }
10343
10344
10346 {
10347 super.OnRightClick();
10348
10350 {
10352 {
10353 if (ScriptInputUserData.CanStoreInputUserData())
10354 {
10355 EntityAI root = GetHierarchyRoot();
10356 Man playerOwner = GetHierarchyRootPlayer();
10357 InventoryLocation dst = new InventoryLocation;
10358
10359
10360 if (!playerOwner && root && root == this)
10361 {
10363 }
10364 else
10365 {
10366
10367 GetInventory().GetCurrentInventoryLocation(dst);
10369 {
10372 {
10374 }
10375 else
10376 {
10378
10379
10380 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10381 {
10383 }
10384 else
10385 {
10386 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10387 }
10388 }
10389 }
10390 }
10391
10392 ScriptInputUserData ctx = new ScriptInputUserData;
10400 }
10401 }
10402 else if (!
GetGame().IsMultiplayer())
10403 {
10405 }
10406 }
10407 }
10408
10410 {
10411 if (root)
10412 {
10413 vector m4[4];
10414 root.GetTransform(m4);
10415 dst.SetGround(this, m4);
10416 }
10417 else
10418 {
10419 GetInventory().GetCurrentInventoryLocation(dst);
10420 }
10421 }
10422
10423 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10424 {
10425
10426 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10427 return false;
10428
10429 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10430 return false;
10431
10432
10434 return false;
10435
10436
10437 Magazine mag = Magazine.Cast(this);
10438 if (mag)
10439 {
10440 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10441 return false;
10442
10443 if (stack_max_limit)
10444 {
10445 Magazine other_mag = Magazine.Cast(other_item);
10446 if (other_item)
10447 {
10448 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10449 return false;
10450 }
10451
10452 }
10453 }
10454 else
10455 {
10456
10458 return false;
10459
10461 return false;
10462 }
10463
10464 PlayerBase player = null;
10465 if (CastTo(player, GetHierarchyRootPlayer()))
10466 {
10467 if (player.GetInventory().HasAttachment(this))
10468 return false;
10469
10470 if (player.IsItemsToDelete())
10471 return false;
10472 }
10473
10474 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10475 return false;
10476
10477 int slotID;
10479 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10480 return false;
10481
10482 return true;
10483 }
10484
10486 {
10488 }
10489
10491 {
10492 return m_IsResultOfSplit;
10493 }
10494
10496 {
10497 m_IsResultOfSplit = value;
10498 }
10499
10501 {
10503 }
10504
10506 {
10507 float other_item_quantity = other_item.GetQuantity();
10508 float this_free_space;
10509
10511
10513
10514 if (other_item_quantity > this_free_space)
10515 {
10516 return this_free_space;
10517 }
10518 else
10519 {
10520 return other_item_quantity;
10521 }
10522 }
10523
10525 {
10527 }
10528
10530 {
10532 return;
10533
10534 if (!IsMagazine() && other_item)
10535 {
10537 if (quantity_used != 0)
10538 {
10539 float hp1 = GetHealth01("","");
10540 float hp2 = other_item.GetHealth01("","");
10541 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10542 hpResult = hpResult / (
GetQuantity() + quantity_used);
10543
10544 hpResult *= GetMaxHealth();
10545 Math.Round(hpResult);
10546 SetHealth("", "Health", hpResult);
10547
10549 other_item.AddQuantity(-quantity_used);
10550 }
10551 }
10553 }
10554
10556 {
10557 #ifdef SERVER
10558 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10559 GetHierarchyParent().IncreaseLifetimeUp();
10560 #endif
10561 };
10562
10564 {
10565 PlayerBase p = PlayerBase.Cast(player);
10566
10567 array<int> recipesIds = p.m_Recipes;
10568 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10569 if (moduleRecipesManager)
10570 {
10571 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10572 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10573 }
10574
10575 for (int i = 0;i < recipesIds.Count(); i++)
10576 {
10577 int key = recipesIds.Get(i);
10578 string recipeName = moduleRecipesManager.GetRecipeName(key);
10580 }
10581 }
10582
10583
10584 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10585 {
10586 super.GetDebugActions(outputList);
10587
10588
10594
10595
10600
10605
10606
10610
10611
10613 {
10617 }
10618
10621
10622
10626
10628
10629 InventoryLocation loc = new InventoryLocation();
10630 GetInventory().GetCurrentInventoryLocation(loc);
10632 {
10633 if (Gizmo_IsSupported())
10636 }
10637
10639 }
10640
10641
10642
10643
10645 {
10646 super.OnAction(action_id, player, ctx);
10647
10649 {
10650 switch (action_id)
10651 {
10654 return true;
10657 return true;
10658 }
10659 }
10660
10662 {
10663 switch (action_id)
10664 {
10666 Delete();
10667 return true;
10668 }
10669 }
10670
10671 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10672 {
10673 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10674 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10675 PlayerBase p = PlayerBase.Cast(player);
10676 if (
EActions.RECIPES_RANGE_START < 1000)
10677 {
10678 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10679 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10680 }
10681 }
10682 #ifndef SERVER
10683 else if (action_id ==
EActions.WATCH_PLAYER)
10684 {
10685 PluginDeveloper.SetDeveloperItemClientEx(player);
10686 }
10687 #endif
10689 {
10690 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10691 {
10692 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10693 OnDebugButtonPressServer(id + 1);
10694 }
10695
10696 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10697 {
10698 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10700 }
10701
10702 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10703 {
10704 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10706 }
10707
10708 else if (action_id ==
EActions.ADD_QUANTITY)
10709 {
10710 if (IsMagazine())
10711 {
10712 Magazine mag = Magazine.Cast(this);
10713 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10714 }
10715 else
10716 {
10718 }
10719
10720 if (m_EM)
10721 {
10722 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10723 }
10724
10725 }
10726
10727 else if (action_id ==
EActions.REMOVE_QUANTITY)
10728 {
10729 if (IsMagazine())
10730 {
10731 Magazine mag2 = Magazine.Cast(this);
10732 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10733 }
10734 else
10735 {
10737 }
10738 if (m_EM)
10739 {
10740 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10741 }
10742
10743 }
10744
10745 else if (action_id ==
EActions.SET_QUANTITY_0)
10746 {
10748
10749 if (m_EM)
10750 {
10751 m_EM.SetEnergy(0);
10752 }
10753 }
10754
10755 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10756 {
10758
10759 if (m_EM)
10760 {
10761 m_EM.SetEnergy(m_EM.GetEnergyMax());
10762 }
10763 }
10764
10765 else if (action_id ==
EActions.ADD_HEALTH)
10766 {
10767 AddHealth("","",GetMaxHealth("","Health")/5);
10768 }
10769 else if (action_id ==
EActions.REMOVE_HEALTH)
10770 {
10771 AddHealth("","",-GetMaxHealth("","Health")/5);
10772 }
10773 else if (action_id ==
EActions.DESTROY_HEALTH)
10774 {
10775 SetHealth01("","",0);
10776 }
10777 else if (action_id ==
EActions.WATCH_ITEM)
10778 {
10780 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10781 #ifdef DEVELOPER
10782 SetDebugDeveloper_item(this);
10783 #endif
10784 }
10785
10786 else if (action_id ==
EActions.ADD_TEMPERATURE)
10787 {
10788 AddTemperature(20);
10789
10790 }
10791
10792 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10793 {
10794 AddTemperature(-20);
10795
10796 }
10797
10798 else if (action_id ==
EActions.FLIP_FROZEN)
10799 {
10800 SetFrozen(!GetIsFrozen());
10801
10802 }
10803
10804 else if (action_id ==
EActions.ADD_WETNESS)
10805 {
10807
10808 }
10809
10810 else if (action_id ==
EActions.REMOVE_WETNESS)
10811 {
10813
10814 }
10815
10816 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10817 {
10820
10821
10822 }
10823
10824 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10825 {
10828 }
10829
10830 else if (action_id ==
EActions.MAKE_SPECIAL)
10831 {
10832 auto debugParams = DebugSpawnParams.WithPlayer(player);
10833 OnDebugSpawnEx(debugParams);
10834 }
10835
10836 }
10837
10838
10839 return false;
10840 }
10841
10842
10843
10844
10848
10851
10852
10853
10855 {
10856 return false;
10857 }
10858
10859
10861 {
10862 return true;
10863 }
10864
10865
10867 {
10868 return true;
10869 }
10870
10871
10872
10874 {
10875 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10877 }
10878
10881 {
10882 return null;
10883 }
10884
10886 {
10887 return false;
10888 }
10889
10891 {
10892 return false;
10893 }
10894
10898
10899
10901 {
10902 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10903 return module_repairing.CanRepair(this, item_repair_kit);
10904 }
10905
10906
10907 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10908 {
10909 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10910 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10911 }
10912
10913
10915 {
10916
10917
10918
10919
10920
10921
10922
10923
10924 return 1;
10925 }
10926
10927
10928
10930 {
10932 }
10933
10934
10935
10937 {
10939 }
10940
10941
10950 {
10951 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10952
10953 if (player)
10954 {
10955 player.MessageStatus(text);
10956 }
10957 }
10958
10959
10968 {
10969 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10970
10971 if (player)
10972 {
10973 player.MessageAction(text);
10974 }
10975 }
10976
10977
10986 {
10987 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10988
10989 if (player)
10990 {
10991 player.MessageFriendly(text);
10992 }
10993 }
10994
10995
11004 {
11005 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11006
11007 if (player)
11008 {
11009 player.MessageImportant(text);
11010 }
11011 }
11012
11014 {
11015 return true;
11016 }
11017
11018
11019 override bool KindOf(
string tag)
11020 {
11021 bool found = false;
11022 string item_name = this.
GetType();
11025
11026 int array_size = item_tag_array.Count();
11027 for (int i = 0; i < array_size; i++)
11028 {
11029 if (item_tag_array.Get(i) == tag)
11030 {
11031 found = true;
11032 break;
11033 }
11034 }
11035 return found;
11036 }
11037
11038
11040 {
11041
11042 super.OnRPC(sender, rpc_type,ctx);
11043
11044
11045 switch (rpc_type)
11046 {
11047 #ifndef SERVER
11048 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11049 Param2<bool, string> p = new Param2<bool, string>(false, "");
11050
11052 return;
11053
11054 bool play = p.param1;
11055 string soundSet = p.param2;
11056
11057 if (play)
11058 {
11060 {
11062 {
11064 }
11065 }
11066 else
11067 {
11069 }
11070 }
11071 else
11072 {
11074 }
11075
11076 break;
11077 #endif
11078
11079 }
11080
11082 {
11084 }
11085 }
11086
11087
11088
11089
11091 {
11092 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11093 return plugin.GetID(
name);
11094 }
11095
11097 {
11098 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11099 return plugin.GetName(id);
11100 }
11101
11104 {
11105
11106
11107 int varFlags;
11108 if (!ctx.
Read(varFlags))
11109 return;
11110
11111 if (varFlags & ItemVariableFlags.FLOAT)
11112 {
11114 }
11115 }
11116
11118 {
11119
11120 super.SerializeNumericalVars(floats_out);
11121
11122
11123
11125 {
11127 }
11128
11130 {
11132 }
11133
11135 {
11137 }
11138
11140 {
11145 }
11146
11148 {
11150 }
11151 }
11152
11154 {
11155
11156 super.DeSerializeNumericalVars(floats);
11157
11158
11159 int index = 0;
11160 int mask = Math.Round(floats.Get(index));
11161
11162 index++;
11163
11165 {
11167 {
11169 }
11170 else
11171 {
11172 float quantity = floats.Get(index);
11173 SetQuantity(quantity,
true,
false,
false,
false);
11174 }
11175 index++;
11176 }
11177
11179 {
11180 float wet = floats.Get(index);
11182 index++;
11183 }
11184
11186 {
11187 int liquidtype = Math.Round(floats.Get(index));
11189 index++;
11190 }
11191
11193 {
11195 index++;
11197 index++;
11199 index++;
11201 index++;
11202 }
11203
11205 {
11206 int cleanness = Math.Round(floats.Get(index));
11208 index++;
11209 }
11210 }
11211
11213 {
11214 super.WriteVarsToCTX(ctx);
11215
11216
11218 {
11220 }
11221
11223 {
11225 }
11226
11228 {
11230 }
11231
11233 {
11234 int r,g,b,a;
11240 }
11241
11243 {
11245 }
11246 }
11247
11249 {
11250 if (!super.ReadVarsFromCTX(ctx,version))
11251 return false;
11252
11253 int intValue;
11254 float value;
11255
11256 if (version < 140)
11257 {
11258 if (!ctx.
Read(intValue))
11259 return false;
11260
11261 m_VariablesMask = intValue;
11262 }
11263
11265 {
11266 if (!ctx.
Read(value))
11267 return false;
11268
11270 {
11272 }
11273 else
11274 {
11276 }
11277 }
11278
11279 if (version < 140)
11280 {
11282 {
11283 if (!ctx.
Read(value))
11284 return false;
11285 SetTemperatureDirect(value);
11286 }
11287 }
11288
11290 {
11291 if (!ctx.
Read(value))
11292 return false;
11294 }
11295
11297 {
11298 if (!ctx.
Read(intValue))
11299 return false;
11301 }
11302
11304 {
11305 int r,g,b,a;
11307 return false;
11309 return false;
11311 return false;
11313 return false;
11314
11316 }
11317
11319 {
11320 if (!ctx.
Read(intValue))
11321 return false;
11323 }
11324
11325 if (version >= 138 && version < 140)
11326 {
11328 {
11329 if (!ctx.
Read(intValue))
11330 return false;
11331 SetFrozen(intValue);
11332 }
11333 }
11334
11335 return true;
11336 }
11337
11338
11340 {
11343 {
11345 }
11346
11347 if (!super.OnStoreLoad(ctx, version))
11348 {
11350 return false;
11351 }
11352
11353 if (version >= 114)
11354 {
11355 bool hasQuickBarIndexSaved;
11356
11357 if (!ctx.
Read(hasQuickBarIndexSaved))
11358 {
11360 return false;
11361 }
11362
11363 if (hasQuickBarIndexSaved)
11364 {
11365 int itmQBIndex;
11366
11367
11368 if (!ctx.
Read(itmQBIndex))
11369 {
11371 return false;
11372 }
11373
11374 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11375 if (itmQBIndex != -1 && parentPlayer)
11376 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11377 }
11378 }
11379 else
11380 {
11381
11382 PlayerBase player;
11383 int itemQBIndex;
11384 if (version ==
int.
MAX)
11385 {
11386 if (!ctx.
Read(itemQBIndex))
11387 {
11389 return false;
11390 }
11391 }
11392 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11393 {
11394
11395 if (!ctx.
Read(itemQBIndex))
11396 {
11398 return false;
11399 }
11400 if (itemQBIndex != -1 && player)
11401 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11402 }
11403 }
11404
11405 if (version < 140)
11406 {
11407
11408 if (!LoadVariables(ctx, version))
11409 {
11411 return false;
11412 }
11413 }
11414
11415
11417 {
11419 return false;
11420 }
11421 if (version >= 132)
11422 {
11424 if (raib)
11425 {
11427 {
11429 return false;
11430 }
11431 }
11432 }
11433
11435 return true;
11436 }
11437
11438
11439
11441 {
11442 super.OnStoreSave(ctx);
11443
11444 PlayerBase player;
11445 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11446 {
11448
11449 int itemQBIndex = -1;
11450 itemQBIndex = player.FindQuickBarEntityIndex(this);
11451 ctx.
Write(itemQBIndex);
11452 }
11453 else
11454 {
11456 }
11457
11459
11461 if (raib)
11462 {
11464 }
11465 }
11466
11467
11469 {
11470 super.AfterStoreLoad();
11471
11473 {
11475 }
11476
11478 {
11481 }
11482 }
11483
11485 {
11486 super.EEOnAfterLoad();
11487
11489 {
11491 }
11492
11495 }
11496
11498 {
11499 return false;
11500 }
11501
11502
11503
11505 {
11507 {
11508 #ifdef PLATFORM_CONSOLE
11509
11511 {
11513 if (menu)
11514 {
11516 }
11517 }
11518 #endif
11519 }
11520
11522 {
11525 }
11526
11528 {
11529 SetWeightDirty();
11531 }
11533 {
11536 }
11537
11539 {
11542 }
11544 {
11547 }
11548
11549 super.OnVariablesSynchronized();
11550 }
11551
11552
11553
11555 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11556 {
11557 if (!IsServerCheck(allow_client))
11558 return false;
11559
11561 return false;
11562
11565
11566 if (value <= (min + 0.001))
11567 value = min;
11568
11569 if (value == min)
11570 {
11571 if (destroy_config)
11572 {
11573 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11574 if (dstr)
11575 {
11577 this.Delete();
11578 return true;
11579 }
11580 }
11581 else if (destroy_forced)
11582 {
11584 this.Delete();
11585 return true;
11586 }
11587
11589 }
11590
11593
11595 {
11597
11598 if (delta)
11600 }
11601
11603
11604 return false;
11605 }
11606
11607
11609 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11610 {
11612 }
11613
11615 {
11618 }
11619
11621 {
11624 }
11625
11627 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11628 {
11629 float value_clamped = Math.Clamp(value, 0, 1);
11631 SetQuantity(result, destroy_config, destroy_forced);
11632 }
11633
11634
11637 {
11639 }
11640
11642 {
11644 }
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11656 {
11657 int slot = -1;
11658 if (GetInventory())
11659 {
11660 InventoryLocation il = new InventoryLocation;
11661 GetInventory().GetCurrentInventoryLocation(il);
11663 }
11664
11666 }
11667
11669 {
11670 float quantity_max = 0;
11671
11673 {
11674 if (attSlotID != -1)
11675 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11676
11677 if (quantity_max <= 0)
11679 }
11680
11681 if (quantity_max <= 0)
11683
11684 return quantity_max;
11685 }
11686
11688 {
11690 }
11691
11693 {
11695 }
11696
11697
11699 {
11701 }
11702
11704 {
11706 }
11707
11709 {
11711 }
11712
11713
11715 {
11716
11717 float weightEx = GetWeightEx();
11718 float special = GetInventoryAndCargoWeight();
11719 return weightEx - special;
11720 }
11721
11722
11724 {
11726 }
11727
11729 {
11731 {
11732 #ifdef DEVELOPER
11733 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11734 {
11735 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11737 }
11738 #endif
11739
11740 return GetQuantity() * GetConfigWeightModified();
11741 }
11742 else if (HasEnergyManager())
11743 {
11744 #ifdef DEVELOPER
11745 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11746 {
11747 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11748 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11749 }
11750 #endif
11751 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11752 }
11753 else
11754 {
11755 #ifdef DEVELOPER
11756 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11757 {
11758 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11759 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11760 }
11761 #endif
11762 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11763 }
11764 }
11765
11768 {
11769 int item_count = 0;
11771
11772 if (GetInventory().GetCargo() != NULL)
11773 {
11774 item_count = GetInventory().GetCargo().GetItemCount();
11775 }
11776
11777 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11778 {
11779 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11780 if (item)
11781 item_count += item.GetNumberOfItems();
11782 }
11783 return item_count;
11784 }
11785
11788 {
11789 float weight = 0;
11790 float wetness = 1;
11791 if (include_wetness)
11794 {
11795 weight = wetness * m_ConfigWeight;
11796 }
11798 {
11799 weight = 1;
11800 }
11801 return weight;
11802 }
11803
11804
11805
11807 {
11808 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11809 {
11810 GameInventory inv = GetInventory();
11811 array<EntityAI> items = new array<EntityAI>;
11813 for (int i = 0; i < items.Count(); i++)
11814 {
11816 if (item)
11817 {
11819 }
11820 }
11821 }
11822 }
11823
11824
11825
11826
11828 {
11829 float energy = 0;
11830 if (HasEnergyManager())
11831 {
11832 energy = GetCompEM().GetEnergy();
11833 }
11834 return energy;
11835 }
11836
11837
11839 {
11840 super.OnEnergyConsumed();
11841
11843 }
11844
11846 {
11847 super.OnEnergyAdded();
11848
11850 }
11851
11852
11854 {
11855 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11856 {
11858 {
11859 float energy_0to1 = GetCompEM().GetEnergy0To1();
11861 }
11862 }
11863 }
11864
11865
11867 {
11868 return ConfigGetFloat("heatIsolation");
11869 }
11870
11872 {
11874 }
11875
11877 {
11878 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11879 if (
GetGame().ConfigIsExisting(paramPath))
11881
11882 return 0.0;
11883 }
11884
11886 {
11887 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11888 if (
GetGame().ConfigIsExisting(paramPath))
11890
11891 return 0.0;
11892 }
11893
11894 override void SetWet(
float value,
bool allow_client =
false)
11895 {
11896 if (!IsServerCheck(allow_client))
11897 return;
11898
11901
11903
11904 m_VarWet = Math.Clamp(value, min, max);
11905
11907 {
11910 }
11911 }
11912
11913 override void AddWet(
float value)
11914 {
11916 }
11917
11919 {
11921 }
11922
11924 {
11926 }
11927
11929 {
11931 }
11932
11934 {
11936 }
11937
11939 {
11941 }
11942
11943 override void OnWetChanged(
float newVal,
float oldVal)
11944 {
11947 if (newLevel != oldLevel)
11948 {
11950 }
11951 }
11952
11954 {
11955 SetWeightDirty();
11956 }
11957
11959 {
11960 return GetWetLevelInternal(
m_VarWet);
11961 }
11962
11963
11964
11966 {
11968 }
11969
11971 {
11973 }
11974
11976 {
11978 }
11979
11981 {
11983 }
11984
11985
11986
11988 {
11989 if (ConfigIsExisting("itemModelLength"))
11990 {
11991 return ConfigGetFloat("itemModelLength");
11992 }
11993 return 0;
11994 }
11995
11997 {
11998 if (ConfigIsExisting("itemAttachOffset"))
11999 {
12000 return ConfigGetFloat("itemAttachOffset");
12001 }
12002 return 0;
12003 }
12004
12005 override void SetCleanness(
int value,
bool allow_client =
false)
12006 {
12007 if (!IsServerCheck(allow_client))
12008 return;
12009
12011
12013
12016 }
12017
12019 {
12021 }
12022
12024 {
12025 return true;
12026 }
12027
12028
12029
12030
12032 {
12034 }
12035
12037 {
12039 }
12040
12041
12042
12043
12044 override void SetColor(
int r,
int g,
int b,
int a)
12045 {
12051 }
12053 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12054 {
12059 }
12060
12062 {
12064 }
12065
12068 {
12069 int r,g,b,a;
12071 r = r/255;
12072 g = g/255;
12073 b = b/255;
12074 a = a/255;
12075 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12076 }
12077
12078
12079
12080 override void SetLiquidType(
int value,
bool allow_client =
false)
12081 {
12082 if (!IsServerCheck(allow_client))
12083 return;
12084
12089 }
12090
12092 {
12093 return ConfigGetInt("varLiquidTypeInit");
12094 }
12095
12097 {
12099 }
12100
12102 {
12104 SetFrozen(false);
12105 }
12106
12109 {
12110 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12111 }
12112
12113
12116 {
12117 PlayerBase nplayer;
12118 if (PlayerBase.CastTo(nplayer, player))
12119 {
12121
12122 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12123 }
12124 }
12125
12126
12129 {
12130 PlayerBase nplayer;
12131 if (PlayerBase.CastTo(nplayer,player))
12132 {
12133
12134 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12135
12136 }
12137
12138
12139 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12140
12141
12142 if (HasEnergyManager())
12143 {
12144 GetCompEM().UpdatePlugState();
12145 }
12146 }
12147
12148
12150 {
12151 super.OnPlacementStarted(player);
12152
12154 }
12155
12156 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12157 {
12159 {
12160 m_AdminLog.OnPlacementComplete(player,
this);
12161 }
12162
12163 super.OnPlacementComplete(player, position, orientation);
12164 }
12165
12166
12167
12168
12169
12171 {
12173 {
12174 return true;
12175 }
12176 else
12177 {
12178 return false;
12179 }
12180 }
12181
12182
12184 {
12186 {
12188 }
12189 }
12190
12191
12193 {
12195 }
12196
12198 {
12200 }
12201
12202 override void InsertAgent(
int agent,
float count = 1)
12203 {
12204 if (count < 1)
12205 return;
12206
12208 }
12209
12212 {
12214 }
12215
12216
12218 {
12220 }
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12264 {
12266 return false;
12267 return true;
12268 }
12269
12271 {
12272
12274 }
12275
12276
12279 {
12280 super.CheckForRoofLimited(timeTresholdMS);
12281
12283 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12284 {
12285 m_PreviousRoofTestTime = time;
12286 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12287 }
12288 }
12289
12290
12292 {
12294 {
12295 return 0;
12296 }
12297
12298 if (GetInventory().GetAttachmentSlotsCount() != 0)
12299 {
12300 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12301 if (filter)
12302 return filter.GetProtectionLevel(type, false, system);
12303 else
12304 return 0;
12305 }
12306
12307 string subclassPath, entryName;
12308
12309 switch (type)
12310 {
12312 entryName = "biological";
12313 break;
12315 entryName = "chemical";
12316 break;
12317 default:
12318 entryName = "biological";
12319 break;
12320 }
12321
12322 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12323
12325 }
12326
12327
12328
12331 {
12332 if (!IsMagazine())
12334
12336 }
12337
12338
12339
12340
12341
12346 {
12347 return true;
12348 }
12349
12351 {
12353 }
12354
12355
12356
12357
12358
12360 {
12361 if (parent)
12362 {
12363 if (parent.IsInherited(DayZInfected))
12364 return true;
12365
12366 if (!parent.IsRuined())
12367 return true;
12368 }
12369
12370 return true;
12371 }
12372
12374 {
12375 if (!super.CanPutAsAttachment(parent))
12376 {
12377 return false;
12378 }
12379
12380 if (!IsRuined() && !parent.IsRuined())
12381 {
12382 return true;
12383 }
12384
12385 return false;
12386 }
12387
12389 {
12390
12391
12392
12393
12394 return super.CanReceiveItemIntoCargo(item);
12395 }
12396
12398 {
12399
12400
12401
12402
12403 GameInventory attachmentInv = attachment.GetInventory();
12405 {
12406 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12407 return false;
12408 }
12409
12410 InventoryLocation loc = new InventoryLocation();
12411 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12412 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12413 return false;
12414
12415 return super.CanReceiveAttachment(attachment, slotId);
12416 }
12417
12419 {
12420 if (!super.CanReleaseAttachment(attachment))
12421 return false;
12422
12423 return GetInventory().AreChildrenAccessible();
12424 }
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12447 {
12448 int id = muzzle_owner.GetMuzzleID();
12449 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12450
12451 if (WPOF_array)
12452 {
12453 for (int i = 0; i < WPOF_array.Count(); i++)
12454 {
12455 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12456
12457 if (WPOF)
12458 {
12459 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12460 }
12461 }
12462 }
12463 }
12464
12465
12467 {
12468 int id = muzzle_owner.GetMuzzleID();
12470
12471 if (WPOBE_array)
12472 {
12473 for (int i = 0; i < WPOBE_array.Count(); i++)
12474 {
12475 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12476
12477 if (WPOBE)
12478 {
12479 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12480 }
12481 }
12482 }
12483 }
12484
12485
12487 {
12488 int id = muzzle_owner.GetMuzzleID();
12489 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12490
12491 if (WPOOH_array)
12492 {
12493 for (int i = 0; i < WPOOH_array.Count(); i++)
12494 {
12495 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12496
12497 if (WPOOH)
12498 {
12499 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12500 }
12501 }
12502 }
12503 }
12504
12505
12507 {
12508 int id = muzzle_owner.GetMuzzleID();
12509 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12510
12511 if (WPOOH_array)
12512 {
12513 for (int i = 0; i < WPOOH_array.Count(); i++)
12514 {
12515 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12516
12517 if (WPOOH)
12518 {
12519 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12520 }
12521 }
12522 }
12523 }
12524
12525
12527 {
12528 int id = muzzle_owner.GetMuzzleID();
12529 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12530
12531 if (WPOOH_array)
12532 {
12533 for (int i = 0; i < WPOOH_array.Count(); i++)
12534 {
12535 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12536
12537 if (WPOOH)
12538 {
12539 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12540 }
12541 }
12542 }
12543 }
12544
12545
12546
12548 {
12550 {
12551 return true;
12552 }
12553
12554 return false;
12555 }
12556
12558 {
12560 {
12561 return true;
12562 }
12563
12564 return false;
12565 }
12566
12568 {
12570 {
12571 return true;
12572 }
12573
12574 return false;
12575 }
12576
12578 {
12579 return false;
12580 }
12581
12584 {
12585 return UATimeSpent.DEFAULT_DEPLOY;
12586 }
12587
12588
12589
12590
12592 {
12594 SetSynchDirty();
12595 }
12596
12598 {
12600 }
12601
12602
12604 {
12605 return false;
12606 }
12607
12610 {
12611 string att_type = "None";
12612
12613 if (ConfigIsExisting("soundAttType"))
12614 {
12615 att_type = ConfigGetString("soundAttType");
12616 }
12617
12619 }
12620
12622 {
12624 }
12625
12626
12627
12628
12629
12635
12637 {
12640
12642 }
12643
12644
12646 {
12648 return;
12649
12651
12654
12657
12658 SoundParameters params = new SoundParameters();
12662 }
12663
12664
12666 {
12668 return;
12669
12671 SetSynchDirty();
12672
12675 }
12676
12677
12679 {
12681 return;
12682
12684 SetSynchDirty();
12685
12688 }
12689
12691 {
12693 }
12694
12696 {
12698 }
12699
12702 {
12703 if (!
GetGame().IsDedicatedServer())
12704 {
12705 if (ConfigIsExisting("attachSoundSet"))
12706 {
12707 string cfg_path = "";
12708 string soundset = "";
12709 string type_name =
GetType();
12710
12713 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12714 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12715
12716 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12717 {
12718 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12719 {
12720 if (cfg_slot_array[i] == slot_type)
12721 {
12722 soundset = cfg_soundset_array[i];
12723 break;
12724 }
12725 }
12726 }
12727
12728 if (soundset != "")
12729 {
12730 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12732 }
12733 }
12734 }
12735 }
12736
12738 {
12739
12740 }
12741
12742 void OnApply(PlayerBase player);
12743
12745 {
12746 return 1.0;
12747 };
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12760
12762 {
12763 SetDynamicPhysicsLifeTime(0.01);
12765 }
12766
12768 {
12769 array<string> zone_names = new array<string>;
12770 GetDamageZones(zone_names);
12771 for (int i = 0; i < zone_names.Count(); i++)
12772 {
12773 SetHealthMax(zone_names.Get(i),"Health");
12774 }
12775 SetHealthMax("","Health");
12776 }
12777
12780 {
12781 float global_health = GetHealth01("","Health");
12782 array<string> zones = new array<string>;
12783 GetDamageZones(zones);
12784
12785 for (int i = 0; i < zones.Count(); i++)
12786 {
12787 SetHealth01(zones.Get(i),"Health",global_health);
12788 }
12789 }
12790
12793 {
12794 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12795 }
12796
12798 {
12799 if (!hasRootAsPlayer)
12800 {
12801 if (refParentIB)
12802 {
12803
12804 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12805 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12806
12807 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12808 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12809
12812 }
12813 else
12814 {
12815
12818 }
12819 }
12820 }
12821
12823 {
12825 {
12826 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12827 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12828 {
12829 float heatPermCoef = 1.0;
12831 while (ent)
12832 {
12833 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12834 ent = ent.GetHierarchyParent();
12835 }
12836
12837 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12838 }
12839 }
12840 }
12841
12843 {
12844
12845 EntityAI parent = GetHierarchyParent();
12846 if (!parent)
12847 {
12848 hasParent = false;
12849 hasRootAsPlayer = false;
12850 }
12851 else
12852 {
12853 hasParent = true;
12854 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12855 refParentIB =
ItemBase.Cast(parent);
12856 }
12857 }
12858
12859 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12860 {
12861
12862 }
12863
12865 {
12866
12867 return false;
12868 }
12869
12871 {
12872
12873
12874 return false;
12875 }
12876
12878 {
12879
12880 return false;
12881 }
12882
12885 {
12886 return !GetIsFrozen() &&
IsOpen();
12887 }
12888
12890 {
12891 bool hasParent = false, hasRootAsPlayer = false;
12893
12894 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12895 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12896
12897 if (wwtu || foodDecay)
12898 {
12902
12903 if (processWetness || processTemperature || processDecay)
12904 {
12906
12907 if (processWetness)
12908 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12909
12910 if (processTemperature)
12912
12913 if (processDecay)
12914 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12915 }
12916 }
12917 }
12918
12921 {
12923 }
12924
12926 {
12929
12930 return super.GetTemperatureFreezeThreshold();
12931 }
12932
12934 {
12937
12938 return super.GetTemperatureThawThreshold();
12939 }
12940
12942 {
12945
12946 return super.GetItemOverheatThreshold();
12947 }
12948
12950 {
12952 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12953
12954 return super.GetTemperatureFreezeTime();
12955 }
12956
12958 {
12960 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12961
12962 return super.GetTemperatureThawTime();
12963 }
12964
12969
12971 {
12972 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12973 }
12974
12976 {
12977 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12978 }
12979
12982 {
12984 }
12985
12987 {
12989 }
12990
12992 {
12994 }
12995
12998 {
12999 return null;
13000 }
13001
13004 {
13005 return false;
13006 }
13007
13009 {
13011 {
13014 if (!trg)
13015 {
13017 explosive = this;
13018 }
13019
13020 explosive.PairRemote(trg);
13022
13023 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13024 trg.SetPersistentPairID(persistentID);
13025 explosive.SetPersistentPairID(persistentID);
13026
13027 return true;
13028 }
13029 return false;
13030 }
13031
13034 {
13035 float ret = 1.0;
13038 ret *= GetHealth01();
13039
13040 return ret;
13041 }
13042
13043 #ifdef DEVELOPER
13044 override void SetDebugItem()
13045 {
13046 super.SetDebugItem();
13047 _itemBase = this;
13048 }
13049
13051 {
13052 string text = super.GetDebugText();
13053
13055 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13056
13057 return text;
13058 }
13059 #endif
13060
13062 {
13063 return true;
13064 }
13065
13067
13069
13071 {
13074 }
13075
13076
13084
13100}
13101
13103{
13105 if (entity)
13106 {
13107 bool is_item = entity.IsInherited(
ItemBase);
13108 if (is_item && full_quantity)
13109 {
13112 }
13113 }
13114 else
13115 {
13117 return NULL;
13118 }
13119 return entity;
13120}
13121
13123{
13124 if (item)
13125 {
13126 if (health > 0)
13127 item.SetHealth("", "", health);
13128
13129 if (item.CanHaveTemperature())
13130 {
13132 if (item.CanFreeze())
13133 item.SetFrozen(false);
13134 }
13135
13136 if (item.HasEnergyManager())
13137 {
13138 if (quantity >= 0)
13139 {
13140 item.GetCompEM().SetEnergy0To1(quantity);
13141 }
13142 else
13143 {
13145 }
13146 }
13147 else if (item.IsMagazine())
13148 {
13149 Magazine mag = Magazine.Cast(item);
13150 if (quantity >= 0)
13151 {
13152 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13153 }
13154 else
13155 {
13157 }
13158
13159 }
13160 else
13161 {
13162 if (quantity >= 0)
13163 {
13164 item.SetQuantityNormalized(quantity, false);
13165 }
13166 else
13167 {
13169 }
13170
13171 }
13172 }
13173}
13174
13175#ifdef DEVELOPER
13177#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.