Esempio n. 1
0
        private IEnumerable <bool> E_Attack()
        {
            int waveCount = 0;

            for (; ;)
            {
                for (int c = 0; c < 30; c++)
                {
                    double angle = DDUtils.GetAngle(new D2Point(Game.I.Player.X, Game.I.Player.Y) - new D2Point(this.X, this.Y));
                    double wave  = Math.Sin(waveCount++ / 10.0);

                    EnemyCommon.TAMA_COLOR_e color = (EnemyCommon.TAMA_COLOR_e) this.RandForColor.GetInt(10);
                    int absorbableWeapon           = -1;

                    if (color == EnemyCommon.TAMA_COLOR_e.BLUE)
                    {
                        absorbableWeapon = 3;
                    }

                    Game.I.Enemies.Add(new Enemy_ルーミア_Tama_03(this.X, this.Y, angle + wave * 1.2, color, absorbableWeapon));

                    for (int w = 0; w < 3; w++)
                    {
                        yield return(true);
                    }
                }

                for (int c = 0; c < 150; c++)
                {
                    yield return(true);
                }
            }
        }
Esempio n. 2
0
        protected override IEnumerable <bool> E_Draw()
        {
            double a_mahoujin = 0.0;

            for (int frame = 0; ; frame++)
            {
                DDUtils.Approach(ref this.X, GameConsts.FIELD_W / 2 + Math.Sin(frame / 101.0) * 20.0, 0.993);
                DDUtils.Approach(ref this.Y, GameConsts.FIELD_H / 2 + Math.Sin(frame / 103.0) * 20.0, 0.993);

                if (30 < frame && frame % 3 == 0)
                {
                    for (int c = 0; c < 2; c++)
                    {
                        double  rad = frame / 27.0 + (Math.PI * 2.0) * c / 2.0;
                        D2Point pt  = DDUtils.AngleToPoint(rad, 20.0);

                        Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_02(this.X + pt.X, this.Y + pt.Y, rad, 0.9, EnemyCommon.TAMA_COLOR_e.RED));
                        Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_02(this.X + pt.X, this.Y + pt.Y, rad, 0.0, EnemyCommon.TAMA_COLOR_e.GREEN));
                        Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_02(this.X + pt.X, this.Y + pt.Y, rad, -0.9, EnemyCommon.TAMA_COLOR_e.BLUE));
                    }
                }

                if (30 < frame && frame % 20 == 0)
                {
                    for (int c = 0; c < 3; c++)
                    {
                        double  rad = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) + (Math.PI * 2.0) * (c * 2 + 1) / 6.0;
                        D2Point pt  = DDUtils.AngleToPoint(rad, 50.0);

                        Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_03(this.X, this.Y, rad, EnemyCommon.TAMA_COLOR_e.PINK));
                    }
                }

                {
                    const int TRANS_FRAME = 60;

                    if (frame == TRANS_FRAME)
                    {
                        // ボム消し
                        // このフレームにおけるボム当たり判定は既に展開しているので、ボスの当たり判定を展開する前のフレームで消す。
                        Game.I.Shots.RemoveAll(v => v.Kind == Shot.Kind_e.BOMB);

                        // 念のためリセット
                        //Game.I.BombUsed = false;
                        Game.I.PlayerWasDead = false;
                    }
                    else if (TRANS_FRAME < frame)
                    {
                        DDUtils.Approach(ref a_mahoujin, 1.0, 0.99);
                        this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 25.0);
                    }
                }

                EnemyCommon_鍵山雛.Draw(this.X, this.Y, true, a_mahoujin);
                EnemyCommon_鍵山雛.DrawOther(this);

                yield return(true);
            }
        }
Esempio n. 3
0
        public void Loaded(Tools.D2Point pt)
        {
            this.X = pt.X;
            this.Y = pt.Y;

            D2Point mvPt = DDUtils.AngleToPoint(
                DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y),
                8.0
                );

            this.XAdd = mvPt.X;
            this.YAdd = mvPt.Y;
        }
Esempio n. 4
0
        protected override IEnumerable <bool> E_Draw()
        {
            D2Point speed = DDUtils.AngleToPoint(DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y), 8.0);

            for (; ;)
            {
                this.X += speed.X;
                this.Y += speed.Y;

                DDDraw.DrawCenter(Ground.I.Picture.Tama0001, this.X, this.Y);

                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 16.0);

                yield return(!DDUtils.IsOutOfScreen(new D2Point(this.X, this.Y), 16.0));
            }
        }
Esempio n. 5
0
        public Enemy_Meteor(D2Point pos)
            : base(pos)
        {
            this.Angle = DDUtils.GetAngle(Game.I.Player.X - pos.X, Game.I.Player.Y - pos.Y);
            this.Speed = 0.0;

            {
                int clr = DDUtils.Random.GetInt(192);
                this.Color = new I3Color(255, clr, clr);
            }

            this.Rot       = 0.0;
            this.RotAdd    = 0.0;
            this.RotAddAdd = DDUtils.Random.DReal() * 0.001;

            DDGround.EL.Add(SCommon.Supplier(this.E_出現エフェクト()));
        }
Esempio n. 6
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 0; ; frame++)
            {
                double rot = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y);
                rot += DDUtils.Random.Real() * 0.05;
                D2Point speedAdd = DDUtils.AngleToPoint(rot, 0.1);

                if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 50.0)
                {
                    speedAdd *= -300.0;
                }
                this.Speed += speedAdd;
                this.Speed *= 0.93;

                this.X += this.Speed.X;
                this.Y += this.Speed.Y;

                if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0))
                {
                    {
                        double xZoom = this.Speed.X < 0.0 ? -1.0 : 1.0;

                        DDDraw.DrawBegin(
                            new DDPicture[]
                        {
                            Ground.I.Picture.Enemy_B0001_01,
                            Ground.I.Picture.Enemy_B0001_02,
                            Ground.I.Picture.Enemy_B0001_03,
                            Ground.I.Picture.Enemy_B0001_04,
                        }
                            [frame / 5 % 4],
                            this.X - DDGround.ICamera.X,
                            this.Y - DDGround.ICamera.Y
                            );
                        DDDraw.DrawZoom_X(xZoom);
                        DDDraw.DrawEnd();
                    }

                    // 当たり判定ナシ
                }
                yield return(true);
            }
        }
Esempio n. 7
0
        public bool EachFrame()
        {
            double rot = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y);

            rot += DDUtils.Random.Real2() * 0.05;
            D2Point speedAdd = DDUtils.AngleToPoint(rot, 0.1);

            if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 50.0)
            {
                speedAdd *= -300.0;
            }
            this.Speed += speedAdd;
            this.Speed *= 0.93;

            this.X += this.Speed.X;
            this.Y += this.Speed.Y;

            return(true);
        }
Esempio n. 8
0
        public bool EachFrame()
        {
            this.Frame++;

            if (this.Frame % 20 == 0)
            {
                Game.I.AddEnemy(IEnemies.Load(new Tama0001(), this.X, this.Y));
            }

            D2Point mvPt = DDUtils.AngleToPoint(
                DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y),
                2.5
                );

            this.X += mvPt.X;
            this.Y += mvPt.Y;

            return(DDUtils.IsOutOfScreen(new D2Point(this.X, this.Y), 64.0) == false);
        }
Esempio n. 9
0
        private void P_Draw()
        {
            double rot = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y);

            rot += DDUtils.Random.Real() * 0.05;
            D2Point speedAdd = DDUtils.AngleToPoint(rot, 0.1);

            if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 50.0)
            {
                speedAdd *= -300.0;
            }
            this.Speed += speedAdd;
            this.Speed *= 0.93;

            this.X += this.Speed.X;
            this.Y += this.Speed.Y;

            if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0))
            {
                {
                    double xZoom = this.Speed.X < 0.0 ? -1.0 : 1.0;

                    DDDraw.DrawBegin(
                        new DDPicture[]
                    {
                        Ground.I.Picture.Enemy_B0001_01,
                        Ground.I.Picture.Enemy_B0001_02,
                        Ground.I.Picture.Enemy_B0001_03,
                        Ground.I.Picture.Enemy_B0001_04,
                    }
                        [this.Frame / 5 % 4],
                        this.X - DDGround.ICamera.X,
                        this.Y - DDGround.ICamera.Y
                        );
                    DDDraw.DrawZoom_X(xZoom);
                    DDDraw.DrawEnd();
                }

                // 当たり判定ナシ
            }
            this.Frame++;
        }
Esempio n. 10
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                double rot = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y);
                rot += DDUtils.Random.Real() * 0.05;
                D2Point speedAdd = DDUtils.AngleToPoint(rot, 0.1);
                double  distance = DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y);

                if (distance < 50.0)
                {
                    speedAdd *= -300.0;
                }
                this.Speed += speedAdd;
                this.Speed *= 0.93;

                this.X += this.Speed.X;
                this.Y += this.Speed.Y;

                if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0))
                {
                    DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                    DDDraw.DrawRotate(DDEngine.ProcFrame / 10.0);
                    DDDraw.DrawEnd();

                    DDPrint.SetBorder(new I3Color(64, 64, 0));
                    DDPrint.SetPrint(
                        (int)this.X - DDGround.ICamera.X - 10,
                        (int)this.Y - DDGround.ICamera.Y - 10,
                        20
                        );
                    DDPrint.PrintLine("敵(仮)");
                    DDPrint.PrintLine("[無害]");
                    DDPrint.PrintLine("DIST=" + distance.ToString("F3"));
                    DDPrint.Reset();

                    // 当たり判定ナシ
                }
                yield return(true);
            }
        }
Esempio n. 11
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 1; ; frame++)
            {
                if (frame % 20 == 0)
                {
                    Game.I.Enemies.Add(new Enemy_BTama0001(this.X, this.Y));
                }

                D2Point speed = DDUtils.AngleToPoint(
                    DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y),
                    2.5
                    );

                this.X += speed.X;
                this.Y += speed.Y;

                DDDraw.DrawCenter(Ground.I.Picture.Enemy0002, this.X, this.Y);

                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 64.0);

                yield return(true);                // 自機をホーミングするので、画面外に出て行かない。
            }
        }
Esempio n. 12
0
        protected override IEnumerable <bool> E_Draw()
        {
            double SCALE = LevelToScale(this.Level);
            double R     = SCommon.ToInt(24.0 * SCALE);

            double xAdd = this.FacingLeft ? -1.0 : 1.0;
            double yAdd = Game.I.Player.YSpeed * 0.2;

            DDUtils.MakeXYSpeed(0.0, 0.0, xAdd, yAdd, 20.0 * SCALE, out xAdd, out yAdd);

            for (int frame = 0; ; frame++)
            {
                if (Game.I.Status.Equipment != GameStatus.Equipment_e.ハンマー陰陽玉)                 // 武器を切り替えたら消滅
                {
                    this.Kill();
                    break;
                }
                double xaa;
                double yaa;

                // バネの加速度
                {
                    xaa = (Game.I.Player.X - this.X) * 0.01;
                    yaa = (Game.I.Player.Y - this.Y) * 0.01;
                }

                yaa += 1.0;                 // 重力加速度

                xAdd += xaa;
                yAdd += yaa;

                // 空気抵抗
                {
                    double 空気抵抗 = LevelTo空気抵抗(this.Level);

                    xAdd *= 空気抵抗;
                    yAdd *= 空気抵抗;
                }

                this.X += xAdd;
                this.Y += yAdd;

                DDDraw.DrawBegin(Ground.I.Picture2.陰陽玉, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(R * 2, R * 2);
                DDDraw.DrawRotate(frame / 10.0);
                DDDraw.DrawEnd();

                // プレイヤーとハンマーを繋ぐバネのような何かを描画する。
                {
                    double d = DDUtils.GetDistance(this.X - Game.I.Player.X, this.Y - Game.I.Player.Y);

                    if (10.0 < d)
                    {
                        double x   = (this.X + Game.I.Player.X) / 2.0;
                        double y   = (this.Y + Game.I.Player.Y) / 2.0;
                        double rot = DDUtils.GetAngle(this.X - Game.I.Player.X, this.Y - Game.I.Player.Y) + Math.PI / 2;

                        DDDraw.SetAlpha(0.5);
                        DDDraw.DrawBegin(Ground.I.Picture2.Laser[4], x - DDGround.ICamera.X, y - DDGround.ICamera.Y);
                        DDDraw.DrawSetSize_H(d);
                        DDDraw.DrawRotate(rot);
                        DDDraw.DrawEnd();
                        DDDraw.Reset();
                    }
                }

                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R);

                yield return(true);
            }
        }
Esempio n. 13
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                if (this.TargetEnemy == null || this.TargetEnemy.HP == -1)                 // ? ターゲットしていない || ターゲットが死亡した。
                {
                    this.TargetEnemy = this.FindTargetEnemy();
                }

                if (this.TargetEnemy != null)
                {
                    double targetRot = DDUtils.GetAngle(new D2Point(this.TargetEnemy.X, this.TargetEnemy.Y) - new D2Point(this.X, this.Y));
                    double diffRot   = targetRot - this.Rot;

                    {
                        const double ROT_ADD = 0.3;

                        if (diffRot < -Math.PI || 0.0 < diffRot && diffRot < Math.PI)
                        {
                            this.Rot += ROT_ADD;
                        }
                        else
                        {
                            this.Rot -= ROT_ADD;
                        }
                    }

                    {
                        const double ROT_MAX = Math.PI * 2.0;

                        this.Rot += ROT_MAX;

                        while (ROT_MAX < this.Rot)
                        {
                            this.Rot -= ROT_MAX;
                        }
                    }
                }

                {
                    const double SPEED = 20.0;

                    D2Point movePt = DDUtils.AngleToPoint(this.Rot, SPEED);

                    this.X += movePt.X;
                    this.Y += movePt.Y;
                }

                DDDraw.SetAlpha(ShotConsts.A);
                DDDraw.SetBright(0.0, 1.0, 1.0);
                DDDraw.DrawBegin(Ground.I.Picture2.D_LASER, this.X, this.Y);
                DDDraw.DrawZoom(1.5);
                DDDraw.DrawRotate(this.Rot - Math.PI * 1.5);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                this.Crash = DDCrashUtils.Circle(
                    new D2Point(this.X, this.Y),
                    40.0
                    );

                yield return(!DDUtils.IsOut(new D2Point(this.X, this.Y), new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H), 100.0));
            }
        }