Esempio n. 1
0
    public void Kick(GamePawn user, int dmg, GamePawn target, Direction dir)
    {
        //user.PlayAnim

        currentActiveSkill = null;
        PlayerManager.instance.hoverMode = HoverMode.NoHover;

        Highlight_Manager.instance.HideHighlight(user.GetSkillPreviewID(), null, false);

        target.OnKicked(user, dmg, dir);
    }
Esempio n. 2
0
    public void ThrowPreview(GamePawn user, GamePawn liftedPawn)
    {
        GridManager.instance.AllTilesBecameNotClickable();
        List <Tile> tilesToHighlight = new List <Tile>();
        Tile        playerTile       = user.GetTile();

        if (liftedPawn is EnemieBehaviour)
        {
            Debug.Log("Lift Enemy");
            //UP
            if (IsAvailableTile(playerTile.neighbours.up))
            {
                tilesToHighlight.Add(playerTile.neighbours.up);
            }
            //RIGHT
            if (IsAvailableTile(playerTile.neighbours.right))
            {
                tilesToHighlight.Add(playerTile.neighbours.right);
            }
            //DOWN
            if (IsAvailableTile(playerTile.neighbours.down))
            {
                tilesToHighlight.Add(playerTile.neighbours.down);
            }
            //LEFT
            if (IsAvailableTile(playerTile.neighbours.left))
            {
                tilesToHighlight.Add(playerTile.neighbours.left);
            }
        }
        else if (liftedPawn is Barrel || liftedPawn is Box)
        {
            Debug.Log("Lift Barrel");
            RaycastHit[] hits = Physics.BoxCastAll(user.GetTile().transform.position + 2 * Vector3.up, ((range + 1) * Vector3.forward + (range + 1) * Vector3.right), Vector3.down, Quaternion.Euler(Quaternion.identity.eulerAngles + new Vector3(0f, 45f, 0f)), 2f, LayerMask.GetMask("FreeTile"));
            foreach (RaycastHit hit in hits)
            {
                Tile tile = hit.transform.GetComponent <Tile>();
                if (IsAvailableTile(tile) || tile.GetPawnOnTile() == liftedPawn)
                {
                    tilesToHighlight.Add(tile);
                }
            }
        }
        Debug.Log("THROW PREVIEW : " + tilesToHighlight.Count);

        Highlight_Manager.instance.HideHighlight(user.GetSkillPreviewID());
        user.SetPreviewID(Highlight_Manager.instance.ShowHighlight(tilesToHighlight, HighlightMode.ActionPreview, true));
        PlayerManager.instance.hoverMode = HoverMode.ThrowHover;
    }
Esempio n. 3
0
    public void Jump(GamePawn user, GamePawn target, Direction dir)
    {
        currentActiveSkill = null;
        Tile jumpTile = target.GetTile().GetNeighbours(dir);

        Highlight_Manager.instance.HideHighlight(user.GetSkillPreviewID());

        Sequence s = DOTween.Sequence();

        PlayerManager.instance.playerCharacter.anim.SetTrigger("Jump");
        s.Append(user.transform.DOMove(jumpTile.transform.position + new Vector3(0, jumpTile.transform.localScale.y, 0), 0.3f)
                 .SetEase(Ease.Linear)
                 .OnComplete(() =>
        {
            user.GetTile().SetPawnOnTile(null);
            user.SetTile(jumpTile);
        }));


        s.OnComplete(() =>
        {
            user.EndAction();
        });
    }