protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { if (DDInput.A.GetInput() == 1) // ? ジャンプ押下 { break; } int koma = frame; //int koma = frame / 2; //int koma = frame / 3; koma += 2; // 最初の2コマを飛ばす。 if (6 <= koma) // koma == 6 以降は(1コマ/2フレーム) { koma -= 6; koma /= 2; koma += 6; } if (8 <= koma) { koma -= 2; // koma == 6, 7 の 2 回目 } if (8 <= koma) { koma -= 2; // koma == 6, 7 の 3 回目 } if (8 <= koma) { koma -= 2; // koma == 6, 7 の 4 回目 } if (Ground.I.Picture2.Tewi_ジャンプ強攻撃.Length <= koma) { break; } double x = Game.I.Player.X; double y = Game.I.Player.Y; double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; bool facingLeft = Game.I.Player.FacingLeft; if (frame == 0) { // TODO: 当たり判定設定 } AttackCommon.ProcPlayer_移動(); AttackCommon.ProcPlayer_Fall(); AttackCommon.ProcPlayer_側面(); AttackCommon.ProcPlayer_脳天(); if (AttackCommon.ProcPlayer_接地()) { break; } DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture2.Tewi_ジャンプ強攻撃[koma], x - DDGround.ICamera.X, y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { const int SHOOTING_FRAME_MAX = 10; int shootingFrame = 0; // 0 == 無効, 1~ == 射撃モーション (カウントダウン方式) // 梯子の中央に寄せる。 // -- 複数箇所から new Attack_Ladder() されるので、ここでやるのが妥当 Game.I.Player.X = GameCommon.ToTablePoint(new D2Point(Game.I.Player.X, 0.0)).X *GameConsts.TILE_W + GameConsts.TILE_W / 2; for (int frame = 0; ; frame++) { if (AttackCommon.CamSlide()) { goto endPlayer; } if (DDInput.DIR_8.GetInput() == 0 && 1 <= DDInput.A.GetInput()) // ? 上ボタンを離して、ジャンプボタン押下 { if (1 <= DDInput.DIR_2.GetInput()) // ? 下ボタン押下 -> ジャンプしない。 { Game.I.Player.JumpFrame = 0; Game.I.Player.JumpCount = 0; Game.I.Player.YSpeed = 0.0; } else // ? 下ボタンを離している -> ジャンプする。 { Game.I.Player.JumpFrame = 1; Game.I.Player.JumpCount = 1; Game.I.Player.YSpeed = GameConsts.PLAYER_ジャンプ初速度; } // スライディングさせないために滞空状態にする。 // -- 入力猶予を考慮して、大きい値を設定する。 Game.I.Player.AirborneFrame = SCommon.IMAX / 2; break; } if (1 <= DDInput.DIR_4.GetInput()) { Game.I.Player.FacingLeft = true; } if (1 <= DDInput.DIR_6.GetInput()) { Game.I.Player.FacingLeft = false; } // 移動 if (shootingFrame == 0) // 射撃モーション時は移動出来ない。 { const double SPEED = 2.5; const double 加速_RATE = 0.5; bool moved = false; if (1 <= DDInput.DIR_8.GetInput()) { Game.I.Player.Y -= Math.Min(SPEED, DDInput.DIR_8.GetInput() * 加速_RATE); moved = true; } if (1 <= DDInput.DIR_2.GetInput()) { Game.I.Player.Y += Math.Min(SPEED, DDInput.DIR_2.GetInput() * 加速_RATE); moved = true; } if (moved) { // none } } if (1 <= DDInput.B.GetInput()) { if (DDInput.B.GetInput() == 1) { Game.I.Shots.Add(new Shot_Normal( Game.I.Player.X + 34.0 * (Game.I.Player.FacingLeft ? -1 : 1), Game.I.Player.Y - 2.0, Game.I.Player.FacingLeft )); } shootingFrame = SHOOTING_FRAME_MAX; } DDUtils.CountDown(ref shootingFrame); //AttackCommon.ProcPlayer_移動(); //AttackCommon.ProcPlayer_Fall(); //AttackCommon.ProcPlayer_側面(); AttackCommon.ProcPlayer_脳天(); if (AttackCommon.ProcPlayer_接地()) { Game.I.Player.JumpFrame = 0; Game.I.Player.JumpCount = 0; Game.I.Player.YSpeed = 0.0; break; } // ? 梯子の下に出た。 if ( Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(Game.I.Player.X, Game.I.Player.Y + GameConsts.TILE_H * 0))).Tile.GetKind() != Tile.Kind_e.LADDER && Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(Game.I.Player.X, Game.I.Player.Y + GameConsts.TILE_H * 1))).Tile.GetKind() != Tile.Kind_e.LADDER ) { Game.I.Player.JumpFrame = 0; Game.I.Player.JumpCount = 0; Game.I.Player.YSpeed = 0.0; break; } endPlayer: DDPicture picture; double xZoom; if (1 <= shootingFrame) { picture = Ground.I.Picture.Chara_A01_Climb_Attack; xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; } else { if (Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(Game.I.Player.X, Game.I.Player.Y))).Tile.GetKind() == Tile.Kind_e.LADDER) { picture = Ground.I.Picture.Chara_A01_Climb[(int)Game.I.Player.Y / 20 % 2]; } else { picture = Ground.I.Picture.Chara_A01_Climb_Top; } xZoom = 1.0; } double x = Game.I.Player.X; double y = Game.I.Player.Y; // 整数化 x = (int)x; y = (int)y; DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( picture, x - DDGround.ICamera.X, y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { DDGround.EL.Add(SCommon.Supplier(Effects.スライディング(Game.I.Player.X, Game.I.Player.Y + 20.0))); for (int frame = 0; ; frame++) { if (10 < frame) // ? 最低持続時間経過 { if (AttackCommon.GetPlayer_側面(4) != 3) // ? ここは立ち上がれる場所である。 { if (DDInput.A.GetInput() <= 0 || DDInput.DIR_2.GetInput() <= 0) // ? 下・ジャンプボタン少なくともどちらかを離している。 { break; } } } if (AttackCommon.GetPlayer_側面(2) != 0) // ? 壁に当たっている。 { if (AttackCommon.GetPlayer_側面(4) != 3) // ? ここは立ち上がれる場所である。 { if (DDInput.A.GetInput() == 1) // ? ジャンプボタンを押した。 { break; } } } if (1 <= DDInput.DIR_4.GetInput()) { Game.I.Player.FacingLeft = true; } if (1 <= DDInput.DIR_6.GetInput()) { Game.I.Player.FacingLeft = false; } // 移動 { const double SPEED = 10.0; if (Game.I.Player.FacingLeft) { Game.I.Player.X -= SPEED; } else { Game.I.Player.X += SPEED; } } //AttackCommon.ProcPlayer_移動(); AttackCommon.ProcPlayer_Fall(); AttackCommon.ProcPlayer_側面(2); AttackCommon.ProcPlayer_脳天(); if (!AttackCommon.ProcPlayer_接地()) { //Game.I.Player.AirborneFrame = 1; // 崖の淵に立ってしまわないように滞空状態にする。 Game.I.Player.AirborneFrame = SCommon.IMAX / 2; // ジャンプしてしまわないように十分大きな値を設定する。 break; } double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture.Chara_A01_Sliding, Game.I.Player.X - DDGround.ICamera.X, Game.I.Player.Y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } }