Ejemplo n.º 1
0
Archivo: Free.cs Proyecto: S4slean/TONO
    public void SpreadFire()
    {
        if (neighbours.up != null && neighbours.up.hasAlcohol)
        {
            Free f = (Free)neighbours.up;
            f.SetFire();
        }
        else if (neighbours.up != null && neighbours.up.GetPawnOnTile() is Barrel)
        {
            Barrel barrel = (Barrel)neighbours.up.GetPawnOnTile();
            barrel.Explode();
        }

        if (neighbours.down != null && neighbours.down.hasAlcohol)
        {
            Free f = (Free)neighbours.down;
            f.SetFire();
        }
        else if (neighbours.down != null && neighbours.down.GetPawnOnTile() is Barrel)
        {
            Barrel barrel = (Barrel)neighbours.down.GetPawnOnTile();
            barrel.Explode();
        }

        if (neighbours.left != null && neighbours.left.hasAlcohol)
        {
            Free f = (Free)neighbours.left;
            f.SetFire();
        }
        else if (neighbours.left != null && neighbours.left.GetPawnOnTile() is Barrel)
        {
            Barrel barrel = (Barrel)neighbours.left.GetPawnOnTile();
            barrel.Explode();
        }

        if (neighbours.right != null && neighbours.right.hasAlcohol)
        {
            Free f = (Free)neighbours.right;
            f.SetFire();
        }
        else if (neighbours.right != null && neighbours.right.GetPawnOnTile() is Barrel)
        {
            Barrel barrel = (Barrel)neighbours.right.GetPawnOnTile();
            barrel.Explode();
        }
    }
 public void Explode(Vector3 force, float additionalDelay)
 {
     RealExplodeable.Explode(force, additionalDelay);
 }