Example #1
0
    public void AttackSystem()
    {
        if (!isAttacking)                                                   //이미 공격 중이 아닐 때 공격
        {
            //----------------------------각각 공격 애니메이션 실행----------------------------
            isAttacking             = true;
            myMonsterRigid.velocity = new Vector2(0, myMonsterRigid.velocity.y);

            AttackAnimation();

            //----------------------------각각 공격 작용----------------------------
            if (myMonsterCode == MonsterCode.FM201)                         //불타는 참치.
            {
            }
            else if (myMonsterCode == MonsterCode.FM202)                    //얼음 날치.
            {
            }
            else if (myMonsterCode == MonsterCode.FM203 || myMonsterCode == MonsterCode.FM205)      //무지개 새, 신전 순찰자.
            {
                int childNum = 0;
                if (myMonsterCode == MonsterCode.FM203)
                {
                    childNum = Random.Range(0, 2);  //0~1
                }
                GameObject throwthing          = transform.GetChild(childNum).gameObject;
                GameObject summonedThrowWeapon = Instantiate(throwthing);
                summonedThrowWeapon.transform.position = new Vector3(transform.position.x + 4, transform.position.y + 2, 0f);
                MonstersThrowWeapon throwWeapon = summonedThrowWeapon.GetComponent <MonstersThrowWeapon>();
                throwWeapon.gameObject.SetActive(true);
                throwWeapon.StartGoToPlayer(myMonsterCode);
            }
            else if (myMonsterCode == MonsterCode.FM204)
            {
                if (transform.parent.childCount < 30)   //몬스터의 총 갯수가 30마리 이상이면 소환 안함.
                {
                    //Clone 소환.
                    GameObject myClone = Instantiate(this.gameObject, transform.parent);
                    myClone.transform.position = transform.position;


                    MonsterFly myCloneInfos = myClone.GetComponent <MonsterFly>();
                    myCloneInfos.myMonsterInfo.monsterDropGoldAmount = 0;   //돈 무한 생성 방지용!
                    myCloneInfos.Awake();
                    myCloneInfos.AttackAnimation();

                    //분신 생성 후 분신도 자신도 텔레포트
                    myClone.transform.position = PlayerObject.transform.position + new Vector3(Random.Range(-10f, 10f), Random.Range(10f, 15f));
                    this.transform.position    = PlayerObject.transform.position + new Vector3(Random.Range(-10f, 10f), Random.Range(10f, 15f));
                }
            }
        }
    }
Example #2
0
    public void AttackSystem()
    {
        if (!isAttacking)                                                   //이미 공격 중이 아닐 때 공격
        {
            //----------------------------각각 공격 애니메이션 실행----------------------------
            isAttacking = true;
            AnimationStateSet(MonsterState.ATTACK);
            myMonsterRigid.velocity = new Vector2(0, myMonsterRigid.velocity.y);

            AttackDelayTimerSet();

            //----------------------------각각 공격 작용----------------------------
            if (myMonsterCode == MonsterCode.WM101)
            {
            }
            else if (myMonsterCode == MonsterCode.WM102 || myMonsterCode == MonsterCode.WM104)                    //뛰는 돌, 불타는 돌. 걸어오다가 일정거리 이하일 때 돌진
            {
                //돌진 공격
                if (isLRM == 1)
                {
                    myMonsterRigid.velocity = new Vector2(-myMonsterInfo.monsterSpeed - 8, myMonsterRigid.velocity.y);
                }
                if (isLRM == 2 || isLRM == 3)
                {
                    myMonsterRigid.velocity = new Vector2(myMonsterInfo.monsterSpeed + 8, myMonsterRigid.velocity.y);
                }
            }
            else if (myMonsterCode == MonsterCode.WM103)                        //서있는 나무. 범위에 들어오면 공격.
            {
            }
            else if (myMonsterCode == MonsterCode.WM106 || myMonsterCode == MonsterCode.WM108)    //원거리 공격. 불타는 주술사, 얼음 펭귄, 무지개 장미, 무지개 새
            {
                int childNum = 0;

                GameObject throwthing          = transform.GetChild(childNum).gameObject;
                GameObject summonedThrowWeapon = Instantiate(throwthing);
                summonedThrowWeapon.transform.position = new Vector3(transform.position.x + 4, transform.position.y + 2, 0f);
                MonstersThrowWeapon throwWeapon = summonedThrowWeapon.GetComponent <MonstersThrowWeapon>();
                throwWeapon.gameObject.SetActive(true);
                throwWeapon.StartGoToPlayer(myMonsterCode);
            }
        }
    }
Example #3
0
    public void AttackSystem()
    {
        if (!isAttacking)                                                   //이미 공격 중이 아닐 때 공격
        {
            //----------------------------각각 공격 애니메이션 실행----------------------------
            isAttacking             = true;
            myMonsterRigid.velocity = new Vector2(0, myMonsterRigid.velocity.y);

            AttackAnimation(attackType);

            //----------------------------각각 공격 작용----------------------------
            if (myMonsterCode == MonsterCode.BM301)                             //습지의 여왕.
            {
                if (attackType == 1)                                            //일반공격 : 채찍 휘두르기
                {
                }
                else if (attackType == 2)                                       //타겟팅 공격 (적당한 프리팹이 없음..)
                {
                    bossAttackPrefabList[0].transform.position = pPosXY;
                    Instantiate(bossAttackPrefabList[0]);
                }
                else if (attackType == 3)                                       //Boss위치에 몬스터 소환(걷는 꽃)
                {
                    dungeonManager.MonsterInstantiateProcessing();
                    bossAttackPrefabList[1].transform.position = mPosXY;
                    Instantiate(bossAttackPrefabList[1]);
                }
            }
            else if (myMonsterCode == MonsterCode.BM302)                        //타오르는 피닉스
            {
                if (attackType == 1)                                            //일반공격 : 부리찍기!!!(애니메이션)
                {
                }
                else if (attackType == 2)                                       //깃털을 던져서 공격!
                {
                    GameObject summonedThrowWeapon = Instantiate(bossAttackPrefabList[0]);
                    summonedThrowWeapon.transform.position = this.transform.position;
                    MonstersThrowWeapon throwWeapon = summonedThrowWeapon.GetComponent <MonstersThrowWeapon>();
                    throwWeapon.gameObject.SetActive(true);
                    throwWeapon.StartGoToPlayer(myMonsterCode);
                }
                else if (attackType == 3)                                       //타겟팅 공격 (적당한 프리팹이 없음..)
                {
                    bossAttackPrefabList[1].transform.position = pPosXY;
                    Instantiate(bossAttackPrefabList[1]);
                }
            }
            else if (myMonsterCode == MonsterCode.BM303)                        //얼음 내시
            {
                if (attackType == 1)                                            //파도 공격!
                {
                    GameObject summonedThrowWeapon = Instantiate(bossAttackPrefabList[0]);
                    summonedThrowWeapon.transform.position = this.transform.position;
                    MonstersThrowWeapon throwWeapon = summonedThrowWeapon.GetComponent <MonstersThrowWeapon>();
                    throwWeapon.gameObject.SetActive(true);
                    throwWeapon.StartGoToPlayer(myMonsterCode, attackType, isLRM);
                }
                else if (attackType == 2)                                       //눈송이 쫓아가기 공격!
                {
                    GameObject summonedThrowWeapon = Instantiate(bossAttackPrefabList[1]);
                    summonedThrowWeapon.transform.position = this.transform.position;
                    MonstersThrowWeapon throwWeapon = summonedThrowWeapon.GetComponent <MonstersThrowWeapon>();
                    throwWeapon.gameObject.SetActive(true);
                    throwWeapon.StartGoToPlayer(myMonsterCode, attackType);
                }
                else if (attackType == 3)                                       //아이스 스피어 소환 공격!
                {
                    int count = 5;
                    List <GameObject> summonedThrowWeaponList = new List <GameObject>();
                    for (int i = 0; i < count; i++) //0,1,2,3,4
                    {
                        summonedThrowWeaponList.Add(Instantiate(bossAttackPrefabList[2]));
                        summonedThrowWeaponList[i].transform.position = new Vector3(transform.position.x, transform.position.y + i * 3, transform.position.z);
                        MonstersThrowWeapon throwWeapon = summonedThrowWeaponList[i].GetComponent <MonstersThrowWeapon>();
                        throwWeapon.gameObject.SetActive(true);
                        throwWeapon.StartGoToPlayer(myMonsterCode, attackType);
                    }
                }
            }
            else if (myMonsterCode == MonsterCode.BM304)                        //해바라기 사자
            {
                if (attackType == 1)                                            //일반공격 : 할퀴기
                {
                }
                else if (attackType == 2)                                                                                                       //꽃잎들 발사!
                {
                    MonstersThrowWeapon throwWeaponScript = Instantiate(transform.GetChild(0).gameObject).GetComponent <MonstersThrowWeapon>(); //꽃을 가져옴.
                    throwWeaponScript.gameObject.SetActive(true);
                    throwWeaponScript.StartGoToPlayer(myMonsterCode, attackType, isLRM);
                }
                else if (attackType == 3)                                       //울부짖기 (디버프)
                {
                }
            }
        }
    }