8065{
8067 {
8068 return true;
8069 }
8070};
8071
8072
8073
8075{
8079
8081
8084
8085
8086
8087
8088
8097
8103
8108
8113
8134 protected bool m_IsResultOfSplit
8135
8137
8142
8143
8144
8146
8150
8151
8152
8154
8157
8158
8159
8165
8166
8174
8177
8178
8180
8181
8183
8184
8189
8190
8195
8196
8198
8199
8201 {
8206
8207 if (!
GetGame().IsDedicatedServer())
8208 {
8210 {
8212
8214 {
8216 }
8217 }
8218
8221 }
8222
8223 m_OldLocation = null;
8224
8226 {
8228 }
8229
8230 if (ConfigIsExisting("headSelectionsToHide"))
8231 {
8234 }
8235
8237 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8238 {
8240 }
8241
8243
8244 m_IsResultOfSplit = false;
8245
8247 }
8248
8250 {
8251 super.InitItemVariables();
8252
8258 m_Count = ConfigGetInt(
"count");
8259
8262
8267
8270
8275
8287
8291
8292
8295 if (ConfigIsExisting("canBeSplit"))
8296 {
8299 }
8300
8302 if (ConfigIsExisting("itemBehaviour"))
8304
8305
8308 RegisterNetSyncVariableInt("m_VarLiquidType");
8309 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8310
8311 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8312 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8313 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8314
8315 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8316 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8317 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8318 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8319
8320 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8321 RegisterNetSyncVariableBool("m_IsTakeable");
8322 RegisterNetSyncVariableBool("m_IsHologram");
8323
8326 {
8329 }
8330
8332
8334 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8336
8337 }
8338
8340 {
8342 }
8343
8345 {
8348 {
8353 }
8354 }
8355
8356 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8357 {
8359 {
8362 }
8363
8365 }
8366
8368 {
8374 }
8375
8377
8379 {
8381
8382 if (!action)
8383 {
8384 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8385 return;
8386 }
8387
8389 if (!ai)
8390 {
8392 return;
8393 }
8394
8396 if (!action_array)
8397 {
8398 action_array = new array<ActionBase_Basic>;
8400 }
8401 if (LogManager.IsActionLogEnable())
8402 {
8403 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8404 }
8405
8406 if (action_array.Find(action) != -1)
8407 {
8408 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8409 }
8410 else
8411 {
8412 action_array.Insert(action);
8413 }
8414 }
8415
8417 {
8419 ActionBase action = player.GetActionManager().GetAction(actionName);
8422
8423 if (action_array)
8424 {
8425 action_array.RemoveItem(action);
8426 }
8427 }
8428
8429
8430
8432 {
8433 ActionOverrideData overrideData = new ActionOverrideData();
8437
8439 if (!actionMap)
8440 {
8443 }
8444
8445 actionMap.Insert(this.
Type(), overrideData);
8446
8447 }
8448
8450
8452
8453
8455 {
8458
8461
8462 string config_to_search = "CfgVehicles";
8463 string muzzle_owner_config;
8464
8466 {
8467 if (IsInherited(Weapon))
8468 config_to_search = "CfgWeapons";
8469
8470 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8471
8472 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8473
8475
8476 if (config_OnFire_subclass_count > 0)
8477 {
8478 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8479
8480 for (int i = 0; i < config_OnFire_subclass_count; i++)
8481 {
8482 string particle_class = "";
8484 string config_OnFire_entry = config_OnFire_class + particle_class;
8485 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8486 WPOF_array.Insert(WPOF);
8487 }
8488
8489
8491 }
8492 }
8493
8495 {
8496 config_to_search = "CfgWeapons";
8497 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8498
8499 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8500
8502
8503 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8504 {
8505 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8506
8507 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8508 {
8509 string particle_class2 = "";
8511 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8512 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8513 WPOBE_array.Insert(WPOBE);
8514 }
8515
8516
8518 }
8519 }
8520 }
8521
8522
8524 {
8527
8529 {
8530 string config_to_search = "CfgVehicles";
8531
8532 if (IsInherited(Weapon))
8533 config_to_search = "CfgWeapons";
8534
8535 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8536 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8537
8538 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8539 {
8540
8542
8544 {
8546 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8548 return;
8549 }
8550
8553
8554
8555
8557 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8558
8559 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8560 {
8561 string particle_class = "";
8563 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8565
8566 if (entry_type == CT_CLASS)
8567 {
8568 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8569 WPOOH_array.Insert(WPOF);
8570 }
8571 }
8572
8573
8575 }
8576 }
8577 }
8578
8580 {
8582 }
8583
8585 {
8587 {
8589
8592
8595
8596 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8597 }
8598 }
8599
8601 {
8603 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8604
8606 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8607
8609 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8610
8612 {
8614 }
8615 }
8616
8618 {
8620 }
8621
8623 {
8626 else
8628
8630 {
8633 }
8634 else
8635 {
8638
8641 }
8642
8644 }
8645
8647 {
8649 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8650 }
8651
8653 {
8655 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
8657 }
8658
8660 {
8662 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8663 }
8664
8666 {
8669
8670 OverheatingParticle OP = new OverheatingParticle();
8675
8677 }
8678
8680 {
8683
8684 return -1;
8685 }
8686
8688 {
8690 {
8693
8694 for (int i = count; i > 0; --i)
8695 {
8696 int id = i - 1;
8699
8702
8703 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8704 {
8705 if (p)
8706 {
8709 }
8710 }
8711 }
8712 }
8713 }
8714
8716 {
8718 {
8720 {
8721 int id = i - 1;
8723
8724 if (OP)
8725 {
8727
8728 if (p)
8729 {
8731 }
8732
8733 delete OP;
8734 }
8735 }
8736
8739 }
8740 }
8741
8744 {
8745 return 0.0;
8746 }
8747
8748
8750 {
8751 return 250;
8752 }
8753
8755 {
8756 return 0;
8757 }
8758
8761 {
8763 return true;
8764
8765 return false;
8766 }
8767
8770 {
8773
8775 {
8777 }
8778 else
8779 {
8780
8782 }
8783
8785 }
8786
8793 {
8794 return -1;
8795 }
8796
8797
8798
8799
8801 {
8803 {
8805 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8806
8807 if (r_index >= 0)
8808 {
8809 InventoryLocation r_il = new InventoryLocation;
8810 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8811
8812 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8815 {
8816 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8817 }
8819 {
8820 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8821 }
8822
8823 }
8824
8825 player.GetHumanInventory().ClearUserReservedLocation(this);
8826 }
8827
8830 }
8831
8832
8833
8834
8836 {
8837 return ItemBase.m_DebugActionsMask;
8838 }
8839
8841 {
8842 return ItemBase.m_DebugActionsMask & mask;
8843 }
8844
8846 {
8847 ItemBase.m_DebugActionsMask = mask;
8848 }
8849
8851 {
8852 ItemBase.m_DebugActionsMask |= mask;
8853 }
8854
8856 {
8857 ItemBase.m_DebugActionsMask &= ~mask;
8858 }
8859
8861 {
8863 {
8865 }
8866 else
8867 {
8869 }
8870 }
8871
8872
8874 {
8875 if (GetEconomyProfile())
8876 {
8877 float q_max = GetEconomyProfile().GetQuantityMax();
8878 if (q_max > 0)
8879 {
8880 float q_min = GetEconomyProfile().GetQuantityMin();
8881 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8882
8884 {
8885 ComponentEnergyManager comp = GetCompEM();
8887 {
8889 }
8890 }
8892 {
8894
8895 }
8896
8897 }
8898 }
8899 }
8900
8903 {
8904 EntityAI parent = GetHierarchyParent();
8905
8906 if (parent)
8907 {
8908 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8909 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8910 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8911 }
8912 }
8913
8916 {
8917 EntityAI parent = GetHierarchyParent();
8918
8919 if (parent)
8920 {
8921 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8922 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8923 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8924 }
8925 }
8926
8928 {
8929
8930
8931
8932
8934
8936 {
8937 if (ScriptInputUserData.CanStoreInputUserData())
8938 {
8939 ScriptInputUserData ctx = new ScriptInputUserData;
8945 ctx.
Write(use_stack_max);
8948
8950 {
8951 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8952 }
8953 }
8954 }
8955 else if (!
GetGame().IsMultiplayer())
8956 {
8958 }
8959 }
8960
8962 {
8964 }
8965
8967 {
8969 }
8970
8972 {
8974 }
8975
8977 {
8978
8979 return false;
8980 }
8981
8983 {
8984 return false;
8985 }
8986
8990 {
8991 return false;
8992 }
8993
8995 {
8996 return "";
8997 }
8998
9000
9002 {
9003 return false;
9004 }
9005
9007 {
9008 return true;
9009 }
9010
9011
9012
9014 {
9015 return true;
9016 }
9017
9019 {
9020 return true;
9021 }
9022
9024 {
9025 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9027 }
9028
9030 {
9032 }
9033
9035 {
9037 if (!is_being_placed)
9039 SetSynchDirty();
9040 }
9041
9042
9044
9046 {
9048 }
9049
9051 {
9053 }
9054
9056 {
9057 return 1;
9058 }
9059
9061 {
9062 return false;
9063 }
9064
9066 {
9068 SetSynchDirty();
9069 }
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9106 {
9107 super.OnMovedInsideCargo(container);
9108
9109 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9110 }
9111
9112 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9113 {
9114 super.EEItemLocationChanged(oldLoc,newLoc);
9115
9116 PlayerBase new_player = null;
9117 PlayerBase old_player = null;
9118
9119 if (newLoc.GetParent())
9120 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9121
9122 if (oldLoc.GetParent())
9123 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9124
9126 {
9127 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9128
9129 if (r_index >= 0)
9130 {
9131 InventoryLocation r_il = new InventoryLocation;
9132 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9133
9134 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9137 {
9138 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9139 }
9141 {
9142 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9143 }
9144
9145 }
9146 }
9147
9149 {
9150 if (new_player)
9151 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9152
9153 if (new_player == old_player)
9154 {
9155
9156 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9157 {
9159 {
9160 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9161 {
9162 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9163 }
9164 }
9165 else
9166 {
9167 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9168 }
9169 }
9170
9171 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9172 {
9173 int type = oldLoc.GetType();
9175 {
9176 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9177 }
9179 {
9180 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9181 }
9182 }
9183 if (!m_OldLocation)
9184 {
9185 m_OldLocation = new InventoryLocation;
9186 }
9187 m_OldLocation.Copy(oldLoc);
9188 }
9189 else
9190 {
9191 if (m_OldLocation)
9192 {
9193 m_OldLocation.Reset();
9194 }
9195 }
9196
9198 }
9199 else
9200 {
9201 if (new_player)
9202 {
9203 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9204 if (res_index >= 0)
9205 {
9206 InventoryLocation il = new InventoryLocation;
9207 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9209 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9212 {
9213 il.
GetParent().GetOnReleaseLock().Invoke(it);
9214 }
9216 {
9218 }
9219
9220 }
9221 }
9223 {
9224
9226 }
9227
9228 if (m_OldLocation)
9229 {
9230 m_OldLocation.Reset();
9231 }
9232 }
9233 }
9234
9235 override void EOnContact(IEntity other, Contact extra)
9236 {
9238 {
9239 int liquidType = -1;
9241 if (impactSpeed > 0.0)
9242 {
9244 #ifndef SERVER
9246 #else
9248 SetSynchDirty();
9249 #endif
9251 }
9252 }
9253
9254 #ifdef SERVER
9255 if (GetCompEM() && GetCompEM().IsPlugged())
9256 {
9257 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9258 GetCompEM().UnplugThis();
9259 }
9260 #endif
9261 }
9262
9264
9266 {
9268 }
9269
9271 {
9272
9273 }
9274
9276 {
9277 super.OnItemLocationChanged(old_owner, new_owner);
9278
9279 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9280 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9281
9282 if (!relatedPlayer && playerNew)
9283 relatedPlayer = playerNew;
9284
9285 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9286 {
9288 if (actionMgr)
9289 {
9290 ActionBase currentAction = actionMgr.GetRunningAction();
9291 if (currentAction)
9293 }
9294 }
9295
9296 Man ownerPlayerOld = null;
9297 Man ownerPlayerNew = null;
9298
9299 if (old_owner)
9300 {
9301 if (old_owner.
IsMan())
9302 {
9303 ownerPlayerOld = Man.Cast(old_owner);
9304 }
9305 else
9306 {
9307 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9308 }
9309 }
9310 else
9311 {
9313 {
9315
9316 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9317 {
9318 GetCompEM().UnplugThis();
9319 }
9320 }
9321 }
9322
9323 if (new_owner)
9324 {
9325 if (new_owner.
IsMan())
9326 {
9327 ownerPlayerNew = Man.Cast(new_owner);
9328 }
9329 else
9330 {
9331 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9332 }
9333 }
9334
9335 if (ownerPlayerOld != ownerPlayerNew)
9336 {
9337 if (ownerPlayerOld)
9338 {
9339 array<EntityAI> subItemsExit = new array<EntityAI>;
9341 for (int i = 0; i < subItemsExit.Count(); i++)
9342 {
9345 }
9346 }
9347
9348 if (ownerPlayerNew)
9349 {
9350 array<EntityAI> subItemsEnter = new array<EntityAI>;
9352 for (int j = 0; j < subItemsEnter.Count(); j++)
9353 {
9356 }
9357 }
9358 }
9359 else if (ownerPlayerNew != null)
9360 {
9361 PlayerBase nplayer;
9362 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9363 {
9364 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9366 for (int k = 0; k < subItemsUpdate.Count(); k++)
9367 {
9369 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9370 }
9371 }
9372 }
9373
9374 if (old_owner)
9375 old_owner.OnChildItemRemoved(this);
9376 if (new_owner)
9377 new_owner.OnChildItemReceived(this);
9378 }
9379
9380
9382 {
9383 super.EEDelete(parent);
9384 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9385 if (player)
9386 {
9388
9389 if (player.IsAlive())
9390 {
9391 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9392 if (r_index >= 0)
9393 {
9394 InventoryLocation r_il = new InventoryLocation;
9395 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9396
9397 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9400 {
9401 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9402 }
9404 {
9405 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9406 }
9407
9408 }
9409
9410 player.RemoveQuickBarEntityShortcut(this);
9411 }
9412 }
9413 }
9414
9416 {
9417 super.EEKilled(killer);
9418
9421 {
9422 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9423 {
9424 if (IsMagazine())
9425 {
9426 if (Magazine.Cast(this).GetAmmoCount() > 0)
9427 {
9429 }
9430 }
9431 else
9432 {
9434 }
9435 }
9436 }
9437 }
9438
9440 {
9441 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9442
9443 super.OnWasAttached(parent, slot_id);
9444
9447
9449 }
9450
9452 {
9453 super.OnWasDetached(parent, slot_id);
9454
9457 }
9458
9460 {
9461 int idx;
9464
9465 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9466 if (inventory_slots.Count() < 1)
9467 {
9468 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9469 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9470 }
9471 else
9472 {
9473 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9474 }
9475
9476 idx = inventory_slots.Find(slot);
9477 if (idx < 0)
9478 return "";
9479
9480 return attach_types.Get(idx);
9481 }
9482
9484 {
9485 int idx = -1;
9486 string slot;
9487
9490
9491 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9492 if (inventory_slots.Count() < 1)
9493 {
9494 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9495 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9496 }
9497 else
9498 {
9499 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9500 if (detach_types.Count() < 1)
9501 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9502 }
9503
9504 for (int i = 0; i < inventory_slots.Count(); i++)
9505 {
9506 slot = inventory_slots.Get(i);
9507 }
9508
9509 if (slot != "")
9510 {
9511 if (detach_types.Count() == 1)
9512 idx = 0;
9513 else
9514 idx = inventory_slots.Find(slot);
9515 }
9516 if (idx < 0)
9517 return "";
9518
9519 return detach_types.Get(idx);
9520 }
9521
9523 {
9524
9526
9527
9528 float min_time = 1;
9529 float max_time = 3;
9530 float delay = Math.RandomFloat(min_time, max_time);
9531
9532 explode_timer.Run(delay, this, "DoAmmoExplosion");
9533 }
9534
9536 {
9537 Magazine magazine = Magazine.Cast(this);
9538 int pop_sounds_count = 6;
9539 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9540
9541
9542 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9543 string sound_name = pop_sounds[ sound_idx ];
9545
9546
9547 magazine.ServerAddAmmoCount(-1);
9548
9549
9550 float min_temp_to_explode = 100;
9551
9552 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9553 {
9555 }
9556 }
9557
9558
9559 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9560 {
9561 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9562
9563 const int CHANCE_DAMAGE_CARGO = 4;
9564 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9565 const int CHANCE_DAMAGE_NOTHING = 2;
9566
9568 {
9569 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9570 int chances;
9571 int rnd;
9572
9573 if (GetInventory().GetCargo())
9574 {
9575 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9576 rnd = Math.RandomInt(0,chances);
9577
9578 if (rnd < CHANCE_DAMAGE_CARGO)
9579 {
9581 }
9582 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9583 {
9585 }
9586 }
9587 else
9588 {
9589 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9590 rnd = Math.RandomInt(0,chances);
9591
9592 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9593 {
9595 }
9596 }
9597 }
9598 }
9599
9601 {
9602 if (GetInventory().GetCargo())
9603 {
9604 int item_count = GetInventory().GetCargo().GetItemCount();
9605 if (item_count > 0)
9606 {
9607 int random_pick = Math.RandomInt(0, item_count);
9609 if (!item.IsExplosive())
9610 {
9611 item.AddHealth("","",damage);
9612 return true;
9613 }
9614 }
9615 }
9616 return false;
9617 }
9618
9620 {
9621 int attachment_count = GetInventory().AttachmentCount();
9622 if (attachment_count > 0)
9623 {
9624 int random_pick = Math.RandomInt(0, attachment_count);
9625 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
9626 if (!attachment.IsExplosive())
9627 {
9628 attachment.AddHealth("","",damage);
9629 return true;
9630 }
9631 }
9632 return false;
9633 }
9634
9636 {
9638 }
9639
9641 {
9643 return GetInventory().CanRemoveEntity();
9644
9645 return false;
9646 }
9647
9649 {
9650
9652 return false;
9653
9654
9656 return false;
9657
9658
9659
9661 if (delta == 0)
9662 return false;
9663
9664
9665 return true;
9666 }
9667
9669 {
9671 {
9672 if (ScriptInputUserData.CanStoreInputUserData())
9673 {
9674 ScriptInputUserData ctx = new ScriptInputUserData;
9679 ctx.
Write(destination_entity);
9683 }
9684 }
9685 else if (!
GetGame().IsMultiplayer())
9686 {
9688 }
9689 }
9690
9692 {
9693 float split_quantity_new;
9697 InventoryLocation loc = new InventoryLocation;
9698
9699 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9700 {
9702 split_quantity_new = stack_max;
9703 else
9705
9707 {
9708 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9709 if (new_item)
9710 {
9711 new_item.SetResultOfSplit(true);
9712 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9714 new_item.
SetQuantity(split_quantity_new,
false,
true);
9715 }
9716 }
9717 }
9718 else if (destination_entity && slot_id == -1)
9719 {
9720 if (quantity > stack_max)
9721 split_quantity_new = stack_max;
9722 else
9723 split_quantity_new = quantity;
9724
9726 {
9728 {
9731 }
9732
9733 if (new_item)
9734 {
9735 new_item.SetResultOfSplit(true);
9736 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9738 new_item.
SetQuantity(split_quantity_new,
false,
true);
9739 }
9740 }
9741 }
9742 else
9743 {
9744 if (stack_max != 0)
9745 {
9747 {
9749 }
9750
9751 if (split_quantity_new == 0)
9752 {
9753 if (!
GetGame().IsMultiplayer())
9754 player.PhysicalPredictiveDropItem(this);
9755 else
9756 player.ServerDropEntity(this);
9757 return;
9758 }
9759
9761 {
9763
9764 if (new_item)
9765 {
9766 new_item.SetResultOfSplit(true);
9767 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9770 new_item.PlaceOnSurface();
9771 }
9772 }
9773 }
9774 }
9775 }
9776
9778 {
9779 float split_quantity_new;
9783 InventoryLocation loc = new InventoryLocation;
9784
9785 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9786 {
9788 split_quantity_new = stack_max;
9789 else
9791
9793 {
9794 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9795 if (new_item)
9796 {
9797 new_item.SetResultOfSplit(true);
9798 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9800 new_item.
SetQuantity(split_quantity_new,
false,
true);
9801 }
9802 }
9803 }
9804 else if (destination_entity && slot_id == -1)
9805 {
9806 if (quantity > stack_max)
9807 split_quantity_new = stack_max;
9808 else
9809 split_quantity_new = quantity;
9810
9812 {
9814 {
9817 }
9818
9819 if (new_item)
9820 {
9821 new_item.SetResultOfSplit(true);
9822 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9824 new_item.
SetQuantity(split_quantity_new,
false,
true);
9825 }
9826 }
9827 }
9828 else
9829 {
9830 if (stack_max != 0)
9831 {
9833 {
9835 }
9836
9838 {
9840
9841 if (new_item)
9842 {
9843 new_item.SetResultOfSplit(true);
9844 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9847 new_item.PlaceOnSurface();
9848 }
9849 }
9850 }
9851 }
9852 }
9853
9855 {
9857 {
9858 if (ScriptInputUserData.CanStoreInputUserData())
9859 {
9860 ScriptInputUserData ctx = new ScriptInputUserData;
9865 dst.WriteToContext(ctx);
9867 }
9868 }
9869 else if (!
GetGame().IsMultiplayer())
9870 {
9872 }
9873 }
9874
9876 {
9878 {
9879 if (ScriptInputUserData.CanStoreInputUserData())
9880 {
9881 ScriptInputUserData ctx = new ScriptInputUserData;
9886 ctx.
Write(destination_entity);
9892 }
9893 }
9894 else if (!
GetGame().IsMultiplayer())
9895 {
9897 }
9898 }
9899
9901 {
9903 }
9904
9906 {
9908 float split_quantity_new;
9910 if (dst.IsValid())
9911 {
9912 int slot_id = dst.GetSlot();
9914
9915 if (quantity > stack_max)
9916 split_quantity_new = stack_max;
9917 else
9918 split_quantity_new = quantity;
9919
9921 {
9923
9924 if (new_item)
9925 {
9926 new_item.SetResultOfSplit(true);
9927 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9929 new_item.
SetQuantity(split_quantity_new,
false,
true);
9930 }
9931
9932 return new_item;
9933 }
9934 }
9935
9936 return null;
9937 }
9938
9940 {
9942 float split_quantity_new;
9944 if (destination_entity)
9945 {
9947 if (quantity > stackable)
9948 split_quantity_new = stackable;
9949 else
9950 split_quantity_new = quantity;
9951
9953 {
9954 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9955 if (new_item)
9956 {
9957 new_item.SetResultOfSplit(true);
9958 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9960 new_item.
SetQuantity(split_quantity_new,
false,
true);
9961 }
9962 }
9963 }
9964 }
9965
9967 {
9969 {
9970 if (ScriptInputUserData.CanStoreInputUserData())
9971 {
9972 ScriptInputUserData ctx = new ScriptInputUserData;
9977 ItemBase destination_entity =
this;
9978 ctx.
Write(destination_entity);
9982 }
9983 }
9984 else if (!
GetGame().IsMultiplayer())
9985 {
9987 }
9988 }
9989
9991 {
9993 float split_quantity_new;
9995 if (player)
9996 {
9998 if (quantity > stackable)
9999 split_quantity_new = stackable;
10000 else
10001 split_quantity_new = quantity;
10002
10004 {
10005 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10006 new_item =
ItemBase.Cast(in_hands);
10007 if (new_item)
10008 {
10009 new_item.SetResultOfSplit(true);
10010 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10012 new_item.SetQuantity(split_quantity_new, false, true);
10013 }
10014 }
10015 }
10016 }
10017
10019 {
10021 float split_quantity_new = Math.Floor(quantity * 0.5);
10022
10024 return;
10025
10027
10028 if (new_item)
10029 {
10030 if (new_item.GetQuantityMax() < split_quantity_new)
10031 {
10032 split_quantity_new = new_item.GetQuantityMax();
10033 }
10034
10035 new_item.SetResultOfSplit(true);
10036 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10037
10039 {
10042 }
10043 else
10044 {
10046 new_item.
SetQuantity(split_quantity_new,
false,
true);
10047 }
10048 }
10049 }
10050
10052 {
10054 float split_quantity_new = Math.Floor(quantity / 2);
10055
10057 return;
10058
10059 InventoryLocation invloc = new InventoryLocation;
10061
10063 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10064
10065 if (new_item)
10066 {
10067 if (new_item.GetQuantityMax() < split_quantity_new)
10068 {
10069 split_quantity_new = new_item.GetQuantityMax();
10070 }
10072 {
10075 }
10076 else if (split_quantity_new > 1)
10077 {
10079 new_item.
SetQuantity(split_quantity_new,
false,
true);
10080 }
10081 }
10082 }
10083
10086 {
10087 SetWeightDirty();
10089
10090 if (parent)
10091 parent.OnAttachmentQuantityChangedEx(this, delta);
10092
10094 {
10096 {
10098 }
10100 {
10101 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10103 }
10104 }
10105
10106 }
10107
10110 {
10111
10112 }
10113
10116 {
10118 }
10119
10121 {
10122 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10123
10125 {
10126 if (newLevel == GameConstants.STATE_RUINED)
10127 {
10129 EntityAI parent = GetHierarchyParent();
10130 if (parent && parent.IsFireplace())
10131 {
10132 CargoBase cargo = GetInventory().GetCargo();
10133 if (cargo)
10134 {
10136 {
10138 }
10139 }
10140 }
10141 }
10142
10144 {
10145
10147 return;
10148 }
10149
10150 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10151 {
10153 }
10154 }
10155 }
10156
10157
10159 {
10160 super.OnRightClick();
10161
10163 {
10165 {
10166 if (ScriptInputUserData.CanStoreInputUserData())
10167 {
10168 EntityAI root = GetHierarchyRoot();
10169 Man playerOwner = GetHierarchyRootPlayer();
10170 InventoryLocation dst = new InventoryLocation;
10171
10172
10173 if (!playerOwner && root && root == this)
10174 {
10176 }
10177 else
10178 {
10179
10180 GetInventory().GetCurrentInventoryLocation(dst);
10182 {
10185 {
10187 }
10188 else
10189 {
10191
10192
10193 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10194 {
10196 }
10197 else
10198 {
10199 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10200 }
10201 }
10202 }
10203 }
10204
10205 ScriptInputUserData ctx = new ScriptInputUserData;
10213 }
10214 }
10215 else if (!
GetGame().IsMultiplayer())
10216 {
10218 }
10219 }
10220 }
10221
10223 {
10224 if (root)
10225 {
10226 vector m4[4];
10227 root.GetTransform(m4);
10228 dst.SetGround(this, m4);
10229 }
10230 else
10231 {
10232 GetInventory().GetCurrentInventoryLocation(dst);
10233 }
10234 }
10235
10236 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10237 {
10238
10239 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10240 return false;
10241
10242 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10243 return false;
10244
10245
10247 return false;
10248
10249
10250 Magazine mag = Magazine.Cast(this);
10251 if (mag)
10252 {
10253 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10254 return false;
10255
10256 if (stack_max_limit)
10257 {
10258 Magazine other_mag = Magazine.Cast(other_item);
10259 if (other_item)
10260 {
10261 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10262 return false;
10263 }
10264
10265 }
10266 }
10267 else
10268 {
10269
10271 return false;
10272
10274 return false;
10275 }
10276
10277 PlayerBase player = null;
10278 if (CastTo(player, GetHierarchyRootPlayer()))
10279 {
10280 if (player.GetInventory().HasAttachment(this))
10281 return false;
10282
10283 if (player.IsItemsToDelete())
10284 return false;
10285 }
10286
10287 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10288 return false;
10289
10290 int slotID;
10292 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10293 return false;
10294
10295 return true;
10296 }
10297
10299 {
10301 }
10302
10304 {
10305 return m_IsResultOfSplit;
10306 }
10307
10309 {
10310 m_IsResultOfSplit = value;
10311 }
10312
10314 {
10316 }
10317
10319 {
10320 float other_item_quantity = other_item.GetQuantity();
10321 float this_free_space;
10322
10324
10326
10327 if (other_item_quantity > this_free_space)
10328 {
10329 return this_free_space;
10330 }
10331 else
10332 {
10333 return other_item_quantity;
10334 }
10335 }
10336
10338 {
10340 }
10341
10343 {
10345 return;
10346
10347 if (!IsMagazine() && other_item)
10348 {
10350 if (quantity_used != 0)
10351 {
10352 float hp1 = GetHealth01("","");
10353 float hp2 = other_item.GetHealth01("","");
10354 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10355 hpResult = hpResult / (
GetQuantity() + quantity_used);
10356
10357 hpResult *= GetMaxHealth();
10358 Math.Round(hpResult);
10359 SetHealth("", "Health", hpResult);
10360
10362 other_item.AddQuantity(-quantity_used);
10363 }
10364 }
10366 }
10367
10369 {
10370 #ifdef SERVER
10371 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10372 GetHierarchyParent().IncreaseLifetimeUp();
10373 #endif
10374 };
10375
10377 {
10378 PlayerBase p = PlayerBase.Cast(player);
10379
10380 array<int> recipesIds = p.m_Recipes;
10381 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10382 if (moduleRecipesManager)
10383 {
10384 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10385 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10386 }
10387
10388 for (int i = 0;i < recipesIds.Count(); i++)
10389 {
10390 int key = recipesIds.Get(i);
10391 string recipeName = moduleRecipesManager.GetRecipeName(key);
10393 }
10394 }
10395
10396
10397 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10398 {
10399 super.GetDebugActions(outputList);
10400
10401
10407
10408
10413
10418
10419
10423
10424
10426 {
10430 }
10431
10434
10435
10439
10441
10442 InventoryLocation loc = new InventoryLocation();
10443 GetInventory().GetCurrentInventoryLocation(loc);
10445 {
10446 if (Gizmo_IsSupported())
10449 }
10450
10452 }
10453
10454
10455
10456
10458 {
10459 super.OnAction(action_id, player, ctx);
10460
10462 {
10463 switch (action_id)
10464 {
10467 return true;
10470 return true;
10471 }
10472 }
10473
10475 {
10476 switch (action_id)
10477 {
10479 Delete();
10480 return true;
10481 }
10482 }
10483
10484 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10485 {
10486 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10487 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10488 PlayerBase p = PlayerBase.Cast(player);
10489 if (
EActions.RECIPES_RANGE_START < 1000)
10490 {
10491 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10492 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10493 }
10494 }
10495 #ifndef SERVER
10496 else if (action_id ==
EActions.WATCH_PLAYER)
10497 {
10498 PluginDeveloper.SetDeveloperItemClientEx(player);
10499 }
10500 #endif
10502 {
10503 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10504 {
10505 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10506 OnDebugButtonPressServer(id + 1);
10507 }
10508
10509 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10510 {
10511 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10513 }
10514
10515 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10516 {
10517 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10519 }
10520
10521 else if (action_id ==
EActions.ADD_QUANTITY)
10522 {
10523 if (IsMagazine())
10524 {
10525 Magazine mag = Magazine.Cast(this);
10526 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10527 }
10528 else
10529 {
10531 }
10532
10533 if (m_EM)
10534 {
10535 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10536 }
10537
10538 }
10539
10540 else if (action_id ==
EActions.REMOVE_QUANTITY)
10541 {
10542 if (IsMagazine())
10543 {
10544 Magazine mag2 = Magazine.Cast(this);
10545 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10546 }
10547 else
10548 {
10550 }
10551 if (m_EM)
10552 {
10553 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10554 }
10555
10556 }
10557
10558 else if (action_id ==
EActions.SET_QUANTITY_0)
10559 {
10561
10562 if (m_EM)
10563 {
10564 m_EM.SetEnergy(0);
10565 }
10566 }
10567
10568 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10569 {
10571
10572 if (m_EM)
10573 {
10574 m_EM.SetEnergy(m_EM.GetEnergyMax());
10575 }
10576 }
10577
10578 else if (action_id ==
EActions.ADD_HEALTH)
10579 {
10580 AddHealth("","",GetMaxHealth("","Health")/5);
10581 }
10582 else if (action_id ==
EActions.REMOVE_HEALTH)
10583 {
10584 AddHealth("","",-GetMaxHealth("","Health")/5);
10585 }
10586 else if (action_id ==
EActions.DESTROY_HEALTH)
10587 {
10588 SetHealth01("","",0);
10589 }
10590 else if (action_id ==
EActions.WATCH_ITEM)
10591 {
10593 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10594 #ifdef DEVELOPER
10595 SetDebugDeveloper_item(this);
10596 #endif
10597 }
10598
10599 else if (action_id ==
EActions.ADD_TEMPERATURE)
10600 {
10601 AddTemperature(20);
10602
10603 }
10604
10605 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10606 {
10607 AddTemperature(-20);
10608
10609 }
10610
10611 else if (action_id ==
EActions.FLIP_FROZEN)
10612 {
10613 SetFrozen(!GetIsFrozen());
10614
10615 }
10616
10617 else if (action_id ==
EActions.ADD_WETNESS)
10618 {
10620
10621 }
10622
10623 else if (action_id ==
EActions.REMOVE_WETNESS)
10624 {
10626
10627 }
10628
10629 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10630 {
10633
10634
10635 }
10636
10637 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10638 {
10641 }
10642
10643 else if (action_id ==
EActions.MAKE_SPECIAL)
10644 {
10645 auto debugParams = DebugSpawnParams.WithPlayer(player);
10646 OnDebugSpawnEx(debugParams);
10647 }
10648
10649 }
10650
10651
10652 return false;
10653 }
10654
10655
10656
10657
10661
10664
10665
10666
10668 {
10669 return false;
10670 }
10671
10672
10674 {
10675 return true;
10676 }
10677
10678
10680 {
10681 return true;
10682 }
10683
10684
10685
10687 {
10688 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10690 }
10691
10694 {
10695 return null;
10696 }
10697
10699 {
10700 return false;
10701 }
10702
10704 {
10705 return false;
10706 }
10707
10711
10712
10714 {
10715 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10716 return module_repairing.CanRepair(this, item_repair_kit);
10717 }
10718
10719
10720 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
10721 {
10722 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
10723 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10724 }
10725
10726
10728 {
10729
10730
10731
10732
10733
10734
10735
10736
10737 return 1;
10738 }
10739
10740
10741
10743 {
10745 }
10746
10747
10748
10750 {
10752 }
10753
10754
10763 {
10764 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10765
10766 if (player)
10767 {
10768 player.MessageStatus(text);
10769 }
10770 }
10771
10772
10781 {
10782 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10783
10784 if (player)
10785 {
10786 player.MessageAction(text);
10787 }
10788 }
10789
10790
10799 {
10800 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10801
10802 if (player)
10803 {
10804 player.MessageFriendly(text);
10805 }
10806 }
10807
10808
10817 {
10818 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10819
10820 if (player)
10821 {
10822 player.MessageImportant(text);
10823 }
10824 }
10825
10827 {
10828 return true;
10829 }
10830
10831
10832 override bool KindOf(
string tag)
10833 {
10834 bool found = false;
10835 string item_name = this.
GetType();
10838
10839 int array_size = item_tag_array.Count();
10840 for (int i = 0; i < array_size; i++)
10841 {
10842 if (item_tag_array.Get(i) == tag)
10843 {
10844 found = true;
10845 break;
10846 }
10847 }
10848 return found;
10849 }
10850
10851
10853 {
10854
10855 super.OnRPC(sender, rpc_type,ctx);
10856
10857
10858 switch (rpc_type)
10859 {
10860 #ifndef SERVER
10861 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10862 Param2<bool, string> p = new Param2<bool, string>(false, "");
10863
10865 return;
10866
10867 bool play = p.param1;
10868 string soundSet = p.param2;
10869
10870 if (play)
10871 {
10873 {
10875 {
10877 }
10878 }
10879 else
10880 {
10882 }
10883 }
10884 else
10885 {
10887 }
10888
10889 break;
10890 #endif
10891
10892 }
10893
10895 {
10897 }
10898 }
10899
10900
10901
10902
10904 {
10905 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10906 return plugin.GetID(
name);
10907 }
10908
10910 {
10911 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10912 return plugin.GetName(id);
10913 }
10914
10917 {
10918
10919
10920 int varFlags;
10921 if (!ctx.
Read(varFlags))
10922 return;
10923
10924 if (varFlags & ItemVariableFlags.FLOAT)
10925 {
10927 }
10928 }
10929
10931 {
10932
10933 super.SerializeNumericalVars(floats_out);
10934
10935
10936
10938 {
10940 }
10941
10943 {
10945 }
10946
10948 {
10950 }
10951
10953 {
10958 }
10959
10961 {
10963 }
10964 }
10965
10967 {
10968
10969 super.DeSerializeNumericalVars(floats);
10970
10971
10972 int index = 0;
10973 int mask = Math.Round(floats.Get(index));
10974
10975 index++;
10976
10978 {
10980 {
10982 }
10983 else
10984 {
10985 float quantity = floats.Get(index);
10986 SetQuantity(quantity,
true,
false,
false,
false);
10987 }
10988 index++;
10989 }
10990
10992 {
10993 float wet = floats.Get(index);
10995 index++;
10996 }
10997
10999 {
11000 int liquidtype = Math.Round(floats.Get(index));
11002 index++;
11003 }
11004
11006 {
11008 index++;
11010 index++;
11012 index++;
11014 index++;
11015 }
11016
11018 {
11019 int cleanness = Math.Round(floats.Get(index));
11021 index++;
11022 }
11023 }
11024
11026 {
11027 super.WriteVarsToCTX(ctx);
11028
11029
11031 {
11033 }
11034
11036 {
11038 }
11039
11041 {
11043 }
11044
11046 {
11047 int r,g,b,a;
11053 }
11054
11056 {
11058 }
11059 }
11060
11062 {
11063 if (!super.ReadVarsFromCTX(ctx,version))
11064 return false;
11065
11066 int intValue;
11067 float value;
11068
11069 if (version < 140)
11070 {
11071 if (!ctx.
Read(intValue))
11072 return false;
11073
11074 m_VariablesMask = intValue;
11075 }
11076
11078 {
11079 if (!ctx.
Read(value))
11080 return false;
11081
11083 {
11085 }
11086 else
11087 {
11089 }
11090 }
11091
11092 if (version < 140)
11093 {
11095 {
11096 if (!ctx.
Read(value))
11097 return false;
11098 SetTemperatureDirect(value);
11099 }
11100 }
11101
11103 {
11104 if (!ctx.
Read(value))
11105 return false;
11107 }
11108
11110 {
11111 if (!ctx.
Read(intValue))
11112 return false;
11114 }
11115
11117 {
11118 int r,g,b,a;
11120 return false;
11122 return false;
11124 return false;
11126 return false;
11127
11129 }
11130
11132 {
11133 if (!ctx.
Read(intValue))
11134 return false;
11136 }
11137
11138 if (version >= 138 && version < 140)
11139 {
11141 {
11142 if (!ctx.
Read(intValue))
11143 return false;
11144 SetFrozen(intValue);
11145 }
11146 }
11147
11148 return true;
11149 }
11150
11151
11153 {
11156 {
11158 }
11159
11160 if (!super.OnStoreLoad(ctx, version))
11161 {
11163 return false;
11164 }
11165
11166 if (version >= 114)
11167 {
11168 bool hasQuickBarIndexSaved;
11169
11170 if (!ctx.
Read(hasQuickBarIndexSaved))
11171 {
11173 return false;
11174 }
11175
11176 if (hasQuickBarIndexSaved)
11177 {
11178 int itmQBIndex;
11179
11180
11181 if (!ctx.
Read(itmQBIndex))
11182 {
11184 return false;
11185 }
11186
11187 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11188 if (itmQBIndex != -1 && parentPlayer)
11189 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11190 }
11191 }
11192 else
11193 {
11194
11195 PlayerBase player;
11196 int itemQBIndex;
11197 if (version ==
int.
MAX)
11198 {
11199 if (!ctx.
Read(itemQBIndex))
11200 {
11202 return false;
11203 }
11204 }
11205 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11206 {
11207
11208 if (!ctx.
Read(itemQBIndex))
11209 {
11211 return false;
11212 }
11213 if (itemQBIndex != -1 && player)
11214 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11215 }
11216 }
11217
11218 if (version < 140)
11219 {
11220
11221 if (!LoadVariables(ctx, version))
11222 {
11224 return false;
11225 }
11226 }
11227
11228
11230 {
11232 return false;
11233 }
11234 if (version >= 132)
11235 {
11237 if (raib)
11238 {
11240 {
11242 return false;
11243 }
11244 }
11245 }
11246
11248 return true;
11249 }
11250
11251
11252
11254 {
11255 super.OnStoreSave(ctx);
11256
11257 PlayerBase player;
11258 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11259 {
11261
11262 int itemQBIndex = -1;
11263 itemQBIndex = player.FindQuickBarEntityIndex(this);
11264 ctx.
Write(itemQBIndex);
11265 }
11266 else
11267 {
11269 }
11270
11272
11274 if (raib)
11275 {
11277 }
11278 }
11279
11280
11282 {
11283 super.AfterStoreLoad();
11284
11286 {
11288 }
11289
11291 {
11294 }
11295 }
11296
11298 {
11299 super.EEOnAfterLoad();
11300
11302 {
11304 }
11305
11308 }
11309
11311 {
11312 return false;
11313 }
11314
11315
11316
11318 {
11320 {
11321 #ifdef PLATFORM_CONSOLE
11322
11324 {
11326 if (menu)
11327 {
11329 }
11330 }
11331 #endif
11332 }
11333
11335 {
11338 }
11339
11341 {
11342 SetWeightDirty();
11344 }
11346 {
11349 }
11350
11352 {
11355 }
11357 {
11360 }
11361
11362 super.OnVariablesSynchronized();
11363 }
11364
11365
11366
11368 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11369 {
11370 if (!IsServerCheck(allow_client))
11371 return false;
11372
11374 return false;
11375
11378
11379 if (value <= (min + 0.001))
11380 value = min;
11381
11382 if (value == min)
11383 {
11384 if (destroy_config)
11385 {
11386 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11387 if (dstr)
11388 {
11390 this.Delete();
11391 return true;
11392 }
11393 }
11394 else if (destroy_forced)
11395 {
11397 this.Delete();
11398 return true;
11399 }
11400
11402 }
11403
11406
11408 {
11410
11411 if (delta)
11413 }
11414
11416
11417 return false;
11418 }
11419
11420
11422 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11423 {
11425 }
11426
11428 {
11431 }
11432
11434 {
11437 }
11438
11440 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11441 {
11442 float value_clamped = Math.Clamp(value, 0, 1);
11444 SetQuantity(result, destroy_config, destroy_forced);
11445 }
11446
11447
11450 {
11452 }
11453
11455 {
11457 }
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11469 {
11470 int slot = -1;
11471 if (GetInventory())
11472 {
11473 InventoryLocation il = new InventoryLocation;
11474 GetInventory().GetCurrentInventoryLocation(il);
11476 }
11477
11479 }
11480
11482 {
11483 float quantity_max = 0;
11484
11486 {
11487 if (attSlotID != -1)
11488 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11489
11490 if (quantity_max <= 0)
11492 }
11493
11494 if (quantity_max <= 0)
11496
11497 return quantity_max;
11498 }
11499
11501 {
11503 }
11504
11506 {
11508 }
11509
11510
11512 {
11514 }
11515
11517 {
11519 }
11520
11522 {
11524 }
11525
11526
11528 {
11529
11530 float weightEx = GetWeightEx();
11531 float special = GetInventoryAndCargoWeight();
11532 return weightEx - special;
11533 }
11534
11535
11537 {
11539 }
11540
11542 {
11544 {
11545 #ifdef DEVELOPER
11546 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11547 {
11548 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11550 }
11551 #endif
11552
11553 return GetQuantity() * GetConfigWeightModified();
11554 }
11555 else if (HasEnergyManager())
11556 {
11557 #ifdef DEVELOPER
11558 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11559 {
11560 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11561 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11562 }
11563 #endif
11564 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11565 }
11566 else
11567 {
11568 #ifdef DEVELOPER
11569 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11570 {
11571 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11572 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11573 }
11574 #endif
11575 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11576 }
11577 }
11578
11581 {
11582 int item_count = 0;
11584
11585 if (GetInventory().GetCargo() != NULL)
11586 {
11587 item_count = GetInventory().GetCargo().GetItemCount();
11588 }
11589
11590 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11591 {
11592 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11593 if (item)
11594 item_count += item.GetNumberOfItems();
11595 }
11596 return item_count;
11597 }
11598
11601 {
11602 float weight = 0;
11603 float wetness = 1;
11604 if (include_wetness)
11607 {
11608 weight = wetness * m_ConfigWeight;
11609 }
11611 {
11612 weight = 1;
11613 }
11614 return weight;
11615 }
11616
11617
11618
11620 {
11621 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11622 {
11623 GameInventory inv = GetInventory();
11624 array<EntityAI> items = new array<EntityAI>;
11626 for (int i = 0; i < items.Count(); i++)
11627 {
11629 if (item)
11630 {
11632 }
11633 }
11634 }
11635 }
11636
11637
11638
11639
11641 {
11642 float energy = 0;
11643 if (HasEnergyManager())
11644 {
11645 energy = GetCompEM().GetEnergy();
11646 }
11647 return energy;
11648 }
11649
11650
11652 {
11653 super.OnEnergyConsumed();
11654
11656 }
11657
11659 {
11660 super.OnEnergyAdded();
11661
11663 }
11664
11665
11667 {
11668 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11669 {
11671 {
11672 float energy_0to1 = GetCompEM().GetEnergy0To1();
11674 }
11675 }
11676 }
11677
11678
11680 {
11681 return ConfigGetFloat("heatIsolation");
11682 }
11683
11685 {
11687 }
11688
11690 {
11691 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11692 if (
GetGame().ConfigIsExisting(paramPath))
11694
11695 return 0.0;
11696 }
11697
11699 {
11700 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
11701 if (
GetGame().ConfigIsExisting(paramPath))
11703
11704 return 0.0;
11705 }
11706
11707 override void SetWet(
float value,
bool allow_client =
false)
11708 {
11709 if (!IsServerCheck(allow_client))
11710 return;
11711
11714
11716
11717 m_VarWet = Math.Clamp(value, min, max);
11718
11720 {
11723 }
11724 }
11725
11726 override void AddWet(
float value)
11727 {
11729 }
11730
11732 {
11734 }
11735
11737 {
11739 }
11740
11742 {
11744 }
11745
11747 {
11749 }
11750
11752 {
11754 }
11755
11756 override void OnWetChanged(
float newVal,
float oldVal)
11757 {
11760 if (newLevel != oldLevel)
11761 {
11763 }
11764 }
11765
11767 {
11768 SetWeightDirty();
11769 }
11770
11772 {
11773 return GetWetLevelInternal(
m_VarWet);
11774 }
11775
11776
11777
11779 {
11781 }
11782
11784 {
11786 }
11787
11789 {
11791 }
11792
11794 {
11796 }
11797
11798
11799
11801 {
11802 if (ConfigIsExisting("itemModelLength"))
11803 {
11804 return ConfigGetFloat("itemModelLength");
11805 }
11806 return 0;
11807 }
11808
11810 {
11811 if (ConfigIsExisting("itemAttachOffset"))
11812 {
11813 return ConfigGetFloat("itemAttachOffset");
11814 }
11815 return 0;
11816 }
11817
11818 override void SetCleanness(
int value,
bool allow_client =
false)
11819 {
11820 if (!IsServerCheck(allow_client))
11821 return;
11822
11824
11826
11829 }
11830
11832 {
11834 }
11835
11837 {
11838 return true;
11839 }
11840
11841
11842
11843
11845 {
11847 }
11848
11850 {
11852 }
11853
11854
11855
11856
11857 override void SetColor(
int r,
int g,
int b,
int a)
11858 {
11864 }
11866 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11867 {
11872 }
11873
11875 {
11877 }
11878
11881 {
11882 int r,g,b,a;
11884 r = r/255;
11885 g = g/255;
11886 b = b/255;
11887 a = a/255;
11888 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11889 }
11890
11891
11892
11893 override void SetLiquidType(
int value,
bool allow_client =
false)
11894 {
11895 if (!IsServerCheck(allow_client))
11896 return;
11897
11902 }
11903
11905 {
11906 return ConfigGetInt("varLiquidTypeInit");
11907 }
11908
11910 {
11912 }
11913
11915 {
11917 SetFrozen(false);
11918 }
11919
11922 {
11923 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11924 }
11925
11926
11929 {
11930 PlayerBase nplayer;
11931 if (PlayerBase.CastTo(nplayer, player))
11932 {
11934
11935 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11936 }
11937 }
11938
11939
11942 {
11943 PlayerBase nplayer;
11944 if (PlayerBase.CastTo(nplayer,player))
11945 {
11946
11947 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11948
11949 }
11950
11951
11952 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11953
11954
11955 if (HasEnergyManager())
11956 {
11957 GetCompEM().UpdatePlugState();
11958 }
11959 }
11960
11961
11963 {
11964 super.OnPlacementStarted(player);
11965
11967 }
11968
11969 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11970 {
11972 {
11973 m_AdminLog.OnPlacementComplete(player,
this);
11974 }
11975
11976 super.OnPlacementComplete(player, position, orientation);
11977 }
11978
11979
11980
11981
11982
11984 {
11986 {
11987 return true;
11988 }
11989 else
11990 {
11991 return false;
11992 }
11993 }
11994
11995
11997 {
11999 {
12001 }
12002 }
12003
12004
12006 {
12008 }
12009
12011 {
12013 }
12014
12015 override void InsertAgent(
int agent,
float count = 1)
12016 {
12017 if (count < 1)
12018 return;
12019
12021 }
12022
12025 {
12027 }
12028
12029
12031 {
12033 }
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12077 {
12079 return false;
12080 return true;
12081 }
12082
12084 {
12085
12087 }
12088
12089
12092 {
12093 super.CheckForRoofLimited(timeTresholdMS);
12094
12096 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12097 {
12098 m_PreviousRoofTestTime = time;
12099 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12100 }
12101 }
12102
12103
12105 {
12107 {
12108 return 0;
12109 }
12110
12111 if (GetInventory().GetAttachmentSlotsCount() != 0)
12112 {
12113 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12114 if (filter)
12115 return filter.GetProtectionLevel(type, false, system);
12116 else
12117 return 0;
12118 }
12119
12120 string subclassPath, entryName;
12121
12122 switch (type)
12123 {
12125 entryName = "biological";
12126 break;
12128 entryName = "chemical";
12129 break;
12130 default:
12131 entryName = "biological";
12132 break;
12133 }
12134
12135 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12136
12138 }
12139
12140
12141
12144 {
12145 if (!IsMagazine())
12147
12149 }
12150
12151
12152
12153
12154
12159 {
12160 return true;
12161 }
12162
12164 {
12166 }
12167
12168
12169
12170
12171
12173 {
12174 if (parent)
12175 {
12176 if (parent.IsInherited(DayZInfected))
12177 return true;
12178
12179 if (!parent.IsRuined())
12180 return true;
12181 }
12182
12183 return true;
12184 }
12185
12187 {
12188 if (!super.CanPutAsAttachment(parent))
12189 {
12190 return false;
12191 }
12192
12193 if (!IsRuined() && !parent.IsRuined())
12194 {
12195 return true;
12196 }
12197
12198 return false;
12199 }
12200
12202 {
12203
12204
12205
12206
12207 return super.CanReceiveItemIntoCargo(item);
12208 }
12209
12211 {
12212
12213
12214
12215
12216 GameInventory attachmentInv = attachment.GetInventory();
12218 {
12219 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12220 return false;
12221 }
12222
12223 InventoryLocation loc = new InventoryLocation();
12224 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12225 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12226 return false;
12227
12228 return super.CanReceiveAttachment(attachment, slotId);
12229 }
12230
12232 {
12233 if (!super.CanReleaseAttachment(attachment))
12234 return false;
12235
12236 return GetInventory().AreChildrenAccessible();
12237 }
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12260 {
12261 int id = muzzle_owner.GetMuzzleID();
12262 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12263
12264 if (WPOF_array)
12265 {
12266 for (int i = 0; i < WPOF_array.Count(); i++)
12267 {
12268 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12269
12270 if (WPOF)
12271 {
12272 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12273 }
12274 }
12275 }
12276 }
12277
12278
12280 {
12281 int id = muzzle_owner.GetMuzzleID();
12283
12284 if (WPOBE_array)
12285 {
12286 for (int i = 0; i < WPOBE_array.Count(); i++)
12287 {
12288 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12289
12290 if (WPOBE)
12291 {
12292 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12293 }
12294 }
12295 }
12296 }
12297
12298
12300 {
12301 int id = muzzle_owner.GetMuzzleID();
12302 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12303
12304 if (WPOOH_array)
12305 {
12306 for (int i = 0; i < WPOOH_array.Count(); i++)
12307 {
12308 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12309
12310 if (WPOOH)
12311 {
12312 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12313 }
12314 }
12315 }
12316 }
12317
12318
12320 {
12321 int id = muzzle_owner.GetMuzzleID();
12322 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12323
12324 if (WPOOH_array)
12325 {
12326 for (int i = 0; i < WPOOH_array.Count(); i++)
12327 {
12328 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12329
12330 if (WPOOH)
12331 {
12332 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12333 }
12334 }
12335 }
12336 }
12337
12338
12340 {
12341 int id = muzzle_owner.GetMuzzleID();
12342 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12343
12344 if (WPOOH_array)
12345 {
12346 for (int i = 0; i < WPOOH_array.Count(); i++)
12347 {
12348 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12349
12350 if (WPOOH)
12351 {
12352 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12353 }
12354 }
12355 }
12356 }
12357
12358
12359
12361 {
12363 {
12364 return true;
12365 }
12366
12367 return false;
12368 }
12369
12371 {
12373 {
12374 return true;
12375 }
12376
12377 return false;
12378 }
12379
12381 {
12383 {
12384 return true;
12385 }
12386
12387 return false;
12388 }
12389
12391 {
12392 return false;
12393 }
12394
12397 {
12398 return UATimeSpent.DEFAULT_DEPLOY;
12399 }
12400
12401
12402
12403
12405 {
12407 SetSynchDirty();
12408 }
12409
12411 {
12413 }
12414
12415
12417 {
12418 return false;
12419 }
12420
12423 {
12424 string att_type = "None";
12425
12426 if (ConfigIsExisting("soundAttType"))
12427 {
12428 att_type = ConfigGetString("soundAttType");
12429 }
12430
12432 }
12433
12435 {
12437 }
12438
12439
12440
12441
12442
12448
12450 {
12453
12455 }
12456
12457
12459 {
12461 return;
12462
12464
12467
12470
12471 SoundParameters params = new SoundParameters();
12475 }
12476
12477
12479 {
12481 return;
12482
12484 SetSynchDirty();
12485
12488 }
12489
12490
12492 {
12494 return;
12495
12497 SetSynchDirty();
12498
12501 }
12502
12504 {
12506 }
12507
12509 {
12511 }
12512
12515 {
12516 if (!
GetGame().IsDedicatedServer())
12517 {
12518 if (ConfigIsExisting("attachSoundSet"))
12519 {
12520 string cfg_path = "";
12521 string soundset = "";
12522 string type_name =
GetType();
12523
12526 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12527 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12528
12529 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12530 {
12531 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12532 {
12533 if (cfg_slot_array[i] == slot_type)
12534 {
12535 soundset = cfg_soundset_array[i];
12536 break;
12537 }
12538 }
12539 }
12540
12541 if (soundset != "")
12542 {
12543 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12545 }
12546 }
12547 }
12548 }
12549
12551 {
12552
12553 }
12554
12555 void OnApply(PlayerBase player);
12556
12558 {
12559 return 1.0;
12560 };
12561
12563 {
12565 }
12566
12568 {
12570 }
12571
12573
12575 {
12576 SetDynamicPhysicsLifeTime(0.01);
12578 }
12579
12581 {
12582 array<string> zone_names = new array<string>;
12583 GetDamageZones(zone_names);
12584 for (int i = 0; i < zone_names.Count(); i++)
12585 {
12586 SetHealthMax(zone_names.Get(i),"Health");
12587 }
12588 SetHealthMax("","Health");
12589 }
12590
12593 {
12594 float global_health = GetHealth01("","Health");
12595 array<string> zones = new array<string>;
12596 GetDamageZones(zones);
12597
12598 for (int i = 0; i < zones.Count(); i++)
12599 {
12600 SetHealth01(zones.Get(i),"Health",global_health);
12601 }
12602 }
12603
12606 {
12607 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12608 }
12609
12611 {
12612 if (!hasRootAsPlayer)
12613 {
12614 if (refParentIB)
12615 {
12616
12617 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12618 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12619
12620 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12621 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12622
12625 }
12626 else
12627 {
12628
12631 }
12632 }
12633 }
12634
12636 {
12638 {
12639 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12640 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
12641 {
12642 float heatPermCoef = 1.0;
12644 while (ent)
12645 {
12646 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12647 ent = ent.GetHierarchyParent();
12648 }
12649
12650 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12651 }
12652 }
12653 }
12654
12656 {
12657
12658 EntityAI parent = GetHierarchyParent();
12659 if (!parent)
12660 {
12661 hasParent = false;
12662 hasRootAsPlayer = false;
12663 }
12664 else
12665 {
12666 hasParent = true;
12667 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12668 refParentIB =
ItemBase.Cast(parent);
12669 }
12670 }
12671
12672 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12673 {
12674
12675 }
12676
12678 {
12679
12680 return false;
12681 }
12682
12684 {
12685
12686
12687 return false;
12688 }
12689
12691 {
12692
12693 return false;
12694 }
12695
12698 {
12699 return !GetIsFrozen() &&
IsOpen();
12700 }
12701
12703 {
12704 bool hasParent = false, hasRootAsPlayer = false;
12706
12707 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
12708 bool foodDecay =
g_Game.IsFoodDecayEnabled();
12709
12710 if (wwtu || foodDecay)
12711 {
12715
12716 if (processWetness || processTemperature || processDecay)
12717 {
12719
12720 if (processWetness)
12721 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
12722
12723 if (processTemperature)
12725
12726 if (processDecay)
12727 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
12728 }
12729 }
12730 }
12731
12734 {
12736 }
12737
12739 {
12742
12743 return super.GetTemperatureFreezeThreshold();
12744 }
12745
12747 {
12750
12751 return super.GetTemperatureThawThreshold();
12752 }
12753
12755 {
12758
12759 return super.GetItemOverheatThreshold();
12760 }
12761
12763 {
12765 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12766
12767 return super.GetTemperatureFreezeTime();
12768 }
12769
12771 {
12773 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12774
12775 return super.GetTemperatureThawTime();
12776 }
12777
12782
12784 {
12785 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12786 }
12787
12789 {
12790 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12791 }
12792
12795 {
12797 }
12798
12800 {
12802 }
12803
12805 {
12807 }
12808
12811 {
12812 return null;
12813 }
12814
12817 {
12818 return false;
12819 }
12820
12822 {
12824 {
12827 if (!trg)
12828 {
12830 explosive = this;
12831 }
12832
12833 explosive.PairRemote(trg);
12835
12836 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12837 trg.SetPersistentPairID(persistentID);
12838 explosive.SetPersistentPairID(persistentID);
12839
12840 return true;
12841 }
12842 return false;
12843 }
12844
12847 {
12848 float ret = 1.0;
12851 ret *= GetHealth01();
12852
12853 return ret;
12854 }
12855
12856 #ifdef DEVELOPER
12857 override void SetDebugItem()
12858 {
12859 super.SetDebugItem();
12860 _itemBase = this;
12861 }
12862
12864 {
12865 string text = super.GetDebugText();
12866
12868 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12869
12870 return text;
12871 }
12872 #endif
12873
12875 {
12876 return true;
12877 }
12878
12880
12882
12884 {
12887 }
12888
12889
12897
12913}
12914
12916{
12918 if (entity)
12919 {
12920 bool is_item = entity.IsInherited(
ItemBase);
12921 if (is_item && full_quantity)
12922 {
12925 }
12926 }
12927 else
12928 {
12930 return NULL;
12931 }
12932 return entity;
12933}
12934
12936{
12937 if (item)
12938 {
12939 if (health > 0)
12940 item.SetHealth("", "", health);
12941
12942 if (item.CanHaveTemperature())
12943 {
12945 if (item.CanFreeze())
12946 item.SetFrozen(false);
12947 }
12948
12949 if (item.HasEnergyManager())
12950 {
12951 if (quantity >= 0)
12952 {
12953 item.GetCompEM().SetEnergy0To1(quantity);
12954 }
12955 else
12956 {
12958 }
12959 }
12960 else if (item.IsMagazine())
12961 {
12962 Magazine mag = Magazine.Cast(item);
12963 if (quantity >= 0)
12964 {
12965 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12966 }
12967 else
12968 {
12970 }
12971
12972 }
12973 else
12974 {
12975 if (quantity >= 0)
12976 {
12977 item.SetQuantityNormalized(quantity, false);
12978 }
12979 else
12980 {
12982 }
12983
12984 }
12985 }
12986}
12987
12988#ifdef DEVELOPER
12990#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.