/// Defines the game difficulty levels, matching the original titles.
enum Difficulty {
  baby(0, "CAN I PLAY, DADDY?"),
  easy(0, "DON'T HURT ME."),
  medium(1, "BRING 'EM ON!"),
  hard(2, "I AM DEATH INCARNATE!"),
  ;

  /// Shared heading used by classic difficulty menus.
  static String get menuText => 'HOW TOUGH ARE YOU?';

  /// The friendly string shown in menus.
  final String title;

  /// The numeric level used for map object filtering logic.
  final int level;

  const Difficulty(this.level, this.title);

  /// Applies canonical incoming enemy-damage scaling for this difficulty.
  ///
  /// Wolf3D reduces damage heavily on baby mode (`>> 2`).
  int scaleIncomingEnemyDamage(int rawDamage) {
    if (rawDamage <= 0) return 0;
    if (this != Difficulty.baby) return rawDamage;

    final scaled = rawDamage >> 2;
    return scaled > 0 ? scaled : 1;
  }
}
