protected override IEnumerator UsePowerRoutine(GridScript gridScript, Grid grid)
        {
            gridScript.PowerCharge = 0f;

            // Search & destroy garbages
            for (int y = 0; y < gridScript.settings.height; y++)
            {
                for (int x = 0; x < gridScript.settings.width; x++)
                {
                    var b = gridScript.Get(x, y);
                    if (b != null && b.block.IsEmpty == false &&
                        b.block.Definition.isGarbage &&
                        b.block.IsConverting == false)
                    {
                        gridScript.TheGrid.BreakGarbage(b.block);
                    }

                    yield return(new WaitForSeconds(0.015f));
                }
            }

            RaisePowerUsed(new PowerUseParams()
            {
                gridScript = gridScript,
                player     = gridScript.player,
                // fx = fx
            });

            EndPower(gridScript);
        }
Esempio n. 2
0
        protected override IEnumerator UsePowerOnOpponent(GridScript gridScript, Grid grid, PowerUseParams param)
        {
            // Wow wow wow.
            // It's going to be fun.
            // Take the blocks below
            // And hide them.
            // Easy?
            // But it scrolls. HA
            // F**k
            // What a shitty power idea.
            for (int x = 0; x < grid.width; x++)
            {
                for (int y = -grid.previewLines; y < 2; y++)
                {
                    var bs = gridScript.Get(x, y);
                    if (bs != null && bs.block.IsEmpty == false &&
                        bs.block.Definition.isGarbage == false)
                    {
                        bs.Hide(3.5f);
                        yield return(new WaitForEndOfFrame());
                    }
                }
            }

            EndPowerOnOpponent(gridScript, grid);
        }
        public override bool CanUsePower(GridScript gridScript, Grid grid)
        {
            for (int y = 0; y < gridScript.settings.height; y++)
            {
                for (int x = 0; x < gridScript.settings.width; x++)
                {
                    var b = gridScript.Get(x, y);
                    if (b != null && b.block.IsEmpty == false &&
                        b.block.Definition.isGarbage &&
                        b.block.IsConverting == false)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }