Exemple #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);
                }
            }
        }
Exemple #2
0
 public Enemy_鍵山雛_Tama_02(double x, double y, double rad, double radZure, EnemyCommon.TAMA_COLOR_e color)
     : base(x, y, Kind_e.TAMA, 0, 0)
 {
     this.Rad     = rad;
     this.RadZure = radZure;
     this.Color   = color;
 }
Exemple #3
0
        protected override IEnumerable <bool> E_Draw()
        {
            double a_mahoujin = 0.0;

            for (int frame = 0; ; frame++)
            {
                {
                    double rad = frame / 70.0;

                    DDUtils.Approach(ref this.X, GameConsts.FIELD_W / 2 + Math.Sin(rad) * 180.0, 0.93);
                    DDUtils.Approach(ref this.Y, GameConsts.FIELD_H / 7 + Math.Cos(rad) * 50.0, 0.93);
                }

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

                        EnemyCommon.TAMA_COLOR_e color = new EnemyCommon.TAMA_COLOR_e[]
                        {
                            EnemyCommon.TAMA_COLOR_e.CYAN,
                            EnemyCommon.TAMA_COLOR_e.YELLOW,
                            EnemyCommon.TAMA_COLOR_e.PURPLE,
                        }
                        [c];

                        Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_01(this.X + pt.X, this.Y + pt.Y, rad + Math.PI / 2.0, color));
                        Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_01(this.X + pt.X, this.Y + pt.Y, rad - Math.PI / 2.0, color));
                    }
                }

                {
                    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);
            }
        }
Exemple #4
0
        public Enemy_Tama_01(double x, double y, EnemyCommon.TAMA_KIND_e tamaKind, EnemyCommon.TAMA_COLOR_e tamaColor, double speed, double angle, int absorbableWeapon = -1)
            : base(x, y, Kind_e.TAMA, 0, 0, absorbableWeapon)
        {
            // x
            // y
            // tamaKind
            // tamaColor
            if (speed < 0.1 || 100.0 < speed)
            {
                throw new DDError();
            }
            if (angle < -3.0 * Math.PI || 3.0 * Math.PI < angle)
            {
                throw new DDError();
            }

            this.TamaKind  = tamaKind;
            this.TamaColor = tamaColor;
            this.Speed     = speed;
            this.Angle     = angle;
        }
Exemple #5
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 0; ; frame++)
            {
                if (DDUtils.IsOut(new D2Point(this.X, this.Y), new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H)))
                {
                    break;
                }

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

                DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y);
                DDDraw.DrawEnd();

                Game.I.EL_AfterDrawWalls.Add(SCommon.Supplier(this.E_魔法陣_1(this.X, this.Y)));

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

                yield return(true);
            }

            Game.I.EL_AfterDrawWalls.Add(SCommon.Supplier(this.E_魔法陣_V(this.X, this.Y)));

            {
                const double SPEED = 3.0;

                if (this.X < 0.0)                 // ? フィールド左側に衝突
                {
                    this.Speed = new D2Point(SPEED, 0.0);
                    this.Color = EnemyCommon.TAMA_COLOR_e.YELLOW;
                }
                else if (GameConsts.FIELD_W < this.X)                 // ? フィールド右側に衝突
                {
                    this.Speed = new D2Point(-SPEED, 0.0);
                    this.Color = EnemyCommon.TAMA_COLOR_e.YELLOW;
                }
                else if (this.Y < 0.0)                 // ? フィールド上側に衝突
                {
                    this.Speed = new D2Point(0.0, SPEED);
                    this.Color = EnemyCommon.TAMA_COLOR_e.ORANGE;
                }
                else                 // ? フィールド下側に衝突
                {
                    this.Speed = new D2Point(0.0, -SPEED);
                    this.Color = EnemyCommon.TAMA_COLOR_e.ORANGE;
                }
            }

            for (int frame = 0; ; frame++)
            {
                this.X += this.Speed.X;
                this.Y += this.Speed.Y;

#if true
                // 他の敵弾より上に(後に)描画する。
                // -- 見えやすいように
                //
                Game.I.EnemyEffects.Add(() =>
                {
                    DDDraw.DrawCenter(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y);
                    return(false);
                });
#else // old
                DDDraw.DrawCenter(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y);
#endif

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

                yield return(!EnemyCommon.IsEvacuated(this));
            }
        }
Exemple #6
0
 public Enemy_鍵山雛_Tama_03(double x, double y, double rad, EnemyCommon.TAMA_COLOR_e color)
     : base(x, y, Kind_e.TAMA, 0, 0)
 {
     this.Speed = DDUtils.AngleToPoint(rad, 1.0);
     this.Color = color;
 }
Exemple #7
0
 public static DDPicture GetTamaPicture(EnemyCommon.TAMA_KIND_e kind, EnemyCommon.TAMA_COLOR_e color)
 {
     return(Ground.I.Picture2.D_TAMA_00[(int)kind][(int)color]);
 }
Exemple #8
0
 public Enemy_ルーミア_Tama_03(double x, double y, double rad, EnemyCommon.TAMA_COLOR_e color, int absorbableWeapon = -1)
     : base(x, y, Kind_e.TAMA, 0, 0, absorbableWeapon)
 {
     this.Speed = DDUtils.AngleToPoint(rad, 6.0);
     this.Color = color;
 }