Esempio n. 1
0
    void makeCircle(int number, EnemyShot type, float offset, float vel, float accel, float minv, float maxv, int tickrate, bool decelYN, int moveFx, float incr)
    {
        float betAng = 360 / number;

        //Creates number of bullets
        for (int i = 0; i < number + 1; i++)
        {
            EnemyShot circBullet = Instantiate(type, transform.position, Quaternion.identity) as EnemyShot;
            circBullet.mvtFxn       = moveFx;
            circBullet.velocity     = vel;
            circBullet.acceleration = accel;
            circBullet.minvelocity  = minv;
            circBullet.maxvelocity  = maxv;
            circBullet.ticks        = tickrate;
            circBullet.direction    = GlobalFxns.ToVect(betAng * i + offset);
            circBullet.increment    = incr;
            if (decelYN)
            {
                circBullet.decelerating = true;
            }
            else
            {
                circBullet.decelerating = false;
            }
        }
    }
Esempio n. 2
0
 void Spell1()
 {
     if (timer > 100 && !chrgAnim)
     {
         anim.Play("Mokou");
         playSnd(3);
         chrgAnim = !chrgAnim;
     }
     if (timer > 120)
     {
         float     tempX = Controller.Instance.player.transform.position.x;
         float     tempY = Controller.Instance.player.transform.position.y;
         Vector3   rota  = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
         float     angle = GlobalFxns.ToAng(rota);
         EnemyShot ph    = Instantiate(phoenix, transform.position, Quaternion.identity) as EnemyShot;
         ph.mvtFxn                = 2;
         ph.velocity              = .05f;
         ph.minvelocity           = .05f;
         ph.maxvelocity           = .05f;
         ph.ticks                 = 20;
         ph.playerX               = tempX;
         ph.playerY               = tempY;
         ph.transform.eulerAngles = new Vector3(0, 0, angle + 90);
         Vector3 dir = rota;
         ph.direction = dir.normalized;
         timer        = 0;
         makeCircle(10, offset, .05f, 0, .05f, .05f, 20, false, 1);
         offset += 5;
         playSnd(1);
         chrgAnim = !chrgAnim;
     }
 }
Esempio n. 3
0
 //Nonspell 1
 void Nonspell1()
 {
     if (currentStg == 1)
     {
         if (timer == 5)
         {
             playSnd(1);
         }
         if (timer == 10)
         {
             playSnd(1);
         }
         if (timer > 15)
         {
             playSnd(1);
             EnemyShot a = (Instantiate(bulletA, transform.position, Quaternion.Euler(GlobalFxns.ToVect(0 + rotation))) as EnemyShot);
             EnemyShot b = (Instantiate(bulletA, transform.position, Quaternion.Euler(GlobalFxns.ToVect(120 + rotation))) as EnemyShot);
             EnemyShot c = (Instantiate(bulletA, transform.position, Quaternion.Euler(GlobalFxns.ToVect(240 + rotation))) as EnemyShot);
             a.direction             = (GlobalFxns.ToVect(0 + rotation));
             b.direction             = (GlobalFxns.ToVect(120 + rotation));
             c.direction             = (GlobalFxns.ToVect(240 + rotation));
             a.transform.eulerAngles = new Vector3(0, 0, GlobalFxns.ToAng(a.direction) + 90);
             b.transform.eulerAngles = new Vector3(0, 0, GlobalFxns.ToAng(b.direction) + 90);
             c.transform.eulerAngles = new Vector3(0, 0, GlobalFxns.ToAng(c.direction) + 90);
             a.setParameters(1, .05f, 0, .05f, .05f, 1, false);
             b.setParameters(1, .05f, 0, .05f, .05f, 1, false);
             c.setParameters(1, .05f, 0, .05f, .05f, 1, false);
             rotation += 10;
             timer     = 0;
         }
     }
 }
Esempio n. 4
0
    new void makeCircle(int number, float offset, float vel, float accel, float minv, float maxv, int tickrate, bool decelYN, int sndVer)
    {
        float betAng = 360 / number;

        //Creates number of bullets
        for (int i = 0; i < number + 1; i++)
        {
            EnemyShot circBullet = Instantiate(bulletA, transform.position, Quaternion.identity) as EnemyShot;
            circBullet.mvtFxn                = 2;
            circBullet.velocity              = vel;
            circBullet.acceleration          = accel;
            circBullet.minvelocity           = minv;
            circBullet.maxvelocity           = maxv;
            circBullet.ticks                 = tickrate;
            circBullet.direction             = GlobalFxns.ToVect(betAng * i + offset);
            circBullet.transform.eulerAngles = new Vector3(0, 0, betAng * i + offset + 90);
            if (decelYN)
            {
                circBullet.decelerating = true;
            }
            else
            {
                circBullet.decelerating = false;
            }
        }
    }
Esempio n. 5
0
 void Spell1()
 {
     if (timer == 30)
     {
         makeCircle(24, coinA, offset, .075f, 0, .075f, .075f, 1, false);
         makeCircle(24, coinB, offset2, .075f, 0, .075f, .075f, 1, false);
         offset  += 12;
         offset2 -= 12;
         timer    = 0;
         timer2++;
         playSnd(1);
     }
     if (timer2 == 2)
     {
         float     tempX    = Controller.Instance.player.transform.position.x;
         float     tempY    = Controller.Instance.player.transform.position.y;
         Vector3   rota     = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
         float     angle    = GlobalFxns.ToAng(rota);
         EnemyShot targeted = Instantiate(spirit, transform.position, Quaternion.identity);
         targeted.setParameters(1, .05f, 0, .05f, .05f, 1, false);
         targeted.transform.eulerAngles = new Vector3(0, 0, angle + 90);
         Vector3 dir = rota;
         targeted.direction = dir.normalized;
         timer2             = 0;
     }
 }
Esempio n. 6
0
 void AimShot()
 {
     if (shotTimer > shotDelay)
     {
         float     deviation = Random.Range(-variance, variance);
         float     tempX     = Controller.Instance.player.transform.position.x;
         float     tempY     = Controller.Instance.player.transform.position.y;
         Vector3   rota      = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
         EnemyShot aimed     = Instantiate(bullet, transform.position, Quaternion.identity);
         bullet.mvtFxn = 2;
         shotTimer     = 0;
         aimed.playerX = tempX;
         aimed.playerY = tempY;
         Vector3 dir = rota;
         if (indirect)
         {
             float ang = GlobalFxns.ToAng(dir.normalized);
             aimed.direction = GlobalFxns.ToVect(ang + deviation);
         }
         else
         {
             aimed.direction = dir.normalized;
         }
         playSnd(1);
     }
 }
Esempio n. 7
0
    void randomMove()
    {
        int random  = Random.Range(0, 50);
        int random2 = Random.Range(-90, 90);
        int random3 = Random.Range(0, 2);

        if (!moving && timer2 > 120 && random > 40)
        {
            if (random3 == 0)
            {
                if (transform.position.x < 0 && transform.position.y > 12 && transform.position.y < 20)
                {
                    velocity      = .01f;
                    movedirection = GlobalFxns.ToVect(random2);
                    moving        = true;
                    timer2        = 0;
                }
            }
            else
            {
                if (transform.position.x > -12 && transform.position.y > 12 && transform.position.y < 20)
                {
                    velocity      = -.01f;
                    movedirection = GlobalFxns.ToVect(random2);
                    moving        = true;
                    timer2        = 0;
                }
            }
        }
        else
        {
            if (timer3 < 120)
            {
                if (transform.position.x > -12 && transform.position.x < 0 && transform.position.y > 15 && transform.position.y < 18)
                {
                    transform.position += movedirection * velocity;
                }
                else
                {
                    if ((movedirection.x > 0 && transform.position.x > 0) || (movedirection.x < 0 && transform.position.x < -12))
                    {
                        movedirection.x    *= -1;
                        transform.position += movedirection * velocity;
                    }
                    if ((movedirection.y > 0 && transform.position.y > 18) || (movedirection.y < 0 && transform.position.y < 15))
                    {
                        movedirection.y    *= -1;
                        transform.position += movedirection * velocity;
                    }
                }
            }
            else if (timer3 > 180)
            {
                moving = !moving;
                timer3 = 0;
            }
            timer3++;
        }
    }
Esempio n. 8
0
 void Nonspell2()
 {
     if (timer == 60)
     {
         if (timer2 == 0)
         {
             float shotSpd = .05f;
             for (int i = 0; i < 54; i++)
             {
                 EnemyShot coin = Instantiate(coinA, transform.position, Quaternion.identity);
                 coin.direction = GlobalFxns.ToVect(0 + rotation + offset);
                 coin.setParameters(1, shotSpd, 0, shotSpd, shotSpd, 1, false);
                 rotation -= 10;
                 shotSpd  += .003f;
             }
             rotation = 0;
             timer2   = 1;
             timer3++;
         }
         else if (timer2 == 1)
         {
             float shotSpd = .05f;
             for (int i = 0; i < 54; i++)
             {
                 EnemyShot coin = Instantiate(coinB, transform.position, Quaternion.identity);
                 coin.direction = GlobalFxns.ToVect(180 + rotation + offset);
                 coin.setParameters(1, shotSpd, 0, shotSpd, shotSpd, 1, false);
                 rotation += 10;
                 shotSpd  += .003f;
             }
             rotation = 0;
             timer2   = 0;
             timer3++;
         }
         playSnd(2);
     }
     if (timer > 90)
     {
         if (timer3 > 3)
         {
             float streamSpd = .05f;
             float tempX     = Controller.Instance.player.transform.position.x;
             float tempY     = Controller.Instance.player.transform.position.y;
             for (int i = 0; i < 3; i++)
             {
                 Vector3 rota  = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
                 float   angle = GlobalFxns.ToAng(rota);
                 makeCircle(20, coinA, angle, streamSpd, 0, streamSpd, streamSpd, 1, false);
                 streamSpd += .005f;
                 playSnd(1);
             }
             timer3 = 0;
         }
         timer = 0;
     }
 }
Esempio n. 9
0
 void curveMove(float angleInc)
 {
     if (moveTimer > 0)
     {
         float currentAng = GlobalFxns.ToAng(direction);
         linearMove(direction, velocity, acceleration, minvelocity, maxvelocity, ticks);
         direction = GlobalFxns.ToVect(currentAng + angleInc);
     }
     else
     {
         mvtFxn = 1;
     }
 }
Esempio n. 10
0
 void Spell2()
 {
     if (timer > 100 && !chrgAnim)
     {
         anim.Play("Mokou");
         chrgAnim = !chrgAnim;
         playSnd(3);
     }
     if (timer > 120)
     {
         for (int i = 0; i < 5 + 1; i++)
         {
             float     tempX  = Controller.Instance.player.transform.position.x;
             float     tempY  = Controller.Instance.player.transform.position.y;
             Vector3   start  = new Vector3(-4 + .8f * i, 16.5f + .4f * i, 0);
             EnemyShot stream = Instantiate(bulletA, start, Quaternion.identity) as EnemyShot;
             Vector3   rota   = (new Vector3(tempX - stream.transform.position.x, tempY - stream.transform.position.y, 0));
             float     angle  = GlobalFxns.ToAng(rota);
             Vector3   dir    = rota;
             stream.direction             = dir.normalized;
             stream.transform.eulerAngles = new Vector3(0, 0, angle + 90);
             stream.setParameters(1, .05f, 0, .05f, .05f, 1, false);
         }
         for (int i = 0; i < 4 + 1; i++)
         {
             float     tempX  = Controller.Instance.player.transform.position.x;
             float     tempY  = Controller.Instance.player.transform.position.y;
             Vector3   start  = new Vector3(-4.5f - .8f * i, 16.9f + .4f * i, 0);
             EnemyShot stream = Instantiate(bulletA, start, Quaternion.identity) as EnemyShot;
             Vector3   rota   = (new Vector3(tempX - stream.transform.position.x, tempY - stream.transform.position.y, 0));
             float     angle  = GlobalFxns.ToAng(rota);
             Vector3   dir    = rota;
             stream.direction             = dir.normalized;
             stream.transform.eulerAngles = new Vector3(0, 0, angle + 90);
             stream.setParameters(1, .05f, 0, .05f, .05f, 1, false);
         }
         timer    = 0;
         chrgAnim = !chrgAnim;
         playSnd(5);
     }
     if (timer2 > 15)
     {
         float     random   = Random.Range(-11f, 3f);
         Vector3   startLoc = new Vector3(random, 19, 0);
         EnemyShot rain     = Instantiate(bulletB, startLoc, Quaternion.identity);
         rain.setParameters(1, .2f, -.0001f, .01f, 0, 1, false);
         rain.direction = new Vector3(0, -.1f, 0);
         timer2         = 0;
         playSnd(4);
     }
 }
Esempio n. 11
0
    IEnumerator Attack()
    {
        Vector3 dir = (Player.p.transform.position - transform.position).normalized;
        float   ang = GlobalFxns.ToAng(dir);

        Orientation(ang);
        attacking = true;
        //Play the atk animation
        anim.SetBool("attacking", true);
        HitScan();
        atkcd = 120;
        yield return(new WaitForSeconds(atkdelay));

        attacking = false;
        anim.SetBool("attacking", false);
    }
Esempio n. 12
0
    void suicideFire()
    {
        float   tempX = Controller.Instance.player.transform.position.x;
        float   tempY = Controller.Instance.player.transform.position.y;
        Vector3 rota  = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
        float   angle = GlobalFxns.ToAng(rota);
        float   spdUp = .05f;

        for (int i = 0; i < 5; i++)
        {
            makeCircle(5, angle, spdUp, 0, spdUp, spdUp, 1, false, 0);
            spdUp += .03f;
            shotTimer++;
        }
        playSnd(1);
    }
Esempio n. 13
0
    public void pursue()
    {
        Vector3 pursuitRadius = new Vector2(PlayerControls.pc.transform.position.x - transform.position.x, PlayerControls.pc.transform.position.y - transform.position.y);

        if (pursuitRadius.magnitude < aggroDist)
        {
            pursuitRadius       = pursuitRadius.normalized;
            transform.position += pursuitRadius * mvtSpd * Time.deltaTime;
            float ang = GlobalFxns.ToAng(pursuitRadius);
            Orientation(ang);
            anim.SetBool("moving", true);
        }
        else
        {
            anim.SetBool("moving", false);
        }
    }
Esempio n. 14
0
 void Move()
 {
     if ((transform.position - Player.p.transform.position).magnitude > atkRad)
     {
         if (!attacking)
         {
             anim.SetBool("moving", true);
             Vector3 dir = (Player.p.transform.position - transform.position).normalized;
             float   ang = GlobalFxns.ToAng(dir);
             Orientation(ang);
             transform.position += dir * mvspd;
             //Debug.Log(dir);
         }
         else
         {
             anim.SetBool("moving", false);
         }
     }
 }
Esempio n. 15
0
 void AimShotgun()
 {
     if (shotTimer > shotDelay)
     {
         float     tempX  = Controller.Instance.player.transform.position.x;
         float     tempY  = Controller.Instance.player.transform.position.y;
         Vector3   rota   = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
         float     angle  = GlobalFxns.ToAng(rota);
         EnemyShot aimed1 = Instantiate(bulletGroupA, transform.position, Quaternion.identity);
         aimed1.mvtFxn  = 2;
         shotTimer      = 0;
         aimed1.playerX = tempX;
         aimed1.playerY = tempY;
         Vector3 dir = rota;
         aimed1.direction             = dir.normalized;
         aimed1.transform.eulerAngles = new Vector3(0, 0, angle + 90);
         playSnd(1);
     }
 }
Esempio n. 16
0
    void midboss2()
    {
        float tempVel = velocity;

        if (shotTimer > 30)
        {
            for (int i = 0; i < 7; i++)
            {
                EnemyShot thing = Instantiate(bullet, transform.position, Quaternion.identity);
                thing.setParameters(1, tempVel, 0, tempVel, tempVel, 1, false);
                EnemyShot thing2 = Instantiate(bullet, transform.position, Quaternion.identity);
                thing2.setParameters(1, tempVel, 0, tempVel, tempVel, 1, false);
                thing.direction  = GlobalFxns.ToVect(-90 + offsetVal);
                thing2.direction = GlobalFxns.ToVect(-90 + -offsetVal);
                tempVel         += .025f;
            }
            offsetVal += offsetInc;
            shotTimer  = 0;
            timerA++;
            playSnd(1);
        }
        if (timerA > 2)
        {
            float   tempX    = Controller.Instance.player.transform.position.x;
            float   tempY    = Controller.Instance.player.transform.position.y;
            Vector3 rota     = (new Vector3(tempX - this.transform.position.x, tempY - this.transform.position.y, 0));
            float   angle    = GlobalFxns.ToAng(rota);
            float   tempVel2 = .05f;
            for (int i = 0; i < 3; i++)
            {
                EnemyShot aimed = Instantiate(bullet, transform.position, Quaternion.identity);
                aimed.playerX = tempX;
                aimed.playerY = tempY;
                Vector3 dir = rota;
                aimed.direction = dir.normalized;
                aimed.setParameters(2, tempVel2, 0, tempVel2, tempVel2, 1, false);
                tempVel2 += .025f;
            }
            timerA = 0;
            playSnd(1);
        }
    }
Esempio n. 17
0
 void Spell3()
 {
     if (timer > 1)
     {
         float     topSpawn = Random.Range(-12, 3.5f);
         float     randVel  = Random.Range(.075f, .1f);
         float     randDir  = Random.Range(-115f, -65f);
         EnemyShot topShot  = Instantiate(rain, new Vector3(topSpawn, 20, 0), Quaternion.identity);
         topShot.transform.localScale *= .75f;
         topShot.setParameters(1, randVel, 0, randVel, randVel, 1, false);
         topShot.direction             = GlobalFxns.ToVect(randDir);
         topShot.transform.eulerAngles = new Vector3(0, 0, randDir + 90);
         timer2--;
         timer = 0;
     }
     if (timer2 < 0)
     {
         //lr true: move left. Else, right.
         if (lr)
         {
             Familiar umbrella = Instantiate(fam, new Vector3(5.75f, 10.5f, 0), Quaternion.identity);
             umbrella.leftright = false;
         }
         else
         {
             Familiar umbrella = Instantiate(fam, new Vector3(-14, 10.5f, 0), Quaternion.identity);
             umbrella.leftright = true;
         }
         lr     = !lr;
         timer2 = 60;
     }
     if (timer3 > 20)
     {
         playSnd(4);
         timer3 = 0;
     }
     timer3++;
 }
Esempio n. 18
0
 void Spell1()
 {
     if (timer > 1)
     {
         EnemyShot pew = Instantiate(shotA, transform.position, Quaternion.identity);
         pew.direction = GlobalFxns.ToVect(offset - 90);
         pew.setParameters(1, .075f, 0, .075f, .075f, 1, false);
         pew.transform.eulerAngles = new Vector3(0, 0, offset - 90);
         EnemyShot pewpew = Instantiate(shotB, transform.position, Quaternion.identity);
         pewpew.direction = GlobalFxns.ToVect(offset2 - 90);
         pewpew.setParameters(1, .05f, 0, .05f, .05f, 1, false);
         pewpew.transform.eulerAngles = new Vector3(0, 0, offset2 - 90);
         offset  += 22;
         offset2 -= 7;
         timer    = 0;
     }
     if (timer2 == 5)
     {
         playSnd(3);
         timer2 = 0;
     }
     timer2++;
 }
Esempio n. 19
0
 void unifiedMvt()
 {
     dirAsFloat = GlobalFxns.ToAng(direction);
     if (dirAsFloat > Controller.Instance.globalAng)
     {
         increment = tempInc;
         direction = GlobalFxns.ToVect(dirAsFloat - increment);
         linearMove(direction, velocity, acceleration, minvelocity, maxvelocity, ticks);
         transform.eulerAngles += new Vector3(0, 0, increment);
     }
     else if (dirAsFloat < Controller.Instance.globalAng)
     {
         increment = tempInc;
         direction = GlobalFxns.ToVect(dirAsFloat + increment);
         linearMove(direction, velocity, acceleration, minvelocity, maxvelocity, ticks);
         transform.eulerAngles += new Vector3(0, 0, -increment);
     }
     else
     {
         increment = 0;
         linearMove(direction, velocity, acceleration, minvelocity, maxvelocity, ticks);
     }
 }
Esempio n. 20
0
    void specialCirc()
    {
        if (shotTimer > shotDelay)
        {
            if (timerA < (180 / offsetInc))
            {
                EnemyShot circBullet1 = Instantiate(bullet2, transform.position, Quaternion.identity) as EnemyShot;
                circBullet1.mvtFxn                = 6;
                circBullet1.velocity              = shotVel;
                circBullet1.acceleration          = shotAccel;
                circBullet1.minvelocity           = shotMinV;
                circBullet1.maxvelocity           = shotMaxV;
                circBullet1.ticks                 = shotTicks;
                circBullet1.direction             = GlobalFxns.ToVect(0 + offsetVal);
                circBullet1.transform.eulerAngles = new Vector3(0, 0, offsetVal - 90);
                circBullet1.transform.localScale += new Vector3(0, 20, 0);
                circBullet1.delay                 = 60;

                EnemyShot circBullet2 = Instantiate(bullet2, transform.position, Quaternion.identity) as EnemyShot;
                circBullet2.mvtFxn                = 6;
                circBullet2.velocity              = shotVel;
                circBullet2.acceleration          = shotAccel;
                circBullet2.minvelocity           = shotMinV;
                circBullet2.maxvelocity           = shotMaxV;
                circBullet2.ticks                 = shotTicks;
                circBullet2.direction             = GlobalFxns.ToVect(180 + offsetVal);
                circBullet2.transform.eulerAngles = new Vector3(0, 0, offsetVal + 90);
                circBullet2.transform.localScale += new Vector3(0, 20, 0);
                circBullet2.delay                 = 60;

                shotTimer = 0;
                timerA++;
                playSnd(1);
            }
        }
    }
Esempio n. 21
0
 void curveMove(float inc)
 {
     dirAsFloat = GlobalFxns.ToAng(direction);
     linearMove(direction, velocity, acceleration, minvelocity, maxvelocity, ticks);
     direction = GlobalFxns.ToVect(dirAsFloat + inc);
 }
Esempio n. 22
0
    IEnumerator stage1()
    {
        yield return(new WaitForSeconds(3));

        //Initial Wave: 7 fairies, slight V formation.
        Enemy mob1 = Instantiate(a, new Vector3(-4, 21, 0), Quaternion.identity);

        mob1.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob1.direction = new Vector3(0, -1, 0);
        mob1.itemDrop  = 2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob2 = Instantiate(a, new Vector3(-2, 21, 0), Quaternion.identity);
        Enemy mob3 = Instantiate(a, new Vector3(-6, 21, 0), Quaternion.identity);

        mob2.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob3.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob2.direction = new Vector3(0, -1, 0);
        mob3.direction = new Vector3(0, -1, 0);
        mob2.itemDrop  = 1;
        mob3.itemDrop  = 1;

        yield return(new WaitForSeconds(.75f));

        Enemy mob4 = Instantiate(a, new Vector3(0, 21, 0), Quaternion.identity);
        Enemy mob5 = Instantiate(a, new Vector3(-8, 21, 0), Quaternion.identity);

        mob4.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob5.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob4.direction = new Vector3(0, -1, 0);
        mob5.direction = new Vector3(0, -1, 0);
        mob4.itemDrop  = 2;
        mob5.itemDrop  = 2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob6 = Instantiate(a, new Vector3(2, 21, 0), Quaternion.identity);
        Enemy mob7 = Instantiate(a, new Vector3(-10, 21, 0), Quaternion.identity);

        mob6.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob7.setParameters(1, .02f, 0, .02f, .02f, 1, false, 5);
        mob6.direction = new Vector3(0, -1, 0);
        mob7.direction = new Vector3(0, -1, 0);
        mob6.itemDrop  = 1;
        mob7.itemDrop  = 1;

        yield return(new WaitForSeconds(8));

        //Wave 2: 7 fairies from top right. Move down, then curve to left.

        Enemy mob8 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob8.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob8.direction = new Vector3(0, -1, 0);
        mob8.itemDrop  = 2;
        mob8.shotType  = 1;
        mob8.shotDelay = 90;
        mob8.shotTimer = -30;
        mob8.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob9 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob9.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob9.direction = new Vector3(0, -1, 0);
        mob8.itemDrop  = 1;
        mob9.shotType  = 1;
        mob9.shotDelay = 90;
        mob9.shotTimer = -30;
        mob9.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob10 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob10.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob10.direction = new Vector3(0, -1, 0);
        mob10.itemDrop  = 2;
        mob10.shotType  = 1;
        mob10.shotDelay = 90;
        mob10.shotTimer = -30;
        mob10.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob11 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob11.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob11.direction = new Vector3(0, -1, 0);
        mob11.itemDrop  = 1;
        mob11.shotType  = 1;
        mob11.shotDelay = 90;
        mob11.shotTimer = -30;
        mob11.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob12 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob12.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob12.direction = new Vector3(0, -1, 0);
        mob12.itemDrop  = 2;
        mob12.shotType  = 1;
        mob12.shotDelay = 90;
        mob12.shotTimer = -30;
        mob12.bullet    = c;

        mob8.mvtFxn     = 2;
        mob8.deltaAngle = -3;
        mob8.moveTimer  = 30;

        Enemy altMob1 = Instantiate(a, new Vector3(-8, 22, 0), Quaternion.identity);

        altMob1.setParameters(1, .045f, 0, .045f, .045f, 1, false, 30);
        altMob1.direction = new Vector3(0, -1, 0);
        altMob1.noForCirc = 12;
        altMob1.shotVel   = .05f;
        altMob1.itemDrop  = 2;
        altMob1.shotType  = 3;
        altMob1.shotDelay = 60;
        altMob1.shotTimer = -30;
        altMob1.offsetInc = 5;
        altMob1.bullet    = c2;
        GameObject sigil1 = Instantiate(Controller.Instance.sigil, altMob1.transform.position, Quaternion.identity, altMob1.transform);

        sigil1.transform.localScale *= .5f;

        yield return(new WaitForSeconds(.75f));

        Enemy mob13 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob13.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob13.direction = new Vector3(0, -1, 0);
        mob13.itemDrop  = 1;
        mob13.shotType  = 1;
        mob13.shotDelay = 90;
        mob13.shotTimer = -30;
        mob13.bullet    = c;

        mob9.mvtFxn     = 2;
        mob9.deltaAngle = -3;
        mob9.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        Enemy mob14 = Instantiate(a, new Vector3(1, 21, 0), Quaternion.identity);

        mob14.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob14.direction = new Vector3(0, -1, 0);
        mob14.itemDrop  = 2;
        mob14.shotType  = 1;
        mob14.shotDelay = 90;
        mob14.shotTimer = -30;
        mob14.bullet    = c;

        mob10.mvtFxn     = 2;
        mob10.deltaAngle = -3;
        mob10.moveTimer  = 30;

        altMob1.velocity = 0;

        yield return(new WaitForSeconds(.75f));

        mob11.mvtFxn     = 2;
        mob11.deltaAngle = -3;
        mob11.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        mob12.mvtFxn     = 2;
        mob12.deltaAngle = -3;
        mob12.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        mob13.mvtFxn     = 2;
        mob13.deltaAngle = -3;
        mob13.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        mob14.mvtFxn     = 2;
        mob14.deltaAngle = -3;
        mob14.moveTimer  = 30;

        yield return(new WaitForSeconds(2));


        //Wave 3: Mirror of wave 2
        Enemy mob15 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob15.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob15.direction = new Vector3(0, -1, 0);
        mob15.itemDrop  = 1;
        mob15.shotType  = 1;
        mob15.shotDelay = 90;
        mob15.shotTimer = -30;
        mob15.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob16 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob16.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob16.direction = new Vector3(0, -1, 0);
        mob16.itemDrop  = 2;
        mob16.shotType  = 1;
        mob16.shotDelay = 90;
        mob16.shotTimer = -30;
        mob16.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob17 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob17.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob17.direction = new Vector3(0, -1, 0);
        mob17.itemDrop  = 1;
        mob17.shotType  = 1;
        mob17.shotDelay = 90;
        mob17.shotTimer = -30;
        mob17.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob18 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob18.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob18.direction = new Vector3(0, -1, 0);
        mob18.itemDrop  = 2;
        mob18.shotType  = 1;
        mob18.shotDelay = 90;
        mob18.shotTimer = -30;
        mob18.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob19 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob19.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob19.direction = new Vector3(0, -1, 0);
        mob19.itemDrop  = 1;
        mob19.shotType  = 1;
        mob19.shotDelay = 90;
        mob19.shotTimer = -30;
        mob19.bullet    = c;

        mob15.mvtFxn     = 2;
        mob15.deltaAngle = 3;
        mob15.moveTimer  = 30;

        Enemy altMob2 = Instantiate(a, new Vector3(0, 22, 0), Quaternion.identity);

        altMob2.setParameters(1, .045f, 0, .045f, .045f, 1, false, 30);
        altMob2.direction = new Vector3(0, -1, 0);
        altMob2.noForCirc = 12;
        altMob2.shotVel   = .05f;
        altMob2.itemDrop  = 2;
        altMob2.shotType  = 3;
        altMob2.shotDelay = 60;
        altMob2.shotTimer = -30;
        altMob2.offsetInc = -5;
        altMob2.bullet    = c2;
        GameObject sigil2 = Instantiate(Controller.Instance.sigil, altMob2.transform.position, Quaternion.identity, altMob2.transform);

        sigil2.transform.localScale *= .5f;

        yield return(new WaitForSeconds(.75f));

        Enemy mob20 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob20.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob20.direction = new Vector3(0, -1, 0);
        mob20.itemDrop  = 2;
        mob20.shotType  = 1;
        mob20.shotDelay = 90;
        mob20.shotTimer = -30;
        mob20.bullet    = c;

        mob16.mvtFxn     = 2;
        mob16.deltaAngle = 3;
        mob16.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        Enemy mob21 = Instantiate(a, new Vector3(-9, 21, 0), Quaternion.identity);

        mob21.setParameters(1, .04f, 0, .04f, .04f, 1, false, 10);
        mob21.direction = new Vector3(0, -1, 0);
        mob21.itemDrop  = 1;
        mob21.shotType  = 1;
        mob21.shotDelay = 90;
        mob21.shotTimer = -30;
        mob21.bullet    = c;

        mob17.mvtFxn     = 2;
        mob17.deltaAngle = 3;
        mob17.moveTimer  = 30;

        altMob2.velocity = 0;

        yield return(new WaitForSeconds(.75f));

        mob18.mvtFxn     = 2;
        mob18.deltaAngle = 3;
        mob18.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        mob19.mvtFxn     = 2;
        mob19.deltaAngle = 3;
        mob19.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        mob20.mvtFxn     = 2;
        mob20.deltaAngle = 3;
        mob20.moveTimer  = 30;

        yield return(new WaitForSeconds(.75f));

        mob21.mvtFxn     = 2;
        mob21.deltaAngle = 3;
        mob21.moveTimer  = 30;

        yield return(new WaitForSeconds(2.5f));

        //Wave 4: Bigger fairy down center
        Enemy mob22 = Instantiate(a1, new Vector3(-4, 21, 0), Quaternion.identity);

        mob22.setParameters(1, .025f, 0, .025f, .025f, 1, false, 200);
        mob22.direction = new Vector3(0, -1, 0);
        mob22.itemDrop  = 2;
        mob22.shotType  = 2;
        mob22.shotDelay = 90;
        mob22.shotTimer = -180;
        mob22.bullet    = c4;

        yield return(new WaitForSeconds(2f));


        //Wave 5: Two big fairies, one on each side. Once they stop, scatter around self (reference MoF deathfairies)

        Enemy altMob3 = Instantiate(a1, new Vector3(-8, 22, 0), Quaternion.identity);

        altMob3.setParameters(1, .045f, 0, .045f, .045f, 1, false, 100);
        altMob3.direction = new Vector3(0, -1, 0);
        altMob3.noForCirc = 12;
        altMob3.shotVel   = .05f;
        altMob3.itemDrop  = 2;
        altMob3.shotType  = 3;
        altMob3.shotDelay = 120;
        altMob3.shotTimer = -30;
        altMob3.offsetInc = 5;
        altMob3.bullet    = c3;
        GameObject sigil3 = Instantiate(Controller.Instance.sigil, altMob3.transform.position, Quaternion.identity, altMob3.transform);

        Enemy altMob4 = Instantiate(a1, new Vector3(0, 22, 0), Quaternion.identity);

        altMob4.setParameters(1, .045f, 0, .045f, .045f, 1, false, 100);
        altMob4.direction = new Vector3(0, -1, 0);
        altMob4.noForCirc = 12;
        altMob4.shotVel   = .05f;
        altMob4.itemDrop  = 2;
        altMob4.shotType  = 3;
        altMob4.shotDelay = 120;
        altMob4.shotTimer = -30;
        altMob4.offsetInc = -5;
        altMob4.bullet    = c3;

        yield return(new WaitForSeconds(1f));

        mob22.velocity = 0;

        yield return(new WaitForSeconds(.5f));

        altMob3.velocity = 0;
        altMob4.velocity = 0;

        yield return(new WaitForSeconds(15));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(1));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(1));

        //Mini-midboss

        Enemy midboss1 = Instantiate(a1, new Vector3(-4, 21, 0), Quaternion.identity);

        midboss1.transform.localScale *= 1.5f;
        midboss1.setParameters(1, .03f, 0, .03f, .03f, 1, false, 500);
        midboss1.setShotParameters(4, .01f, 0, .01f, .01f, 1, false);
        midboss1.offsetInc = 5;
        midboss1.direction = new Vector3(0, -1, 0);
        midboss1.itemDrop  = 3;
        midboss1.shotDelay = 30;
        midboss1.shotTimer = -180;
        midboss1.bullet    = c4;

        yield return(new WaitForSeconds(2));

        midboss1.velocity     = 0;
        midboss1.ptInRotation = 1;

        yield return(new WaitForSeconds(25));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(2));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(2));

        //Waves 6-10: Waves enter from left/right of screen. Move diagonally, shoot at player location.
        //From right
        Enemy mob23 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob23.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob23.direction = GlobalFxns.ToVect(210);
        mob23.itemDrop  = 1;
        mob23.shotType  = 1;
        mob23.shotDelay = 90;
        mob23.shotTimer = -30;
        mob23.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob24 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob24.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob24.direction = GlobalFxns.ToVect(210);
        mob24.itemDrop  = 2;
        mob24.shotType  = 1;
        mob24.shotDelay = 90;
        mob24.shotTimer = -30;
        mob24.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob25 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob25.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob25.direction = GlobalFxns.ToVect(210);
        mob25.itemDrop  = 1;
        mob25.shotType  = 1;
        mob25.shotDelay = 90;
        mob25.shotTimer = -30;
        mob25.bullet    = c4;

        yield return(new WaitForSeconds(.75f));

        Enemy mob26 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob26.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob26.direction = GlobalFxns.ToVect(210);
        mob26.itemDrop  = 1;
        mob26.shotType  = 2;
        mob26.shotDelay = 90;
        mob26.shotTimer = -30;
        mob26.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob27 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob27.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob27.direction = GlobalFxns.ToVect(210);
        mob27.itemDrop  = 2;
        mob27.shotType  = 1;
        mob27.shotDelay = 90;
        mob27.shotTimer = -30;
        mob27.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        //From left

        Enemy mob28 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob28.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob28.direction = GlobalFxns.ToVect(-30);
        mob28.itemDrop  = 1;
        mob28.shotType  = 1;
        mob28.shotDelay = 90;
        mob28.shotTimer = -30;
        mob28.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob29 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob29.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob29.direction = GlobalFxns.ToVect(-30);
        mob29.itemDrop  = 2;
        mob29.shotType  = 1;
        mob29.shotDelay = 90;
        mob29.shotTimer = -30;
        mob29.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob30 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob30.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob30.direction = GlobalFxns.ToVect(-30);
        mob30.itemDrop  = 1;
        mob30.shotType  = 1;
        mob30.shotDelay = 90;
        mob30.shotTimer = -30;
        mob30.bullet    = c4;

        yield return(new WaitForSeconds(.75f));

        Enemy mob31 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob31.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob31.direction = GlobalFxns.ToVect(-30);
        mob31.itemDrop  = 1;
        mob31.shotType  = 2;
        mob31.shotDelay = 90;
        mob31.shotTimer = -30;
        mob31.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob32 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob32.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob32.direction = GlobalFxns.ToVect(-30);
        mob32.itemDrop  = 2;
        mob32.shotType  = 1;
        mob32.shotDelay = 90;
        mob32.shotTimer = -30;
        mob32.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        //Right again

        Enemy mob33 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob33.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob33.direction = GlobalFxns.ToVect(210);
        mob33.itemDrop  = 1;
        mob33.shotType  = 1;
        mob33.shotDelay = 90;
        mob33.shotTimer = -30;
        mob33.bullet    = c4;

        yield return(new WaitForSeconds(.75f));

        Enemy mob34 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob34.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob34.direction = GlobalFxns.ToVect(210);
        mob34.itemDrop  = 2;
        mob34.shotType  = 1;
        mob34.shotDelay = 90;
        mob34.shotTimer = -30;
        mob34.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob35 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob35.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob35.direction = GlobalFxns.ToVect(210);
        mob35.itemDrop  = 1;
        mob35.shotType  = 1;
        mob35.shotDelay = 90;
        mob35.shotTimer = -30;
        mob35.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob36 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob36.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob36.direction = GlobalFxns.ToVect(210);
        mob36.itemDrop  = 1;
        mob36.shotType  = 2;
        mob36.shotDelay = 90;
        mob36.shotTimer = -30;
        mob36.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob37 = Instantiate(a, new Vector3(3, 16, 0), Quaternion.identity);

        mob37.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob37.direction = GlobalFxns.ToVect(210);
        mob37.itemDrop  = 2;
        mob37.shotType  = 1;
        mob37.shotDelay = 90;
        mob37.shotTimer = -30;
        mob37.bullet    = c4;

        yield return(new WaitForSeconds(.5f));

        //Left again
        Enemy mob38 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob38.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob38.direction = GlobalFxns.ToVect(-30);
        mob38.itemDrop  = 1;
        mob38.shotType  = 1;
        mob38.shotDelay = 90;
        mob38.shotTimer = -30;
        mob38.bullet    = c4;

        yield return(new WaitForSeconds(.75f));

        Enemy mob39 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob39.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob39.direction = GlobalFxns.ToVect(-30);
        mob39.itemDrop  = 2;
        mob39.shotType  = 1;
        mob39.shotDelay = 90;
        mob39.shotTimer = -30;
        mob39.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob40 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob40.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob40.direction = GlobalFxns.ToVect(-30);
        mob40.itemDrop  = 1;
        mob40.shotType  = 1;
        mob40.shotDelay = 90;
        mob40.shotTimer = -30;
        mob40.bullet    = c;

        yield return(new WaitForSeconds(.75f));

        Enemy mob41 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob41.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob41.direction = GlobalFxns.ToVect(-30);
        mob41.itemDrop  = 1;
        mob41.shotType  = 2;
        mob41.shotDelay = 90;
        mob41.shotTimer = -30;
        mob41.bullet    = c2;

        yield return(new WaitForSeconds(.75f));

        Enemy mob42 = Instantiate(a, new Vector3(-12, 16, 0), Quaternion.identity);

        mob42.setParameters(1, .03f, 0, .03f, .03f, 1, false, 25);
        mob42.direction = GlobalFxns.ToVect(-30);
        mob42.itemDrop  = 2;
        mob42.shotType  = 1;
        mob42.shotDelay = 90;
        mob42.shotTimer = -30;
        mob42.bullet    = c4;

        yield return(new WaitForSeconds(.5f));

        //Final Wave: No shooting, just a bunch of low HP fairies.

        yield return(new WaitForSeconds(10));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(2));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(5));

        //Spawn Boss
        Boss1 boss = Instantiate(b, new Vector3(-4, 22, 0), Quaternion.identity);
    }
Esempio n. 23
0
    IEnumerator stage2()
    {
        yield return(new WaitForSeconds(3));

        //Wave 1: Suicide ghosts. 5 from each side of the screen, sine mvt.
        Enemy ghost1 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost1.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost1.shotType  = 6;
        ghost1.itemDrop  = 1;
        ghost1.amplitude = .25f;
        ghost1.lr        = false;
        ghost1.mvtScale  = .2f;
        ghost1.bullet    = c;

        Enemy ghost2 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost2.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost2.shotType  = 6;
        ghost2.itemDrop  = 1;
        ghost2.amplitude = .25f;
        ghost2.lr        = true;
        ghost2.mvtScale  = .2f;
        ghost2.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost3 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost3.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost3.shotType  = 6;
        ghost3.itemDrop  = 2;
        ghost3.amplitude = .25f;
        ghost3.lr        = false;
        ghost3.mvtScale  = .2f;
        ghost3.bullet    = c;

        Enemy ghost4 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost4.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost4.shotType  = 6;
        ghost4.itemDrop  = 2;
        ghost4.amplitude = .25f;
        ghost4.lr        = true;
        ghost4.mvtScale  = .2f;
        ghost4.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost5 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost5.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost5.shotType  = 6;
        ghost5.itemDrop  = 1;
        ghost5.amplitude = .25f;
        ghost5.lr        = false;
        ghost5.mvtScale  = .2f;
        ghost5.bullet    = c;

        Enemy ghost6 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost6.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost6.shotType  = 6;
        ghost6.itemDrop  = 1;
        ghost6.amplitude = .25f;
        ghost6.lr        = true;
        ghost6.mvtScale  = .2f;
        ghost6.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost7 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost7.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost7.shotType  = 6;
        ghost7.itemDrop  = 2;
        ghost7.amplitude = .25f;
        ghost7.lr        = false;
        ghost7.mvtScale  = .2f;
        ghost7.bullet    = c;

        Enemy ghost8 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost8.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost8.shotType  = 6;
        ghost8.itemDrop  = 2;
        ghost8.amplitude = .25f;
        ghost8.lr        = true;
        ghost8.mvtScale  = .2f;
        ghost8.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost9 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost9.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost9.shotType  = 6;
        ghost9.itemDrop  = 1;
        ghost9.amplitude = .25f;
        ghost9.lr        = false;
        ghost9.mvtScale  = .2f;
        ghost9.bullet    = c;

        Enemy ghost10 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost10.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost10.shotType  = 6;
        ghost10.itemDrop  = 1;
        ghost10.amplitude = .25f;
        ghost10.lr        = true;
        ghost10.mvtScale  = .2f;
        ghost10.bullet    = c;

        yield return(new WaitForSeconds(8));

        //Wave 2: Incoming fairies from both sides. Create circles as they move. 3 per side.

        Enemy fairy1 = Instantiate(a, new Vector3(4, 13.5f, 0), Quaternion.identity);

        fairy1.setParameters(1, .05f, 0, .05f, .05f, 1, false, 30);
        fairy1.direction = new Vector3(-1, 0, 0);
        fairy1.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy1.itemDrop  = 1;
        fairy1.noForCirc = 5;
        fairy1.shotTimer = -15;
        fairy1.shotDelay = 30;
        fairy1.offsetInc = 5;
        fairy1.bullet    = c2;

        Enemy fairy2 = Instantiate(a, new Vector3(-12, 13.5f, 0), Quaternion.identity);

        fairy2.setParameters(1, .05f, 0, .05f, .05f, 1, false, 30);
        fairy2.direction = new Vector3(1, 0, 0);
        fairy2.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy2.itemDrop  = 2;
        fairy2.noForCirc = 5;
        fairy2.shotTimer = -15;
        fairy2.shotDelay = 30;
        fairy2.offsetInc = -5;
        fairy2.bullet    = c2;

        yield return(new WaitForSeconds(1));

        Enemy fairy3 = Instantiate(a, new Vector3(4, 13.5f, 0), Quaternion.identity);

        fairy3.setParameters(1, .05f, 0, .05f, .05f, 1, false, 30);
        fairy3.direction = new Vector3(-1, 0, 0);
        fairy3.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy3.itemDrop  = 2;
        fairy3.noForCirc = 5;
        fairy3.shotTimer = -15;
        fairy3.shotDelay = 30;
        fairy3.offsetInc = 5;
        fairy3.bullet    = c4;

        Enemy fairy4 = Instantiate(a, new Vector3(-12, 13.5f, 0), Quaternion.identity);

        fairy4.setParameters(1, .05f, 0, .05f, .05f, 1, false, 30);
        fairy4.direction = new Vector3(1, 0, 0);
        fairy4.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy4.itemDrop  = 1;
        fairy4.noForCirc = 5;
        fairy4.shotTimer = -15;
        fairy4.shotDelay = 30;
        fairy4.offsetInc = -5;
        fairy4.bullet    = c4;

        yield return(new WaitForSeconds(1));

        Enemy fairy5 = Instantiate(a, new Vector3(4, 13.5f, 0), Quaternion.identity);

        fairy5.setParameters(1, .05f, 0, .05f, .05f, 1, false, 30);
        fairy5.direction = new Vector3(-1, 0, 0);
        fairy5.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy5.itemDrop  = 1;
        fairy5.noForCirc = 5;
        fairy5.shotTimer = -15;
        fairy5.shotDelay = 30;
        fairy5.offsetInc = 5;
        fairy5.bullet    = c2;

        Enemy fairy6 = Instantiate(a, new Vector3(-12, 13.5f, 0), Quaternion.identity);

        fairy6.setParameters(1, .05f, 0, .05f, .05f, 1, false, 30);
        fairy6.direction = new Vector3(1, 0, 0);
        fairy6.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy6.itemDrop  = 2;
        fairy6.noForCirc = 5;
        fairy6.shotTimer = -15;
        fairy6.shotDelay = 30;
        fairy6.offsetInc = -5;
        fairy6.bullet    = c2;

        //Wave 3: While wave 2 is moving, 2 rows from top come in and U-turn out. Aimed shots at player. 5 per row.

        Enemy fairy7 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy7.direction = new Vector3(0, -1, 0);
        fairy7.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy7.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy7.shotDelay = 60;
        fairy7.shotTimer = -15;
        fairy7.itemDrop  = 2;
        fairy7.bullet    = c1;

        Enemy fairy8 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy8.direction = new Vector3(0, -1, 0);
        fairy8.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy8.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy8.shotDelay = 60;
        fairy8.shotTimer = -15;
        fairy8.itemDrop  = 2;
        fairy8.bullet    = c1;

        yield return(new WaitForSeconds(.5f));

        Enemy fairy9 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy9.direction = new Vector3(0, -1, 0);
        fairy9.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy9.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy9.shotDelay = 60;
        fairy9.shotTimer = -15;
        fairy9.itemDrop  = 1;
        fairy9.bullet    = c3;

        Enemy fairy10 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy10.direction = new Vector3(0, -1, 0);
        fairy10.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy10.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy10.shotDelay = 60;
        fairy10.shotTimer = -15;
        fairy10.itemDrop  = 1;
        fairy10.bullet    = c3;

        yield return(new WaitForSeconds(.5f));

        Enemy fairy11 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy11.direction = new Vector3(0, -1, 0);
        fairy11.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy11.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy11.shotDelay = 60;
        fairy11.shotTimer = -15;
        fairy11.itemDrop  = 2;
        fairy11.bullet    = c1;

        Enemy fairy12 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy12.direction = new Vector3(0, -1, 0);
        fairy12.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy12.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy12.shotDelay = 60;
        fairy12.shotTimer = -15;
        fairy12.itemDrop  = 2;
        fairy12.bullet    = c1;

        yield return(new WaitForSeconds(.5f));

        fairy7.mvtFxn     = 2;
        fairy7.deltaAngle = -3;
        fairy7.moveTimer  = 60;
        fairy8.mvtFxn     = 2;
        fairy8.deltaAngle = 3;
        fairy8.moveTimer  = 60;

        Enemy fairy13 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy13.direction = new Vector3(0, -1, 0);
        fairy13.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy13.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy13.shotDelay = 60;
        fairy13.shotTimer = -15;
        fairy13.itemDrop  = 1;
        fairy13.bullet    = c3;

        Enemy fairy14 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy14.direction = new Vector3(0, -1, 0);
        fairy14.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy14.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy14.shotDelay = 60;
        fairy14.shotTimer = -15;
        fairy14.itemDrop  = 1;
        fairy14.bullet    = c3;

        yield return(new WaitForSeconds(.5f));

        fairy9.mvtFxn      = 2;
        fairy9.deltaAngle  = -3;
        fairy9.moveTimer   = 60;
        fairy10.mvtFxn     = 2;
        fairy10.deltaAngle = 3;
        fairy10.moveTimer  = 60;

        yield return(new WaitForSeconds(.5f));

        fairy11.mvtFxn     = 2;
        fairy11.deltaAngle = -3;
        fairy11.moveTimer  = 60;
        fairy12.mvtFxn     = 2;
        fairy12.deltaAngle = 3;
        fairy12.moveTimer  = 60;
        yield return(new WaitForSeconds(.5f));

        fairy13.mvtFxn     = 2;
        fairy13.deltaAngle = -3;
        fairy13.moveTimer  = 60;
        fairy14.mvtFxn     = 2;
        fairy14.deltaAngle = 3;
        fairy14.moveTimer  = 60;

        yield return(new WaitForSeconds(3));

        //Wave 4: Big fairy pops in from top left to center, create rotating circle pattern as it curves out at 120 degrees. Same from opposite direction.
        Enemy fairy15 = Instantiate(a2, new Vector3(-12, 17, 0), Quaternion.identity);

        fairy15.direction = GlobalFxns.ToVect(-45);
        fairy15.setParameters(1, .05f, 0, .05f, .05f, 1, false, 75);
        fairy15.setShotParameters(7, .1f, 0, .1f, .1f, 1, false);
        fairy15.offsetInc = 15;
        fairy15.noForCirc = 6;
        fairy15.shotDelay = 30;
        fairy15.shotTimer = -15;
        fairy15.itemDrop  = 2;
        fairy15.bullet    = c;

        Enemy fairy16 = Instantiate(a2, new Vector3(4, 17, 0), Quaternion.identity);

        fairy16.direction = GlobalFxns.ToVect(225);
        fairy16.setParameters(1, .05f, 0, .05f, .05f, 1, false, 75);
        fairy16.setShotParameters(7, .1f, 0, .1f, .1f, 1, false);
        fairy16.offsetInc = -15;
        fairy16.noForCirc = 6;
        fairy16.shotDelay = 30;
        fairy16.shotTimer = -15;
        fairy16.itemDrop  = 2;
        fairy16.bullet    = c;

        yield return(new WaitForSeconds(2));

        fairy15.mvtFxn     = 2;
        fairy15.deltaAngle = 1;
        fairy15.moveTimer  = 45;
        fairy16.mvtFxn     = 2;
        fairy16.deltaAngle = -1;
        fairy16.moveTimer  = 45;

        yield return(new WaitForSeconds(8));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(1));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(1));

        //Midboss: Mimic MoF stage 2 big fairy. Add homing burst shots.
        Enemy midboss2 = Instantiate(a2, new Vector3(-4, 21, 0), Quaternion.identity);

        midboss2.setParameters(1, .05f, 0, .05f, .05f, 1, false, 1500);
        midboss2.setShotParameters(8, .05f, 0, .05f, .05f, 1, false);
        midboss2.offsetInc             = 15;
        midboss2.transform.localScale *= 1.5f;
        midboss2.shotTimer             = -150;
        midboss2.shotDelay             = 30;
        midboss2.itemDrop              = 5;
        midboss2.bullet    = amu;
        midboss2.direction = new Vector3(0, -1, 0);
        yield return(new WaitForSeconds(2));

        midboss2.velocity = 0;

        yield return(new WaitForSeconds(25));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(2));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(3));

        //Wave 5: Row of 10 moves in, loops in a big circle while shooting at center before leaving. Same from opp direction.

        //Final wave: Repeat of suicide ghosts, but this time with 2 fairies that shoot in circles moving clockwise/counterclockwise.

        Enemy ghost11 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost11.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost11.shotType  = 6;
        ghost11.itemDrop  = 1;
        ghost11.amplitude = .25f;
        ghost11.lr        = false;
        ghost11.mvtScale  = .2f;
        ghost11.bullet    = c;

        Enemy ghost12 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost12.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost12.shotType  = 6;
        ghost12.itemDrop  = 1;
        ghost12.amplitude = .25f;
        ghost12.lr        = true;
        ghost12.mvtScale  = .2f;
        ghost12.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost13 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost13.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost13.shotType  = 6;
        ghost13.itemDrop  = 2;
        ghost13.amplitude = .25f;
        ghost13.lr        = false;
        ghost13.mvtScale  = .2f;
        ghost13.bullet    = c;

        Enemy ghost14 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost14.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost14.shotType  = 6;
        ghost14.itemDrop  = 2;
        ghost14.amplitude = .25f;
        ghost14.lr        = true;
        ghost14.mvtScale  = .2f;
        ghost14.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost15 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost15.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost15.shotType  = 6;
        ghost15.itemDrop  = 1;
        ghost15.amplitude = .25f;
        ghost15.lr        = false;
        ghost15.mvtScale  = .2f;
        ghost15.bullet    = c;

        Enemy ghost16 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost16.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost16.shotType  = 6;
        ghost16.itemDrop  = 1;
        ghost16.amplitude = .25f;
        ghost16.lr        = true;
        ghost16.mvtScale  = .2f;
        ghost16.bullet    = c;

        Enemy altFairy1 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        altFairy1.direction = new Vector3(0, -1, 0);
        altFairy1.setParameters(1, .05f, 0, .05f, .05f, 1, false, 200);
        altFairy1.setShotParameters(3, .025f, 0, .025f, .025f, 1, false);
        altFairy1.offsetInc = 15;
        altFairy1.noForCirc = 8;
        altFairy1.shotTimer = -180;
        altFairy1.shotDelay = 45;
        altFairy1.itemDrop  = 3;
        altFairy1.bullet    = c3;

        Enemy altFairy2 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        altFairy2.direction = new Vector3(0, -1, 0);
        altFairy2.setParameters(1, .05f, 0, .05f, .05f, 1, false, 200);
        altFairy2.setShotParameters(3, .025f, 0, .025f, .025f, 1, false);
        altFairy2.offsetInc = -15;
        altFairy2.noForCirc = 8;
        altFairy2.shotTimer = -180;
        altFairy2.shotDelay = 45;
        altFairy2.itemDrop  = 3;
        altFairy2.bullet    = c3;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost17 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost17.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost17.shotType  = 6;
        ghost17.itemDrop  = 2;
        ghost17.amplitude = .25f;
        ghost17.lr        = false;
        ghost17.mvtScale  = .2f;
        ghost17.bullet    = c;

        Enemy ghost18 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost18.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost18.shotType  = 6;
        ghost18.itemDrop  = 2;
        ghost18.amplitude = .25f;
        ghost18.lr        = true;
        ghost18.mvtScale  = .2f;
        ghost18.bullet    = c;

        yield return(new WaitForSeconds(.5f));

        Enemy ghost19 = Instantiate(a1, new Vector3(-12, 18, 0), Quaternion.identity);

        ghost19.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost19.shotType  = 6;
        ghost19.itemDrop  = 1;
        ghost19.amplitude = .25f;
        ghost19.lr        = false;
        ghost19.mvtScale  = .2f;
        ghost19.bullet    = c;

        Enemy ghost20 = Instantiate(a1, new Vector3(4, 17, 0), Quaternion.identity);

        ghost20.setParameters(3, .1f, 0, .1f, .1f, 1, false, 10);
        ghost20.shotType  = 6;
        ghost20.itemDrop  = 1;
        ghost20.amplitude = .25f;
        ghost20.lr        = true;
        ghost20.mvtScale  = .2f;
        ghost20.bullet    = c;

        yield return(new WaitForSeconds(1));

        altFairy1.velocity = 0;
        altFairy2.velocity = 0;

        yield return(new WaitForSeconds(15));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(2));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(3));

        //Spawn Boss
        Boss2 boss = Instantiate(b, new Vector3(-4, 22, 0), Quaternion.identity);
    }
Esempio n. 24
0
    IEnumerator stage3()
    {
        yield return(new WaitForSeconds(3));

        //Wave 1: X-pattern-shooting fairies. Center shoots burst at player :D
        Enemy fairy1 = Instantiate(a2, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy1.direction = new Vector3(0, -1, 0);
        fairy1.setParameters(1, .05f, 0, .05f, .05f, 1, false, 250);
        fairy1.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy1.shotDelay = 30;
        fairy1.shotTimer = -90;
        fairy1.noForCirc = 4;
        fairy1.offsetVal = 45;
        fairy1.itemDrop  = 1;
        fairy1.bullet    = c3;
        fairy1.silenced  = true;

        Enemy fairy2 = Instantiate(a2, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy2.direction = new Vector3(0, -1, 0);
        fairy2.setParameters(1, .05f, 0, .05f, .05f, 1, false, 250);
        fairy2.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy2.shotDelay = 30;
        fairy2.shotTimer = -90;
        fairy2.noForCirc = 4;
        fairy2.offsetVal = 45;
        fairy2.itemDrop  = 1;
        fairy2.bullet    = c3;
        fairy2.silenced  = true;

        yield return(new WaitForSeconds(1));

        Enemy fairy3 = Instantiate(a2, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy3.direction = new Vector3(0, -1, 0);
        fairy3.setParameters(1, .075f, 0, .075f, .075f, 1, false, 250);
        fairy3.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy3.shotDelay = 30;
        fairy3.shotTimer = -90;
        fairy3.noForCirc = 4;
        fairy3.offsetVal = 45;
        fairy3.itemDrop  = 2;
        fairy3.bullet    = c3;
        fairy3.silenced  = true;

        Enemy fairy4 = Instantiate(a2, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy4.direction = new Vector3(0, -1, 0);
        fairy4.setParameters(1, .075f, 0, .075f, .075f, 1, false, 250);
        fairy4.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy4.shotDelay = 30;
        fairy4.shotTimer = -90;
        fairy4.noForCirc = 4;
        fairy4.offsetVal = 45;
        fairy4.itemDrop  = 2;
        fairy4.bullet    = c3;
        fairy4.silenced  = true;

        yield return(new WaitForSeconds(0.5f));

        Enemy fairy5 = Instantiate(a2, new Vector3(-4, 22, 0), Quaternion.identity);

        fairy5.direction = new Vector3(0, -1, 0);
        fairy5.setParameters(1, .05f, 0, .05f, .05f, 1, false, 500);
        fairy5.setShotParameters(1, .075f, 0, .075f, .075f, 1, false);
        fairy5.indirect  = true;
        fairy5.variance  = 5;
        fairy5.shotDelay = 20;
        fairy5.shotTimer = -40;
        fairy5.itemDrop  = 1;
        fairy5.bullet    = c4;
        GameObject sigil1 = Instantiate(Controller.Instance.sigil, fairy5.transform.position, Quaternion.identity, fairy5.transform);

        sigil1.transform.localScale *= .25f;

        yield return(new WaitForSeconds(0.5f));

        fairy1.velocity = 0;
        fairy2.velocity = 0;

        yield return(new WaitForSeconds(.75f));

        fairy5.velocity = 0;

        yield return(new WaitForSeconds(.25f));

        fairy3.velocity = 0;
        fairy4.velocity = 0;

        yield return(new WaitForSeconds(10));

        fairy1.direction = new Vector3(1, 0, 0);
        fairy2.direction = new Vector3(-1, 0, 0);
        fairy3.direction = new Vector3(1, 0, 0);
        fairy4.direction = new Vector3(-1, 0, 0);
        fairy5.direction = new Vector3(0, 1, 0);
        fairy1.velocity  = .05f;
        fairy2.velocity  = .05f;
        fairy3.velocity  = .05f;
        fairy4.velocity  = .05f;
        fairy5.velocity  = .05f;
        //Wave 2: Repeat of wave 1, except now with trash mobs in the way.

        Enemy fairy6 = Instantiate(a2, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy6.direction = new Vector3(0, -1, 0);
        fairy6.setParameters(1, .05f, 0, .05f, .05f, 1, false, 250);
        fairy6.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy6.shotDelay = 30;
        fairy6.shotTimer = -90;
        fairy6.noForCirc = 4;
        fairy6.offsetVal = 45;
        fairy6.itemDrop  = 1;
        fairy6.bullet    = c3;
        fairy6.silenced  = true;

        Enemy fairy7 = Instantiate(a2, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy7.direction = new Vector3(0, -1, 0);
        fairy7.setParameters(1, .05f, 0, .05f, .05f, 1, false, 250);
        fairy7.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy7.shotDelay = 30;
        fairy7.shotTimer = -90;
        fairy7.noForCirc = 4;
        fairy7.offsetVal = 45;
        fairy7.itemDrop  = 1;
        fairy7.bullet    = c3;
        fairy7.silenced  = true;

        yield return(new WaitForSeconds(1));

        Enemy fairy8 = Instantiate(a2, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy8.direction = new Vector3(0, -1, 0);
        fairy8.setParameters(1, .075f, 0, .075f, .075f, 1, false, 250);
        fairy8.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy8.shotDelay = 30;
        fairy8.shotTimer = -90;
        fairy8.noForCirc = 4;
        fairy8.offsetVal = 45;
        fairy8.itemDrop  = 2;
        fairy8.bullet    = c3;
        fairy8.silenced  = true;

        Enemy fairy9 = Instantiate(a2, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy9.direction = new Vector3(0, -1, 0);
        fairy9.setParameters(1, .075f, 0, .075f, .075f, 1, false, 250);
        fairy9.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy9.shotDelay = 30;
        fairy9.shotTimer = -90;
        fairy9.noForCirc = 4;
        fairy9.offsetVal = 45;
        fairy9.itemDrop  = 2;
        fairy9.bullet    = c3;
        fairy9.silenced  = true;

        yield return(new WaitForSeconds(0.5f));

        Enemy fairy10 = Instantiate(a2, new Vector3(-4, 22, 0), Quaternion.identity);

        fairy10.direction = new Vector3(0, -1, 0);
        fairy10.setParameters(1, .05f, 0, .05f, .05f, 1, false, 500);
        fairy10.setShotParameters(1, .075f, 0, .075f, .075f, 1, false);
        fairy10.indirect  = true;
        fairy10.variance  = 5;
        fairy10.shotDelay = 20;
        fairy10.shotTimer = -40;
        fairy10.itemDrop  = 1;
        fairy10.bullet    = c2;
        GameObject sigil2 = Instantiate(Controller.Instance.sigil, fairy10.transform.position, Quaternion.identity, fairy10.transform);

        sigil2.transform.localScale *= .25f;

        yield return(new WaitForSeconds(0.5f));

        fairy6.velocity = 0;
        fairy7.velocity = 0;

        yield return(new WaitForSeconds(1f));

        fairy8.velocity  = 0;
        fairy9.velocity  = 0;
        fairy10.velocity = 0;

        yield return(new WaitForSeconds(2.25f));

        Enemy fairy11 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy11.direction = new Vector3(0, -1, 0);
        fairy11.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy11.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy11.shotDelay = 60;
        fairy11.shotTimer = -15;
        fairy11.itemDrop  = 2;
        fairy11.bullet    = c1;

        Enemy fairy12 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy12.direction = new Vector3(0, -1, 0);
        fairy12.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy12.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy12.shotDelay = 60;
        fairy12.shotTimer = -15;
        fairy12.itemDrop  = 2;
        fairy12.bullet    = c1;

        yield return(new WaitForSeconds(.5f));

        Enemy fairy13 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy13.direction = new Vector3(0, -1, 0);
        fairy13.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy13.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy13.shotDelay = 60;
        fairy13.shotTimer = -15;
        fairy13.itemDrop  = 1;
        fairy13.bullet    = c1;

        Enemy fairy14 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy14.direction = new Vector3(0, -1, 0);
        fairy14.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy14.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy14.shotDelay = 60;
        fairy14.shotTimer = -15;
        fairy14.itemDrop  = 1;
        fairy14.bullet    = c1;

        yield return(new WaitForSeconds(.5f));

        Enemy fairy15 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy15.direction = new Vector3(0, -1, 0);
        fairy15.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy15.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy15.shotDelay = 60;
        fairy15.shotTimer = -15;
        fairy15.itemDrop  = 2;
        fairy15.bullet    = c1;

        Enemy fairy16 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy16.direction = new Vector3(0, -1, 0);
        fairy16.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy16.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy16.shotDelay = 60;
        fairy16.shotTimer = -15;
        fairy16.itemDrop  = 2;
        fairy16.bullet    = c1;

        yield return(new WaitForSeconds(.5f));

        fairy11.mvtFxn     = 2;
        fairy11.deltaAngle = -3;
        fairy11.moveTimer  = 60;
        fairy12.mvtFxn     = 2;
        fairy12.deltaAngle = 3;
        fairy12.moveTimer  = 60;

        Enemy fairy17 = Instantiate(a, new Vector3(-1, 22, 0), Quaternion.identity);

        fairy17.direction = new Vector3(0, -1, 0);
        fairy17.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy17.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy17.shotDelay = 60;
        fairy17.shotTimer = -15;
        fairy17.itemDrop  = 1;
        fairy17.bullet    = c1;

        Enemy fairy18 = Instantiate(a, new Vector3(-7, 22, 0), Quaternion.identity);

        fairy18.direction = new Vector3(0, -1, 0);
        fairy18.setParameters(1, .05f, 0, .05f, .05f, 1, false, 15);
        fairy18.setShotParameters(1, .1f, 0, .1f, .1f, 1, false);
        fairy18.shotDelay = 60;
        fairy18.shotTimer = -15;
        fairy18.itemDrop  = 1;
        fairy18.bullet    = c1;

        yield return(new WaitForSeconds(.5f));

        fairy13.mvtFxn     = 2;
        fairy13.deltaAngle = -3;
        fairy13.moveTimer  = 60;
        fairy14.mvtFxn     = 2;
        fairy14.deltaAngle = 3;
        fairy14.moveTimer  = 60;

        yield return(new WaitForSeconds(.5f));

        fairy15.mvtFxn     = 2;
        fairy15.deltaAngle = -3;
        fairy15.moveTimer  = 60;
        fairy16.mvtFxn     = 2;
        fairy16.deltaAngle = 3;
        fairy16.moveTimer  = 60;
        yield return(new WaitForSeconds(.5f));

        fairy17.mvtFxn     = 2;
        fairy17.deltaAngle = -3;
        fairy17.moveTimer  = 60;
        fairy18.mvtFxn     = 2;
        fairy18.deltaAngle = 3;
        fairy18.moveTimer  = 60;

        yield return(new WaitForSeconds(5));

        fairy6.direction  = new Vector3(1, 0, 0);
        fairy7.direction  = new Vector3(-1, 0, 0);
        fairy8.direction  = new Vector3(1, 0, 0);
        fairy9.direction  = new Vector3(-1, 0, 0);
        fairy10.direction = new Vector3(0, 1, 0);
        fairy6.velocity   = .05f;
        fairy7.velocity   = .05f;
        fairy8.velocity   = .05f;
        fairy9.velocity   = .05f;
        fairy10.velocity  = .05f;

        yield return(new WaitForSeconds(3));

        //Wave 3: Two X-shot fairies and a pair of burst streams.
        Enemy fairy19 = Instantiate(a, new Vector3(0, 22, 0), Quaternion.identity);

        fairy19.direction = new Vector3(0, -1, 0);
        fairy19.setParameters(1, .05f, 0, .05f, .05f, 1, false, 250);
        fairy19.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy19.transform.localScale *= 1.5f;
        fairy19.shotDelay             = 20;
        fairy19.shotTimer             = -90;
        fairy19.noForCirc             = 4;
        fairy19.offsetVal             = 45;
        fairy19.offsetInc             = -12;
        fairy19.itemDrop              = 1;
        fairy19.bullet = c;
        GameObject sigil3 = Instantiate(Controller.Instance.sigil, fairy19.transform.position, Quaternion.identity, fairy19.transform);

        sigil3.transform.localScale *= .25f;

        Enemy fairy20 = Instantiate(a, new Vector3(-8, 22, 0), Quaternion.identity);

        fairy20.direction = new Vector3(0, -1, 0);
        fairy20.setParameters(1, .05f, 0, .05f, .05f, 1, false, 250);
        fairy20.setShotParameters(3, .075f, 0, .075f, .075f, 1, false);
        fairy20.transform.localScale *= 1.5f;
        fairy20.shotDelay             = 20;
        fairy20.shotTimer             = -90;
        fairy20.noForCirc             = 4;
        fairy20.offsetVal             = 45;
        fairy20.offsetInc             = 12;
        fairy20.itemDrop              = 1;
        fairy20.bullet = c;
        GameObject sigil4 = Instantiate(Controller.Instance.sigil, fairy20.transform.position, Quaternion.identity, fairy20.transform);

        sigil4.transform.localScale *= .25f;

        Enemy fairy21 = Instantiate(a, new Vector3(-3, 22, 0), Quaternion.identity);

        fairy21.direction = new Vector3(0, -1, 0);
        fairy21.setParameters(1, .05f, 0, .05f, .05f, 1, false, 300);
        fairy21.setShotParameters(1, .075f, 0, .075f, .075f, 1, false);
        fairy21.shotDelay = 60;
        fairy21.shotTimer = -40;
        fairy21.itemDrop  = 3;
        fairy21.bullet    = c4;
        GameObject sigil5 = Instantiate(Controller.Instance.sigil, fairy21.transform.position, Quaternion.identity, fairy21.transform);

        sigil5.transform.localScale *= .25f;

        Enemy fairy22 = Instantiate(a, new Vector3(-5, 22, 0), Quaternion.identity);

        fairy22.direction = new Vector3(0, -1, 0);
        fairy22.setParameters(1, .05f, 0, .05f, .05f, 1, false, 300);
        fairy22.setShotParameters(1, .075f, 0, .075f, .075f, 1, false);
        fairy22.shotDelay = 60;
        fairy22.shotTimer = -40;
        fairy22.itemDrop  = 3;
        fairy22.bullet    = c4;
        GameObject sigil6 = Instantiate(Controller.Instance.sigil, fairy22.transform.position, Quaternion.identity, fairy22.transform);

        sigil6.transform.localScale *= .25f;

        yield return(new WaitForSeconds(1.5f));

        fairy19.velocity = 0;
        fairy20.velocity = 0;
        fairy21.velocity = 0;
        fairy22.velocity = 0;

        yield return(new WaitForSeconds(10));

        fairy19.direction = GlobalFxns.ToVect(-45);
        fairy20.direction = GlobalFxns.ToVect(-135);
        fairy21.direction = GlobalFxns.ToVect(-45);
        fairy22.direction = GlobalFxns.ToVect(-135);

        fairy19.velocity = .05f;
        fairy20.velocity = .05f;
        fairy21.velocity = .05f;
        fairy22.velocity = .05f;

        yield return(new WaitForSeconds(5));

        //Wave 4: Wisps that pop up every few secs or so. Yuugi-style lasers.
        Enemy wisp1 = Instantiate(a1, new Vector3(.75f, 22, 0), Quaternion.identity);

        wisp1.setParameters(1, .05f, 0, .05f, .05f, 1, false, 100);
        wisp1.setShotParameters(10, .075f, 0, .075f, .075f, 1, false);
        wisp1.direction = new Vector3(0, -1, 0);
        wisp1.offsetInc = 15;
        wisp1.shotDelay = 10;
        wisp1.shotTimer = -110;
        wisp1.itemDrop  = 1;

        yield return(new WaitForSeconds(.5f));

        Enemy wisp2 = Instantiate(a1, new Vector3(-6.75f, 22, 0), Quaternion.identity);

        wisp2.setParameters(1, .05f, 0, .05f, .05f, 1, false, 100);
        wisp2.setShotParameters(10, .075f, 0, .075f, .075f, 1, false);
        wisp2.direction = new Vector3(0, -1, 0);
        wisp2.offsetInc = 15;
        wisp2.shotDelay = 10;
        wisp2.shotTimer = -110;
        wisp2.itemDrop  = 1;

        yield return(new WaitForSeconds(.5f));

        Enemy wisp3 = Instantiate(a1, new Vector3(-1.5f, 22, 0), Quaternion.identity);

        wisp3.setParameters(1, .05f, 0, .05f, .05f, 1, false, 100);
        wisp3.setShotParameters(10, .075f, 0, .075f, .075f, 1, false);
        wisp3.direction = new Vector3(0, -1, 0);
        wisp3.offsetInc = 15;
        wisp3.shotDelay = 10;
        wisp3.shotTimer = -110;
        wisp3.itemDrop  = 2;


        yield return(new WaitForSeconds(.5f));

        Enemy wisp4 = Instantiate(a1, new Vector3(-7.25f, 22, 0), Quaternion.identity);

        wisp4.setParameters(1, .05f, 0, .05f, .05f, 1, false, 100);
        wisp4.setShotParameters(10, .075f, 0, .075f, .075f, 1, false);
        wisp4.direction = new Vector3(0, -1, 0);
        wisp4.offsetInc = 15;
        wisp4.shotDelay = 10;
        wisp4.shotTimer = -110;
        wisp4.itemDrop  = 2;

        wisp1.velocity = 0;

        yield return(new WaitForSeconds(.5f));

        wisp2.velocity = 0;

        yield return(new WaitForSeconds(.5f));

        wisp3.velocity = 0;

        yield return(new WaitForSeconds(.5f));

        wisp4.velocity = 0;

        yield return(new WaitForSeconds(3));

        wisp1.direction = GlobalFxns.ToVect(-60);
        wisp1.velocity  = .025f;

        yield return(new WaitForSeconds(.5f));

        wisp2.direction = GlobalFxns.ToVect(-120);
        wisp2.velocity  = .025f;

        yield return(new WaitForSeconds(.5f));

        wisp3.direction = GlobalFxns.ToVect(-60);
        wisp3.velocity  = .025f;

        yield return(new WaitForSeconds(.5f));

        wisp4.direction = GlobalFxns.ToVect(-120);
        wisp4.velocity  = .025f;

        yield return(new WaitForSeconds(3));

        //Wave 5: More Yuugi wisps. Add 4 that aim at player.
        //Wave 6: Death fairy. Would be a midboss, but screw it, outta time.
        Enemy deathFairy = Instantiate(a2, new Vector3(-4, 22, 0), Quaternion.identity);

        deathFairy.setParameters(1, .05f, 0, .05f, .05f, 1, false, 1250);
        deathFairy.direction = new Vector3(0, -1, 0);
        deathFairy.bullet    = deathFairy.bullet2;
        GameObject sigil7 = Instantiate(Controller.Instance.sigil, deathFairy.transform.position, Quaternion.identity, deathFairy.transform);

        sigil7.transform.localScale *= .25f;

        yield return(new WaitForSeconds(2));

        deathFairy.velocity = 0;
        deathFairy.setShotParameters(9, .05f, 0, .05f, .05f, 1, false);
        deathFairy.shotDelay = 2;
        deathFairy.itemDrop  = 4;

        //Boss time~
        yield return(new WaitForSeconds(25));

        Controller.Instance.clearScreen = true;

        yield return(new WaitForSeconds(2));

        Controller.Instance.clearScreen = false;

        yield return(new WaitForSeconds(3));

        //Spawn Boss
        Boss3 boss = Instantiate(b, new Vector3(-4, 22, 0), Quaternion.identity);
    }
Esempio n. 25
0
    void Nonspell1()
    {
        if (!pauseBeforeNext)
        {
            shotVel = .1f;
            if (timer == 20)
            {
                if (lr)
                {
                    offset += 1;
                }
                else
                {
                    offset -= 1;
                }
                for (int i = 0; i < 60; i++)
                {
                    EnemyShot lol = Instantiate(shotA, transform.position, Quaternion.identity);
                    lol.direction = GlobalFxns.ToVect(0 + rotation + offset);
                    lol.setParameters(4, shotVel, 0, shotVel, shotVel, 1, false);
                    rotation += 10;
                }
                playSnd(1);
            }
            if (timer == 25)
            {
                if (lr)
                {
                    offset += 1;
                }
                else
                {
                    offset -= 1;
                }
                for (int i = 0; i < 60; i++)
                {
                    EnemyShot lolk = Instantiate(shotA, transform.position, Quaternion.identity);
                    lolk.direction = GlobalFxns.ToVect(0 + rotationA + offset);
                    lolk.setParameters(4, shotVel, 0, shotVel, shotVel, 1, false);
                    rotationA += 10;
                }
                playSnd(1);
            }
            if (timer == 30)
            {
                if (lr)
                {
                    offset += 1;
                }
                else
                {
                    offset -= 1;
                }
                for (int i = 0; i < 60; i++)
                {
                    EnemyShot lolok = Instantiate(shotA, transform.position, Quaternion.identity);
                    lolok.direction = GlobalFxns.ToVect(0 + rotationB + offset);
                    lolok.setParameters(4, shotVel, 0, shotVel, shotVel, 1, false);
                    rotationB += 10;
                }
                playSnd(1);
            }
            if (timer == 35)
            {
                if (lr)
                {
                    offset += 1;
                }
                else
                {
                    offset -= 1;
                }
                for (int i = 0; i < 60; i++)
                {
                    EnemyShot lolok = Instantiate(shotA, transform.position, Quaternion.identity);
                    lolok.direction = GlobalFxns.ToVect(0 + rotationC + offset);
                    lolok.setParameters(4, shotVel, 0, shotVel, shotVel, 1, false);
                    rotationC += 10;
                }
                playSnd(1);
            }

            if (timer == 40)
            {
                if (lr)
                {
                    offset += 1;
                }
                else
                {
                    offset -= 1;
                }
                for (int i = 0; i < 60; i++)
                {
                    EnemyShot lolok = Instantiate(shotA, transform.position, Quaternion.identity);
                    lolok.direction = GlobalFxns.ToVect(0 + rotationD + offset);
                    lolok.setParameters(4, shotVel, 0, shotVel, shotVel, 1, false);
                    rotationD += 10;
                }
                playSnd(1);
                pauseBeforeNext = true;
            }
        }
        else
        {
            if (timer2 > 30)
            {
                timer           = 0;
                timer2          = 0;
                lr              = !lr;
                pauseBeforeNext = false;
            }
            else
            {
                timer2++;
            }
        }
    }
Esempio n. 26
0
 void Spell2()
 {
     if (Controller.Instance.globalAng == 0)
     {
         Controller.Instance.globalAng = -90;
     }
     if (timer > 10)
     {
         for (int i = 0; i < 1; i++)
         {
             float     topSpawn = Random.Range(-12, 3.5f);
             float     randVel  = Random.Range(.075f, .1f);
             EnemyShot topShot  = Instantiate(rain2, new Vector3(topSpawn, 20, 0), Quaternion.identity);
             topShot.setParameters(5, randVel, 0, randVel, randVel, 1, false);
             topShot.tempInc    = 1;
             topShot.direction  = GlobalFxns.ToVect(Controller.Instance.globalAng);
             topShot.dirAsFloat = Controller.Instance.globalAng;
         }
         for (int i = 0; i < 1; i++)
         {
             float     sideSpawnA = Random.Range(10, 19.5f);
             float     randVel    = Random.Range(.075f, .1f);
             EnemyShot leftShot   = Instantiate(rain2, new Vector3(-12, sideSpawnA, 0), Quaternion.identity);
             leftShot.setParameters(5, randVel, 0, randVel, randVel, 1, false);
             leftShot.tempInc    = 1;
             leftShot.direction  = GlobalFxns.ToVect(Controller.Instance.globalAng);
             leftShot.dirAsFloat = Controller.Instance.globalAng;
         }
         for (int i = 0; i < 1; i++)
         {
             float     sideSpawnB = Random.Range(10, 19.5f);
             float     randVel    = Random.Range(.075f, .1f);
             EnemyShot rightShot  = Instantiate(rain2, new Vector3(3.5f, sideSpawnB, 0), Quaternion.identity);
             rightShot.setParameters(5, randVel, 0, randVel, randVel, 1, false);
             rightShot.tempInc    = 1;
             rightShot.direction  = GlobalFxns.ToVect(Controller.Instance.globalAng);
             rightShot.dirAsFloat = Controller.Instance.globalAng;
         }
         playSnd(4);
         timer2++;
         timer = 0;
     }
     if (timer2 == 5)
     {
         //For timer3: 0 is default (-90), 1 is left (-135), 2 is right (-45).
         int windDir = Random.Range(0, 3);
         timer3 = windDir;
         timer2 = 0;
     }
     if (timer3 == 0)
     {
         Controller.Instance.globalAng = -90;
     }
     else if (timer3 == 1)
     {
         Controller.Instance.globalAng = -45;
     }
     else if (timer3 == 2)
     {
         Controller.Instance.globalAng = -135;
     }
 }
Esempio n. 27
0
    void Move()
    {
        if (!dead && !dashing)
        {
            Vector2 moveVect = Vector2.zero;
            if (Input.GetKey(KeyCode.W))
            {
                moveVect.y += 1;
            }
            if (Input.GetKey(KeyCode.S))
            {
                moveVect.y -= 1;
            }
            if (Input.GetKey(KeyCode.A))
            {
                moveVect.x -= 1;
            }
            if (Input.GetKey(KeyCode.D))
            {
                moveVect.x += 1;
            }
            if (moveVect.magnitude == 0)
            {
                return;
            }

            moveVect.Normalize();
            transform.position += (Vector3)(moveVect * mvspd * 60f * Time.deltaTime);

            float pDir = GlobalFxns.ToAng(moveVect.normalized);
            playerDir = (int)pDir;
            if (playerDir / 45 == 0)
            {
                playerDir   = 2;
                facingRight = true;
                facingBack  = false;
                facingFront = false;
                facingLeft  = false;
            }
            if (playerDir / 45 == 1)
            {
                playerDir = 1;
            }
            if (playerDir / 45 == 2)
            {
                playerDir   = 0;
                facingBack  = true;
                facingRight = false;
                facingLeft  = false;
                facingFront = false;
            }
            if (playerDir / 45 == 3)
            {
                playerDir = 7;
            }
            if (playerDir / 45 == 4)
            {
                playerDir   = 6;
                facingLeft  = true;
                facingFront = false;
                facingBack  = false;
                facingRight = false;
            }
            if (playerDir / 45 == -1)
            {
                playerDir = 3;
            }
            if (playerDir / 45 == -2)
            {
                playerDir   = 4;
                facingFront = true;
                facingBack  = false;
                facingLeft  = false;
                facingRight = false;
            }
            if (playerDir / 45 == -3)
            {
                playerDir = 5;
            }
            int rando = Random.Range(0, 3);
            switch (rando)
            {
            case 0:
                Sound.me.PlaySound(mvt, .15f, 2, 3);
                break;

            case 1:
                Sound.me.PlaySound(mvt2, .15f, 2, 3);
                break;

            case 2:
                Sound.me.PlaySound(mvt3, .15f, 2, 3);
                break;
            }
        }
    }
Esempio n. 28
0
    /*IEnumerator Counter()
     * {
     *  if (!countering)
     *  {
     *      countering = true;
     *                  anim.SetBool ("counter", true);
     *      yield return new WaitForSeconds(1);
     *                  anim.SetBool ("counter", false);
     *      countering = false;
     *      yield return new WaitForSeconds(1);
     *  }
     * }*/

    void Dash()
    {
        if ((Input.GetKeyDown(KeyCode.K)) && dashCD < 1)
        {
            anim.SetBool("dash", true);
            dashing = true;
            iframe  = true;
            timer   = 15;
            dashCD  = 60;
        }
        else if (timer > 0)
        {
            if (playerDir == 0)
            {
                //play dash UP
                transform.position += GlobalFxns.ToVect(90).normalized * .2f;
            }
            if (playerDir == 1)
            {
                //play dash UPRT
                transform.position += GlobalFxns.ToVect(45).normalized * .2f;
            }
            if (playerDir == 2)
            {
                //play dash RT
                transform.position += GlobalFxns.ToVect(0).normalized * .2f;
            }
            if (playerDir == 3)
            {
                //play dash DNRT
                transform.position += GlobalFxns.ToVect(-45).normalized * .2f;
            }
            if (playerDir == 4)
            {
                //play dash DN
                transform.position += GlobalFxns.ToVect(-90).normalized * .2f;
            }
            if (playerDir == 5)
            {
                //play dash DNLT
                transform.position += GlobalFxns.ToVect(-135).normalized * .2f;
            }
            if (playerDir == 6)
            {
                //play dash LT
                transform.position += GlobalFxns.ToVect(180).normalized * .2f;
            }
            if (playerDir == 7)
            {
                //play dash UPLT
                transform.position += GlobalFxns.ToVect(135).normalized * .2f;
            }
            timer--;
        }
        else
        {
            iframe  = false;
            dashing = false;
            anim.SetBool("dash", false);
        }
        if (dashCD > 0)
        {
            dashCD--;
        }
    }