Example #1
0
    public void UseLinkedSkill()
    {
        if (skillData.TargetType == TargetType.FoeSingle || skillData.TargetType == TargetType.FriendSingle)
        {
            if (skillData.SkillType == SkillType.Physical)
            {
                Cursor.SetCursor(GameManager.Instance.Texture2DUtils.attackCursor, Vector2.zero, CursorMode.Auto);
            }
            else if (skillData.SkillType == SkillType.Defensive)
            {
                Cursor.SetCursor(GameManager.Instance.Texture2DUtils.buffCursor, Vector2.zero, CursorMode.Auto);
            }
            else if (skillData.SkillType == SkillType.Magical)
            {
                Cursor.SetCursor(GameManager.Instance.Texture2DUtils.magicCursor, Vector2.zero, CursorMode.Auto);
            }

            if (skillData.TargetType == TargetType.FoeSingle)
            {
                BattleHandler.ActivateFeedbackSelection(false, true);
            }
            else
            {
                BattleHandler.ActivateFeedbackSelection(true, false);
            }

            // TODO: find an other way
            GameManager.Instance.GetBattleUI.GetComponent <UIBattleHandler>().GetSkillsPanelIndex(skillData.SkillUser.GetComponent <PawnInstance>()).gameObject.SetActive(false);
            BattleHandler.WaitForSkillConfirmation(skillData);
        }
        else
        {
            GameManager.Instance.GetBattleUI.GetComponent <UIBattleHandler>().GetSkillsPanelIndex(skillData.SkillUser.GetComponent <PawnInstance>()).gameObject.SetActive(false);
            BattleHandler.WaitForSkillConfirmation(skillData);
            // WARNING: change sensitive code, test it
            Debug.LogWarning("Have you tested this code yet?");
            BattleHandler.PendingSkill.UseSkill();
        }
    }