示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Minion")) //나중에챔피언일때도적일때도조건에추가
        {                               //미니언의 경우 트리거 켜진건 공격 추-적 반경이라 디스턴스를 추가
         //if (Vector3.Distance(other.transform.position, transform.position) <= skillRange)
         //{
            MinionAtk mA = other.GetComponent <MinionBehavior>().minAtk;
            mA.PauseAtk(1f, true);
            //other.GetComponent<Rigidbody>().AddForce(0, upPower, 0);
            other.transform.DOJump(other.transform.position, 3, 1, 1f);
            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 (other.GetComponent <MinionBehavior>().HitMe(damage, "AP"))
            {
                //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                mySkill.TheChampionAtk.ResetTarget();
            }
        }
        else if (other.tag.Equals("Player"))
        {
            ChampionAtk cA = other.GetComponent <ChampionBehavior>().myChampAtk;
            cA.PauseAtk(1f, true);
            other.transform.DOJump(other.transform.position, 3, 1, 1f);
            float damage = mySkill.skillData.qDamage[mySkill.TheChampionData.skill_Q - 1]
                           + mySkill.Acalculate(mySkill.skillData.qAstat, mySkill.skillData.qAvalue);
            if (other.GetComponent <ChampionBehavior>().HitMe(damage, "AP"))
            {
                mySkill.TheChampionAtk.ResetTarget();
            }
        }
    }
示例#2
0
    public override void W()
    {
        base.W();
        InitTempValue();
        OnMove();
        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"))
        {
            MinionAtk mA = TempObject1.GetComponent <MinionBehavior>().minAtk;
            mA.PushMe(Vector3.up * 3 + TempObject1.transform.position
                      + (((TempObject1.transform.position - TempVector1).normalized) * 5), 0.5f);
            mA.PauseAtk(1f, true);
            float damage = skillData.wDamage[TheChampionData.skill_W - 1]
                           + Acalculate(skillData.wAstat, skillData.wAvalue);
            if (TempObject1.GetComponent <MinionBehavior>().HitMe(damage, "AP"))
            {
                //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                TheChampionAtk.ResetTarget();
            }
        }
        else if (TempObject1.tag.Equals("Player"))
        {
            ChampionAtk cA = TempObject1.GetComponent <ChampionBehavior>().myChampAtk;
            cA.PushMe(Vector3.up * 3 + TempObject1.transform.position
                      + (((TempObject1.transform.position - TempVector1).normalized) * 5), 0.5f);
            cA.PauseAtk(1f, true);
            float damage = skillData.wDamage[TheChampionData.skill_W - 1]
                           + Acalculate(skillData.wAstat, skillData.wAvalue);
            if (TempObject1.GetComponent <ChampionBehavior>().HitMe(damage, "AP"))
            {
                //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                TheChampionAtk.ResetTarget();
            }
        }
        skillselect = SSelect.none;
    }
示例#3
0
 private void OnCollisionEnter(Collision collision)
 {
     if (skillselect.Equals(SSelect.W) && isSkillIng)
     {
         if (collision.transform.tag.Equals("Minion") && collision.gameObject != TempObject1)
         {
             MinionAtk mA = collision.gameObject.GetComponent <MinionBehavior>().minAtk;
             mA.PushMe(Vector3.up * 3 + collision.transform.position
                       + (((collision.transform.position - TempVector1).normalized) * 5), 0.5f);
             mA.PauseAtk(1f, true);
             float damage = skillData.wDamage[TheChampionData.skill_W - 1]
                            + Acalculate(skillData.wAstat, skillData.wAvalue);
             if (collision.gameObject.GetComponent <MinionBehavior>().HitMe(damage, "AP"))
             {
                 //여기에는 나중에 평타 만들면 플레이어의 현재 공격 타겟이 죽었을 시 초기화해주는 것을 넣자.
                 TheChampionAtk.ResetTarget();
             }
         }
     }
 }
示例#4
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;
    }
示例#5
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;
    }