예제 #1
0
파일: BaseBomb.cs 프로젝트: R3D87/Bomberman
    void PropateExplotion(int x, int y, int limit, int xStep, int yStep)
    {
        Debug.Log("X: " + x + " Y: " + y);
        if (limit >= ExplotionRange)
        {
            return;
        }

        BaseTile tileToCheck = tile.GetNeigbourInDirection(x, y);

        if (tileToCheck.GetType() == typeof(Wall))
        {
            return;
        }
        ExplosionEffect SFX = Instantiate(effect, tileToCheck.transform.position, Quaternion.identity);

        tileToCheck.AddObjectToTile(SFX);

        tileToCheck.GetComponent <IDamage>().TakeDamage(Damage);
        if (xStep == 0 && yStep == 0)
        {
            return;
        }

        limit++;

        PropateExplotion(x + xStep, y + yStep, limit, xStep, yStep);
    }
예제 #2
0
    public bool CanPerform(BaseTile t)
    {
        if (t == null)
        {
            return(CanPerform());
        }

        bool contains = false;

        foreach (var f in affectedTypes)
        {
            if (f == t.GetType())
            {
                contains = true;
            }
        }

        return(contains && CanPerform());
    }
예제 #3
0
    private bool CanBlockLazer(BaseTile tile)
    {
        if (tile == null)
        {
            return(false);
        }
        //if (!(t is NormalTile) && !(t is PorterStartTile)) return true;

        foreach (var type in blockTileTypes)
        {
            if (tile.GetType() == type)
            {
                return(true);
            }
            if (_rmm?.GetRobot(tile.ParentGrid.ColID, tile.ParentGrid.RowID))
            {
                return(true);
            }
        }
        return(false);
    }