Beispiel #1
0
    void Missile()
    {
        GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossNormal");

        obj.transform.position = BigBulletPos.transform.position;
        obj.transform.rotation = BigBulletPos.transform.rotation;

        BossMissile bullet = obj.gameObject.GetComponent <BossMissile>();

        bullet.Shoot(BigBulletPos.transform.up);

        GameManager.Inst().SodManager.PlayEffect("Bs_Normal");
    }
Beispiel #2
0
    IEnumerator stagAiCoroutine()
    {
        int prevRandom = 1;

        while (Health > 0)
        {
            int randomInt = Mathf.RoundToInt(Random.Range(1.0f, 4.0f));
            //4 is current range 1 -4, use this modulus to avoid repeats
            //Make sure to assign prevRandom after this check lol
            if (randomInt == prevRandom)
            {
                randomInt = (randomInt + prevRandom) % 4;
            }

            //Start the movement
            executingMovementCoroutine = movementCoroutine(potentialPoints [randomInt]);
            StartCoroutine(executingMovementCoroutine);



            yield return(new WaitForSeconds(2f));

            //Stop the movement
            StopCoroutine(executingMovementCoroutine);

            //Attack
            BossMissile missileInstance1 = Instantiate(missileToSpawn, transform.position, Quaternion.identity) as BossMissile;
            missileInstance1.SetMissileDirection(new Vector3(1f, 1f, 0f));

            BossMissile missileInstance2 = Instantiate(missileToSpawn, transform.position, Quaternion.identity) as BossMissile;
            missileInstance2.SetMissileDirection(new Vector3(1f, -1f, 0f));

            BossMissile missileInstance3 = Instantiate(missileToSpawn, transform.position, Quaternion.identity) as BossMissile;
            missileInstance3.SetMissileDirection(new Vector3(-1f, 1f, 0f));

            BossMissile missileInstance4 = Instantiate(missileToSpawn, transform.position, Quaternion.identity) as BossMissile;
            missileInstance4.SetMissileDirection(new Vector3(-1f, -1f, 0f));

            prevRandom = randomInt;
        }

        Destroy(gameObject);
    }
Beispiel #3
0
    IEnumerator MissileShot()
    {
        yield return(new WaitForSeconds(0.2f));

        GameObject  instantMissileA = Instantiate(missile, missilePortA.position, missilePortA.rotation);
        BossMissile bossMissile     = instantMissileA.GetComponent <BossMissile>();

        bossMissile.Target = target;

        yield return(new WaitForSeconds(0.3f));

        GameObject  instantMissileB = Instantiate(missile, missilePortB.position, missilePortB.rotation);
        BossMissile bossMissileB    = instantMissileB.GetComponent <BossMissile>();

        bossMissileB.Target = target;

        yield return(new WaitForSeconds(5f));

        StartCoroutine(RandomAttacks());
    }
Beispiel #4
0
    IEnumerator MissileShot()
    {
        animator.SetTrigger("doShot");
        yield return(new WaitForSeconds(0.2f));

        GameObject  instantMissileA = Instantiate(this.bossMissile, missilePortA.position, missilePortA.rotation);
        BossMissile bossmissileA    = instantMissileA.GetComponent <BossMissile>();

        bossmissileA.target = target;

        yield return(new WaitForSeconds(0.3f));

        GameObject  instantMissileB = Instantiate(this.bossMissile, missilePortB.position, missilePortB.rotation);
        BossMissile bossmissileB    = instantMissileB.GetComponent <BossMissile>();

        bossmissileB.target = target;

        yield return(new WaitForSeconds(2f));

        StartCoroutine(Pattern());
    }
    void Awake()
    {
        Col    = gameObject.GetComponent <CircleCollider2D>();
        Parent = gameObject.transform.parent.gameObject;

        if (PType == ParentType.PLAYER)
        {
            if (Parent.GetComponent <Missile>())
            {
                MS = Parent.GetComponent <Missile>();
            }
            else
            {
                CH = Parent.GetComponent <Chain>();
            }
        }
        else
        {
            if (Parent.GetComponent <BossMissile>())
            {
                BM = Parent.GetComponent <BossMissile>();
            }
        }
    }