From f4da9c8cb29b713ce4db1648edd3703fb03695c2 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 17 Feb 2025 19:34:36 -0800 Subject: [PATCH] add enemy count generator --- src/Main.cc | 12 +++++++++--- tests/{load-maps.test.sh => check-supermaps.test.sh} | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) rename tests/{load-maps.test.sh => check-supermaps.test.sh} (63%) diff --git a/src/Main.cc b/src/Main.cc index 4a0b4b58..624d18c0 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -2625,8 +2625,14 @@ Action a_show_battle_params( s->battle_params->get_table(true, Episode::EP4).print(stdout); }); -Action a_load_maps_test( - "load-maps-test", nullptr, +[](phosg::Arguments& args) { +Action a_check_supermaps( + "check-supermaps", "\ + check-supermaps [--disassemble] [--generate-enemy-stats]\n\ + Checks the supermaps for all free-play areas and quests. If --disassemble\n\ + is given, saves the contents of each supermap to text files in the current\n\ + directory. If --generate-enemy-stats is given, saves tables of enemy\n\ + counts for each quest to text files in the current directory.\n", + +[](phosg::Arguments& args) { bool save_disassembly = args.get("disassemble"); bool generate_enemy_stats = args.get("generate-enemy-stats"); @@ -2727,7 +2733,7 @@ Action a_load_maps_test( string filename = phosg::string_printf("supermap_quest_%" PRIu32 "_%08" PRIX32 "_enemy_counts.txt", it.first, random_seed); auto f = phosg::fopen_unique(filename, "wt"); fprintf(f.get(), "QUEST %" PRIu32 " (%s)\n", it.first, it.second->name.c_str()); - fprintf(f.get(), "ENEMY--------------- DCNTE 11/2K DC-V1 DC-V2 PCNTE PC-V2 GCNTE GC-V3 XB-V3 BB-V4\n"); + fprintf(f.get(), "ENEMY--------------- DCNTE 11/2K DC-V1 DC-V2 PCNTE PC-V2 GCNTE GC-V3 XB-V3 BB-V4\n"); for (size_t type_ss = 0; type_ss < static_cast(EnemyType::MAX_ENEMY_TYPE); type_ss++) { EnemyType type = static_cast(type_ss); bool any_count_nonzero = false; diff --git a/tests/load-maps.test.sh b/tests/check-supermaps.test.sh similarity index 63% rename from tests/load-maps.test.sh rename to tests/check-supermaps.test.sh index 50b5496d..625d9a6d 100755 --- a/tests/load-maps.test.sh +++ b/tests/check-supermaps.test.sh @@ -7,4 +7,4 @@ if [ -z "$EXECUTABLE" ]; then EXECUTABLE="./newserv" fi -$EXECUTABLE --config=tests/config.json load-maps-test +$EXECUTABLE --config=tests/config.json check-supermaps