Ejemplo n.º 1
0
    public void CallDead(float time, bool isDragon, string team)
    {
        isDead  = true;
        stat.Hp = 0;
        IamDead(time);
        if (monAtk == null)
        {
            monAtk = transform.GetComponentInChildren <MonsterAtk>();
        }
        monAtk.enemiesList.Clear();

        if (PhotonNetwork.isMasterClient)
        {
            return;
        }

        if (isDragon)
        {
            if (team.Equals("red"))
            {
                GameObject.FindGameObjectWithTag("InGameManager").GetComponent <InGameManager>().blueTeamDragonKill++;
            }
            else
            {
                GameObject.FindGameObjectWithTag("InGameManager").GetComponent <InGameManager>().redTeamDragonKill++;
            }
        }
    }
Ejemplo n.º 2
0
    private void Dead()
    {
        InitJungleStatus();
        if (monAtk == null)
        {
            monAtk = transform.GetComponentInChildren <MonsterAtk>();
        }
        if (TheAIDest == null)
        {
            TheAIDest = gameObject.GetComponent <AIDestinationSetter>();
        }
        if (TheAIPath == null)
        {
            TheAIPath = gameObject.GetComponent <AIPath>();
        }
        monAtk.TheAIPath = null;
        monAtk.nowTarget = null;
        monAtk.StopAllCoroutines();
        TheAIPath.canMove   = true;
        TheAIPath.canSearch = true;
        gameObject.GetComponent <AIDestinationSetter>().target = null;
        myCenter.StartCoroutine("Respawn");
        TheAIDest.target = myCenter.transform;
        monAtk.nowTarget = null;
        gameObject.SetActive(false);

        // 죽을때 마우스바뀐상태면 원래대로
        if (mouseChanged)
        {
            cursor.SetCursor(cursor.PreCursor, Vector2.zero);
        }
    }
Ejemplo n.º 3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag.Equals("Minion"))
     {
         MinionAtk mA = other.GetComponent <MinionBehavior>().minAtk;
         if (!mA.isPushing)
         {
             return;
         }
         mA.PushWall();
     }
     else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
     {
         ChampionAtk cA = other.GetComponent <ChampionBehavior>().myChampAtk;
         if (!cA.isPushing)
         {
             return;
         }
         cA.PushWall();
     }
     else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
     {
         MonsterAtk mA = other.GetComponent <MonsterBehaviour>().monAtk;
         if (!mA.isPushing)
         {
             return;
         }
         mA.PushWall();
     }
 }
Ejemplo n.º 4
0
 public void LateInit()
 {
     TheAIDest    = GetComponent <AIDestinationSetter>();
     TheAIPath    = GetComponent <AIPath>();
     monAtk       = GetComponentInChildren <MonsterAtk>();
     TheFogEntity = GetComponent <FogOfWarEntity>();
     monAtk.LateInit();
 }
Ejemplo n.º 5
0
    private void OnTriggerEnter(Collider other)
    {
        //미니언, 챔피언, 몬스터가 벽으로 밀쳐진다면 벽을 뚫고 지나가지 못하게 엮으로 밀어준다.
        if (other.gameObject.tag.Equals("Minion"))
        {
            MinionAtk minAtk = other.GetComponent <MinionBehavior>().minAtk;

            if (!minAtk.isPushing)
            {
                return;
            }

            minAtk.PushWall();
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionAtk champAtk = other.GetComponent <ChampionBehavior>().myChampAtk;

            if (!champAtk.isPushing)
            {
                return;
            }

            champAtk.PushWall();
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterAtk monAtk = other.GetComponent <MonsterBehaviour>().monAtk;

            if (!monAtk.isPushing)
            {
                return;
            }

            monAtk.PushWall();
        }
    }
Ejemplo n.º 6
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;
    }
Ejemplo n.º 7
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;
    }