Ejemplo n.º 1
0
    public IEnumerator Behave008(float x, float arrivalY, GameObject originalShot, float awayAngle = -90f, bool another = false)
    {
        transform.position = new Vector3(x, StgFrame.topS + BodyRadius);
        SetDestAtTime(x, arrivalY, 1);
        yield return(WaitForStop());

        Angle = Angle2Player;
        FireWay(originalShot, 3, 5, StgFrame.height / 1.8f, Angle);
        yield return(Yielder.WaitForFixedSeconds(0.5f));

        if (another)
        {
            yield return(Yielder.WaitForFixedSeconds(0.5f));
        }

        Acceleration = StgFrame.height / 2f;
        SpeedLimit   = StgFrame.height / 1f;
        Angle        = awayAngle;

        if (another)
        {
            for (var i = 0; i < 3; i++)
            {
                yield return(Yielder.WaitForFixedSeconds(0.3f));

                FireRoundWay(originalShot, 6, 2, 3f, StgFrame.height / 2.8f, Mathfd.RandomAngle());
            }
        }
    }
Ejemplo n.º 2
0
 public IEnumerator Behave101(GameObject originalShot)
 {
     while (true)
     {
         FireRoundR210(originalShot, 5, Random.Range(0, StgFrame.halfWidth / 3), Mathfd.RandomAngle(), StgFrame.halfWidth / 40, StgFrame.height / 2, Mathfd.RandomAngle(), -StgFrame.height / 1, StgFrame.height / 2.5f);
         yield return(Yielder.WaitForFixedSeconds(0.2f));
     }
 }
Ejemplo n.º 3
0
 public IEnumerator FireBehave002(GameObject original, int roundN, int lineN, float speed, float lineIntervalT, int roundCount)
 {
     for (var i = 0; i < roundCount; i++)
     {
         float angle = Mathfd.RandomAngle();
         for (var j = 0; j < lineN; j++)
         {
             FireRound(original, roundN, speed, angle);
             yield return(Yielder.WaitForFixedSeconds(lineIntervalT));
         }
     }
 }
Ejemplo n.º 4
0
    public IEnumerator Behave001(float x, GameObject originalShot, float awayAngleSpeed)
    {
        transform.position = new Vector3(x, StgFrame.topS + BodyRadius);

        Speed = StgFrame.height / 2.7f;
        Angle = -90f;

        yield return(Yielder.WaitForFixedSeconds(1f));

        FireRound(originalShot, 14, StgFrame.height / 2f, Mathfd.RandomAngle());
        yield return(Yielder.WaitForFixedSeconds(0.4f));

        AngleSpeed = awayAngleSpeed;
    }
Ejemplo n.º 5
0
    public IEnumerator Behave201(GameObject originalShot, float lr = 1, bool another = false)
    {
        float lAngle   = Mathfd.RandomAngle();
        var   sAngle   = 0f;
        var   num      = 4;
        var   t        = 1f;
        var   interval = t / 40;

        if (another)
        {
            sAngle = 360 / num / 2;
        }

        for (var i = 0; i < 30; i++)
        {
            FireRoundR2102Player(originalShot, num, StgFrame.halfWidth * 0.45f, lAngle, StgFrame.halfWidth * 0.05f, StgFrame.height / 10, sAngle, StgFrame.height / 0.8f, StgFrame.height / 1.5f);
            yield return(Yielder.WaitForFixedSeconds(interval));

            lAngle += 11 * lr;
            sAngle -= 360 / num / 3 * lr;
        }
    }
Ejemplo n.º 6
0
    //public IEnumerator Behave010(float lr,float fromY,float toX,float toY,float t,bool another = false)
    //{
    //    transform.position = new Vector3(StgFrame.centerX + (StgFrame.halfWidth + StgFrame.shakeRange + bodyR) * lr, fromY);
    //    SetDestAtTime(toX, toY, t);
    //    //move
    //    while (speed != 0)
    //    {

    //    }
    //}

    public IEnumerator Behave200(GameObject originalShot)
    {
        var enemy = GetComponent <Enemy>();

        transform.position = new Vector3(StgFrame.centerX, StgFrame.topS + BodyRadius);
        SetDestAtTime(X, StgFrame.PY(0.7f), 1);
        yield return(WaitForStop());

        while (enemy.GetHPP() > 0.6f)
        {
            for (var lr = -1; lr <= 1; lr += 2)
            {
                for (var i = 0; i < 3; i++)
                {
                    FireWay(originalShot, 15, 1, StgFrame.height / 2.5f, Angle2Player);
                    yield return(Yielder.WaitForFixedSeconds(0.46f));
                }
                yield return(Behave201(originalShot, lr, true));

                yield return(Yielder.WaitForFixedSeconds(1));

                FireRound(originalShot, 30, StgFrame.height / 3.2f, Mathfd.RandomAngle());
                yield return(Yielder.WaitForFixedSeconds(0.8f));

                yield return(Behave201(originalShot, lr));

                yield return(Behave201(originalShot, -lr, true));

                yield return(Yielder.WaitForFixedSeconds(1));
            }
        }

        while (enemy.GetHPP() > 0f)
        {
            for (var lr = -1; lr <= 1 && enemy.GetHPP() > 0f; lr += 2)
            {
                for (var lr2 = -1; lr2 <= 1; lr2 += 2)
                {
                    SetDestAtTime(StgFrame.PX(Random.Range(0.4f, 0.7f) * lr * lr2), StgFrame.PY(Random.Range(0.7f, 0.8f)), 2);
                    for (var i = 0; i < 6; i++)
                    {
                        yield return(Yielder.WaitForFixedSeconds(0.2f));

                        FireRoundWay(originalShot, 3, 3, 3, StgFrame.height / 2.2f, Mathfd.RandomAngle());
                    }
                    yield return(WaitForStop());

                    SetDestAtTime(X, StgFrame.PY(-0.8f), 0.7f);
                    yield return(WaitForStop());

                    for (var i = 0; i < 2; i++)
                    {
                        CreateBehave007Actor(originalShot, transform, 90 + Mathfd.Shake(2), originalShot);
                        yield return(Yielder.WaitForFixedSeconds(0.5f));
                    }
                }

                SetDestAtTime(StgFrame.centerX, StgFrame.centerY, 3);
                yield return(WaitForStop());

                Angle = -90;

                {
                    float speed    = StgFrame.height * 0.8f;
                    float interval = 1.4f;
                    for (var i = 0; i < 20; i++)
                    {
                        for (var j = 0; j < 8; j++)
                        {
                            Fire(originalShot, Random.Range(speed, speed * 0.6f), Angle2Player + Mathfd.Shake(4));
                        }
                        yield return(Yielder.WaitForFixedSeconds(interval));

                        speed    = Mathf.Min(StgFrame.height * 1.4f, speed + StgFrame.height * 0.2f);
                        interval = Mathf.Max(0.2f, interval - 0.3f);
                    }
                }
                yield return(Yielder.WaitForFixedSeconds(1f));
            }
        }
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 横から出てきてFireRound
    /// </summary>
    /// <param name="originalEnemy"></param>
    /// <param name="lr"></param>
    /// <param name="y"></param>
    /// <param name="arrivalX"></param>
    /// <param name="originalShot"></param>
    /// <returns></returns>
    public static StgAct CreateBehave004EnemyB(GameObject originalEnemy, float lr, float y, float arrivalX, GameObject originalShot)
    {
        StgAct clone = StgAct.ApparentInstantiate(originalEnemy);

        clone.StartCoroutine(clone.Behave004(lr, y, arrivalX, 0.8f, clone.FireRoundBehave(originalShot, 10, StgFrame.height / 3f, Mathfd.RandomAngle()), 0.5f, StgFrame.height / 3, StgFrame.height / 2));

        return(clone);
    }