Пример #1
0
 IEnumerator AtkMotion()
 {
     while (true)
     {
         if (!isAtkPause)
         {
             bool check = true;
             if (!isTargetting)
             {
                 check = false;
             }
             else if (AtkTargetObj == null)
             {
                 check = false;
             }
             else if (AtkTargetObj.Equals(AStarTargetObj))
             {
                 check = false;
             }
             if (check)
             {
                 if (AtkTargetObj.tag.Equals("Minion"))
                 {
                     MinionBehavior behav = AtkTargetObj.GetComponent <MinionBehavior>();
                     if (behav != null)
                     {
                         if (behav.HitMe(myChampionData.mystat.Attack_Damage, "AD"))
                         {
                             ResetTarget();
                         }
                     }
                 }
                 else if (AtkTargetObj.tag.Equals("Player"))
                 {//이 태그대로 할건지 바뀌는지는 모르겠음. 우선 챔피언 공격임.
                     ChampionBehavior behav = AtkTargetObj.GetComponent <ChampionBehavior>();
                     if (behav != null)
                     {
                         if (behav.HitMe(myChampionData.mystat.Attack_Damage, "AD", gameObject))
                         {
                             ResetTarget();
                         }
                     }
                 }
                 else if (AtkTargetObj.tag.Equals("Tower"))
                 {
                     TowerBehaviour behav = AtkTargetObj.GetComponent <TowerBehaviour>();
                     if (behav != null)
                     {
                         if (behav.HitMe(myChampionData.mystat.Attack_Damage))
                         {
                             ResetTarget();
                         }
                     }
                 }
             }
         }
         yield return(new WaitForSeconds(1));
     }
 }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        //충돌한 적의 종류에 따라 각각의 HitMe 함수를 호출한다
        if (other.tag.Equals("Minion"))
        {
            MinionBehavior minBehav = other.GetComponent <MinionBehavior>();

            if (!other.gameObject.name.Contains(mySkill.TheChampionBehaviour.team))
            {
                minBehav.minAtk.PauseAtk(1f, true);
                float damage = CalculateDamage();

                if (minBehav != null)
                {
                    int viewID = minBehav.GetComponent <PhotonView>().viewID;
                    minBehav.HitMe(damage, "AP", mySkill.gameObject);
                }
            }
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionBehavior champBehav = other.GetComponent <ChampionBehavior>();

            if (champBehav.team != mySkill.TheChampionBehaviour.team)
            {
                champBehav.myChampAtk.PauseAtk(1f, true);
                float damage = CalculateDamage();

                if (champBehav != null)
                {
                    int viewID = champBehav.GetComponent <PhotonView>().viewID;
                    champBehav.HitMe(damage, "AP", mySkill.gameObject, mySkill.name);
                }
            }
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterBehaviour monBehav = other.GetComponent <MonsterBehaviour>();
            monBehav.monAtk.PauseAtk(1f, true);
            float damage = CalculateDamage();

            if (monBehav != null)
            {
                int viewID = monBehav.GetComponent <PhotonView>().viewID;
                monBehav.HitMe(damage, "AP", mySkill.gameObject);
            }
        }
    }
Пример #3
0
    public void HitSync(int viewID)
    {
        GameObject g = PhotonView.Find(viewID).gameObject;

        if (g != null)
        {
            if (g.tag.Equals("Minion"))
            {
                MinionBehavior mB = g.GetComponent <MinionBehavior>();
                if (mB != null)
                {
                    mB.HitMe(stat.Attack_Damage, "AD", gameObject);
                }
                //print("MinionBehaviour is null");
            }
            else if (g.layer.Equals(LayerMask.NameToLayer("Champion")))
            {
                ChampionSound.instance.IamAttackedSound(Audio, g.name);
                g.GetComponent <ChampionBehavior>().HitMe(stat.Attack_Damage, "AD", gameObject, gameObject.name);
            }
        }
    }
Пример #4
0
    public void HitSync(int viewID)
    {
        GameObject obj = PhotonView.Find(viewID).gameObject;

        //각각 피격당한 대상의 HitMe 함수를 호출함.
        if (obj != null)
        {
            if (obj.tag.Equals("Minion"))
            {
                MinionBehavior minBehav = obj.GetComponent <MinionBehavior>();

                if (minBehav != null)
                {
                    minBehav.HitMe(stat.AttackDamage, "AD", gameObject);
                }
            }
            else if (obj.layer.Equals(LayerMask.NameToLayer("Champion")))
            {
                ChampionSound.instance.IamAttackedSound(audio, obj.name);
                obj.GetComponent <ChampionBehavior>().HitMe(stat.AttackDamage, "AD", gameObject, gameObject.name);
            }
        }
    }
Пример #5
0
    private void Update()
    {
        damagetime -= Time.deltaTime;
        if (damagetime <= 0)
        {
            damagetime = 0.5f;
            for (int i = 0; i < EnemyList.Count; ++i)
            {
                if (EnemyList[i].Equals(mySkill.gameObject))
                {
                    continue;
                }
                float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1]
                               + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue);
                if (EnemyList[i].layer.Equals(LayerMask.NameToLayer("Champion")))
                {
                    ChampionBehavior cB = EnemyList[i].GetComponent <ChampionBehavior>();
                    if (cB.Team != mySkill.TheChampionBehaviour.Team)
                    {
                        if (cB != null)
                        {
                            if (cB.HitMe(damage, "AP", mySkill.gameObject, mySkill.name))
                            {
                                mySkill.TheChampionAtk.ResetTarget();
                                //if (!sysmsg)
                                //    sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent<SystemMessage>();
                                //sysmsg.sendKillmsg("mundo", EnemyList[i].GetComponent<ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString());
                                // 스킬쏜애 주인이 나면 킬올리자
                                if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                                {
                                    mySkill.TheChampionData.Kill_CS_Gold_Exp(EnemyList[i].gameObject.name, 0, EnemyList[i].transform.position);
                                }
                                EnemyDeleteStack.Push(EnemyList[i]);
                            }
                            if (cB.myChampionData.totalstat.Hp <= 0)
                            {
                                EnemyDeleteStack.Push(EnemyList[i]);
                            }
                        }
                    }
                }
                else if (EnemyList[i].layer.Equals(LayerMask.NameToLayer("Monster")))
                {
                    MonsterBehaviour mB = EnemyList[i].GetComponent <MonsterBehaviour>();
                    if (mB != null)
                    {
                        if (mB.HitMe(damage, "AP", mySkill.gameObject))
                        {
                            mySkill.TheChampionAtk.ResetTarget();

                            //// 스킬쏜애 주인이 나면 킬올리자
                            //if (mySkill.GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                            //{
                            //    mySkill.TheChampionData.Kill_CS_Gold_Exp(EnemyList[i].gameObject.name, 3, EnemyList[i].transform.position);
                            //}
                            EnemyDeleteStack.Push(EnemyList[i]);
                        }
                        if (mB.stat.Hp <= 0)
                        {
                            EnemyDeleteStack.Push(EnemyList[i]);
                        }
                    }
                }
                else if (EnemyList[i].tag.Equals("Minion"))
                {
                    MinionBehavior mB = EnemyList[i].GetComponent <MinionBehavior>();
                    if (!EnemyList[i].name.Contains(mySkill.TheChampionBehaviour.Team))
                    {
                        if (mB != null)
                        {
                            if (mB.HitMe(damage, "AP", mySkill.gameObject))
                            {
                                mySkill.TheChampionAtk.ResetTarget();

                                // 스킬쏜애 주인이 나면 킬올리자
                                if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                                {
                                    mySkill.TheChampionData.Kill_CS_Gold_Exp(EnemyList[i].gameObject.name, 1, EnemyList[i].transform.position);
                                }
                                EnemyDeleteStack.Push(EnemyList[i]);
                            }
                            if (mB.stat.Hp <= 0)
                            {
                                EnemyDeleteStack.Push(EnemyList[i]);
                            }
                        }
                    }
                }
                while (EnemyDeleteStack.Count > 0)
                {
                    GameObject g = EnemyDeleteStack.Pop();
                    if (EnemyList.Contains(g))
                    {
                        EnemyList.Remove(g);
                    }
                }
            }
        }
    }
Пример #6
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Minion")) //나중에챔피언일때도적일때도조건에추가
        {                               //미니언의 경우 트리거 켜진건 공격 추-적 반경이라 디스턴스를 추가
         //if (Vector3.Distance(other.transform.position, transform.position) <= skillRange)
         //{
            MinionBehavior mB = other.GetComponent <MinionBehavior>();
            if (!other.gameObject.name.Contains(mySkill.TheChampionBehaviour.Team))
            {
                mB.minAtk.PauseAtk(1f, true);
                //other.GetComponent<Rigidbody>().AddForce(0, upPower, 0);
                //s = other.transform.DOJump(other.transform.position, 3, 1, 1f).OnUpdate(() => { if (mB.isDead) if (s != null) s.Kill(); });
                float damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                               + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
                //공격 코드(데미지 등) 삽입'
                //float damage = mySkill.QSkillInfo.myskill.Damage[mySkill.QSkillInfo.myskill.skillLevel]
                //    + mySkill.QSkillInfo.Acalculate(mySkill.QSkillInfo.myskill.Astat, mySkill.QSkillInfo.myskill.Avalue);

                if (mB != null)
                {
                    int viewID = mB.GetComponent <PhotonView>().viewID;
                    //mySkill.HitRPC(viewID, damage, "AP", "Jump");
                    if (mB.HitMe(damage, "AP", mySkill.gameObject))
                    {
                        //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                        mySkill.TheChampionAtk.ResetTarget();

                        // 스킬쏜애 주인이 나면 킬올리자
                        if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                        {
                            mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 1, other.transform.position);
                        }
                    }
                }
            }
        }
        //else if (other.tag.Equals("Player"))
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionBehavior cB = other.GetComponent <ChampionBehavior>();
            if (cB.Team != mySkill.TheChampionBehaviour.Team)
            {
                cB.myChampAtk.PauseAtk(1f, true);
                float damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                               + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
                if (cB != null)
                {
                    int viewID = cB.GetComponent <PhotonView>().viewID;
                    //mySkill.HitRPC(viewID, damage, "AP", "Jump");
                    if (cB.HitMe(damage, "AP", mySkill.gameObject, mySkill.name))
                    {
                        mySkill.TheChampionAtk.ResetTarget();
                        if (!sysmsg)
                        {
                            sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
                        }
                        sysmsg.sendKillmsg("alistar", other.GetComponent <ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString());
                        // 스킬쏜애 주인이 나면 킬올리자
                        if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                        {
                            mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 0, other.transform.position);
                        }
                    }
                }
                //s = other.transform.DOJump(other.transform.position, 3, 1, 1f).OnUpdate(() =>
                //{
                //    if (cB.myChampionData.totalstat.Hp - ((damage * 100f) / (100f + cB.myChampionData.totalstat.Ability_Def)) <= 1)
                //    {
                //        if (s != null)
                //            s.Kill();
                //    }
                //});
            }
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterBehaviour mB = other.GetComponent <MonsterBehaviour>();
            mB.monAtk.PauseAtk(1f, true);
            //s = other.transform.DOJump(other.transform.position, 3, 1, 1f).OnUpdate(() => { if (mB.isDead) if (s != null) s.Kill(); });
            float damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                           + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
            if (mB != null)
            {
                int viewID = mB.GetComponent <PhotonView>().viewID;
                //mySkill.HitRPC(viewID, damage, "AP", "Jump");
                if (mB.HitMe(damage, "AP", mySkill.gameObject))
                {
                    mySkill.TheChampionAtk.ResetTarget();

                    //// 스킬쏜애 주인이 나면 킬올리자
                    //if (mySkill.GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                    //{
                    //    mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 3, other.transform.position);
                    //}
                }
            }
        }
    }
Пример #7
0
    private void OnTriggerEnter(Collider other)
    {
        a.Add(other.gameObject);
        if (firstAtk)
        {
            bool trig = false;
            if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
            {
                if (!other.gameObject.Equals(mySkill.gameObject))
                {
                    ChampionBehavior mB = other.GetComponent <ChampionBehavior>();
                    if (mB.Team != mySkill.TheChampionBehaviour.Team)
                    {
                        trig = true;
                        float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1]
                                       + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue);
                        if (mB != null)
                        {
                            if (mB.HitMe(damage, "AD", mySkill.gameObject, mySkill.name))
                            {
                                mySkill.TheChampionAtk.ResetTarget();
                                if (!sysmsg)
                                {
                                    sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
                                }
                                //sysmsg.sendKillmsg("ashe", other.GetComponent<ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString());
                                // 스킬쏜애 주인이 나면 킬올리자
                                if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                                {
                                    mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 0, other.transform.position);
                                }
                            }
                        }
                    }
                }
            }
            else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
            {
                MonsterBehaviour mB     = other.GetComponent <MonsterBehaviour>();
                float            damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1]
                                          + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue);
                if (mB != null)
                {
                    trig = true;
                    if (mB.HitMe(damage, "AD", mySkill.gameObject))
                    {
                        mySkill.TheChampionAtk.ResetTarget();
                        //// 스킬쏜애 주인이 나면 킬올리자
                        //if (mySkill.GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                        //{
                        //   //mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 3, other.transform.position);
                        //}
                    }
                }
            }
            else if (other.tag.Equals("Minion"))
            {
                MinionBehavior mB = other.GetComponent <MinionBehavior>();
                if (!other.name.Contains(mySkill.TheChampionBehaviour.Team))
                {
                    trig = true;
                    float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1]
                                   + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue);
                    if (mB != null)
                    {
                        if (mB.HitMe(damage, "AD", mySkill.gameObject))
                        {
                            mySkill.TheChampionAtk.ResetTarget();

                            // 스킬쏜애 주인이 나면 킬올리자
                            if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                            {
                                mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 1, other.transform.position);
                            }
                        }
                    }
                }
            }

            if (trig)
            {
                gameObject.SetActive(false);
                firstAtk = false;
            }
        }
    }
Пример #8
0
    /// <summary>
    /// 공격을 담당하는 코루틴
    /// </summary>
    IEnumerator Attack()
    {
        while (!myChampBehav.isDead)
        {
            if (!isAtkPause)
            {
                bool isCheck = true;

                if (!isTargetting)
                {
                    isCheck = false;
                }
                else if (atkTargetObj == null)
                {
                    isCheck = false;
                }
                else if (atkTargetObj.Equals(aStarTargetObj))
                {
                    isCheck = false;
                }

                //타겟이 있다면 공격
                if (isCheck)
                {
                    myChampBehav.transform.DOLookAt(atkTargetObj.transform.position, 0);

                    //공격하는 대상과 피격당하는 대상을 구분하여 처리
                    if (atkTargetObj.tag.Equals("Minion"))
                    {
                        MakeAsheArrow();

                        MinionBehavior minBehav = atkTargetObj.GetComponent <MinionBehavior>();
                        AudioSource    minAudio = minBehav.transform.GetChild(minBehav.transform.childCount - 1).GetComponent <AudioSource>();

                        if (minBehav != null)
                        {
                            int viewID = minBehav.GetComponent <PhotonView>().viewID;
                            myChampBehav.HitRPC(viewID);
                            ChampionSound.instance.IamAttackedSound(minAudio, champName);

                            if (isAshe)
                            {
                                asheSkill.QCountUp();
                            }

                            minBehav.HitMe(myChampionData.totalStat.AttackDamage, "AD", myChampBehav.gameObject);

                            if (!skillKey.Equals(""))
                            {
                                if (--skillKeyNum < 1)
                                {
                                    skillKey = "";
                                }
                            }
                        }
                    }
                    else if (atkTargetObj.layer.Equals(LayerMask.NameToLayer("Champion")))
                    {
                        MakeAsheArrow();

                        ChampionBehavior champBehav = atkTargetObj.GetComponent <ChampionBehavior>();
                        AudioSource      champaudio = champBehav.gameObject.GetComponent <AudioSource>();

                        if (champBehav != null)
                        {
                            int viewID = champBehav.GetComponent <PhotonView>().viewID;
                            myChampBehav.HitRPC(viewID);
                            ChampionSound.instance.IamAttackedSound(champaudio, champName);

                            if (isAshe)
                            {
                                asheSkill.QCountUp();
                            }

                            champBehav.HitMe(myChampionData.totalStat.AttackDamage, "AD", myChampBehav.gameObject, myChampBehav.name);

                            if (!skillKey.Equals(""))
                            {
                                if (--skillKeyNum < 1)
                                {
                                    skillKey = "";
                                }
                            }
                        }
                    }
                    else if (atkTargetObj.tag.Equals("Tower"))
                    {
                        MakeAsheArrow();
                        TowerBehaviour towerBehav = atkTargetObj.GetComponent <TowerBehaviour>();
                        AudioSource    towerAudio = towerBehav.GetComponent <AudioSource>();

                        if (towerBehav != null)
                        {
                            string key     = "";
                            char[] keyChar = towerBehav.gameObject.name.ToCharArray();

                            for (int i = 13; i < 16; ++i)
                            {
                                key += keyChar[i];
                            }

                            myChampBehav.HitRPC(key);
                            ChampionSound.instance.IamAttackedSound(towerAudio, champName);

                            if (isAshe)
                            {
                                asheSkill.QCountUp();
                            }

                            // 타워를 파괴 시 팀의 cs, 골드, 경험치를 올린다
                            if (towerBehav.HitMe(myChampionData.totalStat.AttackDamage))
                            {
                                myChampionData.Kill_CS_Gold_Exp(atkTargetObj.name, 2, atkTargetObj.transform.position);
                                ResetTarget();
                            }

                            if (!skillKey.Equals(""))
                            {
                                if (--skillKeyNum < 1)
                                {
                                    skillKey = "";
                                }
                            }
                        }
                    }
                    else if (atkTargetObj.tag.Equals("Suppressor"))
                    {
                        MakeAsheArrow();
                        SuppressorBehaviour supBehav = atkTargetObj.GetComponent <SuppressorBehaviour>();

                        if (supBehav != null)
                        {
                            string key     = "";
                            char[] keyChar = supBehav.gameObject.name.ToCharArray();

                            for (int i = 11; i < 14; ++i)
                            {
                                key += keyChar[i];
                            }

                            myChampBehav.HitRPC(key);

                            if (isAshe)
                            {
                                asheSkill.QCountUp();
                            }

                            supBehav.HitMe(myChampionData.totalStat.AttackDamage);

                            if (!skillKey.Equals(""))
                            {
                                if (--skillKeyNum < 1)
                                {
                                    skillKey = "";
                                }
                            }
                        }
                    }
                    else if (atkTargetObj.tag.Equals("Nexus"))
                    {
                        MakeAsheArrow();
                        SuppressorBehaviour supBehav = atkTargetObj.GetComponent <SuppressorBehaviour>();

                        if (supBehav != null)
                        {
                            string key     = "";
                            char[] keyChar = supBehav.gameObject.name.ToCharArray();
                            key += keyChar[6];
                            myChampBehav.HitRPC(key);

                            if (isAshe)
                            {
                                asheSkill.QCountUp();
                            }

                            supBehav.HitMe(myChampionData.totalStat.AttackDamage);

                            if (!skillKey.Equals(""))
                            {
                                if (--skillKeyNum < 1)
                                {
                                    skillKey = "";
                                }
                            }
                        }
                    }
                    else if (atkTargetObj.layer.Equals(LayerMask.NameToLayer("Monster")))
                    {
                        MakeAsheArrow();
                        MonsterBehaviour monBehav = atkTargetObj.GetComponent <MonsterBehaviour>();

                        if (monBehav != null)
                        {
                            int viewID = monBehav.GetComponent <PhotonView>().viewID;
                            myChampBehav.HitRPC(viewID);

                            if (isAshe)
                            {
                                asheSkill.QCountUp();
                            }

                            monBehav.HitMe(myChampionData.totalStat.AttackDamage, "AD", myChamp);

                            if (!skillKey.Equals(""))
                            {
                                if (--skillKeyNum < 1)
                                {
                                    skillKey = "";
                                }
                            }
                        }
                    }
                }
            }

            float AtkSpeed = myChampionData.myStat.AttackSpeed * (1 + (myChampionData.totalStat.UP_AttackSpeed * (myChampionData.totalStat.Level - 1) + (myChampionData.totalStat.AttackSpeed - myChampionData.myStat.AttackSpeed)) / 100);
            //어택 딜레이타임을 1초로 설정
            atkDelayTime = 1f / AtkSpeed;

            yield return(new WaitForSeconds(atkDelayTime));
        }
    }
Пример #9
0
    IEnumerator AtkMotion()
    {
        while (true)
        {
            if (!isAtkPause)
            {
                bool check = true;
                if (nowTarget == null)
                {
                    check = false;
                }
                else if (!nowTarget.activeInHierarchy)
                {
                    check = false;
                }

                if (check)
                {
                    if (Anim.GetBool("walking"))
                    {
                        Anim.SetBool("walking", false);
                    }
                    Anim.SetTrigger("attack");
                    myMinion.transform.DOLookAt(nowTarget.transform.position, 1);
                    if (nowTarget.tag.Equals("Minion"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            MinionBehavior behav = nowTarget.GetComponent <MinionBehavior>();
                            if (behav != null)
                            {
                                if (behav.HitMe(myBehav.stat.Attack_Damage))
                                {
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float      moveTime = 0.2f;
                            GameObject Arrow    = Minion_ObjectPool.current.GetPooledArrow();
                            Arrow.SetActive(true);
                            Arrow.transform.position = myMinion.transform.position;
                            Arrow.transform.LookAt(nowTarget.transform.position);
                            Arrow.transform.DOMove(nowTarget.transform.position, moveTime, true);
                            Arrow.GetComponent <TargetProjectile>().ActiveFalse(moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float      moveTime   = 0.2f;
                            GameObject Cannonball = Minion_ObjectPool.current.GetPooledCannonball();
                            Cannonball.SetActive(true);
                            Cannonball.transform.position = myMinion.transform.position + (nowTarget.transform.position - myMinion.transform.position).normalized * 2f;
                            Cannonball.transform.DOMove(nowTarget.transform.position, moveTime, true);
                            Cannonball.GetComponent <TargetProjectile>().ActiveFalse(moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.tag.Equals("Player"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            ChampionBehavior behav = nowTarget.GetComponent <ChampionBehavior>();
                            if (behav != null)
                            {
                                if (behav.HitMe(myBehav.stat.Attack_Damage, "AD", gameObject))
                                {
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float      moveTime = 0.2f;
                            GameObject Arrow    = Minion_ObjectPool.current.GetPooledArrow();
                            Arrow.SetActive(true);
                            Arrow.transform.position = myMinion.transform.position;
                            Arrow.transform.LookAt(nowTarget.transform.position);
                            Arrow.transform.DOMove(nowTarget.transform.position, moveTime, true);
                            Arrow.GetComponent <TargetProjectile>().ActiveFalse(moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float      moveTime   = 0.2f;
                            GameObject Cannonball = Minion_ObjectPool.current.GetPooledCannonball();
                            Cannonball.SetActive(true);
                            Cannonball.transform.position = myMinion.transform.position + (nowTarget.transform.position - myMinion.transform.position).normalized * 2f;
                            Cannonball.transform.DOMove(nowTarget.transform.position, moveTime, true);
                            Cannonball.GetComponent <TargetProjectile>().ActiveFalse(moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.tag.Equals("Tower"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            TowerBehaviour behav = nowTarget.GetComponent <TowerBehaviour>();
                            if (behav != null)
                            {
                                if (behav.HitMe(myBehav.stat.Attack_Damage))
                                {
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float      moveTime = 0.2f;
                            GameObject Arrow    = Minion_ObjectPool.current.GetPooledArrow();
                            Arrow.SetActive(true);
                            Arrow.transform.position = myMinion.transform.position;
                            Arrow.transform.LookAt(nowTarget.transform.position);
                            Arrow.transform.DOMove(nowTarget.transform.position, moveTime, true);
                            Arrow.GetComponent <TargetProjectile>().ActiveFalse(moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float      moveTime   = 0.2f;
                            GameObject Cannonball = Minion_ObjectPool.current.GetPooledCannonball();
                            Cannonball.SetActive(true);
                            Cannonball.transform.position = myMinion.transform.position + (nowTarget.transform.position - myMinion.transform.position).normalized * 2f;
                            Cannonball.transform.DOMove(nowTarget.transform.position, moveTime, true);
                            Cannonball.GetComponent <TargetProjectile>().ActiveFalse(moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                }
            }
            yield return(new WaitForSeconds(1));
        }



        //if (nowTarget != null)
        //{
        //    if (nowTarget.activeInHierarchy)
        //    {
        //        Anim.SetTrigger("attack");
        //        if (name.Contains("Melee"))
        //        {
        //            if (nowTarget.tag.Equals("Minion"))
        //            {
        //                MinionBehavior behav = nowTarget.GetComponent<MinionBehavior>();
        //                behav.stat.Hp -= myBehav.stat.Attack_Damage;
        //                print(behav.stat.Hp);
        //                if (behav.stat.Hp < 0)
        //                {
        //                    behav.stat.Hp = 0;
        //                    behav.IamDead();
        //                    enemiesList.Remove(nowTarget);
        //                    nowTarget = null;
        //                    TheAIPath.canMove = true;
        //                    TheAIPath.canSearch = true;
        //                    StopCoroutine(AtkMotion());
        //                    //적 사망 코드
        //                }
        //            }
        //        }
        //    }
        //    else
        //    {
        //        TheAIPath.canMove = true;
        //        TheAIPath.canSearch = true;
        //        StopCoroutine(AtkMotion());
        //    }
        //}
        //else
        //{
        //    TheAIPath.canMove = true;
        //    TheAIPath.canSearch = true;
        //    StopCoroutine(AtkMotion());
        //}
    }
Пример #10
0
 IEnumerator AtkMotion()
 {
     while (true)
     {
         if (!isAtkPause)
         {
             bool check = true;
             if (!isTargetting)
             {
                 check = false;
             }
             else if (AtkTargetObj == null)
             {
                 check = false;
             }
             else if (AtkTargetObj.Equals(AStarTargetObj))
             {
                 check = false;
             }
             if (check)
             {
                 myChampBehav.transform.DOLookAt(AtkTargetObj.transform.position, 0);
                 if (AtkTargetObj.tag.Equals("Minion"))
                 {
                     if (isAshe)
                     {
                         float moveTime = 0.4f;
                         myChampBehav.ArrowRPC(AtkTargetObj.transform.position, moveTime);
                     }
                     MinionBehavior behav    = AtkTargetObj.GetComponent <MinionBehavior>();
                     AudioSource    minAudio = behav.transform.GetChild(behav.transform.childCount - 1).GetComponent <AudioSource>();
                     if (behav != null)
                     {
                         int viewID = behav.GetComponent <PhotonView>().viewID;
                         myChampBehav.HitRPC(viewID);
                         ChampionSound.instance.IamAttackedSound(minAudio, champname);
                         if (isAshe)
                         {
                             asheSkill.qCountUp();
                         }
                         if (behav.HitMe(myChampionData.totalstat.Attack_Damage, "AD", myChampBehav.gameObject))
                         {
                             // 미니언쳤는데 죽었으면 cs, 골드 경험치 올려라
                             myChampionData.Kill_CS_Gold_Exp(AtkTargetObj.name, 1, AtkTargetObj.transform.position);
                             ResetTarget();
                         }
                         if (!skillKey.Equals(""))
                         {
                             if (--skillKeyNum < 1)
                             {
                                 skillKey = "";
                             }
                         }
                     }
                 }
                 //else if (AtkTargetObj.tag.Equals("Player"))
                 else if (AtkTargetObj.layer.Equals(LayerMask.NameToLayer("Champion")))
                 {//이 태그대로 할건지 바뀌는지는 모르겠음. 우선 챔피언 공격임.
                     if (isAshe)
                     {
                         float moveTime = 0.4f;
                         myChampBehav.ArrowRPC(AtkTargetObj.transform.position, moveTime);
                     }
                     ChampionBehavior behav      = AtkTargetObj.GetComponent <ChampionBehavior>();
                     AudioSource      champaudio = behav.gameObject.GetComponent <AudioSource>();
                     if (behav != null)
                     {
                         int viewID = behav.GetComponent <PhotonView>().viewID;
                         myChampBehav.HitRPC(viewID);
                         ChampionSound.instance.IamAttackedSound(champaudio, champname);
                         if (isAshe)
                         {
                             asheSkill.qCountUp();
                         }
                         if (behav.HitMe(myChampionData.totalstat.Attack_Damage, "AD", myChampBehav.gameObject, myChampBehav.name))
                         {
                             // 유저쳤는데 죽었으면 kill 골드 경험치 올려라
                             myChampionData.Kill_CS_Gold_Exp(AtkTargetObj.name, 0, AtkTargetObj.transform.position);
                             sysmsg.sendKillmsg(myChampionData.ChampionName, behav.GetComponent <ChampionData>().ChampionName, myChampBehav.Team);
                             ResetTarget();
                         }
                         if (!skillKey.Equals(""))
                         {
                             if (--skillKeyNum < 1)
                             {
                                 skillKey = "";
                             }
                         }
                     }
                 }
                 else if (AtkTargetObj.tag.Equals("Tower"))
                 {
                     if (isAshe)
                     {
                         float moveTime = 0.4f;
                         myChampBehav.ArrowRPC(AtkTargetObj.transform.position, moveTime);
                     }
                     TowerBehaviour behav      = AtkTargetObj.GetComponent <TowerBehaviour>();
                     AudioSource    towerAudio = behav.GetComponent <AudioSource>();
                     if (behav != null)
                     {
                         string key     = "";
                         char[] keyChar = behav.gameObject.name.ToCharArray();
                         for (int i = 13; i < 16; ++i)
                         {
                             key += keyChar[i];
                         }
                         myChampBehav.HitRPC(key);
                         ChampionSound.instance.IamAttackedSound(towerAudio, champname);
                         if (isAshe)
                         {
                             asheSkill.qCountUp();
                         }
                         if (behav.HitMe(myChampionData.totalstat.Attack_Damage))
                         {
                             // 타워쳤는데 죽으면 cs 골드 경험치 올려라
                             myChampionData.Kill_CS_Gold_Exp(AtkTargetObj.name, 2, AtkTargetObj.transform.position);
                             ResetTarget();
                         }
                         if (!skillKey.Equals(""))
                         {
                             if (--skillKeyNum < 1)
                             {
                                 skillKey = "";
                             }
                         }
                     }
                 }
                 else if (AtkTargetObj.tag.Equals("Suppressor"))
                 {
                     if (isAshe)
                     {
                         float moveTime = 0.4f;
                         myChampBehav.ArrowRPC(AtkTargetObj.transform.position, moveTime);
                     }
                     SuppressorBehaviour behav = AtkTargetObj.GetComponent <SuppressorBehaviour>();
                     if (behav != null)
                     {
                         string key     = "";
                         char[] keyChar = behav.gameObject.name.ToCharArray();
                         for (int i = 11; i < 14; ++i)
                         {
                             key += keyChar[i];
                         }
                         myChampBehav.HitRPC(key);
                         if (isAshe)
                         {
                             asheSkill.qCountUp();
                         }
                         if (behav.HitMe(myChampionData.totalstat.Attack_Damage))
                         {
                             // 억제기쳤는데 죽으면 cs 골드 경험치 올려라
                             myChampionData.Kill_CS_Gold_Exp(AtkTargetObj.name, 2, AtkTargetObj.transform.position);
                             ResetTarget();
                         }
                         if (!skillKey.Equals(""))
                         {
                             if (--skillKeyNum < 1)
                             {
                                 skillKey = "";
                             }
                         }
                     }
                 }
                 else if (AtkTargetObj.tag.Equals("Nexus"))
                 {
                     if (isAshe)
                     {
                         float moveTime = 0.4f;
                         myChampBehav.ArrowRPC(AtkTargetObj.transform.position, moveTime);
                     }
                     SuppressorBehaviour behav = AtkTargetObj.GetComponent <SuppressorBehaviour>();
                     if (behav != null)
                     {
                         string key     = "";
                         char[] keyChar = behav.gameObject.name.ToCharArray();
                         key += keyChar[6];
                         myChampBehav.HitRPC(key);
                         if (isAshe)
                         {
                             asheSkill.qCountUp();
                         }
                         if (behav.HitMe(myChampionData.totalstat.Attack_Damage))
                         {
                             ResetTarget();
                         }
                         if (!skillKey.Equals(""))
                         {
                             if (--skillKeyNum < 1)
                             {
                                 skillKey = "";
                             }
                         }
                     }
                 }
                 else if (AtkTargetObj.layer.Equals(LayerMask.NameToLayer("Monster")))
                 {
                     if (isAshe)
                     {
                         float moveTime = 0.4f;
                         myChampBehav.ArrowRPC(AtkTargetObj.transform.position, moveTime);
                     }
                     MonsterBehaviour behav = AtkTargetObj.GetComponent <MonsterBehaviour>();
                     if (behav != null)
                     {
                         int viewID = behav.GetComponent <PhotonView>().viewID;
                         myChampBehav.HitRPC(viewID);
                         if (isAshe)
                         {
                             asheSkill.qCountUp();
                         }
                         if (behav.HitMe(myChampionData.totalstat.Attack_Damage, "AD", myChamp))
                         {
                             // 죽었으면 cs올려라
                             //myChampionData.Kill_CS_Gold_Exp(AtkTargetObj.name, 3, AtkTargetObj.transform.position);
                             ResetTarget();
                         }
                         if (!skillKey.Equals(""))
                         {
                             if (--skillKeyNum < 1)
                             {
                                 skillKey = "";
                             }
                         }
                     }
                 }
             }
         }
         float AS = myChampionData.mystat.Attack_Speed * (1 + (myChampionData.totalstat.UP_AttackSpeed * (myChampionData.totalstat.Level - 1) + (myChampionData.totalstat.Attack_Speed - myChampionData.mystat.Attack_Speed)) / 100);
         atkDelayTime = 1f / AS;
         yield return(new WaitForSeconds(atkDelayTime));
     }
 }
Пример #11
0
    private void Update()
    {
        damageTime -= Time.deltaTime;

        // 0.5초마다 반경 내의 적에게 데미지를 준다
        if (damageTime <= 0)
        {
            damageTime = 0.5f;

            for (int i = 0; i < enemyList.Count; ++i)
            {
                if (enemyList[i].Equals(mySkill.gameObject))
                {
                    continue;
                }

                float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1]
                               + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue, true);

                // 현재 충돌한 적에 따라 각각의 HitMe 함수를 호출한다
                if (enemyList[i].layer.Equals(LayerMask.NameToLayer("Champion")))
                {
                    ChampionBehavior champBehav = enemyList[i].GetComponent <ChampionBehavior>();

                    if (champBehav.team != mySkill.TheChampionBehaviour.team)
                    {
                        if (champBehav != null)
                        {
                            champBehav.HitMe(damage, "AP", mySkill.gameObject, mySkill.name);

                            if (champBehav.myChampionData.totalStat.Hp <= 0)
                            {
                                enemyDeleteStack.Push(enemyList[i]);
                            }
                        }
                    }
                }
                else if (enemyList[i].layer.Equals(LayerMask.NameToLayer("Monster")))
                {
                    MonsterBehaviour monBehav = enemyList[i].GetComponent <MonsterBehaviour>();

                    if (monBehav != null)
                    {
                        if (monBehav.HitMe(damage, "AP", mySkill.gameObject))
                        {
                            mySkill.TheChampionAtk.ResetTarget();
                            enemyDeleteStack.Push(enemyList[i]);
                        }

                        if (monBehav.stat.Hp <= 0)
                        {
                            enemyDeleteStack.Push(enemyList[i]);
                        }
                    }
                }
                else if (enemyList[i].tag.Equals("Minion"))
                {
                    MinionBehavior minBehav = enemyList[i].GetComponent <MinionBehavior>();

                    if (!enemyList[i].name.Contains(mySkill.TheChampionBehaviour.team))
                    {
                        if (minBehav != null)
                        {
                            minBehav.HitMe(damage, "AP", mySkill.gameObject);

                            if (minBehav.stat.Hp <= 0)
                            {
                                enemyDeleteStack.Push(enemyList[i]);
                            }
                        }
                    }
                }

                // 죽은 적은 데미지를 입히는 대상에서 제외시킨다
                while (enemyDeleteStack.Count > 0)
                {
                    GameObject deletingEnemyObj = enemyDeleteStack.Pop();

                    if (enemyList.Contains(deletingEnemyObj))
                    {
                        enemyList.Remove(deletingEnemyObj);
                    }
                }
            }
        }
    }
Пример #12
0
    private void OnTriggerEnter(Collider other)
    {
        if (firstAtk)
        {
            bool trig = false;
            if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
            {
                if (other.gameObject.Equals(mySkill.gameObject))
                {
                    return;
                }
                ChampionBehavior cB = other.GetComponent <ChampionBehavior>();
                if (cB.Team != mySkill.TheChampionBehaviour.Team)
                {
                    trig = true;
                    float damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                                   + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
                    if (cB != null)
                    {
                        //int viewID = mB.GetComponent<PhotonView>().viewID;
                        //mySkill.HitRPC(viewID, damage, "AP");
                        int x2 = 1;
                        ChampionSound.instance.PlayOtherFx(cB.GetComponentInChildren <AudioSource>(), ChampionSound.instance.Mundo_Q_Hit);
                        if (cB.HitMe(damage, "AP", mySkill.gameObject, mySkill.name))
                        {
                            x2 = 2;
                            mySkill.TheChampionAtk.ResetTarget();
                            if (!sysmsg)
                            {
                                sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
                            }
                            sysmsg.sendKillmsg("mundo", other.GetComponent <ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString());
                            // 스킬쏜애 주인이 나면 킬올리자
                            if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                            {
                                mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 0, other.transform.position);
                            }
                        }
                        mySkill.Heal(damage * x2);
                    }
                }
            }
            else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
            {
                MonsterBehaviour mB     = other.GetComponent <MonsterBehaviour>();
                float            damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                                          + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
                if (mB != null)
                {
                    trig = true;
                    //int viewID = mB.GetComponent<PhotonView>().viewID;
                    //mySkill.HitRPC(viewID, damage, "AP");
                    int x2 = 1;
                    //몬스터 오디오 처리하면 켤것
                    //ChampionSound.instance.PlayOtherFx(mB.GetComponentInChildren<AudioSource>(), ChampionSound.instance.Mundo_Q_Hit);
                    if (mB.HitMe(damage, "AP", mySkill.gameObject))
                    {
                        x2 = 2;
                        mySkill.TheChampionAtk.ResetTarget();

                        //// 스킬쏜애 주인이 나면 킬올리자
                        //if (mySkill.GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                        //{
                        //    mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 3, other.transform.position);

                        //}
                    }
                    mySkill.Heal(damage * x2);
                }
            }
            else if (other.tag.Equals("Minion"))
            {
                MinionBehavior mB = other.GetComponent <MinionBehavior>();
                if (!other.name.Contains(mySkill.TheChampionBehaviour.Team))
                {
                    trig = true;
                    float damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                                   + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
                    if (mB != null)
                    {
                        //int viewID = mB.GetComponent<PhotonView>().viewID;
                        //mySkill.HitRPC(viewID, damage, "AP");
                        ChampionSound.instance.PlayOtherFx(mB.Audio, ChampionSound.instance.Mundo_Q_Hit);
                        int x2 = 1;
                        if (mB.HitMe(damage, "AP", mySkill.gameObject))
                        {
                            x2 = 2;
                            mySkill.TheChampionAtk.ResetTarget();

                            // 스킬쏜애 주인이 나면 킬올리자
                            if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                            {
                                mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 1, other.transform.position);
                            }
                        }
                        mySkill.Heal(damage * x2);
                    }
                }
            }

            if (trig)
            {
                gameObject.SetActive(false);
                firstAtk = false;
            }
        }
    }
Пример #13
0
    IEnumerator AtkMotion()
    {
        while (true)
        {
            if (!isAtkPause)
            {
                bool check = true;
                if (nowTarget == null)
                {
                    check = false;
                }
                else if (!nowTarget.activeInHierarchy)
                {
                    check = false;
                }

                if (check)
                {
                    if (Anim.GetBool("walking"))
                    {
                        Anim.SetBool("walking", false);
                    }
                    Anim.SetTrigger("attack");
                    Vector3 v = nowTarget.transform.position;
                    v.y = 0;
                    myMinion.transform.DOLookAt(v, 1);
                    if (nowTarget.tag.Equals("Minion"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            MinionBehavior behav = nowTarget.GetComponent <MinionBehavior>();

                            if (behav != null)
                            {
                                int viewID = behav.GetComponent <PhotonView>().viewID;
                                myBehav.HitRPC(viewID);
                                if (behav.HitMe(myBehav.stat.Attack_Damage))
                                {
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.layer.Equals(LayerMask.NameToLayer("Champion")))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            ChampionBehavior behav = nowTarget.GetComponent <ChampionBehavior>();

                            if (behav != null)
                            {
                                int viewID = behav.GetComponent <PhotonView>().viewID;
                                myBehav.HitRPC(viewID);
                                if (behav.HitMe(myBehav.stat.Attack_Damage, "AD", myMinion, myMinion.name))
                                {
                                    sysmsg.sendKillmsg("minion", behav.GetComponent <ChampionData>().ChampionName, myBehav.team.ToString());
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.tag.Equals("Tower"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            TowerBehaviour behav = nowTarget.GetComponent <TowerBehaviour>();

                            if (behav != null)
                            {
                                string key     = "";
                                char[] keyChar = behav.gameObject.name.ToCharArray();
                                for (int i = 13; i < 16; ++i)
                                {
                                    key += keyChar[i];
                                }
                                myBehav.HitRPC(key);
                                if (behav.HitMe(myBehav.stat.Attack_Damage))
                                {
                                    if (enemyColor.Equals("Red"))
                                    {
                                        inGameManager.blueTeamPlayer[0].GetComponent <PhotonView>().RPC("GlobalGold", PhotonTargets.All, "blue", 100);
                                    }
                                    else
                                    {
                                        inGameManager.redTeamPlayer[0].GetComponent <PhotonView>().RPC("GlobalGold", PhotonTargets.All, "red", 100);
                                    }
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.tag.Equals("Suppressor") || nowTarget.tag.Equals("Nexus"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            SuppressorBehaviour behav = nowTarget.GetComponent <SuppressorBehaviour>();

                            if (behav != null)
                            {
                                string key     = "";
                                char[] keyChar = behav.gameObject.name.ToCharArray();
                                if (nowTarget.tag.Equals("Nexus"))
                                {
                                    key += keyChar[6];
                                }
                                else
                                {
                                    for (int i = 11; i < 14; ++i)
                                    {
                                        key += keyChar[i];
                                    }
                                }
                                myBehav.HitRPC(key);
                                if (behav.HitMe(myBehav.stat.Attack_Damage))
                                {
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                }
            }
            atkDelayTime = 1f;
            yield return(new WaitForSeconds(1));
        }
    }
Пример #14
0
    /// <summary>
    /// 공격을 담당하는 코루틴
    /// </summary>
    IEnumerator Attack()
    {
        while (true)
        {
            if (!isAtkPause)
            {
                bool isCheck = true;

                if (nowTarget == null)
                {
                    isCheck = false;
                }
                else if (!nowTarget.activeInHierarchy)
                {
                    isCheck = false;
                }

                //타겟이 있다면 공격
                if (isCheck)
                {
                    if (anim.GetBool("walking"))
                    {
                        anim.SetBool("walking", false);
                    }

                    anim.SetTrigger("attack");
                    Vector3 v = nowTarget.transform.position;
                    v.y = 0;
                    myMinion.transform.DOLookAt(v, 1);

                    //공격하는 대상과 피격당하는 대상을 구분하여 처리
                    if (nowTarget.tag.Equals("Minion"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            MinionBehavior minBehav = nowTarget.GetComponent <MinionBehavior>();

                            if (minBehav != null)
                            {
                                int viewID = minBehav.GetComponent <PhotonView>().viewID;
                                myBehav.HitRPC(viewID);
                                minBehav.HitMe(myBehav.stat.AttackDamage);
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.layer.Equals(LayerMask.NameToLayer("Champion")))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            ChampionBehavior champBehav = nowTarget.GetComponent <ChampionBehavior>();

                            if (champBehav != null)
                            {
                                int viewID = champBehav.GetComponent <PhotonView>().viewID;
                                myBehav.HitRPC(viewID);
                                champBehav.HitMe(myBehav.stat.AttackDamage, "AD", myMinion, myMinion.name);
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.tag.Equals("Tower"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            TowerBehaviour towerBehav = nowTarget.GetComponent <TowerBehaviour>();

                            if (towerBehav != null)
                            {
                                string key     = "";
                                char[] keyChar = towerBehav.gameObject.name.ToCharArray();

                                for (int i = 13; i < 16; ++i)
                                {
                                    key += keyChar[i];
                                }

                                myBehav.HitRPC(key);

                                if (towerBehav.HitMe(myBehav.stat.AttackDamage))
                                {
                                    if (enemyColor.Equals("Red"))
                                    {
                                        TheInGameManager.blueTeamPlayer[0].GetComponent <PhotonView>().RPC("GlobalGold", PhotonTargets.All, "blue", 100);
                                    }
                                    else
                                    {
                                        TheInGameManager.redTeamPlayer[0].GetComponent <PhotonView>().RPC("GlobalGold", PhotonTargets.All, "red", 100);
                                    }

                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                    else if (nowTarget.tag.Equals("Suppressor") || nowTarget.tag.Equals("Nexus"))
                    {
                        if (myMinion.name.Contains("Melee"))
                        {
                            SuppressorBehaviour supBehav = nowTarget.GetComponent <SuppressorBehaviour>();

                            if (supBehav != null)
                            {
                                string key     = "";
                                char[] keyChar = supBehav.gameObject.name.ToCharArray();

                                if (nowTarget.tag.Equals("Nexus"))
                                {
                                    key += keyChar[6];
                                }
                                else
                                {
                                    for (int i = 11; i < 14; ++i)
                                    {
                                        key += keyChar[i];
                                    }
                                }

                                myBehav.HitRPC(key);

                                if (supBehav.HitMe(myBehav.stat.AttackDamage))
                                {
                                    enemiesList.Remove(nowTarget);
                                }
                            }
                        }
                        else if (myMinion.name.Contains("Magician"))
                        {
                            float moveTime = 0.4f;
                            myBehav.ArrowRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                        else if (myMinion.name.Contains("Siege"))
                        {
                            float moveTime = 0.4f;
                            myBehav.CannonballRPC(nowTarget.transform.position, moveTime);
                            Invoke("ProjectileAtk", moveTime);
                        }
                    }
                }
            }

            //어택 딜레이타임을 1초로 설정
            atkDelayTime = 1f;

            yield return(new WaitForSeconds(1));
        }
    }
Пример #15
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Minion"))
        {
            MinionBehavior mB = other.GetComponent <MinionBehavior>();
            if (!other.gameObject.name.Contains(mySkill.TheChampionBehaviour.Team))
            {
                float damage = (mySkill.skillData.eDamage[mySkill.TheChampionData.skill_E - 1]
                                + mySkill.Acalculate(mySkill.skillData.eAstat, mySkill.skillData.eAvalue)) / 10f;
                if (mB != null)
                {
                    int viewID = mB.GetComponent <PhotonView>().viewID;
                    //mySkill.HitRPC(viewID, damage, "AP");
                    if (mB.HitMe(damage, "AP", mySkill.gameObject))
                    {
                        //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                        mySkill.TheChampionAtk.ResetTarget();

                        // 스킬쏜애 주인이 나면 킬올리자
                        if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                        {
                            mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 1, other.transform.position);
                        }
                    }
                }
            }
        }
        //else if(other.tag.Equals("Player"))
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionBehavior cB = other.GetComponent <ChampionBehavior>();
            if (cB.Team != mySkill.TheChampionBehaviour.Team)
            {
                float damage = (mySkill.skillData.eDamage[mySkill.TheChampionData.skill_E - 1]
                                + mySkill.Acalculate(mySkill.skillData.eAstat, mySkill.skillData.eAvalue)) / 10f;
                if (cB != null)
                {
                    int viewID = cB.GetComponent <PhotonView>().viewID;
                    //mySkill.HitRPC(viewID, damage, "AP");
                    if (cB.HitMe(damage, "AP", mySkill.gameObject, mySkill.name))
                    {
                        mySkill.TheChampionAtk.ResetTarget();
                        if (!sysmsg)
                        {
                            sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
                        }
                        sysmsg.sendKillmsg("alistar", other.GetComponent <ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString());
                        // 스킬쏜애 주인이 나면 킬올리자
                        if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                        {
                            mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 0, other.transform.position);
                        }
                    }
                }
            }
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterBehaviour mB = other.GetComponent <MonsterBehaviour>();

            float damage = (mySkill.skillData.eDamage[mySkill.TheChampionData.skill_E - 1]
                            + mySkill.Acalculate(mySkill.skillData.eAstat, mySkill.skillData.eAvalue)) / 10f;
            if (mB != null)
            {
                int viewID = mB.GetComponent <PhotonView>().viewID;
                //mySkill.HitRPC(viewID, damage, "AP");
                if (mB.HitMe(damage, "AP", mySkill.gameObject))
                {
                    mySkill.TheChampionAtk.ResetTarget();

                    //// 스킬쏜애 주인이 나면 킬올리자
                    //if (mySkill.GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                    //{
                    //    mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 3, other.transform.position);
                    //}
                }
            }
        }
    }
Пример #16
0
    public override void W()
    {
        InitTempValue();
        OnMove();
        HitEffectRPC("Alistar", "W");
        GameObject obj = SkillObj["W"][0];

        if (obj.activeInHierarchy)
        {
            Pooling(QSkillprefab, "W", 10);
            obj = SkillObj["W"][0];
        }
        SkillObj["W"].RemoveAt(0);
        SkillObj["W"].Add(obj);
        obj.transform.position = transform.position;
        obj.SetActive(true);
        if (TempObject1.tag.Equals("Minion"))
        {
            MinionBehavior mB = TempObject1.GetComponent <MinionBehavior>();
            if (!TempObject1.gameObject.name.Contains(TheChampionBehaviour.Team))
            {
                MinionAtk mA = mB.minAtk;
                //mA.PushMe(Vector3.up * 3 + TempObject1.transform.position
                //    + (((TempObject1.transform.position - TempVector1).normalized) * 5), 0.5f);
                Vector3 direction = (TempObject1.transform.position - TempVector1).normalized;
                Vector3 v         = TempObject1.transform.position
                                    + (direction * 10);;
                RaycastHit hit;
                if (Physics.Raycast(mA.transform.position, direction, out hit, 12, 1 << LayerMask.NameToLayer("WallCollider")))
                {
                    float dis = Vector3.Distance(hit.point, TempObject1.transform.position);
                    v = TempObject1.transform.position
                        + (direction * (dis - 1f));
                }

                v.y = 0;
                mA.PushMe(v, 0.5f);
                mA.PauseAtk(1f, true);
                float damage = skillData.wDamage[TheChampionData.skill_W - 1]
                               + Acalculate(skillData.wAstat, skillData.wAvalue);

                if (mB != null)
                {
                    int viewID = mB.GetComponent <PhotonView>().viewID;
                    HitRPC(viewID, damage, "AP", "Push");
                    if (mB.HitMe(damage, "AP", gameObject))
                    {
                        //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                        TheChampionAtk.ResetTarget();

                        // 스킬쏜애 주인이 나면 킬올리자
                        if (GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
                        {
                            TheChampionData.Kill_CS_Gold_Exp(TempObject1.gameObject.name, 1, TempObject1.transform.position);
                        }
                    }
                }
            }
        }
        //else if (TempObject1.tag.Equals("Player"))
        else if (TempObject1.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionBehavior cB = TempObject1.GetComponent <ChampionBehavior>();
            if (cB.Team != TheChampionBehaviour.Team)
            {
                ChampionAtk cA        = cB.myChampAtk;
                Vector3     direction = (TempObject1.transform.position - TempVector1).normalized;
                Vector3     v         = TempObject1.transform.position
                                        + (direction * 5);;
                RaycastHit hit;
                if (Physics.Raycast(cA.transform.position, direction, out hit, 6, 1 << LayerMask.NameToLayer("WallCollider")))
                {
                    float dis = Vector3.Distance(hit.point, TempObject1.transform.position);
                    v = TempObject1.transform.position
                        + (direction * (dis - 1f));
                }

                v.y = 0.5f;
                cA.PushMe(v, 0.5f);
                cA.PauseAtk(1f, true);
                float damage = skillData.wDamage[TheChampionData.skill_W - 1]
                               + Acalculate(skillData.wAstat, skillData.wAvalue);

                if (cB != null)
                {
                    int viewID = cB.GetComponent <PhotonView>().viewID;
                    HitRPC(viewID, damage, "AP", "Push");
                    if (cB.HitMe(damage, "AP", gameObject, gameObject.name))
                    {
                        TheChampionAtk.ResetTarget();
                        if (!sysmsg)
                        {
                            sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>();
                        }
                        //sysmsg.sendKillmsg("alistar", TempObject1.GetComponent<ChampionData>().ChampionName, TheChampionBehaviour.Team.ToString());
                        // 스킬쏜애 주인이 나면 킬올리자
                        //if (GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                        //{

                        //    TheChampionData.Kill_CS_Gold_Exp(TempObject1.gameObject.name, 0, TempObject1.transform.position);
                        //}
                    }
                }
            }
        }
        else if (TempObject1.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterBehaviour mB        = TempObject1.GetComponent <MonsterBehaviour>();
            MonsterAtk       mA        = mB.monAtk;
            Vector3          direction = (TempObject1.transform.position - TempVector1).normalized;
            Vector3          v         = TempObject1.transform.position
                                         + (direction * 5);;
            RaycastHit hit;
            if (Physics.Raycast(mA.transform.position, direction, out hit, 6, 1 << LayerMask.NameToLayer("WallCollider")))
            {
                float dis = Vector3.Distance(hit.point, TempObject1.transform.position);
                v = TempObject1.transform.position
                    + (direction * (dis - 1f));
            }

            v.y = 0;
            mA.PushMe(v, 0.5f);
            mA.PauseAtk(1f, true);
            float damage = skillData.wDamage[TheChampionData.skill_W - 1]
                           + Acalculate(skillData.wAstat, skillData.wAvalue);

            if (mB != null)
            {
                int viewID = mB.GetComponent <PhotonView>().viewID;
                HitRPC(viewID, damage, "AP", "Push");
                if (mB.HitMe(damage, "AP", gameObject))
                {
                    TheChampionAtk.ResetTarget();

                    //// 스킬쏜애 주인이 나면 킬올리자
                    //if (GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player))
                    //{
                    //    TheChampionData.Kill_CS_Gold_Exp(TempObject1.gameObject.name, 3, TempObject1.transform.position);
                    //}
                }
            }
        }
        skillselect = SSelect.none;
    }
Пример #17
0
    private void OnTriggerEnter(Collider other)
    {
        // 다른 챔피언과 충돌한 적 있는지 검사
        if (isFirstAtk)
        {
            bool isTrig = false;

            // 현재 충돌한 적에 따라 각각의 HitMe 함수를 호출한다
            if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
            {
                if (!other.gameObject.Equals(mySkill.gameObject))
                {
                    ChampionBehavior champBehav = other.GetComponent <ChampionBehavior>();

                    if (champBehav.team != mySkill.TheChampionBehaviour.team)
                    {
                        isTrig = true;
                        float damage = CalculateDamage();

                        if (champBehav != null)
                        {
                            champBehav.HitMe(damage, "AD", mySkill.gameObject, mySkill.name);
                        }
                    }
                }
            }
            else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
            {
                MonsterBehaviour monBehav = other.GetComponent <MonsterBehaviour>();
                float            damage   = CalculateDamage();

                if (monBehav != null)
                {
                    isTrig = true;

                    if (monBehav.HitMe(damage, "AD", mySkill.gameObject))
                    {
                        mySkill.TheChampionAtk.ResetTarget();
                    }
                }
            }
            else if (other.tag.Equals("Minion"))
            {
                MinionBehavior minBehav = other.GetComponent <MinionBehavior>();

                if (!other.name.Contains(mySkill.TheChampionBehaviour.team))
                {
                    isTrig = true;
                    float damage = CalculateDamage();

                    if (minBehav != null)
                    {
                        minBehav.HitMe(damage, "AD", mySkill.gameObject);
                    }
                }
            }

            // 피격당한 게 확인되면 isFirstAtk을 꺼 다른 이에게 충돌할 일이 없도록 처리한다.
            if (isTrig)
            {
                gameObject.SetActive(false);
                isFirstAtk = false;
            }
        }
    }
Пример #18
0
    private void OnTriggerEnter(Collider other)
    {
        // 다른 챔피언과 충돌한 적 있는지 검사
        if (isFirstAtk)
        {
            bool isTrig = false;

            // 현재 충돌한 적에 따라 각각의 HitMe 함수를 호출하고 체력을 회복한다
            if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
            {
                if (other.gameObject.Equals(mySkill.gameObject))
                {
                    return;
                }

                ChampionBehavior champBehav = other.GetComponent <ChampionBehavior>();

                if (champBehav.team != mySkill.TheChampionBehaviour.team)
                {
                    isTrig = true;
                    float damage = CalculateDamage();

                    if (champBehav != null)
                    {
                        int x2 = 1;
                        ChampionSound.instance.PlayOtherFx(champBehav.GetComponentInChildren <AudioSource>(), ChampionSound.instance.Mundo_Q_Hit);
                        champBehav.HitMe(damage, "AP", mySkill.gameObject, mySkill.name);
                        mySkill.activeMundoQEffect(champBehav.transform.position);
                        mySkill.Heal(damage * x2);
                    }
                }
            }
            else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
            {
                MonsterBehaviour monBehav = other.GetComponent <MonsterBehaviour>();
                float            damage   = CalculateDamage();

                if (monBehav != null)
                {
                    isTrig = true;
                    int x2 = 1;

                    if (monBehav.HitMe(damage, "AP", mySkill.gameObject))
                    {
                        x2 = 2;
                        mySkill.TheChampionAtk.ResetTarget();
                    }

                    mySkill.Heal(damage * x2);
                }
            }
            else if (other.tag.Equals("Minion"))
            {
                MinionBehavior minBehav = other.GetComponent <MinionBehavior>();

                if (!other.name.Contains(mySkill.TheChampionBehaviour.team))
                {
                    isTrig = true;
                    float damage = CalculateDamage();

                    if (minBehav != null)
                    {
                        ChampionSound.instance.PlayOtherFx(minBehav.audio, ChampionSound.instance.Mundo_Q_Hit);
                        int x2 = 1;
                        minBehav.HitMe(damage, "AP", mySkill.gameObject);
                        mySkill.activeMundoQEffect(minBehav.transform.position);
                        mySkill.Heal(damage * x2);
                    }
                }
            }

            // 피격당한 게 확인되면 isFirstAtk을 꺼 다른 이에게 충돌할 일이 없도록 처리한다.
            if (isTrig)
            {
                gameObject.SetActive(false);
                isFirstAtk = false;
            }
        }
    }
Пример #19
0
    /// <summary>
    /// W 스킬 함수
    /// </summary>
    public override void W()
    {
        GameObject enemyObj    = wArguObj;
        Vector3    enemyVector = wArguVec;

        OnMove();
        HitEffectRPC("Alistar", "W");
        GameObject obj = GetSkillInThePool("W");

        obj.transform.position = transform.position;
        obj.SetActive(true);

        // 공격하는 대상에 따라 공격 처리를 한다.
        if (enemyObj.tag.Equals("Minion"))
        {
            MinionBehavior minBehav = enemyObj.GetComponent <MinionBehavior>();

            // 적인지 확인
            if (!enemyObj.gameObject.name.Contains(TheChampionBehaviour.team))
            {
                MinionAtk  minAtk       = minBehav.minAtk;
                Vector3    directionVec = (enemyObj.transform.position - enemyVector).normalized;
                Vector3    maxVec       = enemyObj.transform.position + (directionVec * 10);;
                RaycastHit hit;

                if (Physics.Raycast(minAtk.transform.position, directionVec, out hit, 12, 1 << LayerMask.NameToLayer("WallCollider")))
                {
                    float dist = Vector3.Distance(hit.point, enemyObj.transform.position);
                    maxVec = enemyObj.transform.position + (directionVec * (dist - 1f));
                }

                //밀친 후 공격당한 대상의 HitMe 함수를 호출
                maxVec.y = 0;
                minAtk.PushMe(maxVec, 0.5f);
                minAtk.PauseAtk(1f, true);
                float damage = skillData.wDamage[TheChampionData.skill_W - 1] + Acalculate(skillData.wAstat, skillData.wAvalue);

                if (minBehav != null)
                {
                    int viewID = minBehav.GetComponent <PhotonView>().viewID;
                    HitRPC(viewID, damage, "AP", "Push");
                    minBehav.HitMe(damage, "AP", gameObject);
                }
            }
        }
        else if (enemyObj.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionBehavior champBehav = enemyObj.GetComponent <ChampionBehavior>();

            // 적인지 확인
            if (champBehav.team != TheChampionBehaviour.team)
            {
                ChampionAtk champAtk     = champBehav.myChampAtk;
                Vector3     directionVec = (enemyObj.transform.position - enemyVector).normalized;
                Vector3     maxVec       = enemyObj.transform.position + (directionVec * 5);;
                RaycastHit  hit;

                if (Physics.Raycast(champAtk.transform.position, directionVec, out hit, 6, 1 << LayerMask.NameToLayer("WallCollider")))
                {
                    float dis = Vector3.Distance(hit.point, enemyObj.transform.position);
                    maxVec = enemyObj.transform.position + (directionVec * (dis - 1f));
                }

                //밀친 후 공격당한 대상의 HitMe 함수를 호출
                maxVec.y = 0.5f;
                champAtk.PushMe(maxVec, 0.5f);
                champAtk.PauseAtk(1f, true);
                float damage = skillData.wDamage[TheChampionData.skill_W - 1] + Acalculate(skillData.wAstat, skillData.wAvalue);

                if (champBehav != null)
                {
                    int viewID = champBehav.GetComponent <PhotonView>().viewID;

                    HitRPC(viewID, damage, "AP", "Push");
                    champBehav.HitMe(damage, "AP", gameObject, gameObject.name);
                }
            }
        }
        else if (enemyObj.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterBehaviour monBehav     = enemyObj.GetComponent <MonsterBehaviour>();
            MonsterAtk       monAtk       = monBehav.monAtk;
            Vector3          directionVec = (enemyObj.transform.position - enemyVector).normalized;
            Vector3          maxVec       = enemyObj.transform.position + (directionVec * 5);;
            RaycastHit       hit;

            if (Physics.Raycast(monAtk.transform.position, directionVec, out hit, 6, 1 << LayerMask.NameToLayer("WallCollider")))
            {
                float dist = Vector3.Distance(hit.point, enemyObj.transform.position);
                maxVec = enemyObj.transform.position + (directionVec * (dist - 1f));
            }

            //밀친 후 공격당한 대상의 HitMe 함수를 호출
            maxVec.y = 0;
            monAtk.PushMe(maxVec, 0.5f);
            monAtk.PauseAtk(1f, true);
            float damage = skillData.wDamage[TheChampionData.skill_W - 1] + Acalculate(skillData.wAstat, skillData.wAvalue);

            if (monBehav != null)
            {
                int viewID = monBehav.GetComponent <PhotonView>().viewID;
                HitRPC(viewID, damage, "AP", "Push");
                monBehav.HitMe(damage, "AP", gameObject);
            }
        }

        // 스킬 선택을 해제함
        skillSelect = SkillSelect.none;
    }