diff --git a/apps/wolf_3d_cli/bin/main.dart b/apps/wolf_3d_cli/bin/main.dart index 02eb5e8..0c62b29 100644 --- a/apps/wolf_3d_cli/bin/main.dart +++ b/apps/wolf_3d_cli/bin/main.dart @@ -50,7 +50,7 @@ void main() async { final engine = WolfEngine( data: data, - difficulty: Difficulty.bringEmOn, + difficulty: Difficulty.medium, startingEpisode: 0, audio: cliAudio, input: input, diff --git a/apps/wolf_3d_gui/lib/screens/difficulty_screen.dart b/apps/wolf_3d_gui/lib/screens/difficulty_screen.dart index 57c116e..36d4e06 100644 --- a/apps/wolf_3d_gui/lib/screens/difficulty_screen.dart +++ b/apps/wolf_3d_gui/lib/screens/difficulty_screen.dart @@ -42,7 +42,7 @@ class _DifficultyScreenState extends State { backgroundColor: Colors.black, floatingActionButton: FloatingActionButton( backgroundColor: Colors.red[900], - onPressed: () => _startGame(Difficulty.bringEmOn, showGallery: true), + onPressed: () => _startGame(Difficulty.medium, showGallery: true), child: const Icon(Icons.bug_report, color: Colors.white), ), body: Center( diff --git a/packages/wolf_3d_dart/lib/src/data_types/difficulty.dart b/packages/wolf_3d_dart/lib/src/data_types/difficulty.dart index 3f6fd75..3c00711 100644 --- a/packages/wolf_3d_dart/lib/src/data_types/difficulty.dart +++ b/packages/wolf_3d_dart/lib/src/data_types/difficulty.dart @@ -1,9 +1,9 @@ /// Defines the game difficulty levels, matching the original titles. enum Difficulty { - canIPlayDaddy(0, "Can I play, Daddy?"), - dontHurtMe(0, "Don't hurt me."), - bringEmOn(1, "Bring em' on!"), - iAmDeathIncarnate(2, "I am Death incarnate!"), + baby(0, "Can I play, Daddy?"), + easy(0, "Don't hurt me."), + medium(1, "Bring em' on!"), + hard(2, "I am Death incarnate!"), ; /// The friendly string shown in menus. diff --git a/packages/wolf_3d_dart/lib/src/data_types/map_objects.dart b/packages/wolf_3d_dart/lib/src/data_types/map_objects.dart index d2ea75b..51729c0 100644 --- a/packages/wolf_3d_dart/lib/src/data_types/map_objects.dart +++ b/packages/wolf_3d_dart/lib/src/data_types/map_objects.dart @@ -91,11 +91,11 @@ abstract class MapObject { // --- Enemy Range Constants --- // Every enemy type occupies a block of 36 IDs. // Modulo math is used on these ranges to determine orientation and patrol status. - static const int guardStart = 108; // 108-143 - static const int dogStart = 144; // 144-179 - static const int ssStart = 180; // 180-215 - static const int mutantStart = 216; // 216-251 - static const int officerStart = 252; // 252-287 + static const int guardStart = 108; // Claims 108-115, 144-151, 180-187 + static const int dogStart = 116; // Claims 116-123, 152-159, 188-195 + static const int ssStart = 126; // Claims 126-133, 162-169, 198-205 + static const int mutantStart = 136; // Claims 136-143, 172-179, 208-215 + static const int officerStart = 252; // Claims 252-259, 288-295, 324-331 // --- Missing Decorative Bodies --- static const int deadGuard = 124; // Decorative only in WL1 diff --git a/packages/wolf_3d_dart/lib/src/engine/wolf_3d_engine_base.dart b/packages/wolf_3d_dart/lib/src/engine/wolf_3d_engine_base.dart index 6da0ccb..17ad316 100644 --- a/packages/wolf_3d_dart/lib/src/engine/wolf_3d_engine_base.dart +++ b/packages/wolf_3d_dart/lib/src/engine/wolf_3d_engine_base.dart @@ -220,8 +220,8 @@ class WolfEngine { final double timeScale = delta.inMilliseconds / 16.666; // Apply the timeScale multiplier to ensure consistent speed at any framerate - double moveSpeed = 0.14 * timeScale; - double turnSpeed = 0.10 * timeScale; + final double moveSpeed = 0.10 * timeScale; + final double turnSpeed = 0.08 * timeScale; Coordinate2D movement = const Coordinate2D(0, 0); double dAngle = 0.0; diff --git a/packages/wolf_3d_dart/lib/src/entities/entities/enemies/enemy_type.dart b/packages/wolf_3d_dart/lib/src/entities/entities/enemies/enemy_type.dart index 9c94179..1c48888 100644 --- a/packages/wolf_3d_dart/lib/src/entities/entities/enemies/enemy_type.dart +++ b/packages/wolf_3d_dart/lib/src/entities/entities/enemies/enemy_type.dart @@ -99,12 +99,21 @@ enum EnemyType { /// Identifies an [EnemyType] based on a tile ID from the map's object layer. static EnemyType? fromMapId(int id) { - // Each enemy occupies exactly 48 IDs across 3 states. - if (id >= 108 && id <= 155) return EnemyType.guard; - if (id >= 156 && id <= 203) return EnemyType.dog; - if (id >= 204 && id <= 251) return EnemyType.ss; - if (id >= 252 && id <= 299) return EnemyType.mutant; - if (id >= 300 && id <= 347) return EnemyType.officer; + for (final type in EnemyType.values) { + final data = type.mapData; + + // Check Easy (Base) + if (id >= data.baseId && id < data.baseId + 8) return type; + + // Check Medium (+1 Offset) + int mediumBase = data.baseId + data.tierOffset; + if (id >= mediumBase && id < mediumBase + 8) return type; + + // Check Hard (+2 Offsets) + int hardBase = data.baseId + (data.tierOffset * 2); + if (id >= hardBase && id < hardBase + 8) return type; + } + return null; }