public BowserDead(BowserObject context) : base(context) { Context.IsDead = true; Context.PointValue = 0; Context.BoundingBox = null; Context.Gravity = false; Context.Sprite = DeadEnemySpriteFactory.Create(EnemyType.Bowser); }
public BowserAlive(BowserObject context) : base(context) { if (Context.Orientation == Facing.Right) { Context.Velocity = new Vector2(1f, Context.Velocity.Y); } else if (Context.Orientation == Facing.Left) { Context.Velocity = new Vector2(-1f, Context.Velocity.Y); } Context.Sprite = MovingEnemySpriteFactory.Create(EnemyType.BowserIdle); }
public BowserWalk(BowserObject context) : base(context) { Action = BowserAction.Walk; }
protected BowserActionState(BowserObject context) { random = new Byte[1]; Context = context; }
public void TriggerPlayerKilledBowserEvent(BowserObject bowser, Mario player) { PlayerKilledBowserEventArgs args = new PlayerKilledBowserEventArgs(bowser, player); OnRaisePlayerKilledBowserEvent(args); }
public void TriggerCannonEvent(BowserObject boss) { CannonEventArgs args = new CannonEventArgs(boss); OnRaiseCannonEvent(args); }
public BowserIdle(BowserObject context) : base(context) { Action = BowserAction.Idle; Context.Velocity = Vector2.Zero; }
public virtual bool CollisionResponse(AbstractGameObject gameObject, Side side, GameTime gameTime) { if (gameObject is AbstractEnemy && !((AbstractEnemy)gameObject).IsDead) { if (side == Side.Bottom) { if (gameObject is PiranhaObject) { TakeDamage(gameObject); } else if (gameObject is BowserObject) { if (Context.Velocity.X > 0) { Context.Velocity = new Vector2(Context.Velocity.X + 2, -7); } else if (Context.Velocity.X < 0) { Context.Velocity = new Vector2(Context.Velocity.X - 2, -7); } else { Context.Velocity = new Vector2(-5, -7); } float whereOnHitBox = Math.Abs(Context.Position.X - gameObject.Position.X); if (whereOnHitBox > 250 && gameObject.Orientation is Facing.Left || whereOnHitBox < 600 && gameObject.Orientation is Facing.Right) { TakeDamage(gameObject); } } else { Context.Velocity = new Vector2(Context.Velocity.X, -7); } } else { if (gameObject is BowserObject) { BowserObject boss = (BowserObject)gameObject; if (!(boss.PowerupStateBowser is BowserInvincibility)) { TakeDamage(gameObject); } } else { TakeDamage(gameObject); } } return(true); } else if (gameObject is AbstractBlock) { if (side == Side.Bottom && gameObject.Velocity.Y < 0) { if (!ReferenceEquals(((AbstractBlock)gameObject).Bumper, Context)) { TakeDamage(((AbstractBlock)gameObject).Bumper); } } } else if (gameObject is Mario) { Mario temp = (Mario)gameObject; if (side == Side.Top) { if (temp.ActionState is MarioFall2 && !Context.IsGroundDash) { TakeDamage(gameObject); } } else if (side == Side.Bottom && !((temp.PowerupState is MarioInvincibility2) || temp.PowerupState is MarioDead2)) { if (!(Context.ActionState is MarioJump2)) { Context.Velocity = new Vector2(Context.Velocity.X, -7); } } } else if ((gameObject is FireBall && !ReferenceEquals(((FireBall)gameObject).Owner, Context)) && !Context.IsGroundDash) { TakeDamage(((FireBall)gameObject).Owner); } else if (gameObject is BigFireBall && !Context.IsGroundDash) { TakeDamage(((BigFireBall)gameObject).Owner); } else if (gameObject is CannonFireBall && !Context.IsGroundDash) { TakeDamage(((CannonFireBall)gameObject).Owner); } else if (gameObject is RedMushroomObject) { BecomeSuper(); return(true); } else if (gameObject is FireFlowerObject) { BecomeFire(); return(true); } return(false); }
protected BowserPowerupState(BowserObject context) { Context = context; }
public BowserFireBreathing(BowserObject context) : base(context) { Action = BowserAction.BreatheFire; Context.Velocity = Vector2.Zero; }
public BowserInvincibility(BowserObject context) : base(context) { Powerup = BowserPowerup.Invincible; Context.SpriteTint = new Color(Color.White, 100); }