Exemple #1
0
    private void IgniteCheck()
    {
        if (isIgniteClick) // 스킬시전
        {
            if (isSmiteClick || isTeleportClick || Input.GetMouseButton(1))
            {
                cursor.SetCursor(0, Vector2.zero);
                isIgniteClick = false;
                splatmanager.Cancel();
                return;
            }
            else if (Input.GetMouseButtonDown(0))
            {
                splatmanager.Cancel();
                isIgniteClick = false;
                Ignite();
                cursor.SetCursor(0, Vector2.zero);
            }
        }

        if (isIgnite) // 점화 맞았을때
        {
            ImOnFire   = true;
            IgnteTime += Time.deltaTime;
            if (IgnteTime >= 1.0f)
            {
                IgnteTime = 0;
                IgnteDam += Mathf.FloorToInt(55 + (25 * Attackerlevel)) / 5;
                if (mybehav.HitMe((float)Mathf.FloorToInt(55 + (25 * Attackerlevel)) / 5, "FD", IgniteAtker, IgniteAtker.gameObject.name))
                {
                    if (ImOnFire)
                    {
                        ImOnFire  = false;
                        IgnteTime = 0;
                        IgnteDam  = 0;
                        ChampionData chdata = IgniteAtker.GetComponent <ChampionData>();
                        chdata.Kill_CS_Gold_Exp("", 0, this.transform.position);
                    }
                }
            }
            if (IgnteDam >= Mathf.FloorToInt(55 + (25 * Attackerlevel)))
            {
                IgnteDam  = 0;
                IgnteTime = 0;
                isIgnite  = false;
            }
        }
    }
    /// <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));
        }
    }
Exemple #3
0
    //타겟팅 점화, 강타,
    private void Update()
    {
        if (isInGameScene)
        {
            if (chat.chatInput.IsActive())
            {
                return;
            }

            if (isIgniteClick)
            {
                if (isSmiteClick || isTeleportClick || Input.GetMouseButton(1))
                {
                    cursor.SetCursor(0, Vector2.zero);
                    isIgniteClick = false;
                    splatmanager.Cancel();
                    return;
                }
                else if (Input.GetMouseButtonDown(0))
                {
                    splatmanager.Cancel();
                    isIgniteClick = false;
                    Ignite();
                    cursor.SetCursor(0, Vector2.zero);
                }
            }
            if (isSmiteClick)
            {
                if (isIgniteClick || isTeleportClick || Input.GetMouseButton(1))
                {
                    cursor.SetCursor(0, Vector2.zero);
                    isSmiteClick = false;
                    splatmanager.Cancel();
                    return;
                }
                else if (Input.GetMouseButtonDown(0))
                {
                    splatmanager.Cancel();
                    isSmiteClick = false;
                    Smite();
                    cursor.SetCursor(0, Vector2.zero);
                }
            }
            if (isTeleportClick)
            {
                if (isIgniteClick || isSmiteClick || Input.GetMouseButton(1))
                {
                    cursor.SetCursor(0, Vector2.zero);
                    isTeleportClick = false;
                    return;
                }
                else if (Input.GetMouseButtonDown(0))
                {
                    TeleportDestinationSet();
                    isTeleportClick = false;
                    cursor.SetCursor(0, Vector2.zero);
                }
            }
        }
        if (isIgnite)
        {
            ImOnFire   = true;
            IgnteTime += Time.deltaTime;
            if (IgnteTime >= 1.0f)
            {
                IgnteTime = 0;
                IgnteDam += Mathf.FloorToInt(55 + (25 * Attackerlevel)) / 5;
                if (mybehav.HitMe((float)Mathf.FloorToInt(55 + (25 * Attackerlevel)) / 5, "FD", IgniteAtker, IgniteAtker.gameObject.name))
                {
                    if (ImOnFire)
                    {
                        ImOnFire  = false;
                        IgnteTime = 0;
                        IgnteDam  = 0;
                        ChampionData chdata = IgniteAtker.GetComponent <ChampionData>();
                        chdata.Kill_CS_Gold_Exp("", 0, this.transform.position);
                    }
                }
            }
            if (IgnteDam >= Mathf.FloorToInt(55 + (25 * Attackerlevel)))
            {
                IgnteDam  = 0;
                IgnteTime = 0;
                isIgnite  = false;
            }
        }

        if (isTeleportDestSet)//목표 설정후에
        {
            if (!Once)
            {
                curhp = ChampData.totalstat.Hp;
                Once  = true;
                SendEffect("Teleport", Player.transform.position, team, photonview.viewID);
                Ping.GetFxPool("Going", TeleportDestPos, false);
                if (Target.GetComponent <PhotonView>() != null)
                {
                    SendEffect("Teleport", Target.transform.position, team, photonview.viewID);
                }
                else
                {
                    SendEffect("Teleport", Target.transform.position, team);
                }
                AIPath.isStopped = true;
                if (Target.transform.name.Contains("Minion"))
                {
                    Target.GetComponent <Pathfinding.AIPath>().isStopped = true;
                }
            }
            TeleportTime -= Time.deltaTime;
            if (curhp > ChampData.totalstat.Hp)
            {
                if (fog.Count > 0)
                {
                    for (int i = 0; i < fog.Count; i++)
                    {
                        fog[i].stopParticle();
                    }
                }
                fog.Clear();
                cursor.SetCursor(cursor.PreCursor, Vector2.zero);
                isTeleportDestSet = false;
                TeleportTime      = 4.5f;
                Once = false;
                cam.ResetTarget();
                AIPath.isStopped = false;
                if (Target.transform.name.Contains("Minion"))
                {
                    Target.GetComponent <Pathfinding.AIPath>().isStopped = false;
                }
                return;
            }
            else if (Input.GetKeyDown(KeyCode.D))
            {
                if (fog.Count > 0)
                {
                    for (int i = 0; i < fog.Count; i++)
                    {
                        fog[i].stopParticle();
                    }
                }
                fog.Clear();
                cursor.SetCursor(cursor.PreCursor, Vector2.zero);
                if (Spell_D == 6)
                {
                    ChampData.current_Cooldown_D = 1;
                }
                else if (Spell_F == 6)
                {
                    ChampData.current_Cooldown_F = 1;
                }
                isTeleportDestSet = false;
                TeleportTime      = 4.5f;
                Once = false;
                cam.ResetTarget();
                cursor.SetCursor(0, Vector3.zero);
                AIPath.isStopped = false;
                if (Target.transform.name.Contains("Minion"))
                {
                    Target.GetComponent <Pathfinding.AIPath>().isStopped = false;
                }
                return;
            }
            else if (TeleportTime <= 0)
            {
                cam.SetTarget(Player.transform);
                TeleportTime              = 4.5f;
                TeleportDestPos.y         = Player.transform.position.y;
                Player.transform.position = TeleportDestPos;
                //AstarTarget.transform.position = Player.transform.position;
                isTeleportDestSet = false;
                Once = false;
                Invoke("TeleportEnd", 0.5f);
            }
        }

        if (isGhost) //유체화 켜졌을때
        {
            if (!aiPath)
            {
                return;
            }
            GhostAcceleration -= Time.deltaTime;

            if (GhostAcceleration >= 8.0f)
            {
                MaxSpeed         = aiPath.maxSpeed + (aiPath.maxSpeed * (0.27f + (0.01f * (float)Playerlevel)));
                aiPath.maxSpeed += (aiPath.maxSpeed * (0.27f + (0.01f * Playerlevel))) * Time.deltaTime;
                if (aiPath.maxSpeed >= MaxSpeed)
                {
                    aiPath.maxSpeed = MaxSpeed;
                }
                //27% + (1% * level)
            }
            if (GhostAcceleration <= 0)
            {
                Ghost(false);
            }
        }
        if (Input.GetKeyDown(KeyCode.J))
        {
            ChampData.current_Cooldown_D = 1;
            ChampData.current_Cooldown_F = 1;
        }
    }
Exemple #4
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));
     }
 }