941 {
945 {
948 if (!itemTypes || !itemBaseQuantities)
949 return;
950
951 float quantityToolCoef = 1.0;
952 ItemBase tool = player.GetItemInHands();
953 if (tool)
954 {
955
956 }
957
958
959 vector posHead = MiscGameplayFunctions.GetPlayerHeadPosition(player);
960 vector destination = player.GetPosition();
963 if (parent.MemoryPointExists("" + partName + "_materials"))
964 {
965 destination = parent.GetMemoryPointPos("" + partName + "_materials");
966 destination =
g_Game.ObjectModelToWorld(parent, destination);
967 }
968 else if (parent.MemoryPointExists("" + mainPartName + "_materials"))
969 {
970 destination = parent.GetMemoryPointPos("" + mainPartName + "_materials");
971 destination =
g_Game.ObjectModelToWorld(parent, destination);
972 }
973
974
975 int count = itemTypes.Count();
976 for (int i = 0; i < count; ++i)
977 {
978 string itemType = itemTypes[i];
979 float quantity = itemBaseQuantities[i];
980 quantity *= quantityToolCoef;
982 if (quantity <= 0)
983 {
984 continue;
985 }
986
987 MiscGameplayFunctions.CreateItemBasePilesDispersed(itemType, posHead, destination,
UAItemsSpreadRadius.
NARROW,quantity, MiscGameplayFunctions.GetTypeMaxGlobalHealth(itemType), player);
988 }
989 }
990 }
ConstructionPartTypeData m_PartTypeData
Super root of all classes in Enforce script.
array< string > GetRubbleMaterialTypes()
array< float > GetRubbleMaterialBaseQuantities()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Round(float f)
Returns mathematical round of value.