示例#1
0
        /// <summary>
        /// Manually uses each ashes on a tarromin potions to make serums.
        /// </summary>
        /// <returns>true if successful</returns>
        protected bool MakeSerums()
        {
            Point ashesInventorySlot;
            Point tarrominPotionInventorySlot;

            for (int i = 0; i < HALF_INVENTORY; i++)
            {
                if (StopFlag)
                {
                    return(false);
                }

                ashesInventorySlot = Inventory.InventoryIndexToCoordinates(i);
                if (ashesInventorySlot.Y % 2 == 1)  //Iterate through odd rows right to left instead of left to right like on even rows.
                {
                    ashesInventorySlot = Inventory.MirrorHorizontal(ashesInventorySlot);
                }
                tarrominPotionInventorySlot = Inventory.MirrorVertical(ashesInventorySlot);

                if (i % 2 == 0)
                {   //Use top half item on mirrored bottom half item.
                    Inventory.UseItemOnItem(ashesInventorySlot, tarrominPotionInventorySlot, false);
                }
                else
                {   //Use bottom half item on mirrored top half item.
                    Inventory.UseItemOnItem(tarrominPotionInventorySlot, ashesInventorySlot, false);
                }

                RunParams.Iterations--;
            }
            return(true);
        }