Exemple #1
0
 public override void Activate(GamePawn user, Tile target)
 {
     //base.Activate(user, target);
 }
Exemple #2
0
 public virtual List <Tile> GetRange(GamePawn user, bool useCombo)
 {
     return(new List <Tile>());
 }
Exemple #3
0
 public virtual void OnKicked(GamePawn user, int dmg, Direction dir)
 {
 }
Exemple #4
0
 public virtual List <Tile> HasAvailableTarget(GamePawn user)
 {
     return(null);
 }
Exemple #5
0
 public virtual List <Tile> GetRange(GamePawn user)
 {
     return(new List <Tile>());
 }
Exemple #6
0
 public virtual void SetPawnOnTile(GamePawn pawn)
 {
     pawnOnTile = pawn;
 }
Exemple #7
0
 public override void Preview(GamePawn user)
 {
     user.SetPreviewID(Highlight_Manager.instance.ShowHighlight(ComboManager.instance.AddBarrelToComboPreview((Barrel)user, true), HighlightMode.ExplosionPreview));
 }
Exemple #8
0
    public void ThrowProjectile(GamePawn user, GamePawn target, GameObject projectile, int dmg)
    {
        GameObject instance = Instantiate(projectile, user.transform.position + Vector3.up, Quaternion.identity);

        instance.GetComponent <Projectiles>().Throw(target.transform, user, dmg);
    }
Exemple #9
0
 public override List <Tile> HasAvailableTarget(GamePawn user)
 {
     return(null);
 }
Exemple #10
0
 public override void Preview(GamePawn user)
 {
 }
Exemple #11
0
    public List <Tile> GetCrossRange(GamePawn user, int range, bool usingCombo = false)
    {
        Tile        startingTile = user.GetTile();
        List <Tile> res          = new List <Tile>();

        res.Add(startingTile);
        Tile currentUp;
        Tile currentRight;
        Tile currentDown;
        Tile currentLeft;

        //UP-RIGHT
        currentUp    = startingTile.neighbours.up;
        currentRight = startingTile.neighbours.right;
        for (int i = 0; i < range; i++)
        {
            if (currentUp != null || currentRight != null)
            {
                if (!IsWall(currentUp) || !IsWall(currentRight))
                {
                    Tile checkTile = null;
                    if (currentUp == null || IsWall(currentUp))
                    {
                        checkTile = currentRight.neighbours.up;
                    }
                    else if (currentRight == null || IsWall(currentRight))
                    {
                        checkTile = currentUp.neighbours.right;
                    }
                    else
                    {
                        checkTile = currentUp.neighbours.right;
                    }
                    CheckForCombo(res, checkTile, usingCombo);
                    if (checkTile != null && !IsWall(checkTile))
                    {
                        currentUp    = checkTile.neighbours.up;
                        currentRight = checkTile.neighbours.right;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }

        //RIGHT-DOWN
        currentRight = startingTile.neighbours.right;
        currentDown  = startingTile.neighbours.down;
        for (int i = 0; i < range; i++)
        {
            if (currentRight != null || currentDown != null)
            {
                if (!IsWall(currentRight) || !IsWall(currentDown))
                {
                    Tile checkTile = null;
                    if (currentRight == null || IsWall(currentRight))
                    {
                        checkTile = currentDown.neighbours.right;
                    }
                    else if (currentDown == null || IsWall(currentDown))
                    {
                        checkTile = currentRight.neighbours.down;
                    }
                    else
                    {
                        checkTile = currentRight.neighbours.down;
                    }
                    CheckForCombo(res, checkTile, usingCombo);
                    if (checkTile != null && !IsWall(checkTile))
                    {
                        currentRight = checkTile.neighbours.right;
                        currentDown  = checkTile.neighbours.down;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }

        //DOWN-LEFT
        currentDown = startingTile.neighbours.down;
        currentLeft = startingTile.neighbours.left;
        for (int i = 0; i < range; i++)
        {
            if (currentDown != null || currentLeft != null)
            {
                if (!IsWall(currentDown) || !IsWall(currentLeft))
                {
                    Tile checkTile = null;
                    if (currentDown == null || IsWall(currentDown))
                    {
                        checkTile = currentLeft.neighbours.down;
                    }
                    else if (currentLeft == null || IsWall(currentLeft))
                    {
                        checkTile = currentDown.neighbours.left;
                    }
                    else
                    {
                        checkTile = currentDown.neighbours.left;
                    }
                    CheckForCombo(res, checkTile, usingCombo);
                    if (checkTile != null && !IsWall(checkTile))
                    {
                        currentDown = checkTile.neighbours.down;
                        currentLeft = checkTile.neighbours.left;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }

        //LEFT-UP
        currentLeft = startingTile.neighbours.left;
        currentUp   = startingTile.neighbours.up;
        for (int i = 0; i < range; i++)
        {
            if (currentLeft != null || currentUp != null)
            {
                if (!IsWall(currentLeft) || !IsWall(currentUp))
                {
                    Tile checkTile = null;
                    if (currentLeft == null || IsWall(currentLeft))
                    {
                        checkTile = currentUp.neighbours.left;
                    }
                    else if (currentUp == null || IsWall(currentUp))
                    {
                        checkTile = currentLeft.neighbours.up;
                    }
                    else
                    {
                        checkTile = currentLeft.neighbours.up;
                    }
                    CheckForCombo(res, checkTile, usingCombo);
                    if (checkTile != null && !IsWall(checkTile))
                    {
                        currentLeft = checkTile.neighbours.left;
                        currentUp   = checkTile.neighbours.up;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }
        //print("Cross Range : " + res.Count);
        return(res);
    }
Exemple #12
0
    public List <Tile> GetPlusRange(GamePawn user, int range, bool usingCombo = false)
    {
        Tile        startingTile = user.GetTile();
        List <Tile> res          = new List <Tile>();

        res.Add(startingTile);
        Tile currentTile;

        //UP
        currentTile = startingTile.neighbours.up;
        for (int i = 0; i < range; i++)
        {
            if (currentTile != null && !IsWall(currentTile))
            {
                if (!IsWater(currentTile))
                {
                    res.Add(currentTile);
                }
                if (currentTile.GetPawnOnTile() is Barrel)
                {
                    Barrel barrel = currentTile.GetPawnOnTile() as Barrel;
                    if (!ComboManager.instance.BarrelAlreadyInCombo(barrel))
                    {
                        res.AddRange(ComboManager.instance.AddBarrelToComboPreview(barrel, usingCombo));
                    }
                }
            }
            else
            {
                break;
            }
            currentTile = currentTile.neighbours.up;
        }

        //RIGHT
        currentTile = startingTile.neighbours.right;
        for (int i = 0; i < range; i++)
        {
            if (currentTile != null && !IsWall(currentTile))
            {
                if (!IsWater(currentTile))
                {
                    res.Add(currentTile);
                }
                if (currentTile.GetPawnOnTile() is Barrel)
                {
                    Barrel barrel = currentTile.GetPawnOnTile() as Barrel;
                    if (!ComboManager.instance.BarrelAlreadyInCombo(barrel))
                    {
                        res.AddRange(ComboManager.instance.AddBarrelToComboPreview(barrel, usingCombo));
                    }
                }
            }
            else
            {
                break;
            }
            currentTile = currentTile.neighbours.right;
        }

        //DOWN
        currentTile = startingTile.neighbours.down;
        for (int i = 0; i < range; i++)
        {
            if (currentTile != null && !IsWall(currentTile))
            {
                if (!IsWater(currentTile))
                {
                    res.Add(currentTile);
                }
                if (currentTile.GetPawnOnTile() is Barrel)
                {
                    Barrel barrel = currentTile.GetPawnOnTile() as Barrel;
                    if (!ComboManager.instance.BarrelAlreadyInCombo(barrel))
                    {
                        res.AddRange(ComboManager.instance.AddBarrelToComboPreview(barrel, usingCombo));
                    }
                }
            }
            else
            {
                break;
            }
            currentTile = currentTile.neighbours.down;
        }

        //LEFT
        currentTile = startingTile.neighbours.left;
        for (int i = 0; i < range; i++)
        {
            if (currentTile != null && !IsWall(currentTile))
            {
                if (!IsWater(currentTile))
                {
                    res.Add(currentTile);
                }
                if (currentTile.GetPawnOnTile() is Barrel)
                {
                    Barrel barrel = currentTile.GetPawnOnTile() as Barrel;
                    if (!ComboManager.instance.BarrelAlreadyInCombo(barrel))
                    {
                        res.AddRange(ComboManager.instance.AddBarrelToComboPreview(barrel, usingCombo));
                    }
                }
            }
            else
            {
                break;
            }
            currentTile = currentTile.neighbours.left;
        }

        return(res);
    }