8305{
8307 {
8308 return true;
8309 }
8310};
8311
8312
8313
8315{
8319
8321
8324
8325
8326
8327
8328
8337
8343
8348
8353
8374 protected bool m_IsResultOfSplit
8375
8377
8382
8383
8384
8386
8390
8391
8392
8394
8397
8398
8399
8405
8406
8414
8417
8418
8420
8421
8423
8424
8429
8430
8435
8436
8438
8439
8441 {
8446
8447 if (!
GetGame().IsDedicatedServer())
8448 {
8450 {
8452
8454 {
8456 }
8457 }
8458
8461 }
8462
8463 m_OldLocation = null;
8464
8466 {
8468 }
8469
8470 if (ConfigIsExisting("headSelectionsToHide"))
8471 {
8474 }
8475
8477 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8478 {
8480 }
8481
8483
8484 m_IsResultOfSplit = false;
8485
8487 }
8488
8490 {
8491 super.InitItemVariables();
8492
8498 m_Count = ConfigGetInt(
"count");
8499
8502
8507
8510
8515
8527
8531
8532
8535 if (ConfigIsExisting("canBeSplit"))
8536 {
8539 }
8540
8542 if (ConfigIsExisting("itemBehaviour"))
8544
8545
8548 RegisterNetSyncVariableInt("m_VarLiquidType");
8549 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8550
8551 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8552 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8553 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8554
8555 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8556 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8557 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8558 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8559
8560 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8561 RegisterNetSyncVariableBool("m_IsTakeable");
8562 RegisterNetSyncVariableBool("m_IsHologram");
8563
8566 {
8569 }
8570
8572
8574 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8576
8577 }
8578
8580 {
8582 }
8583
8585 {
8588 {
8593 }
8594 }
8595
8596 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8597 {
8599 {
8602 }
8603
8605 }
8606
8608 {
8614 }
8615
8617
8619 {
8621
8622 if (!action)
8623 {
8624 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8625 return;
8626 }
8627
8629 if (!ai)
8630 {
8632 return;
8633 }
8634
8636 if (!action_array)
8637 {
8638 action_array = new array<ActionBase_Basic>;
8640 }
8641 if (LogManager.IsActionLogEnable())
8642 {
8643 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8644 }
8645
8646 if (action_array.Find(action) != -1)
8647 {
8648 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8649 }
8650 else
8651 {
8652 action_array.Insert(action);
8653 }
8654 }
8655
8657 {
8659 ActionBase action = player.GetActionManager().GetAction(actionName);
8662
8663 if (action_array)
8664 {
8665 action_array.RemoveItem(action);
8666 }
8667 }
8668
8669
8670
8672 {
8673 ActionOverrideData overrideData = new ActionOverrideData();
8677
8679 if (!actionMap)
8680 {
8683 }
8684
8685 actionMap.Insert(this.
Type(), overrideData);
8686
8687 }
8688
8690
8692
8693
8695 {
8698
8701
8702 string config_to_search = "CfgVehicles";
8703 string muzzle_owner_config;
8704
8706 {
8707 if (IsInherited(Weapon))
8708 config_to_search = "CfgWeapons";
8709
8710 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8711
8712 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8713
8715
8716 if (config_OnFire_subclass_count > 0)
8717 {
8718 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8719
8720 for (int i = 0; i < config_OnFire_subclass_count; i++)
8721 {
8722 string particle_class = "";
8724 string config_OnFire_entry = config_OnFire_class + particle_class;
8725 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8726 WPOF_array.Insert(WPOF);
8727 }
8728
8729
8731 }
8732 }
8733
8735 {
8736 config_to_search = "CfgWeapons";
8737 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8738
8739 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8740
8742
8743 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8744 {
8745 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8746
8747 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8748 {
8749 string particle_class2 = "";
8751 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8752 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8753 WPOBE_array.Insert(WPOBE);
8754 }
8755
8756
8758 }
8759 }
8760 }
8761
8762
8764 {
8767
8769 {
8770 string config_to_search = "CfgVehicles";
8771
8772 if (IsInherited(Weapon))
8773 config_to_search = "CfgWeapons";
8774
8775 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8776 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8777
8778 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8779 {
8780
8782
8784 {
8786 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8788 return;
8789 }
8790
8793
8794
8795
8797 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8798
8799 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8800 {
8801 string particle_class = "";
8803 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8805
8806 if (entry_type == CT_CLASS)
8807 {
8808 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8809 WPOOH_array.Insert(WPOF);
8810 }
8811 }
8812
8813
8815 }
8816 }
8817 }
8818
8820 {
8822 }
8823
8825 {
8827 {
8829
8832
8835
8836 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8837 }
8838 }
8839
8841 {
8843 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8844
8846 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8847
8849 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8850
8852 {
8854 }
8855 }
8856
8858 {
8860 }
8861
8863 {
8866 else
8868
8870 {
8873 }
8874 else
8875 {
8878
8881 }
8882
8884 }
8885
8887 {
8889 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8890 }
8891
8893 {
8895 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8897 }
8898
8900 {
8902 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8903 }
8904
8906 {
8909
8910 OverheatingParticle OP = new OverheatingParticle();
8915
8917 }
8918
8920 {
8923
8924 return -1;
8925 }
8926
8928 {
8930 {
8933
8934 for (int i = count; i > 0; --i)
8935 {
8936 int id = i - 1;
8939
8942
8943 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8944 {
8945 if (p)
8946 {
8949 }
8950 }
8951 }
8952 }
8953 }
8954
8956 {
8958 {
8960 {
8961 int id = i - 1;
8963
8964 if (OP)
8965 {
8967
8968 if (p)
8969 {
8971 }
8972
8973 delete OP;
8974 }
8975 }
8976
8979 }
8980 }
8981
8984 {
8985 return 0.0;
8986 }
8987
8988
8990 {
8991 return 250;
8992 }
8993
8995 {
8996 return 0;
8997 }
8998
9001 {
9003 return true;
9004
9005 return false;
9006 }
9007
9010 {
9013
9015 {
9017 }
9018 else
9019 {
9020
9022 }
9023
9025 }
9026
9033 {
9034 return -1;
9035 }
9036
9037
9038
9039
9041 {
9043 {
9045 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9046
9047 if (r_index >= 0)
9048 {
9049 InventoryLocation r_il = new InventoryLocation;
9050 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9051
9052 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9055 {
9056 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9057 }
9059 {
9060 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9061 }
9062
9063 }
9064
9065 player.GetHumanInventory().ClearUserReservedLocation(this);
9066 }
9067
9070 }
9071
9072
9073
9074
9076 {
9077 return ItemBase.m_DebugActionsMask;
9078 }
9079
9081 {
9082 return ItemBase.m_DebugActionsMask & mask;
9083 }
9084
9086 {
9087 ItemBase.m_DebugActionsMask = mask;
9088 }
9089
9091 {
9092 ItemBase.m_DebugActionsMask |= mask;
9093 }
9094
9096 {
9097 ItemBase.m_DebugActionsMask &= ~mask;
9098 }
9099
9101 {
9103 {
9105 }
9106 else
9107 {
9109 }
9110 }
9111
9112
9114 {
9115 if (GetEconomyProfile())
9116 {
9117 float q_max = GetEconomyProfile().GetQuantityMax();
9118 if (q_max > 0)
9119 {
9120 float q_min = GetEconomyProfile().GetQuantityMin();
9121 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9122
9124 {
9125 ComponentEnergyManager comp = GetCompEM();
9127 {
9129 }
9130 }
9132 {
9134
9135 }
9136
9137 }
9138 }
9139 }
9140
9143 {
9144 EntityAI parent = GetHierarchyParent();
9145
9146 if (parent)
9147 {
9148 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9149 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9150 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9151 }
9152 }
9153
9156 {
9157 EntityAI parent = GetHierarchyParent();
9158
9159 if (parent)
9160 {
9161 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9162 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9163 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9164 }
9165 }
9166
9168 {
9169
9170
9171
9172
9174
9176 {
9177 if (ScriptInputUserData.CanStoreInputUserData())
9178 {
9179 ScriptInputUserData ctx = new ScriptInputUserData;
9185 ctx.
Write(use_stack_max);
9188
9190 {
9191 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9192 }
9193 }
9194 }
9195 else if (!
GetGame().IsMultiplayer())
9196 {
9198 }
9199 }
9200
9202 {
9204 }
9205
9207 {
9209 }
9210
9212 {
9214 }
9215
9217 {
9218
9219 return false;
9220 }
9221
9223 {
9224 return false;
9225 }
9226
9230 {
9231 return false;
9232 }
9233
9235 {
9236 return "";
9237 }
9238
9240
9242 {
9243 return false;
9244 }
9245
9247 {
9248 return true;
9249 }
9250
9251
9252
9254 {
9255 return true;
9256 }
9257
9259 {
9260 return true;
9261 }
9262
9264 {
9265 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9267 }
9268
9270 {
9272 }
9273
9275 {
9277 if (!is_being_placed)
9279 SetSynchDirty();
9280 }
9281
9282
9284
9286 {
9288 }
9289
9291 {
9293 }
9294
9296 {
9297 return 1;
9298 }
9299
9301 {
9302 return false;
9303 }
9304
9306 {
9308 SetSynchDirty();
9309 }
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9346 {
9347 super.OnMovedInsideCargo(container);
9348
9349 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9350 }
9351
9352 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9353 {
9354 super.EEItemLocationChanged(oldLoc,newLoc);
9355
9356 PlayerBase new_player = null;
9357 PlayerBase old_player = null;
9358
9359 if (newLoc.GetParent())
9360 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9361
9362 if (oldLoc.GetParent())
9363 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9364
9366 {
9367 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9368
9369 if (r_index >= 0)
9370 {
9371 InventoryLocation r_il = new InventoryLocation;
9372 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9373
9374 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9377 {
9378 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9379 }
9381 {
9382 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9383 }
9384
9385 }
9386 }
9387
9389 {
9390 if (new_player)
9391 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9392
9393 if (new_player == old_player)
9394 {
9395
9396 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9397 {
9399 {
9400 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9401 {
9402 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9403 }
9404 }
9405 else
9406 {
9407 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9408 }
9409 }
9410
9411 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9412 {
9413 int type = oldLoc.GetType();
9415 {
9416 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9417 }
9419 {
9420 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9421 }
9422 }
9423 if (!m_OldLocation)
9424 {
9425 m_OldLocation = new InventoryLocation;
9426 }
9427 m_OldLocation.Copy(oldLoc);
9428 }
9429 else
9430 {
9431 if (m_OldLocation)
9432 {
9433 m_OldLocation.Reset();
9434 }
9435 }
9436
9438 }
9439 else
9440 {
9441 if (new_player)
9442 {
9443 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9444 if (res_index >= 0)
9445 {
9446 InventoryLocation il = new InventoryLocation;
9447 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9449 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9452 {
9453 il.
GetParent().GetOnReleaseLock().Invoke(it);
9454 }
9456 {
9458 }
9459
9460 }
9461 }
9463 {
9464
9466 }
9467
9468 if (m_OldLocation)
9469 {
9470 m_OldLocation.Reset();
9471 }
9472 }
9473 }
9474
9475 override void EOnContact(IEntity other, Contact extra)
9476 {
9478 {
9479 int liquidType = -1;
9481 if (impactSpeed > 0.0)
9482 {
9484 #ifndef SERVER
9486 #else
9488 SetSynchDirty();
9489 #endif
9491 }
9492 }
9493
9494 #ifdef SERVER
9495 if (GetCompEM() && GetCompEM().IsPlugged())
9496 {
9497 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9498 GetCompEM().UnplugThis();
9499 }
9500 #endif
9501 }
9502
9504
9506 {
9508 }
9509
9511 {
9512
9513 }
9514
9516 {
9517 super.OnItemLocationChanged(old_owner, new_owner);
9518
9519 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9520 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9521
9522 if (!relatedPlayer && playerNew)
9523 relatedPlayer = playerNew;
9524
9525 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9526 {
9528 if (actionMgr)
9529 {
9530 ActionBase currentAction = actionMgr.GetRunningAction();
9531 if (currentAction)
9533 }
9534 }
9535
9536 Man ownerPlayerOld = null;
9537 Man ownerPlayerNew = null;
9538
9539 if (old_owner)
9540 {
9541 if (old_owner.
IsMan())
9542 {
9543 ownerPlayerOld = Man.Cast(old_owner);
9544 }
9545 else
9546 {
9547 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9548 }
9549 }
9550 else
9551 {
9553 {
9555
9556 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9557 {
9558 GetCompEM().UnplugThis();
9559 }
9560 }
9561 }
9562
9563 if (new_owner)
9564 {
9565 if (new_owner.
IsMan())
9566 {
9567 ownerPlayerNew = Man.Cast(new_owner);
9568 }
9569 else
9570 {
9571 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9572 }
9573 }
9574
9575 if (ownerPlayerOld != ownerPlayerNew)
9576 {
9577 if (ownerPlayerOld)
9578 {
9579 array<EntityAI> subItemsExit = new array<EntityAI>;
9581 for (int i = 0; i < subItemsExit.Count(); i++)
9582 {
9585 }
9586 }
9587
9588 if (ownerPlayerNew)
9589 {
9590 array<EntityAI> subItemsEnter = new array<EntityAI>;
9592 for (int j = 0; j < subItemsEnter.Count(); j++)
9593 {
9596 }
9597 }
9598 }
9599 else if (ownerPlayerNew != null)
9600 {
9601 PlayerBase nplayer;
9602 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9603 {
9604 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9606 for (int k = 0; k < subItemsUpdate.Count(); k++)
9607 {
9609 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9610 }
9611 }
9612 }
9613
9614 if (old_owner)
9615 old_owner.OnChildItemRemoved(this);
9616 if (new_owner)
9617 new_owner.OnChildItemReceived(this);
9618 }
9619
9620
9622 {
9623 super.EEDelete(parent);
9624 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9625 if (player)
9626 {
9628
9629 if (player.IsAlive())
9630 {
9631 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9632 if (r_index >= 0)
9633 {
9634 InventoryLocation r_il = new InventoryLocation;
9635 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9636
9637 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9640 {
9641 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9642 }
9644 {
9645 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9646 }
9647
9648 }
9649
9650 player.RemoveQuickBarEntityShortcut(this);
9651 }
9652 }
9653 }
9654
9656 {
9657 super.EEKilled(killer);
9658
9661 {
9662 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9663 {
9664 if (IsMagazine())
9665 {
9666 if (Magazine.Cast(this).GetAmmoCount() > 0)
9667 {
9669 }
9670 }
9671 else
9672 {
9674 }
9675 }
9676 }
9677 }
9678
9680 {
9681 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9682
9683 super.OnWasAttached(parent, slot_id);
9684
9687
9689 }
9690
9692 {
9693 super.OnWasDetached(parent, slot_id);
9694
9697 }
9698
9700 {
9701 int idx;
9704
9705 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9706 if (inventory_slots.Count() < 1)
9707 {
9708 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9709 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9710 }
9711 else
9712 {
9713 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9714 }
9715
9716 idx = inventory_slots.Find(slot);
9717 if (idx < 0)
9718 return "";
9719
9720 return attach_types.Get(idx);
9721 }
9722
9724 {
9725 int idx = -1;
9726 string slot;
9727
9730
9731 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9732 if (inventory_slots.Count() < 1)
9733 {
9734 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9735 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9736 }
9737 else
9738 {
9739 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9740 if (detach_types.Count() < 1)
9741 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9742 }
9743
9744 for (int i = 0; i < inventory_slots.Count(); i++)
9745 {
9746 slot = inventory_slots.Get(i);
9747 }
9748
9749 if (slot != "")
9750 {
9751 if (detach_types.Count() == 1)
9752 idx = 0;
9753 else
9754 idx = inventory_slots.Find(slot);
9755 }
9756 if (idx < 0)
9757 return "";
9758
9759 return detach_types.Get(idx);
9760 }
9761
9763 {
9764
9766
9767
9768 float min_time = 1;
9769 float max_time = 3;
9770 float delay = Math.RandomFloat(min_time, max_time);
9771
9772 explode_timer.Run(delay, this, "DoAmmoExplosion");
9773 }
9774
9776 {
9777 Magazine magazine = Magazine.Cast(this);
9778 int pop_sounds_count = 6;
9779 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9780
9781
9782 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9783 string sound_name = pop_sounds[ sound_idx ];
9785
9786
9787 magazine.ServerAddAmmoCount(-1);
9788
9789
9790 float min_temp_to_explode = 100;
9791
9792 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9793 {
9795 }
9796 }
9797
9798
9799 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9800 {
9801 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9802
9803 const int CHANCE_DAMAGE_CARGO = 4;
9804 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9805 const int CHANCE_DAMAGE_NOTHING = 2;
9806
9808 {
9809 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9810 int chances;
9811 int rnd;
9812
9813 if (GetInventory().GetCargo())
9814 {
9815 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9816 rnd = Math.RandomInt(0,chances);
9817
9818 if (rnd < CHANCE_DAMAGE_CARGO)
9819 {
9821 }
9822 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9823 {
9825 }
9826 }
9827 else
9828 {
9829 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9830 rnd = Math.RandomInt(0,chances);
9831
9832 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9833 {
9835 }
9836 }
9837 }
9838 }
9839
9841 {
9842 if (GetInventory().GetCargo())
9843 {
9844 int item_count = GetInventory().GetCargo().GetItemCount();
9845 if (item_count > 0)
9846 {
9847 int random_pick = Math.RandomInt(0, item_count);
9849 if (!item.IsExplosive())
9850 {
9851 item.AddHealth("","",damage);
9852 return true;
9853 }
9854 }
9855 }
9856 return false;
9857 }
9858
9860 {
9861 int attachment_count = GetInventory().AttachmentCount();
9862 if (attachment_count > 0)
9863 {
9864 int random_pick = Math.RandomInt(0, attachment_count);
9865 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9866 if (!attachment.IsExplosive())
9867 {
9868 attachment.AddHealth("","",damage);
9869 return true;
9870 }
9871 }
9872 return false;
9873 }
9874
9876 {
9878 }
9879
9881 {
9883 return GetInventory().CanRemoveEntity();
9884
9885 return false;
9886 }
9887
9889 {
9890
9892 return false;
9893
9894
9896 return false;
9897
9898
9899
9901 if (delta == 0)
9902 return false;
9903
9904
9905 return true;
9906 }
9907
9909 {
9911 {
9912 if (ScriptInputUserData.CanStoreInputUserData())
9913 {
9914 ScriptInputUserData ctx = new ScriptInputUserData;
9919 ctx.
Write(destination_entity);
9923 }
9924 }
9925 else if (!
GetGame().IsMultiplayer())
9926 {
9928 }
9929 }
9930
9932 {
9933 float split_quantity_new;
9937 InventoryLocation loc = new InventoryLocation;
9938
9939 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9940 {
9942 split_quantity_new = stack_max;
9943 else
9945
9947 {
9948 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9949 if (new_item)
9950 {
9951 new_item.SetResultOfSplit(true);
9952 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9954 new_item.
SetQuantity(split_quantity_new,
false,
true);
9955 }
9956 }
9957 }
9958 else if (destination_entity && slot_id == -1)
9959 {
9960 if (quantity > stack_max)
9961 split_quantity_new = stack_max;
9962 else
9963 split_quantity_new = quantity;
9964
9966 {
9968 {
9971 }
9972
9973 if (new_item)
9974 {
9975 new_item.SetResultOfSplit(true);
9976 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9978 new_item.
SetQuantity(split_quantity_new,
false,
true);
9979 }
9980 }
9981 }
9982 else
9983 {
9984 if (stack_max != 0)
9985 {
9987 {
9989 }
9990
9991 if (split_quantity_new == 0)
9992 {
9993 if (!
GetGame().IsMultiplayer())
9994 player.PhysicalPredictiveDropItem(this);
9995 else
9996 player.ServerDropEntity(this);
9997 return;
9998 }
9999
10001 {
10003
10004 if (new_item)
10005 {
10006 new_item.SetResultOfSplit(true);
10007 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10010 new_item.PlaceOnSurface();
10011 }
10012 }
10013 }
10014 }
10015 }
10016
10018 {
10019 float split_quantity_new;
10023 InventoryLocation loc = new InventoryLocation;
10024
10025 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10026 {
10028 split_quantity_new = stack_max;
10029 else
10031
10033 {
10034 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10035 if (new_item)
10036 {
10037 new_item.SetResultOfSplit(true);
10038 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10040 new_item.
SetQuantity(split_quantity_new,
false,
true);
10041 }
10042 }
10043 }
10044 else if (destination_entity && slot_id == -1)
10045 {
10046 if (quantity > stack_max)
10047 split_quantity_new = stack_max;
10048 else
10049 split_quantity_new = quantity;
10050
10052 {
10054 {
10057 }
10058
10059 if (new_item)
10060 {
10061 new_item.SetResultOfSplit(true);
10062 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10064 new_item.
SetQuantity(split_quantity_new,
false,
true);
10065 }
10066 }
10067 }
10068 else
10069 {
10070 if (stack_max != 0)
10071 {
10073 {
10075 }
10076
10078 {
10080
10081 if (new_item)
10082 {
10083 new_item.SetResultOfSplit(true);
10084 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10087 new_item.PlaceOnSurface();
10088 }
10089 }
10090 }
10091 }
10092 }
10093
10095 {
10097 {
10098 if (ScriptInputUserData.CanStoreInputUserData())
10099 {
10100 ScriptInputUserData ctx = new ScriptInputUserData;
10105 dst.WriteToContext(ctx);
10107 }
10108 }
10109 else if (!
GetGame().IsMultiplayer())
10110 {
10112 }
10113 }
10114
10116 {
10118 {
10119 if (ScriptInputUserData.CanStoreInputUserData())
10120 {
10121 ScriptInputUserData ctx = new ScriptInputUserData;
10126 ctx.
Write(destination_entity);
10132 }
10133 }
10134 else if (!
GetGame().IsMultiplayer())
10135 {
10137 }
10138 }
10139
10141 {
10143 }
10144
10146 {
10148 float split_quantity_new;
10150 if (dst.IsValid())
10151 {
10152 int slot_id = dst.GetSlot();
10154
10155 if (quantity > stack_max)
10156 split_quantity_new = stack_max;
10157 else
10158 split_quantity_new = quantity;
10159
10161 {
10163
10164 if (new_item)
10165 {
10166 new_item.SetResultOfSplit(true);
10167 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10169 new_item.
SetQuantity(split_quantity_new,
false,
true);
10170 }
10171
10172 return new_item;
10173 }
10174 }
10175
10176 return null;
10177 }
10178
10180 {
10182 float split_quantity_new;
10184 if (destination_entity)
10185 {
10187 if (quantity > stackable)
10188 split_quantity_new = stackable;
10189 else
10190 split_quantity_new = quantity;
10191
10193 {
10194 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10195 if (new_item)
10196 {
10197 new_item.SetResultOfSplit(true);
10198 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10200 new_item.
SetQuantity(split_quantity_new,
false,
true);
10201 }
10202 }
10203 }
10204 }
10205
10207 {
10209 {
10210 if (ScriptInputUserData.CanStoreInputUserData())
10211 {
10212 ScriptInputUserData ctx = new ScriptInputUserData;
10217 ItemBase destination_entity =
this;
10218 ctx.
Write(destination_entity);
10222 }
10223 }
10224 else if (!
GetGame().IsMultiplayer())
10225 {
10227 }
10228 }
10229
10231 {
10233 float split_quantity_new;
10235 if (player)
10236 {
10238 if (quantity > stackable)
10239 split_quantity_new = stackable;
10240 else
10241 split_quantity_new = quantity;
10242
10244 {
10245 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10246 new_item =
ItemBase.Cast(in_hands);
10247 if (new_item)
10248 {
10249 new_item.SetResultOfSplit(true);
10250 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10252 new_item.SetQuantity(split_quantity_new, false, true);
10253 }
10254 }
10255 }
10256 }
10257
10259 {
10261 float split_quantity_new = Math.Floor(quantity * 0.5);
10262
10264 return;
10265
10267
10268 if (new_item)
10269 {
10270 if (new_item.GetQuantityMax() < split_quantity_new)
10271 {
10272 split_quantity_new = new_item.GetQuantityMax();
10273 }
10274
10275 new_item.SetResultOfSplit(true);
10276 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10277
10279 {
10282 }
10283 else
10284 {
10286 new_item.
SetQuantity(split_quantity_new,
false,
true);
10287 }
10288 }
10289 }
10290
10292 {
10294 float split_quantity_new = Math.Floor(quantity / 2);
10295
10297 return;
10298
10299 InventoryLocation invloc = new InventoryLocation;
10301
10303 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10304
10305 if (new_item)
10306 {
10307 if (new_item.GetQuantityMax() < split_quantity_new)
10308 {
10309 split_quantity_new = new_item.GetQuantityMax();
10310 }
10312 {
10315 }
10316 else if (split_quantity_new > 1)
10317 {
10319 new_item.
SetQuantity(split_quantity_new,
false,
true);
10320 }
10321 }
10322 }
10323
10326 {
10327 SetWeightDirty();
10329
10330 if (parent)
10331 parent.OnAttachmentQuantityChangedEx(this, delta);
10332
10334 {
10336 {
10338 }
10340 {
10341 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10343 }
10344 }
10345
10346 }
10347
10350 {
10351
10352 }
10353
10356 {
10358 }
10359
10361 {
10362 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10363
10365 {
10366 if (newLevel == GameConstants.STATE_RUINED)
10367 {
10369 EntityAI parent = GetHierarchyParent();
10370 if (parent && parent.IsFireplace())
10371 {
10372 CargoBase cargo = GetInventory().GetCargo();
10373 if (cargo)
10374 {
10376 {
10378 }
10379 }
10380 }
10381 }
10382
10384 {
10385
10387 return;
10388 }
10389
10390 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10391 {
10393 }
10394 }
10395 }
10396
10397
10399 {
10400 super.OnRightClick();
10401
10403 {
10405 {
10406 if (ScriptInputUserData.CanStoreInputUserData())
10407 {
10408 EntityAI root = GetHierarchyRoot();
10409 Man playerOwner = GetHierarchyRootPlayer();
10410 InventoryLocation dst = new InventoryLocation;
10411
10412
10413 if (!playerOwner && root && root == this)
10414 {
10416 }
10417 else
10418 {
10419
10420 GetInventory().GetCurrentInventoryLocation(dst);
10422 {
10425 {
10427 }
10428 else
10429 {
10431
10432
10433 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10434 {
10436 }
10437 else
10438 {
10439 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10440 }
10441 }
10442 }
10443 }
10444
10445 ScriptInputUserData ctx = new ScriptInputUserData;
10453 }
10454 }
10455 else if (!
GetGame().IsMultiplayer())
10456 {
10458 }
10459 }
10460 }
10461
10463 {
10464 if (root)
10465 {
10466 vector m4[4];
10467 root.GetTransform(m4);
10468 dst.SetGround(this, m4);
10469 }
10470 else
10471 {
10472 GetInventory().GetCurrentInventoryLocation(dst);
10473 }
10474 }
10475
10476 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10477 {
10478
10479 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10480 return false;
10481
10482 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10483 return false;
10484
10485
10487 return false;
10488
10489
10490 Magazine mag = Magazine.Cast(this);
10491 if (mag)
10492 {
10493 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10494 return false;
10495
10496 if (stack_max_limit)
10497 {
10498 Magazine other_mag = Magazine.Cast(other_item);
10499 if (other_item)
10500 {
10501 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10502 return false;
10503 }
10504
10505 }
10506 }
10507 else
10508 {
10509
10511 return false;
10512
10514 return false;
10515 }
10516
10517 PlayerBase player = null;
10518 if (CastTo(player, GetHierarchyRootPlayer()))
10519 {
10520 if (player.GetInventory().HasAttachment(this))
10521 return false;
10522
10523 if (player.IsItemsToDelete())
10524 return false;
10525 }
10526
10527 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10528 return false;
10529
10530 int slotID;
10532 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10533 return false;
10534
10535 return true;
10536 }
10537
10539 {
10541 }
10542
10544 {
10545 return m_IsResultOfSplit;
10546 }
10547
10549 {
10550 m_IsResultOfSplit = value;
10551 }
10552
10554 {
10556 }
10557
10559 {
10560 float other_item_quantity = other_item.GetQuantity();
10561 float this_free_space;
10562
10564
10566
10567 if (other_item_quantity > this_free_space)
10568 {
10569 return this_free_space;
10570 }
10571 else
10572 {
10573 return other_item_quantity;
10574 }
10575 }
10576
10578 {
10580 }
10581
10583 {
10585 return;
10586
10587 if (!IsMagazine() && other_item)
10588 {
10590 if (quantity_used != 0)
10591 {
10592 float hp1 = GetHealth01("","");
10593 float hp2 = other_item.GetHealth01("","");
10594 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10595 hpResult = hpResult / (
GetQuantity() + quantity_used);
10596
10597 hpResult *= GetMaxHealth();
10598 Math.Round(hpResult);
10599 SetHealth("", "Health", hpResult);
10600
10602 other_item.AddQuantity(-quantity_used);
10603 }
10604 }
10606 }
10607
10609 {
10610 #ifdef SERVER
10611 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10612 GetHierarchyParent().IncreaseLifetimeUp();
10613 #endif
10614 };
10615
10617 {
10618 PlayerBase p = PlayerBase.Cast(player);
10619
10620 array<int> recipesIds = p.m_Recipes;
10621 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10622 if (moduleRecipesManager)
10623 {
10624 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10625 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10626 }
10627
10628 for (int i = 0;i < recipesIds.Count(); i++)
10629 {
10630 int key = recipesIds.Get(i);
10631 string recipeName = moduleRecipesManager.GetRecipeName(key);
10633 }
10634 }
10635
10636
10637 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10638 {
10639 super.GetDebugActions(outputList);
10640
10641
10647
10648
10653
10658
10659
10663
10664
10666 {
10670 }
10671
10674
10675
10679
10681
10682 InventoryLocation loc = new InventoryLocation();
10683 GetInventory().GetCurrentInventoryLocation(loc);
10685 {
10686 if (Gizmo_IsSupported())
10689 }
10690
10692 }
10693
10694
10695
10696
10698 {
10699 super.OnAction(action_id, player, ctx);
10700
10702 {
10703 switch (action_id)
10704 {
10707 return true;
10710 return true;
10711 }
10712 }
10713
10715 {
10716 switch (action_id)
10717 {
10719 Delete();
10720 return true;
10721 }
10722 }
10723
10724 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10725 {
10726 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10727 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10728 PlayerBase p = PlayerBase.Cast(player);
10729 if (
EActions.RECIPES_RANGE_START < 1000)
10730 {
10731 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10732 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10733 }
10734 }
10735 #ifndef SERVER
10736 else if (action_id ==
EActions.WATCH_PLAYER)
10737 {
10738 PluginDeveloper.SetDeveloperItemClientEx(player);
10739 }
10740 #endif
10742 {
10743 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10744 {
10745 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10746 OnDebugButtonPressServer(id + 1);
10747 }
10748
10749 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10750 {
10751 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10753 }
10754
10755 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10756 {
10757 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10759 }
10760
10761 else if (action_id ==
EActions.ADD_QUANTITY)
10762 {
10763 if (IsMagazine())
10764 {
10765 Magazine mag = Magazine.Cast(this);
10766 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10767 }
10768 else
10769 {
10771 }
10772
10773 if (m_EM)
10774 {
10775 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10776 }
10777
10778 }
10779
10780 else if (action_id ==
EActions.REMOVE_QUANTITY)
10781 {
10782 if (IsMagazine())
10783 {
10784 Magazine mag2 = Magazine.Cast(this);
10785 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10786 }
10787 else
10788 {
10790 }
10791 if (m_EM)
10792 {
10793 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10794 }
10795
10796 }
10797
10798 else if (action_id ==
EActions.SET_QUANTITY_0)
10799 {
10801
10802 if (m_EM)
10803 {
10804 m_EM.SetEnergy(0);
10805 }
10806 }
10807
10808 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10809 {
10811
10812 if (m_EM)
10813 {
10814 m_EM.SetEnergy(m_EM.GetEnergyMax());
10815 }
10816 }
10817
10818 else if (action_id ==
EActions.ADD_HEALTH)
10819 {
10820 AddHealth("","",GetMaxHealth("","Health")/5);
10821 }
10822 else if (action_id ==
EActions.REMOVE_HEALTH)
10823 {
10824 AddHealth("","",-GetMaxHealth("","Health")/5);
10825 }
10826 else if (action_id ==
EActions.DESTROY_HEALTH)
10827 {
10828 SetHealth01("","",0);
10829 }
10830 else if (action_id ==
EActions.WATCH_ITEM)
10831 {
10833 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10834 #ifdef DEVELOPER
10835 SetDebugDeveloper_item(this);
10836 #endif
10837 }
10838
10839 else if (action_id ==
EActions.ADD_TEMPERATURE)
10840 {
10841 AddTemperature(20);
10842
10843 }
10844
10845 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10846 {
10847 AddTemperature(-20);
10848
10849 }
10850
10851 else if (action_id ==
EActions.FLIP_FROZEN)
10852 {
10853 SetFrozen(!GetIsFrozen());
10854
10855 }
10856
10857 else if (action_id ==
EActions.ADD_WETNESS)
10858 {
10860
10861 }
10862
10863 else if (action_id ==
EActions.REMOVE_WETNESS)
10864 {
10866
10867 }
10868
10869 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10870 {
10873
10874
10875 }
10876
10877 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10878 {
10881 }
10882
10883 else if (action_id ==
EActions.MAKE_SPECIAL)
10884 {
10885 auto debugParams = DebugSpawnParams.WithPlayer(player);
10886 OnDebugSpawnEx(debugParams);
10887 }
10888
10889 }
10890
10891
10892 return false;
10893 }
10894
10895
10896
10897
10901
10904
10905
10906
10908 {
10909 return false;
10910 }
10911
10912
10914 {
10915 return true;
10916 }
10917
10918
10920 {
10921 return true;
10922 }
10923
10924
10925
10927 {
10928 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10930 }
10931
10934 {
10935 return null;
10936 }
10937
10939 {
10940 return false;
10941 }
10942
10944 {
10945 return false;
10946 }
10947
10951
10952
10954 {
10955 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10956 return module_repairing.CanRepair(this, item_repair_kit);
10957 }
10958
10959
10960 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10961 {
10962 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10963 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10964 }
10965
10966
10968 {
10969
10970
10971
10972
10973
10974
10975
10976
10977 return 1;
10978 }
10979
10980
10981
10983 {
10985 }
10986
10987
10988
10990 {
10992 }
10993
10994
11003 {
11004 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11005
11006 if (player)
11007 {
11008 player.MessageStatus(text);
11009 }
11010 }
11011
11012
11021 {
11022 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11023
11024 if (player)
11025 {
11026 player.MessageAction(text);
11027 }
11028 }
11029
11030
11039 {
11040 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11041
11042 if (player)
11043 {
11044 player.MessageFriendly(text);
11045 }
11046 }
11047
11048
11057 {
11058 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11059
11060 if (player)
11061 {
11062 player.MessageImportant(text);
11063 }
11064 }
11065
11067 {
11068 return true;
11069 }
11070
11071
11072 override bool KindOf(
string tag)
11073 {
11074 bool found = false;
11075 string item_name = this.
GetType();
11078
11079 int array_size = item_tag_array.Count();
11080 for (int i = 0; i < array_size; i++)
11081 {
11082 if (item_tag_array.Get(i) == tag)
11083 {
11084 found = true;
11085 break;
11086 }
11087 }
11088 return found;
11089 }
11090
11091
11093 {
11094
11095 super.OnRPC(sender, rpc_type,ctx);
11096
11097
11098 switch (rpc_type)
11099 {
11100 #ifndef SERVER
11101 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11102 Param2<bool, string> p = new Param2<bool, string>(false, "");
11103
11105 return;
11106
11107 bool play = p.param1;
11108 string soundSet = p.param2;
11109
11110 if (play)
11111 {
11113 {
11115 {
11117 }
11118 }
11119 else
11120 {
11122 }
11123 }
11124 else
11125 {
11127 }
11128
11129 break;
11130 #endif
11131
11132 }
11133
11135 {
11137 }
11138 }
11139
11140
11141
11142
11144 {
11145 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11146 return plugin.GetID(
name);
11147 }
11148
11150 {
11151 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11152 return plugin.GetName(id);
11153 }
11154
11157 {
11158
11159
11160 int varFlags;
11161 if (!ctx.
Read(varFlags))
11162 return;
11163
11164 if (varFlags & ItemVariableFlags.FLOAT)
11165 {
11167 }
11168 }
11169
11171 {
11172
11173 super.SerializeNumericalVars(floats_out);
11174
11175
11176
11178 {
11180 }
11181
11183 {
11185 }
11186
11188 {
11190 }
11191
11193 {
11198 }
11199
11201 {
11203 }
11204 }
11205
11207 {
11208
11209 super.DeSerializeNumericalVars(floats);
11210
11211
11212 int index = 0;
11213 int mask = Math.Round(floats.Get(index));
11214
11215 index++;
11216
11218 {
11220 {
11222 }
11223 else
11224 {
11225 float quantity = floats.Get(index);
11226 SetQuantity(quantity,
true,
false,
false,
false);
11227 }
11228 index++;
11229 }
11230
11232 {
11233 float wet = floats.Get(index);
11235 index++;
11236 }
11237
11239 {
11240 int liquidtype = Math.Round(floats.Get(index));
11242 index++;
11243 }
11244
11246 {
11248 index++;
11250 index++;
11252 index++;
11254 index++;
11255 }
11256
11258 {
11259 int cleanness = Math.Round(floats.Get(index));
11261 index++;
11262 }
11263 }
11264
11266 {
11267 super.WriteVarsToCTX(ctx);
11268
11269
11271 {
11273 }
11274
11276 {
11278 }
11279
11281 {
11283 }
11284
11286 {
11287 int r,g,b,a;
11293 }
11294
11296 {
11298 }
11299 }
11300
11302 {
11303 if (!super.ReadVarsFromCTX(ctx,version))
11304 return false;
11305
11306 int intValue;
11307 float value;
11308
11309 if (version < 140)
11310 {
11311 if (!ctx.
Read(intValue))
11312 return false;
11313
11314 m_VariablesMask = intValue;
11315 }
11316
11318 {
11319 if (!ctx.
Read(value))
11320 return false;
11321
11323 {
11325 }
11326 else
11327 {
11329 }
11330 }
11331
11332 if (version < 140)
11333 {
11335 {
11336 if (!ctx.
Read(value))
11337 return false;
11338 SetTemperatureDirect(value);
11339 }
11340 }
11341
11343 {
11344 if (!ctx.
Read(value))
11345 return false;
11347 }
11348
11350 {
11351 if (!ctx.
Read(intValue))
11352 return false;
11354 }
11355
11357 {
11358 int r,g,b,a;
11360 return false;
11362 return false;
11364 return false;
11366 return false;
11367
11369 }
11370
11372 {
11373 if (!ctx.
Read(intValue))
11374 return false;
11376 }
11377
11378 if (version >= 138 && version < 140)
11379 {
11381 {
11382 if (!ctx.
Read(intValue))
11383 return false;
11384 SetFrozen(intValue);
11385 }
11386 }
11387
11388 return true;
11389 }
11390
11391
11393 {
11396 {
11398 }
11399
11400 if (!super.OnStoreLoad(ctx, version))
11401 {
11403 return false;
11404 }
11405
11406 if (version >= 114)
11407 {
11408 bool hasQuickBarIndexSaved;
11409
11410 if (!ctx.
Read(hasQuickBarIndexSaved))
11411 {
11413 return false;
11414 }
11415
11416 if (hasQuickBarIndexSaved)
11417 {
11418 int itmQBIndex;
11419
11420
11421 if (!ctx.
Read(itmQBIndex))
11422 {
11424 return false;
11425 }
11426
11427 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11428 if (itmQBIndex != -1 && parentPlayer)
11429 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11430 }
11431 }
11432 else
11433 {
11434
11435 PlayerBase player;
11436 int itemQBIndex;
11437 if (version ==
int.
MAX)
11438 {
11439 if (!ctx.
Read(itemQBIndex))
11440 {
11442 return false;
11443 }
11444 }
11445 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11446 {
11447
11448 if (!ctx.
Read(itemQBIndex))
11449 {
11451 return false;
11452 }
11453 if (itemQBIndex != -1 && player)
11454 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11455 }
11456 }
11457
11458 if (version < 140)
11459 {
11460
11461 if (!LoadVariables(ctx, version))
11462 {
11464 return false;
11465 }
11466 }
11467
11468
11470 {
11472 return false;
11473 }
11474 if (version >= 132)
11475 {
11477 if (raib)
11478 {
11480 {
11482 return false;
11483 }
11484 }
11485 }
11486
11488 return true;
11489 }
11490
11491
11492
11494 {
11495 super.OnStoreSave(ctx);
11496
11497 PlayerBase player;
11498 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11499 {
11501
11502 int itemQBIndex = -1;
11503 itemQBIndex = player.FindQuickBarEntityIndex(this);
11504 ctx.
Write(itemQBIndex);
11505 }
11506 else
11507 {
11509 }
11510
11512
11514 if (raib)
11515 {
11517 }
11518 }
11519
11520
11522 {
11523 super.AfterStoreLoad();
11524
11526 {
11528 }
11529
11531 {
11534 }
11535 }
11536
11538 {
11539 super.EEOnAfterLoad();
11540
11542 {
11544 }
11545
11548 }
11549
11551 {
11552 return false;
11553 }
11554
11555
11556
11558 {
11560 {
11561 #ifdef PLATFORM_CONSOLE
11562
11564 {
11566 if (menu)
11567 {
11569 }
11570 }
11571 #endif
11572 }
11573
11575 {
11578 }
11579
11581 {
11582 SetWeightDirty();
11584 }
11586 {
11589 }
11590
11592 {
11595 }
11597 {
11600 }
11601
11602 super.OnVariablesSynchronized();
11603 }
11604
11605
11606
11608 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11609 {
11610 if (!IsServerCheck(allow_client))
11611 return false;
11612
11614 return false;
11615
11618
11619 if (value <= (min + 0.001))
11620 value = min;
11621
11622 if (value == min)
11623 {
11624 if (destroy_config)
11625 {
11626 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11627 if (dstr)
11628 {
11630 this.Delete();
11631 return true;
11632 }
11633 }
11634 else if (destroy_forced)
11635 {
11637 this.Delete();
11638 return true;
11639 }
11640
11642 }
11643
11646
11648 {
11650
11651 if (delta)
11653 }
11654
11656
11657 return false;
11658 }
11659
11660
11662 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11663 {
11665 }
11666
11668 {
11671 }
11672
11674 {
11677 }
11678
11680 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11681 {
11682 float value_clamped = Math.Clamp(value, 0, 1);
11684 SetQuantity(result, destroy_config, destroy_forced);
11685 }
11686
11687
11690 {
11692 }
11693
11695 {
11697 }
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11709 {
11710 int slot = -1;
11711 if (GetInventory())
11712 {
11713 InventoryLocation il = new InventoryLocation;
11714 GetInventory().GetCurrentInventoryLocation(il);
11716 }
11717
11719 }
11720
11722 {
11723 float quantity_max = 0;
11724
11726 {
11727 if (attSlotID != -1)
11728 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11729
11730 if (quantity_max <= 0)
11732 }
11733
11734 if (quantity_max <= 0)
11736
11737 return quantity_max;
11738 }
11739
11741 {
11743 }
11744
11746 {
11748 }
11749
11750
11752 {
11754 }
11755
11757 {
11759 }
11760
11762 {
11764 }
11765
11766
11768 {
11769
11770 float weightEx = GetWeightEx();
11771 float special = GetInventoryAndCargoWeight();
11772 return weightEx - special;
11773 }
11774
11775
11777 {
11779 }
11780
11782 {
11784 {
11785 #ifdef DEVELOPER
11786 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11787 {
11788 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11790 }
11791 #endif
11792
11793 return GetQuantity() * GetConfigWeightModified();
11794 }
11795 else if (HasEnergyManager())
11796 {
11797 #ifdef DEVELOPER
11798 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11799 {
11800 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11801 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11802 }
11803 #endif
11804 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11805 }
11806 else
11807 {
11808 #ifdef DEVELOPER
11809 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11810 {
11811 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11812 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11813 }
11814 #endif
11815 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11816 }
11817 }
11818
11821 {
11822 int item_count = 0;
11824
11825 if (GetInventory().GetCargo() != NULL)
11826 {
11827 item_count = GetInventory().GetCargo().GetItemCount();
11828 }
11829
11830 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11831 {
11832 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11833 if (item)
11834 item_count += item.GetNumberOfItems();
11835 }
11836 return item_count;
11837 }
11838
11841 {
11842 float weight = 0;
11843 float wetness = 1;
11844 if (include_wetness)
11847 {
11848 weight = wetness * m_ConfigWeight;
11849 }
11851 {
11852 weight = 1;
11853 }
11854 return weight;
11855 }
11856
11857
11858
11860 {
11861 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11862 {
11863 GameInventory inv = GetInventory();
11864 array<EntityAI> items = new array<EntityAI>;
11866 for (int i = 0; i < items.Count(); i++)
11867 {
11869 if (item)
11870 {
11872 }
11873 }
11874 }
11875 }
11876
11877
11878
11879
11881 {
11882 float energy = 0;
11883 if (HasEnergyManager())
11884 {
11885 energy = GetCompEM().GetEnergy();
11886 }
11887 return energy;
11888 }
11889
11890
11892 {
11893 super.OnEnergyConsumed();
11894
11896 }
11897
11899 {
11900 super.OnEnergyAdded();
11901
11903 }
11904
11905
11907 {
11908 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11909 {
11911 {
11912 float energy_0to1 = GetCompEM().GetEnergy0To1();
11914 }
11915 }
11916 }
11917
11918
11920 {
11921 return ConfigGetFloat("heatIsolation");
11922 }
11923
11925 {
11927 }
11928
11930 {
11931 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11932 if (
GetGame().ConfigIsExisting(paramPath))
11934
11935 return 0.0;
11936 }
11937
11939 {
11940 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11941 if (
GetGame().ConfigIsExisting(paramPath))
11943
11944 return 0.0;
11945 }
11946
11947 override void SetWet(
float value,
bool allow_client =
false)
11948 {
11949 if (!IsServerCheck(allow_client))
11950 return;
11951
11954
11956
11957 m_VarWet = Math.Clamp(value, min, max);
11958
11960 {
11963 }
11964 }
11965
11966 override void AddWet(
float value)
11967 {
11969 }
11970
11972 {
11974 }
11975
11977 {
11979 }
11980
11982 {
11984 }
11985
11987 {
11989 }
11990
11992 {
11994 }
11995
11996 override void OnWetChanged(
float newVal,
float oldVal)
11997 {
12000 if (newLevel != oldLevel)
12001 {
12003 }
12004 }
12005
12007 {
12008 SetWeightDirty();
12009 }
12010
12012 {
12013 return GetWetLevelInternal(
m_VarWet);
12014 }
12015
12016
12017
12019 {
12021 }
12022
12024 {
12026 }
12027
12029 {
12031 }
12032
12034 {
12036 }
12037
12038
12039
12041 {
12042 if (ConfigIsExisting("itemModelLength"))
12043 {
12044 return ConfigGetFloat("itemModelLength");
12045 }
12046 return 0;
12047 }
12048
12050 {
12051 if (ConfigIsExisting("itemAttachOffset"))
12052 {
12053 return ConfigGetFloat("itemAttachOffset");
12054 }
12055 return 0;
12056 }
12057
12058 override void SetCleanness(
int value,
bool allow_client =
false)
12059 {
12060 if (!IsServerCheck(allow_client))
12061 return;
12062
12064
12066
12069 }
12070
12072 {
12074 }
12075
12077 {
12078 return true;
12079 }
12080
12081
12082
12083
12085 {
12087 }
12088
12090 {
12092 }
12093
12094
12095
12096
12097 override void SetColor(
int r,
int g,
int b,
int a)
12098 {
12104 }
12106 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12107 {
12112 }
12113
12115 {
12117 }
12118
12121 {
12122 int r,g,b,a;
12124 r = r/255;
12125 g = g/255;
12126 b = b/255;
12127 a = a/255;
12128 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12129 }
12130
12131
12132
12133 override void SetLiquidType(
int value,
bool allow_client =
false)
12134 {
12135 if (!IsServerCheck(allow_client))
12136 return;
12137
12142 }
12143
12145 {
12146 return ConfigGetInt("varLiquidTypeInit");
12147 }
12148
12150 {
12152 }
12153
12155 {
12157 SetFrozen(false);
12158 }
12159
12162 {
12163 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12164 }
12165
12166
12169 {
12170 PlayerBase nplayer;
12171 if (PlayerBase.CastTo(nplayer, player))
12172 {
12174
12175 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12176 }
12177 }
12178
12179
12182 {
12183 PlayerBase nplayer;
12184 if (PlayerBase.CastTo(nplayer,player))
12185 {
12186
12187 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12188
12189 }
12190
12191
12192 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12193
12194
12195 if (HasEnergyManager())
12196 {
12197 GetCompEM().UpdatePlugState();
12198 }
12199 }
12200
12201
12203 {
12204 super.OnPlacementStarted(player);
12205
12207 }
12208
12209 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12210 {
12212 {
12213 m_AdminLog.OnPlacementComplete(player,
this);
12214 }
12215
12216 super.OnPlacementComplete(player, position, orientation);
12217 }
12218
12219
12220
12221
12222
12224 {
12226 {
12227 return true;
12228 }
12229 else
12230 {
12231 return false;
12232 }
12233 }
12234
12235
12237 {
12239 {
12241 }
12242 }
12243
12244
12246 {
12248 }
12249
12251 {
12253 }
12254
12255 override void InsertAgent(
int agent,
float count = 1)
12256 {
12257 if (count < 1)
12258 return;
12259
12261 }
12262
12265 {
12267 }
12268
12269
12271 {
12273 }
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12317 {
12319 return false;
12320 return true;
12321 }
12322
12324 {
12325
12327 }
12328
12329
12332 {
12333 super.CheckForRoofLimited(timeTresholdMS);
12334
12336 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12337 {
12338 m_PreviousRoofTestTime = time;
12339 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12340 }
12341 }
12342
12343
12345 {
12347 {
12348 return 0;
12349 }
12350
12351 if (GetInventory().GetAttachmentSlotsCount() != 0)
12352 {
12353 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12354 if (filter)
12355 return filter.GetProtectionLevel(type, false, system);
12356 else
12357 return 0;
12358 }
12359
12360 string subclassPath, entryName;
12361
12362 switch (type)
12363 {
12365 entryName = "biological";
12366 break;
12368 entryName = "chemical";
12369 break;
12370 default:
12371 entryName = "biological";
12372 break;
12373 }
12374
12375 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12376
12378 }
12379
12380
12381
12384 {
12385 if (!IsMagazine())
12387
12389 }
12390
12391
12392
12393
12394
12399 {
12400 return true;
12401 }
12402
12404 {
12406 }
12407
12408
12409
12410
12411
12413 {
12414 if (parent)
12415 {
12416 if (parent.IsInherited(DayZInfected))
12417 return true;
12418
12419 if (!parent.IsRuined())
12420 return true;
12421 }
12422
12423 return true;
12424 }
12425
12427 {
12428 if (!super.CanPutAsAttachment(parent))
12429 {
12430 return false;
12431 }
12432
12433 if (!IsRuined() && !parent.IsRuined())
12434 {
12435 return true;
12436 }
12437
12438 return false;
12439 }
12440
12442 {
12443
12444
12445
12446
12447 return super.CanReceiveItemIntoCargo(item);
12448 }
12449
12451 {
12452
12453
12454
12455
12456 GameInventory attachmentInv = attachment.GetInventory();
12458 {
12459 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12460 return false;
12461 }
12462
12463 InventoryLocation loc = new InventoryLocation();
12464 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12465 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12466 return false;
12467
12468 return super.CanReceiveAttachment(attachment, slotId);
12469 }
12470
12472 {
12473 if (!super.CanReleaseAttachment(attachment))
12474 return false;
12475
12476 return GetInventory().AreChildrenAccessible();
12477 }
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12500 {
12501 int id = muzzle_owner.GetMuzzleID();
12502 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12503
12504 if (WPOF_array)
12505 {
12506 for (int i = 0; i < WPOF_array.Count(); i++)
12507 {
12508 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12509
12510 if (WPOF)
12511 {
12512 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12513 }
12514 }
12515 }
12516 }
12517
12518
12520 {
12521 int id = muzzle_owner.GetMuzzleID();
12523
12524 if (WPOBE_array)
12525 {
12526 for (int i = 0; i < WPOBE_array.Count(); i++)
12527 {
12528 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12529
12530 if (WPOBE)
12531 {
12532 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12533 }
12534 }
12535 }
12536 }
12537
12538
12540 {
12541 int id = muzzle_owner.GetMuzzleID();
12542 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12543
12544 if (WPOOH_array)
12545 {
12546 for (int i = 0; i < WPOOH_array.Count(); i++)
12547 {
12548 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12549
12550 if (WPOOH)
12551 {
12552 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12553 }
12554 }
12555 }
12556 }
12557
12558
12560 {
12561 int id = muzzle_owner.GetMuzzleID();
12562 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12563
12564 if (WPOOH_array)
12565 {
12566 for (int i = 0; i < WPOOH_array.Count(); i++)
12567 {
12568 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12569
12570 if (WPOOH)
12571 {
12572 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12573 }
12574 }
12575 }
12576 }
12577
12578
12580 {
12581 int id = muzzle_owner.GetMuzzleID();
12582 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12583
12584 if (WPOOH_array)
12585 {
12586 for (int i = 0; i < WPOOH_array.Count(); i++)
12587 {
12588 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12589
12590 if (WPOOH)
12591 {
12592 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12593 }
12594 }
12595 }
12596 }
12597
12598
12599
12601 {
12603 {
12604 return true;
12605 }
12606
12607 return false;
12608 }
12609
12611 {
12613 {
12614 return true;
12615 }
12616
12617 return false;
12618 }
12619
12621 {
12623 {
12624 return true;
12625 }
12626
12627 return false;
12628 }
12629
12631 {
12632 return false;
12633 }
12634
12637 {
12638 return UATimeSpent.DEFAULT_DEPLOY;
12639 }
12640
12641
12642
12643
12645 {
12647 SetSynchDirty();
12648 }
12649
12651 {
12653 }
12654
12655
12657 {
12658 return false;
12659 }
12660
12663 {
12664 string att_type = "None";
12665
12666 if (ConfigIsExisting("soundAttType"))
12667 {
12668 att_type = ConfigGetString("soundAttType");
12669 }
12670
12672 }
12673
12675 {
12677 }
12678
12679
12680
12681
12682
12688
12690 {
12693
12695 }
12696
12697
12699 {
12701 return;
12702
12704
12707
12710
12711 SoundParameters params = new SoundParameters();
12715 }
12716
12717
12719 {
12721 return;
12722
12724 SetSynchDirty();
12725
12728 }
12729
12730
12732 {
12734 return;
12735
12737 SetSynchDirty();
12738
12741 }
12742
12744 {
12746 }
12747
12749 {
12751 }
12752
12755 {
12756 if (!
GetGame().IsDedicatedServer())
12757 {
12758 if (ConfigIsExisting("attachSoundSet"))
12759 {
12760 string cfg_path = "";
12761 string soundset = "";
12762 string type_name =
GetType();
12763
12766 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12767 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12768
12769 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12770 {
12771 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12772 {
12773 if (cfg_slot_array[i] == slot_type)
12774 {
12775 soundset = cfg_soundset_array[i];
12776 break;
12777 }
12778 }
12779 }
12780
12781 if (soundset != "")
12782 {
12783 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12785 }
12786 }
12787 }
12788 }
12789
12791 {
12792
12793 }
12794
12795 void OnApply(PlayerBase player);
12796
12798 {
12799 return 1.0;
12800 };
12801
12803 {
12805 }
12806
12808 {
12810 }
12811
12813
12815 {
12816 SetDynamicPhysicsLifeTime(0.01);
12818 }
12819
12821 {
12822 array<string> zone_names = new array<string>;
12823 GetDamageZones(zone_names);
12824 for (int i = 0; i < zone_names.Count(); i++)
12825 {
12826 SetHealthMax(zone_names.Get(i),"Health");
12827 }
12828 SetHealthMax("","Health");
12829 }
12830
12833 {
12834 float global_health = GetHealth01("","Health");
12835 array<string> zones = new array<string>;
12836 GetDamageZones(zones);
12837
12838 for (int i = 0; i < zones.Count(); i++)
12839 {
12840 SetHealth01(zones.Get(i),"Health",global_health);
12841 }
12842 }
12843
12846 {
12847 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12848 }
12849
12851 {
12852 if (!hasRootAsPlayer)
12853 {
12854 if (refParentIB)
12855 {
12856
12857 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12858 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12859
12860 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12861 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12862
12865 }
12866 else
12867 {
12868
12871 }
12872 }
12873 }
12874
12876 {
12878 {
12879 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12880 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12881 {
12882 float heatPermCoef = 1.0;
12884 while (ent)
12885 {
12886 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12887 ent = ent.GetHierarchyParent();
12888 }
12889
12890 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12891 }
12892 }
12893 }
12894
12896 {
12897
12898 EntityAI parent = GetHierarchyParent();
12899 if (!parent)
12900 {
12901 hasParent = false;
12902 hasRootAsPlayer = false;
12903 }
12904 else
12905 {
12906 hasParent = true;
12907 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12908 refParentIB =
ItemBase.Cast(parent);
12909 }
12910 }
12911
12912 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12913 {
12914
12915 }
12916
12918 {
12919
12920 return false;
12921 }
12922
12924 {
12925
12926
12927 return false;
12928 }
12929
12931 {
12932
12933 return false;
12934 }
12935
12938 {
12939 return !GetIsFrozen() &&
IsOpen();
12940 }
12941
12943 {
12944 bool hasParent = false, hasRootAsPlayer = false;
12946
12947 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12948 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12949
12950 if (wwtu || foodDecay)
12951 {
12955
12956 if (processWetness || processTemperature || processDecay)
12957 {
12959
12960 if (processWetness)
12961 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12962
12963 if (processTemperature)
12965
12966 if (processDecay)
12967 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12968 }
12969 }
12970 }
12971
12974 {
12976 }
12977
12979 {
12982
12983 return super.GetTemperatureFreezeThreshold();
12984 }
12985
12987 {
12990
12991 return super.GetTemperatureThawThreshold();
12992 }
12993
12995 {
12998
12999 return super.GetItemOverheatThreshold();
13000 }
13001
13003 {
13005 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13006
13007 return super.GetTemperatureFreezeTime();
13008 }
13009
13011 {
13013 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13014
13015 return super.GetTemperatureThawTime();
13016 }
13017
13022
13024 {
13025 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13026 }
13027
13029 {
13030 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13031 }
13032
13035 {
13037 }
13038
13040 {
13042 }
13043
13045 {
13047 }
13048
13051 {
13052 return null;
13053 }
13054
13057 {
13058 return false;
13059 }
13060
13062 {
13064 {
13067 if (!trg)
13068 {
13070 explosive = this;
13071 }
13072
13073 explosive.PairRemote(trg);
13075
13076 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13077 trg.SetPersistentPairID(persistentID);
13078 explosive.SetPersistentPairID(persistentID);
13079
13080 return true;
13081 }
13082 return false;
13083 }
13084
13087 {
13088 float ret = 1.0;
13091 ret *= GetHealth01();
13092
13093 return ret;
13094 }
13095
13096 #ifdef DEVELOPER
13097 override void SetDebugItem()
13098 {
13099 super.SetDebugItem();
13100 _itemBase = this;
13101 }
13102
13104 {
13105 string text = super.GetDebugText();
13106
13108 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13109
13110 return text;
13111 }
13112 #endif
13113
13115 {
13116 return true;
13117 }
13118
13120
13122
13124 {
13127 }
13128
13129
13137
13153}
13154
13156{
13158 if (entity)
13159 {
13160 bool is_item = entity.IsInherited(
ItemBase);
13161 if (is_item && full_quantity)
13162 {
13165 }
13166 }
13167 else
13168 {
13170 return NULL;
13171 }
13172 return entity;
13173}
13174
13176{
13177 if (item)
13178 {
13179 if (health > 0)
13180 item.SetHealth("", "", health);
13181
13182 if (item.CanHaveTemperature())
13183 {
13185 if (item.CanFreeze())
13186 item.SetFrozen(false);
13187 }
13188
13189 if (item.HasEnergyManager())
13190 {
13191 if (quantity >= 0)
13192 {
13193 item.GetCompEM().SetEnergy0To1(quantity);
13194 }
13195 else
13196 {
13198 }
13199 }
13200 else if (item.IsMagazine())
13201 {
13202 Magazine mag = Magazine.Cast(item);
13203 if (quantity >= 0)
13204 {
13205 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13206 }
13207 else
13208 {
13210 }
13211
13212 }
13213 else
13214 {
13215 if (quantity >= 0)
13216 {
13217 item.SetQuantityNormalized(quantity, false);
13218 }
13219 else
13220 {
13222 }
13223
13224 }
13225 }
13226}
13227
13228#ifdef DEVELOPER
13230#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.