private IEnumerator act_debug()
        {
            int target_id = MissileManager.Instance.registTarget(update_time_);

            MissileManager.Instance.setTargetRadius(target_id, 1f /* radius */);
            {
                var pos = new Vector3(0f, 0f, 10f);
                MissileManager.Instance.updateTarget(target_id, ref pos);
            }
            for (;;)
            {
                var lpos = new Vector3(0f, 0f, -40f);
                var rot  = Quaternion.Euler(0f, -30f, 0f);
                MissileManager.Instance.spawn(ref lpos,
                                              ref rot,
                                              target_id, update_time_);
                for (var i = new Utility.WaitForSeconds(2f, update_time_); !i.end(update_time_);)
                {
                    var pos = new Vector3(100f, 0f, 10f);
                    MissileManager.Instance.updateTarget(target_id, ref pos);
                    MissileManager.Instance.checkHitAndClear(target_id);
                    yield return(null);
                }
            }
        }
Example #2
0
        public IEnumerator auto_play()
        {
            for (;;)
            {
                float time = MyRandom.Range(0.5f, 1f);
                float dir  = (float)((int)MyRandom.Range(0f, 8f)) * Mathf.PI * 0.25f;
                for (var i = new Utility.WaitForSeconds(time, update_time_); !i.end(update_time_);)
                {
                    autoplay_buttons_[(int)InputManager.Button.Horizontal] = (int)(Mathf.Cos(dir) * 128f);
                    autoplay_buttons_[(int)InputManager.Button.Vertical]   = (int)(Mathf.Sin(dir) * 128f);
                    if (MyRandom.ProbabilityForSecond(1f, SystemManager.Instance.getDT()))
                    {
                        autoplay_buttons_[(int)InputManager.Button.Fire] = 0;
                    }
                    else
                    {
                        autoplay_buttons_[(int)InputManager.Button.Fire] = 1;
                    }
                    if (MyRandom.ProbabilityForSecond(0.6f, SystemManager.Instance.getDT()))
                    {
                        autoplay_buttons_[(int)InputManager.Button.Roll] = MyRandom.Range(-1, 2);
                    }
                    yield return(null);

                    if (hit_wall_)
                    {
                        break;
                    }
                }
            }
        }
 private IEnumerator act()
 {
     for (;;) {
     yield return null;
     var pos = new Vector3(MyRandom.Range(-15f, 15f), MyRandom.Range(-15f, 15f), -10f);
     Enemy.create(ref pos, ref CV.QuaternionIdentity, Enemy.Type.Zako);
     // for (var i = Utility.WaitForSeconds(0.20f, update_time_); i.MoveNext();) { yield return null; }
     for (var i = new Utility.WaitForSeconds(0.2f, update_time_); !i.end(update_time_);) {
         yield return null;
     }
     }
 }
Example #4
0
 public IEnumerator dragon_act()
 {
     for (;;)
     {
         while (rigidbody_.transform_.position_.y < 0f)
         {
             rigidbody_.addRelativeForceZ(20f);
             var target = new Vector3(0f, 0f, 0f);
             rigidbody_.addTargetTorque(ref target, 20f);
             yield return(null);
         }
         for (var i = new Utility.WaitForSeconds(4f, update_time_); !i.end(update_time_);)
         {
             rigidbody_.addSpringForceY(8f, 2f);
             rigidbody_.addRelativeTorqueZ(25f);
             var target = Player.Instance.rigidbody_.transform_.position_;
             rigidbody_.addSpringTorque(ref target, 20f);
             yield return(null);
         }
         for (var i = new Utility.WaitForSeconds(4f, update_time_); !i.end(update_time_);)
         {
             rigidbody_.addSpringForceY(8f, 2f);
             var target = Player.Instance.rigidbody_.transform_.position_;
             rigidbody_.addSpringTorque(ref target, 20f);
             yield return(null);
         }
         for (var i = new Utility.WaitForSeconds(4f, update_time_); !i.end(update_time_);)
         {
             rigidbody_.addSpringForceY(4f, 3f);
             // rigidbody_.addRelativeForceX(5f);
             var target = Player.Instance.rigidbody_.transform_.position_;
             rigidbody_.addSpringTorque(ref target, 20f);
             yield return(null);
         }
         for (var i = new Utility.WaitForSeconds(1f, update_time_); !i.end(update_time_);)
         {
             rigidbody_.addRelativeForceZ(20f);
             var target = new Vector3(0f, 20f, 0f);
             rigidbody_.addTargetTorque(ref target, 10f);
             yield return(null);
         }
         for (var i = new Utility.WaitForSeconds(4f, update_time_); !i.end(update_time_);)
         {
             rigidbody_.addRelativeForceZ(40f);
             var target = new Vector3(0f, -20f, 0f);
             rigidbody_.addTargetTorque(ref target, 20f);
             yield return(null);
         }
         yield return(null);
     }
 }
Example #5
0
        private IEnumerator act()
        {
            for (;;)
            {
                yield return(null);

                var pos = new Vector3(MyRandom.Range(-15f, 15f), MyRandom.Range(-15f, 15f), -10f);
                Enemy.create(ref pos, ref CV.QuaternionIdentity, Enemy.Type.Zako);
                // for (var i = Utility.WaitForSeconds(0.20f, update_time_); i.MoveNext();) { yield return null; }
                for (var i = new Utility.WaitForSeconds(0.2f, update_time_); !i.end(update_time_);)
                {
                    yield return(null);
                }
            }
        }
Example #6
0
        public IEnumerator zako2_act()
        {
            rigidbody_.setDamper(2f);
            rigidbody_.setRotateDamper(20f);
            target_position_.x = MyRandom.Range(-5f, 5f);
            target_position_.y = MyRandom.Range(-5f, 5f);

            yield return(null);

            for (var i = new Utility.WaitForSeconds(2.2f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addForceZ(-160f);
                rigidbody_.addSpringForceXY(target_position_.x, target_position_.y, 2f);
                yield return(null);
            }

            var sec        = MyRandom.Range(3f, 5f);
            var fired_time = update_time_;
            var move_force = new Vector3(-target_position_.x, -target_position_.y, 0f);

            move_force.Normalize();
            move_force = Quaternion.Euler(0f, 0f, MyRandom.Range(-45f, 45f)) * move_force * 4f;
            for (var i = new Utility.WaitForSeconds(sec, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addTargetTorque(ref Player.Instance.rigidbody_.transform_.position_,
                                           100f);
                rigidbody_.addForce(ref move_force);
                var target = Player.Instance.rigidbody_.transform_.position_;
                if (update_time_ - fired_time > 0.4f)
                {
                    EnemyBullet.create(ref rigidbody_.transform_.position_,
                                       ref target,
                                       50f /* speed */,
                                       update_time_);
                    fired_time = update_time_;
                }
                yield return(null);
            }

            for (var i = new Utility.WaitForSeconds(4f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addOrientTorque(ref CV.Vector3Back, 100f);
                rigidbody_.addForceZ(-80f);
                yield return(null);
            }

            destroy();
        }
Example #7
0
        public IEnumerator zako_act()
        {
            rigidbody_.setDamper(2f);
            rigidbody_.setRotateDamper(4f);
            yield return(null);

            for (var i = new Utility.WaitForSeconds(0.8f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addSpringTorque(ref Player.Instance.rigidbody_.transform_.position_, 3f);
                rigidbody_.addSpringForceY(4f /* target_y */, 4f /* ratio */);
                yield return(null);
            }
            WaterSurface.Instance.makeBump(ref rigidbody_.transform_.position_, 1f /* value */, 1f /* size */);
            for (var i = new Utility.WaitForSeconds(1f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addSpringTorque(ref Player.Instance.rigidbody_.transform_.position_, 3f);
                rigidbody_.addSpringForceY(4f /* target_y */, 4f /* ratio */);
                if (MyRandom.Probability(0.1f))
                {
                    WaterSplash.Instance.spawn(ref rigidbody_.transform_.position_,
                                               ref CV.Vector3Zero, update_time_ - 0.2f);
                }
                yield return(null);
            }
            for (var i = new Utility.WaitForSeconds(10f, update_time_); !i.end(update_time_);)
            {
                var pos = Player.Instance.rigidbody_.transform_.position_;
                // pos.y -= 1f;
                rigidbody_.addSpringTorque(ref pos, 8f);
                rigidbody_.addSpringForceY(4f /* target_y */, 4f /* ratio */);
                if (MyRandom.Probability(0.04f))
                {
                    EnemyBullet.create(ref rigidbody_.transform_.position_,
                                       ref rigidbody_.transform_.rotation_,
                                       60f /* speed */, update_time_);
                }
                yield return(null);
            }
            for (var i = new Utility.WaitForSeconds(3f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addHorizontalStableTorque(8f /* torque_level */);
                rigidbody_.addRelativeForceZ(80f);
                yield return(null);
            }
            destroy();
        }
Example #8
0
        public IEnumerator zako_act()
        {
            rigidbody_.setDamper(2f);
            rigidbody_.setRotateDamper(2f);
            target_position_.x = MyRandom.Range(-20f, 20);
            target_position_.y = MyRandom.Range(-20f, 20);
            rigidbody_.addForceZ(40f);
            yield return(null);

            // for (var i = Utility.WaitForSeconds(10f, update_time_); i.MoveNext();) {
            for (var i = new Utility.WaitForSeconds(10f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addForceX(target_position_.x - rigidbody_.transform_.position_.x * 2f);
                rigidbody_.addForceY(target_position_.y - rigidbody_.transform_.position_.y * 2f);
                rigidbody_.addForceZ(10f);
                rigidbody_.addTorqueZ(-rigidbody_.velocity_.x * 1f);

                if (MyRandom.ProbabilityForSecond(1.5f, SystemManager.Instance.getDT()))
                {
                    var pos = Player.Instance.rigidbody_.transform_.position_;
                    pos.z += MyRandom.Range(-10f, 10f);
                    EnemyBullet.create(ref rigidbody_.transform_.position_,
                                       ref pos,
                                       50f /* speed */,
                                       update_time_);
                }

                if (phase_ == Phase.Dying)
                {
                    // for (var j = Utility.WaitForSeconds(0.1f, update_time_); j.MoveNext();) {
                    for (var j = new Utility.WaitForSeconds(0.1f, update_time_); j.end(update_time_);)
                    {
                        yield return(null);
                    }
                    break;
                }

                yield return(null);
            }
            destroy();
        }
Example #9
0
 private IEnumerator act()
 {
     // SystemManager.Instance.registBgm(DrawBuffer.BGM.Battle);
     {
         var position = new Vector3(0f, -10f, 0f);
         var rotation = Quaternion.Euler(-90f, 0f, 0f);
         Enemy.create(Enemy.Type.Dragon, ref position, ref rotation);
     }
     for (;;)
     {
         {
             var position = new Vector3(MyRandom.Range(-10f, 10f), -10f, MyRandom.Range(-10f, 10f));
             var rotation = Quaternion.Euler(-90f, 0f, 0f);
             Enemy.create(Enemy.Type.Zako, ref position, ref rotation);
         }
         for (var i = new Utility.WaitForSeconds(MyRandom.Range(1f, 3f), update_time_); !i.end(update_time_);)
         {
             yield return(null);
         }
         yield return(null);
     }
 }
Example #10
0
 public IEnumerator auto_play()
 {
     for (;;) {
     float time = MyRandom.Range(0.5f, 1f);
     float dir = (float)((int)MyRandom.Range(0f, 8f)) * Mathf.PI * 0.25f;
     for (var i = new Utility.WaitForSeconds(time, update_time_); !i.end(update_time_);) {
         autoplay_buttons_[(int)InputManager.Button.Horizontal] = (int)(Mathf.Cos(dir)*128f);
         autoplay_buttons_[(int)InputManager.Button.Vertical] = (int)(Mathf.Sin(dir)*128f);
         if (MyRandom.ProbabilityForSecond(1f, SystemManager.Instance.getDT())) {
             autoplay_buttons_[(int)InputManager.Button.Fire] = 0;
         } else {
             autoplay_buttons_[(int)InputManager.Button.Fire] = 1;
         }
         if (MyRandom.ProbabilityForSecond(0.6f, SystemManager.Instance.getDT())) {
             autoplay_buttons_[(int)InputManager.Button.Roll] = MyRandom.Range(-1, 2);
         }
         yield return null;
         if (hit_wall_) {
             break;
         }
     }
     }
 }
Example #11
0
        public IEnumerator zako_act()
        {
            rigidbody_.setDamper(2f);
            rigidbody_.setRotateDamper(2f);
            target_position_.x = MyRandom.Range(-20f, 20);
            target_position_.y = MyRandom.Range(-20f, 20);
            rigidbody_.addForceZ(40f);
            yield return null;
            // for (var i = Utility.WaitForSeconds(10f, update_time_); i.MoveNext();) {
            for (var i = new Utility.WaitForSeconds(10f, update_time_); !i.end(update_time_);) {
            rigidbody_.addForceX(target_position_.x - rigidbody_.transform_.position_.x * 2f);
            rigidbody_.addForceY(target_position_.y - rigidbody_.transform_.position_.y * 2f);
            rigidbody_.addForceZ(10f);
            rigidbody_.addTorqueZ(-rigidbody_.velocity_.x * 1f);

            if (MyRandom.ProbabilityForSecond(1.5f, SystemManager.Instance.getDT())) {
                var pos = Player.Instance.rigidbody_.transform_.position_;
                pos.z += MyRandom.Range(-10f, 10f);
                EnemyBullet.create(ref rigidbody_.transform_.position_,
                                   ref pos,
                                   50f /* speed */,
                                   update_time_);
            }

            if (phase_ == Phase.Dying) {
                // for (var j = Utility.WaitForSeconds(0.1f, update_time_); j.MoveNext();) {
                for (var j = new Utility.WaitForSeconds(0.1f, update_time_); j.end(update_time_);) {
                    yield return null;
                }
                break;
            }

            yield return null;
            }
            destroy();
        }
Example #12
0
        private IEnumerator unitychan_act()
        {
            float wait_sec;
            for (;;) {
            wait_sec = MyRandom.Range(5f, 15f);
            for (var i = new Utility.WaitForSeconds(wait_sec, update_time_); !i.end(update_time_);) {
                yield return null;
            }
            unitychan_height_ratio_ = 4f/128f;
            for (unitychan_width_ratio_ = 0f;
                 unitychan_width_ratio_ < 1f;
                 unitychan_width_ratio_ += 8f * current_dt_) {
                yield return null;
            }
            unitychan_width_ratio_ = 1f;

            for (;
                 unitychan_height_ratio_ < 1f;
                 unitychan_height_ratio_ += 8f * current_dt_) {
                yield return null;
            }
            unitychan_height_ratio_ = 1f;

            DrawBuffer.SE voice = DrawBuffer.SE.VoiceIkuyo;
            switch (MyRandom.Range(0, 5)) {
                case 0:
                    voice = DrawBuffer.SE.VoiceIkuyo;
                    unitychan_kind_ = MySprite.Kind.UnityChanLaugh;
                    break;
                case 1:
                    voice = DrawBuffer.SE.VoiceUwaa;
                    unitychan_kind_ = MySprite.Kind.UnityChanOuch;
                    break;
                case 2:
                    voice = DrawBuffer.SE.VoiceSorosoro;
                    unitychan_kind_ = MySprite.Kind.UnityChanLaugh;
                    break;
                case 3:
                    voice = DrawBuffer.SE.VoiceOtoto;
                    unitychan_kind_ = MySprite.Kind.UnityChanGrin;
                    break;
                case 4:
                    voice = DrawBuffer.SE.VoiceYoshi;
                    unitychan_kind_ = MySprite.Kind.UnityChanGrin;
                    break;
            }
            SystemManager.Instance.registSound(voice);
            wait_sec = MyRandom.Range(2f, 3f);
            for (var i = new Utility.WaitForSeconds(wait_sec, update_time_); !i.end(update_time_);) {
                yield return null;
            }

            for (;
                 unitychan_height_ratio_ > 4f/128f;
                 unitychan_height_ratio_ -= 8f * current_dt_) {
                yield return null;
            }
            unitychan_height_ratio_ = 4f/128f;
            for (;
                 unitychan_width_ratio_ > 0f;
                 unitychan_width_ratio_ -= 8f * current_dt_) {
                yield return null;
            }
            unitychan_width_ratio_ = 0f;
            }
        }
Example #13
0
        private IEnumerator unitychan_act()
        {
            float wait_sec;

            for (;;)
            {
                wait_sec = MyRandom.Range(5f, 15f);
                for (var i = new Utility.WaitForSeconds(wait_sec, update_time_); !i.end(update_time_);)
                {
                    yield return(null);
                }
                unitychan_height_ratio_ = 4f / 128f;
                for (unitychan_width_ratio_ = 0f;
                     unitychan_width_ratio_ < 1f;
                     unitychan_width_ratio_ += 8f * current_dt_)
                {
                    yield return(null);
                }
                unitychan_width_ratio_ = 1f;

                for (;
                     unitychan_height_ratio_ < 1f;
                     unitychan_height_ratio_ += 8f * current_dt_)
                {
                    yield return(null);
                }
                unitychan_height_ratio_ = 1f;

                DrawBuffer.SE voice = DrawBuffer.SE.VoiceIkuyo;
                switch (MyRandom.Range(0, 5))
                {
                case 0:
                    voice           = DrawBuffer.SE.VoiceIkuyo;
                    unitychan_kind_ = MySprite.Kind.UnityChanLaugh;
                    break;

                case 1:
                    voice           = DrawBuffer.SE.VoiceUwaa;
                    unitychan_kind_ = MySprite.Kind.UnityChanOuch;
                    break;

                case 2:
                    voice           = DrawBuffer.SE.VoiceSorosoro;
                    unitychan_kind_ = MySprite.Kind.UnityChanLaugh;
                    break;

                case 3:
                    voice           = DrawBuffer.SE.VoiceOtoto;
                    unitychan_kind_ = MySprite.Kind.UnityChanGrin;
                    break;

                case 4:
                    voice           = DrawBuffer.SE.VoiceYoshi;
                    unitychan_kind_ = MySprite.Kind.UnityChanGrin;
                    break;
                }
                SystemManager.Instance.registSound(voice);
                wait_sec = MyRandom.Range(2f, 3f);
                for (var i = new Utility.WaitForSeconds(wait_sec, update_time_); !i.end(update_time_);)
                {
                    yield return(null);
                }

                for (;
                     unitychan_height_ratio_ > 4f / 128f;
                     unitychan_height_ratio_ -= 8f * current_dt_)
                {
                    yield return(null);
                }
                unitychan_height_ratio_ = 4f / 128f;
                for (;
                     unitychan_width_ratio_ > 0f;
                     unitychan_width_ratio_ -= 8f * current_dt_)
                {
                    yield return(null);
                }
                unitychan_width_ratio_ = 0f;
            }
        }
Example #14
0
        public IEnumerator dragon_act()
        {
            double charge_start = update_time_;

            rigidbody_.setDamper(2f);
            while (dragon_.mode_ == Dragon.Mode.Attack)
            {
                // for (var i = new Utility.WaitForSeconds(30f, update_time_); !i.end(update_time_);) {
                {
                    {
                        var target = Player.Instance.rigidbody_.transform_.position_ + new Vector3(0f, 0f, 20f);
                        limit_target(ref target, 4f);
                        rigidbody_.addTargetTorque(ref target, 50f /* torque_level */, -1f /* max_level */);
                        rigidbody_.addForwardForce(40f);
                        rigidbody_.addLocalTorqueZ(60f);
                    }
                    if (update_time_ - charge_start < 4f)
                    {
                        dragon_.is_charging_ = true;
                    }
                    else
                    {
                        // dragon_.is_charging_ = false;
                        double fired_time = 0;
                        for (var w = new Utility.WaitForSeconds(4f, update_time_); !w.end(update_time_);)
                        {
                            var target = Player.Instance.rigidbody_.transform_.position_;
                            rigidbody_.addTargetTorque(ref target, 50f /* torque_level */, -1f /* max_level */);
                            if (update_time_ - fired_time > 0.2f)
                            {
                                var muzzle_pos = rigidbody_.transform_.transformPosition(ref MUZZLE_OFFSET);
                                SystemManager.Instance.registSound(DrawBuffer.SE.Missile);
                                EnemyBullet.create(ref muzzle_pos,
                                                   ref rigidbody_.transform_.rotation_,
                                                   50f /* speed */,
                                                   2f /* width */,
                                                   20f /* length */,
                                                   update_time_);
                                fired_time = update_time_;
                            }
                            yield return(null);
                        }
                        charge_start = update_time_;
                    }
                    yield return(null);
                }

                yield return(null);
            }

            for (var i = new Utility.WaitForSeconds(2f, update_time_); !i.end(update_time_);)
            {
                rigidbody_.addOrientTorque(ref CV.Vector3Forward, 50f /* torque_level */);
                rigidbody_.addLocalTorqueZ(60f);
                rigidbody_.addSpringForceZ(-9f, 0.5f /* ratio */);
                yield return(null);
            }
            rigidbody_.setDamper(8f);
            {
                double back_and_force_time = update_time_ + 5f;
                double fire_time           = update_time_ + 1f;
                while (dragon_.mode_ == Dragon.Mode.Chase)
                {
                    rigidbody_.addOrientTorque(ref CV.Vector3Forward, 50f /* torque_level */);
                    float phase = Mathf.Repeat((float)update_time_ * 1f, Mathf.PI * 2f);
                    rigidbody_.addLocalTorqueZ(-7f);
                    rigidbody_.addSpringForceXY(Mathf.Cos(phase) * 8f,
                                                Mathf.Sin(phase) * 8f,
                                                8f /* ratio */);
                    float target_z = -5f;
                    if (update_time_ - back_and_force_time > 0f)
                    {
                        float p = -40f + Mathf.PerlinNoise(Mathf.Repeat((float)update_time_ * 0.1f, 1f), 0f) * 120f;
                        target_z += p;
                    }
                    rigidbody_.addSpringForceZ(target_z, 20f /* ratio */);
                    if (update_time_ - fire_time > 0f)
                    {
                        if (Player.Instance.rigidbody_.transform_.position_.z >
                            rigidbody_.transform_.position_.z)
                        {
                            SystemManager.Instance.registSound(DrawBuffer.SE.Missile);
                            var muzzle_pos = rigidbody_.transform_.transformPosition(ref MUZZLE_OFFSET);
                            EnemyBullet.create(ref muzzle_pos,
                                               ref CV.QuaternionIdentity,
                                               50f /* speed */,
                                               2f /* width */,
                                               20f /* length */,
                                               update_time_);
                        }
                        fire_time = update_time_ + 0.2f + Mathf.PerlinNoise(Mathf.Repeat((float)update_time_, 1f), 0f) * 0.5f;
                    }

                    dragon_.addTubeTorque(1f /* power */);

                    yield return(null);
                }
            }
            while (dragon_.mode_ == Dragon.Mode.Farewell)
            {
                rigidbody_.addForceZ(-100f);
                yield return(null);
            }
            {
                for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
                var pos = Player.Instance.rigidbody_.transform_.position_ + new Vector3(0f, 20f, 10f);
                var rot = Quaternion.Euler(90f, 0f, 0f);
                reset(ref pos, ref rot);
                yield return(null);

                for (var w = new Utility.WaitForSeconds(0.5f, update_time_); !w.end(update_time_);)
                {
                    rigidbody_.addForwardForce(100f /* force */);
                    rigidbody_.addLocalTorqueZ(10f);
                    yield return(null);
                }
                SystemManager.Instance.registBgm(DrawBuffer.BGM.Stop);
                SystemManager.Instance.setBulletTime(true);
                for (var w = new Utility.WaitForSeconds(0.5f, update_time_); !w.end(update_time_);)
                {
                    rigidbody_.addForwardForce(100f /* force */);
                    rigidbody_.addLocalTorqueZ(10f);
                    yield return(null);
                }
                for (var w = new Utility.WaitForSeconds(3f, update_time_); !w.end(update_time_);)
                {
                    var target = new Vector3(0f, 0f, 15f + Player.Instance.rigidbody_.transform_.position_.z);
                    rigidbody_.addTargetTorque(ref target, 25f /* torque_level */, -1f /* max_level */);
                    rigidbody_.addLocalTorqueZ(-40f);
                    rigidbody_.addForwardForce(200f /* force */);
                    yield return(null);
                }
                SystemManager.Instance.setBulletTime(false);
                for (var w = new Utility.WaitForSeconds(30f, update_time_); !w.end(update_time_);)
                {
                    rigidbody_.addForwardForce(100f /* force */);
                    rigidbody_.addForceZ(-300f /* force */);
                    yield return(null);
                }
            }
            for (;;)
            {
                yield return(null);
            }
        }
Example #15
0
        private IEnumerator act()
        {
            game_phase_ = GamePhase.Title;
            Player.Instance.setPhaseTitle();
            Player.Instance.setPositionXY(0f, -27f);
            SystemManager.Instance.registBgm(DrawBuffer.BGM.Stop);
            SystemManager.Instance.registMotion(DrawBuffer.Motion.Play);
            SystemManager.Instance.setFlowSpeed(0f);
            SystemManager.Instance.setSubjective(true);

            for (var w = new Utility.WaitForSeconds(4f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Notice notice;
            {
                notice = Notice.create(-400f, 400f,
                                       MySprite.Kind.GamePadPress,
                                       MySprite.Type.Full,
                                       false /* blink */);
            }
            var leave_time_start = update_time_;

            while (game_phase_ == GamePhase.Title)
            {
                bool exit_title   = false;
                var  elapsed_time = update_time_ - leave_time_start;
                if (InputManager.Instance.getButton(InputManager.Button.Fire) > 0)
                {
                    exit_title = true;
                    replay_manager_.startRecording(update_time_);
                    replay_mode_ = false;
                }
                else
                {
                    if (replay_manager_.hasRecorded())
                    {
                        bool start_replay = false;
                        if (replay_mode_)
                        {
                            if (elapsed_time > 1f)
                            {
                                start_replay = true;
                            }
                        }
                        else
                        {
                            if (elapsed_time > 30f)
                            {
                                start_replay = true;
                                replay_mode_ = true;
                            }
                        }
                        if (start_replay)
                        {
                            exit_title = true;
                            SystemManager.Instance.setSubjective(false);
                            replay_manager_.startPlaying(update_time_, Player.Instance);
                        }
                    }
                }
                if (exit_title)
                {
                    game_phase_ = GamePhase.Game;
                    SystemManager.Instance.registSound(DrawBuffer.SE.Missile);
                    SystemManager.Instance.registMotion(DrawBuffer.Motion.GoodLuck);
                }
                yield return(null);
            }
            notice.destroy();
            MyRandom.setSeed(123456789u);

            for (var w = new Utility.WaitForSeconds(1.5f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Player.Instance.setPhaseStart();
            SystemManager.Instance.registBgm(DrawBuffer.BGM.Battle);
            for (var w = new Utility.WaitForSeconds(4f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Notice.create(0f, 0f,
                          update_time_ + 3f,
                          MySprite.Kind.GamePadPress,
                          MySprite.Type.Full,
                          true /* blink */);
            for (var w = new Utility.WaitForSeconds(1f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }

            Player.Instance.setPhaseBattle();
            SystemManager.Instance.setFlowSpeed(-100f);
            while (TubeScroller.Instance.getDistance() < 100f)
            {
                yield return(null);
            }

            for (var j = 0; j < 4; ++j)
            {
                for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
                for (var i = 0; i < 4; ++i)
                {
                    for (var w = new Utility.WaitForSeconds(0.5f, update_time_); !w.end(update_time_);)
                    {
                        yield return(null);
                    }
                    Enemy.create(Enemy.Type.Zako2);
                }

                if (j == 1)
                {
                    Notice.create(-200f, 200f,
                                  update_time_ + 3f,
                                  MySprite.Kind.GamePadRelease,
                                  MySprite.Type.Full,
                                  true /* blink */);
                }
            }

            while (TubeScroller.Instance.getDistance() < 2400f)
            {
                yield return(null);
            }

            Enemy dragon = Enemy.create(Enemy.Type.Dragon);

            SystemManager.Instance.setFlowSpeed(-10f);

            while (TubeScroller.Instance.getDistance() < 2800f)
            {
                for (var w = new Utility.WaitForSeconds(5f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
                for (var j = new Utility.WaitForSeconds(2f, update_time_); !j.end(update_time_);)
                {
                    yield return(null);

                    Enemy.create(Enemy.Type.Zako2);
                    for (var w = new Utility.WaitForSeconds(0.25f, update_time_); !w.end(update_time_);)
                    {
                        yield return(null);
                    }
                }
                yield return(null);
            }

            float flow_speed = 150f;

            SystemManager.Instance.setFlowSpeed(-150f);
            dragon.setMode(Dragon.Mode.Chase);

            for (var i = 0; i < 4; ++i)
            {
                for (var v = new Utility.WaitForSeconds(3f, update_time_); !v.end(update_time_);)
                {
                    Enemy.create(Enemy.Type.Zako2);
                    for (var w = new Utility.WaitForSeconds(0.5f, update_time_); !w.end(update_time_);)
                    {
                        yield return(null);
                    }
                }
                for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
            }

            for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            dragon.setMode(Dragon.Mode.Farewell);
            for (var i = 0; i < 16; ++i)
            {
                float rot = 30f * i;
                Shutter.create(rot, flow_speed, update_time_);
                Shutter.create(rot + 180f, flow_speed, update_time_);
                for (var w = new Utility.WaitForSeconds(1f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
            }
            while (TubeScroller.Instance.getDistance() < 9400f)
            {
                yield return(null);
            }

            dragon.setMode(Dragon.Mode.LastAttack);
            for (var w = new Utility.WaitForSeconds(11f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Notice.create(0f, 0f,
                          update_time_ + 6f,
                          MySprite.Kind.Logo,
                          MySprite.Type.Full,
                          false);
            for (var w = new Utility.WaitForSeconds(5f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }

            SystemManager.Instance.restart();
        }
Example #16
0
 private IEnumerator fetch_auto()
 {
     for (;;)
     {
         for (var w = new Utility.WaitForSeconds(MyRandom.Range(2f, 4f), update_time_);
              !w.end(update_time_);)
         {
             if (latest_.horizontal_ < 0f)
             {
                 for (var w0 = new Utility.WaitForSeconds(MyRandom.Range(0.1f, 1f), update_time_);
                      !w0.end(update_time_);)
                 {
                     latest_.left_button_ = true;
                     yield return(null);
                 }
             }
             else
             {
                 for (var w0 = new Utility.WaitForSeconds(MyRandom.Range(0.1f, 1f), update_time_);
                      !w0.end(update_time_);)
                 {
                     latest_.right_button_ = true;
                     yield return(null);
                 }
             }
             for (var w0 = new Utility.WaitForSeconds(MyRandom.Range(0.1f, 0.6f), update_time_);
                  !w0.end(update_time_);)
             {
                 yield return(null);
             }
             yield return(null);
         }
         if (MyRandom.Probability(0.5f))
         {
             for (var w = new Utility.WaitForSeconds(MyRandom.Range(0.8f, 1.2f), update_time_);
                  !w.end(update_time_);)
             {
                 latest_.jump_button_ = true;
                 yield return(null);
             }
         }
         if (MyRandom.Probability(0.1f))
         {
             for (var w = new Utility.WaitForSeconds(MyRandom.Range(3f, 4f), update_time_);
                  !w.end(update_time_);)
             {
                 for (var w0 = new Utility.WaitForSeconds(MyRandom.Range(0.2f, 0.4f), update_time_);
                      !w0.end(update_time_);)
                 {
                     latest_.left_button_ = true;
                     yield return(null);
                 }
                 for (var w0 = new Utility.WaitForSeconds(MyRandom.Range(0.2f, 0.4f), update_time_);
                      !w0.end(update_time_);)
                 {
                     latest_.right_button_ = true;
                     yield return(null);
                 }
                 yield return(null);
             }
         }
         for (var w = new Utility.WaitForSeconds(MyRandom.Range(0.2f, 0.8f), update_time_);
              !w.end(update_time_);)
         {
             yield return(null);
         }
         yield return(null);
     }
 }