Ejemplo n.º 1
0
 public override void CancelSkill()
 {
     TheSplatManager.Cancel();
     InitTempValue();
     skillselect = SSelect.none;
     isSkillIng  = false;
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 선택 후 클릭 시 발동되는 스킬의 공통된 계산 처리를 담당하는 함수
    /// </summary>
    /// <param name="skillKey"></param>
    private void SkillingClick(string skillKey)
    {
        skillSelect = SkillSelect.none;
        Vector3 mousePos = Input.mousePosition;
        Ray     r        = Camera.main.ScreenPointToRay(mousePos);

        RaycastHit[] hits = Physics.RaycastAll(r, 50f);
        arguVec = Vector3.zero;

        foreach (RaycastHit hit in hits)
        {
            //클릭된 지점을 향해 스킬 발동
            if (hit.collider.tag.Equals("Terrain"))
            {
                isSkilling = true;
                TheSplatManager.Cancel();
                CallChampDataUsedSkill(skillKey);
                arguVec   = hit.point;
                arguVec.y = 0.5f;
                Invoke(skillKey, 0.1f);
                float animStopTime = (skillKey == "E") ? 0.7f : 0.8f;
                championAnimation.AnimationApply(skillKey, true);
                championAnimation.AnimationApply(skillKey, false, animStopTime);
                break;
            }
        }
    }
Ejemplo n.º 3
0
 public override void ECasting()
 {
     if (AsheHawkCount > 0)
     {
         isSkillIng  = true;
         skillselect = SSelect.E;
         TheSplatManager.Cancel();
     }
 }
Ejemplo n.º 4
0
 public override void QCasting()
 {
     isSkillIng  = true;
     skillselect = SSelect.none;
     TheSplatManager.Cancel();
     Q();
     TheChampionData.UsedQ();
     SkillEnd(1f);
 }
Ejemplo n.º 5
0
 public override void RCasting()
 {
     isSkillIng  = true;
     skillselect = SSelect.none;
     TheSplatManager.Cancel();
     HitEffectRPC("Mundo", "R");
     TheChampionData.UsedR();
     R();
     SkillEnd(0f);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// E 스킬을 호출하는 함수
 /// </summary>
 public override void ECasting()
 {
     // 매가 남아있는지 확인
     if (asheHawkCount > 0)
     {
         isSkilling  = true;
         skillSelect = SkillSelect.E;
         TheSplatManager.Cancel();
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Q 스킬을 호출하는 함수
 /// </summary>
 public override void QCasting()
 {
     isSkilling  = true;
     skillSelect = SkillSelect.none;
     TheSplatManager.Cancel();
     HitEffectRPC("Alistar", "Q");
     Q();
     CallChampDataUsedSkill("Q");
     EndSkill(1f);
     championAnimation.AnimationApply("Q", true);
     championAnimation.AnimationApply("Q", false, 0.7f);
 }
Ejemplo n.º 8
0
 public override void QCasting()
 {
     if (qStackCount > 3)
     {
         isSkillIng  = true;
         qStackCount = 0;
         if (IAmAshe == true)
         {
             TheStackImage.TextDic["AsheQ"].text = "";
             TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(false);
         }
         TheSplatManager.Cancel();
         TheChampionData.UsedQ();
         HitEffectRPC("Ashe", "Q");
         Q();
         SkillEnd(0f);
     }
 }
Ejemplo n.º 9
0
    /// <summary>
    /// Q 스킬을 호출하는 함수
    /// </summary>
    public override void QCasting()
    {
        // Q 스택이 가득 찼는지 확인
        if (qStackCount > 3)
        {
            isSkilling  = true;
            qStackCount = 0;

            if (isIAmAshe == true)
            {
                TheStackImage.TextDic["AsheQ"].text = "";
                TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(false);
            }

            TheSplatManager.Cancel();
            CallChampDataUsedSkill("Q");
            HitEffectRPC("Ashe", "Q");
            Q();
            EndSkill(0f);
        }
    }
Ejemplo n.º 10
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {//스킬선택해제
            TheSplatManager.Cancel();
            InitTempValue();
            skillselect = SSelect.none;
            isSkillIng  = false;
        }
        if (skillselect.Equals(SSelect.W))
        {
            if (Input.GetMouseButtonDown(0))
            {
                Ray          ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit[] r   = Physics.RaycastAll(ray, 280);
                foreach (RaycastHit rc in r)
                {//미니언일때부터 분류. 챔피언은 나중에 추가
                    if (rc.transform.tag.Equals("Minion"))
                    {
                        if (Vector3.Distance(transform.position, rc.transform.position) <= TheSplatManager.Point.Range)
                        {
                            isSkillIng = true;
                            TheSplatManager.Cancel();
                            TheAIPath.isStopped = true;
                            TempObject1         = rc.transform.gameObject;
                            TempVector1         = transform.position;
                            TempVector2         = rc.transform.position;
                            TheChampionData.UsedW();
                            transform.DOMove(TempVector2, 0.1f);
                            Invoke("W", 0.1f);

                            SkillEnd(0.1f);
                            break;
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 11
0
    private void Update()
    {
        if (IAmAshe == null)
        {
            if (gameObject.tag.Equals("Player"))
            {
                IAmAshe = true;
            }
            else
            {
                IAmAshe = false;
            }
        }
        if (IAmAshe == true)
        {
            if (beforeELv.Equals(0))
            {
                if (TheChampionData.skill_E > 0)
                {
                    if (TheStackImage == null)
                    {
                        TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>();
                    }
                    beforeELv = 1;
                    if (AsheHawkCount > 0)
                    {
                        TheStackImage.ImageDic["AsheE"].gameObject.SetActive(true);
                        TheStackImage.TextDic["AsheE"].text = AsheHawkCount.ToString();
                    }
                }
            }
        }
        if (TheChampionData.skill_Q > 0)
        {
            if (TheStackImage == null)
            {
                TheStackImage = GameObject.FindGameObjectWithTag("StackImage").GetComponent <StackImage>();
            }
            if (isQ)
            {
                qTIme -= Time.deltaTime;
                if (qTIme <= 0)
                {
                    isQ   = false;
                    qTIme = 4f;
                    if (photonView.isMine)
                    {
                        TheChampionData.skillPlusAtkDam = 0;
                        TheChampionData.TotalStatDamDefUpdate();
                        TheChampionData.UIStat.Refresh();
                    }
                    QSkillObj.SetActive(false);
                }
            }
            else if (qStackCount > 0)
            {
                keepQStackTime -= Time.deltaTime;
                if (keepQStackTime < 0)
                {
                    reduceQStackTime -= Time.deltaTime;
                    if (reduceQStackTime < 0)
                    {
                        --qStackCount;
                        if (IAmAshe == true)
                        {
                            if (qStackCount.Equals(0))
                            {
                                TheStackImage.TextDic["AsheQ"].text = "";
                                TheStackImage.ImageDic["AsheQ"].gameObject.SetActive(false);
                            }
                            else
                            {
                                TheStackImage.TextDic["AsheQ"].text = qStackCount.ToString();
                            }
                        }
                        reduceQStackTime = 0.75f;
                    }
                }
            }
        }
        if (TheChampionData.skill_E > 0 && AsheHawkCount < 2)
        {
            AsheHawkChargeTime -= Time.deltaTime;
            if (AsheHawkChargeTime < 0)
            {
                AsheHawkChargeTime = 100 - (TheChampionData.skill_E * 10);
                ++AsheHawkCount;
                if (IAmAshe == true)
                {
                    if (AsheHawkCount.Equals(1))
                    {
                        TheStackImage.ImageDic["AsheE"].gameObject.SetActive(true);
                    }
                    TheStackImage.TextDic["AsheE"].text = AsheHawkCount.ToString();
                }
            }
        }
        if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape))
        {//스킬선택해제
            CancelSkill();
        }
        if (skillselect.Equals(SSelect.E))
        {
            if (Input.GetMouseButtonDown(0))
            {
                skillselect = SSelect.none;
                Vector3      h    = Vector3.zero;
                Vector3      v    = Input.mousePosition;
                Ray          r    = Camera.main.ScreenPointToRay(v);
                RaycastHit[] hits = Physics.RaycastAll(r, 50f);

                TempVector1 = Vector3.zero;
                foreach (RaycastHit hit in hits)
                {
                    if (hit.collider.tag.Equals("Terrain"))
                    {
                        isSkillIng = true;
                        TheSplatManager.Cancel();
                        TheChampionData.UsedE();
                        TempVector1   = hit.point;
                        TempVector1.y = 0.5f;
                        Invoke("E", 0.1f);

                        championAnimation.AnimationApply("E", true);
                        championAnimation.AnimationApply("E", false, 0.7f);
                        break;
                    }
                }
            }
        }
        if (skillselect.Equals(SSelect.R))
        {
            if (Input.GetMouseButtonDown(0))
            {
                skillselect = SSelect.none;
                if (audio != null)
                {
                    ChampionSound.instance.Skill(PlayerData.Instance.championName, 3, audio);
                }
                Vector3      h    = Vector3.zero;
                Vector3      v    = Input.mousePosition;
                Ray          r    = Camera.main.ScreenPointToRay(v);
                RaycastHit[] hits = Physics.RaycastAll(r, 50f);

                TempVector1 = Vector3.zero;
                foreach (RaycastHit hit in hits)
                {
                    if (hit.collider.tag.Equals("Terrain"))
                    {
                        isSkillIng = true;
                        TheSplatManager.Cancel();
                        TheChampionData.UsedR();
                        TempVector1   = hit.point;
                        TempVector1.y = 0.5f;
                        Invoke("R", 0.1f);

                        championAnimation.AnimationApply("R", true);
                        championAnimation.AnimationApply("R", false, 0.8f);
                        break;
                    }
                }
            }
        }
        if (skillselect.Equals(SSelect.W))
        {
            if (Input.GetMouseButtonDown(0))
            {
                skillselect = SSelect.none;
                Vector3      h    = Vector3.zero;
                Vector3      v    = Input.mousePosition;
                Ray          r    = Camera.main.ScreenPointToRay(v);
                RaycastHit[] hits = Physics.RaycastAll(r, 50f);
                TempVector1 = Vector3.zero;
                foreach (RaycastHit hit in hits)
                {
                    if (hit.collider.tag.Equals("Terrain"))
                    {
                        isSkillIng = true;
                        TheSplatManager.Cancel();
                        TheChampionData.UsedW();
                        TempVector1   = hit.point;
                        TempVector1.y = 0.5f;
                        Invoke("W", 0.1f);

                        championAnimation.AnimationApply("W", true);
                        championAnimation.AnimationApply("W", false, 0.8f);
                        break;
                    }
                }
            }
        }
    }
Ejemplo n.º 12
0
    private void Update()
    {
        //우클릭하거나 esc키를 누르면 스킬 선택이 해제된다.
        if (Input.GetMouseButtonDown(1) || Input.GetKeyDown(KeyCode.Escape))
        {
            CancelSkill();
        }

        //돌진 스킬을 선택
        if (skillSelect.Equals(SkillSelect.W))
        {
            //돌진 스킬을 선택한 상황에서 마우스 왼쪽 버튼 클릭
            if (Input.GetMouseButtonDown(0))
            {
                Ray        ray       = Camera.main.ScreenPointToRay(Input.mousePosition);
                int        layerMask = LayerMask.NameToLayer("GroundLayer");
                RaycastHit hit;

                if (Physics.Raycast(ray, out hit, 500, 1 << layerMask))
                {
                    //클릭된 지점의 땅을 검사할 것이다.
                    if (hit.transform.tag.Equals("Terrain"))
                    {
                        bool       isEnemyClick = false;
                        float      distance     = 1000000;
                        Collider   enemy        = null;
                        Collider[] cols         = Physics.OverlapSphere(hit.point, 5f);

                        //오버랩스피어를 이용해 클릭한 지점 주변에 공격할 대상이 있는지 검사한다.
                        foreach (Collider col in cols)
                        {
                            if (col.transform.tag.Equals("Minion"))
                            {
                                if (!col.transform.name.Contains(TheChampionBehaviour.team))
                                {
                                    if (col.transform.GetComponent <FogOfWarEntity>().isCanTargeting)
                                    {
                                        isEnemyClick = true;
                                    }
                                }
                            }
                            else if (col.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
                            {
                                if (!col.transform.GetComponent <ChampionBehavior>().team.Equals(TheChampionBehaviour.team))
                                {
                                    if (col.transform.GetComponent <FogOfWarEntity>().isCanTargeting)
                                    {
                                        isEnemyClick = true;
                                    }
                                }
                            }
                            else if (col.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
                            {
                                if (col.transform.GetComponent <FogOfWarEntity>().isCanTargeting)
                                {
                                    isEnemyClick = true;
                                }
                            }

                            //적을 설정한다.
                            if (isEnemyClick)
                            {
                                float tempDist = Vector3.SqrMagnitude(hit.point - col.transform.position);

                                if (tempDist < distance)
                                {
                                    enemy = col;
                                }

                                isEnemyClick = false;
                            }
                        }

                        // 타겟팅한 적을 대상으로 W 스킬을 사용한다.
                        if (enemy != null)
                        {
                            if (Vector3.Distance(transform.position, enemy.transform.position) <= TheSplatManager.Point.Range)
                            {
                                isSkilling = true;
                                TheSplatManager.Cancel();
                                TheAIPath.isStopped = true;
                                wArguObj            = enemy.transform.gameObject;
                                wArguVec            = transform.position;
                                CallChampDataUsedSkill("W");
                                transform.DOLookAt(enemy.transform.position, 0.1f);
                                transform.DOMove(enemy.transform.position, 0.1f);
                                Invoke("W", 0.1f);
                                EndSkill(0.1f);
                            }
                        }
                        else
                        {
                            //제대로 적이 선택되지 않은 경우 w 스킬 선택을 해제한다.
                            TheSplatManager.Cancel();
                            skillSelect = SkillSelect.none;
                            isSkilling  = false;
                        }
                    }
                }
            }
        }
    }