private IEnumerator ActivatePuzzleCombo(GameEntity puzzleCombo)
    {
        CellHelper.BlockFallAt(puzzleCombo.gridPosition.value);

        yield return(null);

        yield return(new WaitWhile(() => WaitHelper.Has(WaitType.FallingItem)));

        WaitHelper.Increase(WaitType.Hint, WaitType.Input, WaitType.Fall, WaitType.Turn, WaitType.CriticalAnimation);

        var cubes = GetColorCubes(puzzleCombo.color.Value);

        puzzleCombo.AddPuzzleTargetedCubes(cubes);

        yield return(new WaitWhile(() => puzzleCombo.hasPuzzleTargetedCubes));

        yield return(new WaitUntil(() => puzzleCombo.hasPosItemsToActivate));

        CellHelper.UnBlockFallAt(puzzleCombo.gridPosition.value);

        puzzleCombo.isWillBeDestroyed = true;

        yield return(ActivatePositiveItemsSequentially(puzzleCombo.posItemsToActivate.PosItemIds));

        WaitHelper.Reduce(WaitType.Hint, WaitType.Input, WaitType.Fall, WaitType.Turn, WaitType.CriticalAnimation);
    }
    private void ActivateRotorRotor(GameEntity entity)
    {
        WaitHelper.Increase(WaitType.CriticalAnimation);
        CellHelper.BlockFallAt(entity.gridPosition.value);

        entity.isSpawnAnimationStarted = true;
    }
Ejemplo n.º 3
0
    private void ActivateTntTnt(GameEntity tntTnt)
    {
        WaitHelper.Increase(WaitType.Input, WaitType.Turn, WaitType.CriticalAnimation);

        var pos    = tntTnt.gridPosition.value;
        var radius = tntTnt.tntTnt.Radius;

        for (int x = pos.x - radius; x <= pos.x + radius; x++)
        {
            for (int y = pos.y - radius; y <= pos.y + radius; y++)
            {
                CellHelper.BlockFallAt(new Vector2Int(x, y));
            }
        }

        tntTnt.isSpawnAnimationStarted = true;
    }
    private void ActivateTnt(GameEntity tnt)
    {
        WaitHelper.Increase(WaitType.Input, WaitType.Turn, WaitType.CriticalAnimation);

        tnt.isTntExplosionStarted = true;
        tnt.isCanFall             = false;

        var       tntPos = tnt.gridPosition.value;
        const int radius = 1;

        for (var x = tntPos.x - radius; x <= tntPos.x + radius; x++)
        {
            for (var y = tntPos.y - radius; y <= tntPos.y + radius; y++)
            {
                CellHelper.BlockFallAt(new Vector2Int(x, y));
            }
        }
    }