Example #1
0
 private static void DropEvenly(ItemType t, Vector2 baseLoc, int count, bool autocollect, float r, float a0)
 {
     for (int ii = 0; ii < count; ++ii)
     {
         ItemPooler.RequestItem(new ItemRequestContext(baseLoc, r * M.CosSinDeg(a0 + ii * 360f / count)), t)
         ?.Autocollect(autocollect || t.Autocollect());
     }
 }
Example #2
0
        private static void DropEvenly(ItemType t, ItemType small, decimal smallRatio, Vector2 baseLoc,
                                       decimal count, bool autocollect, float r, float a0)
        {
            int fullCt  = (int)Math.Floor(count);
            int smallCt = (int)Math.Floor((count - fullCt) / smallRatio);
            var step    = 360f / (smallCt + fullCt);

            if (fullCt > 0)
            {
                a0 -= (fullCt - 1f) / 2f * step;
            }
            for (int ii = 0; ii < smallCt + fullCt; ++ii)
            {
                ItemPooler.RequestItem(new ItemRequestContext(baseLoc, r * M.CosSinDeg(a0 + ii * step)), ii < fullCt ? t : small)
                ?.Autocollect(autocollect || t.Autocollect());
            }
        }
Example #3
0
 public void DropOne(ItemType type) =>
 ItemPooler.RequestItem(new ItemRequestContext(rBPI.loc, Vector2.zero), type);