From b0a70fa7ddedc3b315bd48eefdaaca29e85e0f94 Mon Sep 17 00:00:00 2001 From: quellen-sol Date: Fri, 4 Oct 2024 14:59:11 -0600 Subject: [PATCH] Complete rename --- .github/workflows/release.yml | 18 +++++----- Cargo.lock | 26 +++++++------- EXAMPLE.yaml | 4 +-- crates/ap-bot-main/Cargo.toml | 2 +- crates/ap-bot-main/src/main.rs | 2 +- scripts/make-and-gen.sh | 2 +- world/apbot/Errors.py | 2 -- world/archipelapal/Errors.py | 2 ++ world/{apbot => archipelapal}/Items.py | 6 ++-- world/{apbot => archipelapal}/Locations.py | 4 +-- world/{apbot => archipelapal}/Options.py | 2 +- world/{apbot => archipelapal}/__init__.py | 42 +++++++++++----------- world/{apbot => archipelapal}/utils.py | 0 world/make_apworld.sh | 2 +- 14 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 world/apbot/Errors.py create mode 100644 world/archipelapal/Errors.py rename world/{apbot => archipelapal}/Items.py (89%) rename world/{apbot => archipelapal}/Locations.py (88%) rename world/{apbot => archipelapal}/Options.py (97%) rename world/{apbot => archipelapal}/__init__.py (78%) rename world/{apbot => archipelapal}/utils.py (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e36a96..9e604e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,12 +35,12 @@ jobs: - name: Build Linux Binary and Zip run: | cargo build --release --target ${{ env.LINUX_GNU_TARGET }} - zip -j ap-bot-${{ env.LINUX_GNU_TARGET }}-${{ github.ref_name }}.zip ./target/${{ env.LINUX_GNU_TARGET }}/release/ap-bot + zip -j ArchipelaPal-${{ env.LINUX_GNU_TARGET }}-${{ github.ref_name }}.zip ./target/${{ env.LINUX_GNU_TARGET }}/release/ArchipelaPal - name: Build Windows Binary and Zip run: | cargo build --release --target ${{ env.WINDOWS_GNU_TARGET }} - zip -j ap-bot-${{ env.WINDOWS_GNU_TARGET }}-${{ github.ref_name }}.zip ./target/${{ env.WINDOWS_GNU_TARGET }}/release/ap-bot.exe + zip -j ArchipelaPal-${{ env.WINDOWS_GNU_TARGET }}-${{ github.ref_name }}.zip ./target/${{ env.WINDOWS_GNU_TARGET }}/release/ArchipelaPal.exe - name: Create Draft GitHub Release uses: actions/create-release@v1 @@ -49,7 +49,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - release_name: APBot Release ${{ github.ref }} + release_name: ArchipelaPal Release ${{ github.ref }} draft: true prerelease: false @@ -59,8 +59,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./ap-bot-${{ env.LINUX_GNU_TARGET }}-${{ github.ref_name }}.zip - asset_name: ap-bot-${{ env.LINUX_GNU_TARGET }}-${{ github.ref_name }}.zip + asset_path: ./ArchipelaPal-${{ env.LINUX_GNU_TARGET }}-${{ github.ref_name }}.zip + asset_name: ArchipelaPal-${{ env.LINUX_GNU_TARGET }}-${{ github.ref_name }}.zip asset_content_type: application/zip - name: Upload Windows Asset @@ -69,8 +69,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./ap-bot-${{ env.WINDOWS_GNU_TARGET }}-${{ github.ref_name }}.zip - asset_name: ap-bot-${{ env.WINDOWS_GNU_TARGET }}-${{ github.ref_name }}.zip + asset_path: ./ArchipelaPal-${{ env.WINDOWS_GNU_TARGET }}-${{ github.ref_name }}.zip + asset_name: ArchipelaPal-${{ env.WINDOWS_GNU_TARGET }}-${{ github.ref_name }}.zip asset_content_type: application/zip - name: Upload APWorld @@ -79,8 +79,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./world/apbot.apworld - asset_name: apbot.apworld + asset_path: ./world/archipelapal.apworld + asset_name: archipelapal.apworld asset_content_type: application/zip - name: Upload Example YAML diff --git a/Cargo.lock b/Cargo.lock index db74739..aea5759 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,34 +82,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] -name = "ap-bot" +name = "archipelago_rs" version = "0.1.0" dependencies = [ "anyhow", - "archipelago_rs", - "clap", - "dotenvy", - "env_logger", - "log", - "rand", + "futures-util", "serde", "serde_json", + "serde_repr", + "thiserror", "tokio", + "tokio-tungstenite", + "tungstenite", ] [[package]] -name = "archipelago_rs" +name = "archipelapal" version = "0.1.0" dependencies = [ "anyhow", - "futures-util", + "archipelago_rs", + "clap", + "dotenvy", + "env_logger", + "log", + "rand", "serde", "serde_json", - "serde_repr", - "thiserror", "tokio", - "tokio-tungstenite", - "tungstenite", ] [[package]] diff --git a/EXAMPLE.yaml b/EXAMPLE.yaml index ec3f82a..6f9edd1 100644 --- a/EXAMPLE.yaml +++ b/EXAMPLE.yaml @@ -1,8 +1,8 @@ name: ExampleUser -game: APBot +game: ArchipelaPal description: This is an example YAML that genrates between 100-200 chests with 20 goal items, and therefore 80-180 junk items -APBot: +ArchipelaPal: progression_balancing: '50' accessibility: items diff --git a/crates/ap-bot-main/Cargo.toml b/crates/ap-bot-main/Cargo.toml index 10d9d59..f397a44 100644 --- a/crates/ap-bot-main/Cargo.toml +++ b/crates/ap-bot-main/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ap-bot" +name = "archipelapal" version = "0.1.0" edition = "2021" diff --git a/crates/ap-bot-main/src/main.rs b/crates/ap-bot-main/src/main.rs index 80be522..cac21dc 100644 --- a/crates/ap-bot-main/src/main.rs +++ b/crates/ap-bot-main/src/main.rs @@ -36,7 +36,7 @@ struct Args { skip_start_confirmation: bool, } -pub const GAME_NAME: &str = "APBot"; +pub const GAME_NAME: &str = "ArchipelaPal"; pub const ITEM_HANDLING: i32 = 0b111; #[tokio::main] diff --git a/scripts/make-and-gen.sh b/scripts/make-and-gen.sh index 54674be..e1f4f75 100755 --- a/scripts/make-and-gen.sh +++ b/scripts/make-and-gen.sh @@ -6,7 +6,7 @@ START_DIR=$(pwd) cd ../world ./make_apworld.sh -mv apbot.apworld ~/Archipelago/lib/worlds/ +mv archipelapal.apworld ~/Archipelago/lib/worlds/ cd ~/Archipelago/output # Delete ALL files in this directory, except for .zip files diff --git a/world/apbot/Errors.py b/world/apbot/Errors.py deleted file mode 100644 index 72d4167..0000000 --- a/world/apbot/Errors.py +++ /dev/null @@ -1,2 +0,0 @@ -class APBotError(Exception): - pass diff --git a/world/archipelapal/Errors.py b/world/archipelapal/Errors.py new file mode 100644 index 0000000..d886a71 --- /dev/null +++ b/world/archipelapal/Errors.py @@ -0,0 +1,2 @@ +class ArchipelaPalError(Exception): + pass diff --git a/world/apbot/Items.py b/world/archipelapal/Items.py similarity index 89% rename from world/apbot/Items.py rename to world/archipelapal/Items.py index d7ca9ac..bcbbfb9 100644 --- a/world/apbot/Items.py +++ b/world/archipelapal/Items.py @@ -2,7 +2,7 @@ # Junk Item JUNK_CODE_OFFSET = 0x000000 -JUNK_ITEM_NAME = "APBot Junk" +JUNK_ITEM_NAME = "ArchipelaPal Junk" JUNK_ITEM_CODE = JUNK_CODE_OFFSET + 1 # Goal Item @@ -17,8 +17,8 @@ SPEED_BOOST_NAME = "Speed Boost" SPEED_BOOST_CODE = GAME_AFFECTOR_OFFSET + 1 -class APBotItem(Item): - game = "APBot" +class ArchipelaPalItem(Item): + game = "ArchipelaPal" item_names_table = {} diff --git a/world/apbot/Locations.py b/world/archipelapal/Locations.py similarity index 88% rename from world/apbot/Locations.py rename to world/archipelapal/Locations.py index 751253b..9475e9c 100644 --- a/world/apbot/Locations.py +++ b/world/archipelapal/Locations.py @@ -3,8 +3,8 @@ # Chest ID offset CHEST_ITEM_OFFSET = 0x030000 -class APBotLocation(Location): - game = "APBot" +class ArchipelaPalLocation(Location): + game = "ArchipelaPal" loc_table = {} diff --git a/world/apbot/Options.py b/world/archipelapal/Options.py similarity index 97% rename from world/apbot/Options.py rename to world/archipelapal/Options.py index d3d682b..865e1f4 100644 --- a/world/apbot/Options.py +++ b/world/archipelapal/Options.py @@ -58,7 +58,7 @@ class PctSpeedBoosts(Range): @dataclass -class APBotOptions(PerGameCommonOptions): +class ArchipelaPalOptions(PerGameCommonOptions): num_regions: NumRegions min_chests_per_region: MinChestsPerRegion max_chests_per_region: MaxChestsPerRegion diff --git a/world/apbot/__init__.py b/world/archipelapal/__init__.py similarity index 78% rename from world/apbot/__init__.py rename to world/archipelapal/__init__.py index 6b97378..54bd89b 100644 --- a/world/apbot/__init__.py +++ b/world/archipelapal/__init__.py @@ -1,24 +1,24 @@ from BaseClasses import Region, ItemClassification from worlds.AutoWorld import World, WebWorld -from .Errors import APBotError -from .Items import APBotItem, item_names_table, JUNK_ITEM_CODE, JUNK_ITEM_NAME, GOAL_ITEM_OFFSET, GOAL_ITEM_NAME, KEY_ITEM_OFFSET, SPEED_BOOST_NAME, SPEED_BOOST_CODE -from .Locations import APBotLocation, loc_table, CHEST_ITEM_OFFSET -from .Options import APBotOptions +from .Errors import ArchipelaPalError +from .Items import ArchipelaPalItem, item_names_table, JUNK_ITEM_CODE, JUNK_ITEM_NAME, GOAL_ITEM_OFFSET, GOAL_ITEM_NAME, KEY_ITEM_OFFSET, SPEED_BOOST_NAME, SPEED_BOOST_CODE +from .Locations import ArchipelaPalLocation, loc_table, CHEST_ITEM_OFFSET +from .Options import ArchipelaPalOptions from .utils import * -class APBotWeb(WebWorld): +class ArchipelaPalWeb(WebWorld): tutorials = [] theme = "ice" -class APBot(World): +class ArchipelaPal(World): """ An automatic world-playing bot for Archipelago Randomizer """ - game = "APBot" - options_dataclass = APBotOptions - options: APBotOptions - web = APBotWeb() + game = "ArchipelaPal" + options_dataclass = ArchipelaPalOptions + options: ArchipelaPalOptions + web = ArchipelaPalWeb() item_name_to_id = item_names_table location_name_to_id = loc_table @@ -47,13 +47,13 @@ def generate_early(self) -> None: min_expected_chests = num_regions * min_chests_per_region + 1 # +1 for the starting chest if min_chests_per_region > max_chests_per_region: - raise APBotError(f"min_chests_per_region ({min_chests_per_region}) must be less than or equal to max_chests_per_region ({max_chests_per_region})") + raise ArchipelaPalError(f"min_chests_per_region ({min_chests_per_region}) must be less than or equal to max_chests_per_region ({max_chests_per_region})") if min_time > max_time: - raise APBotError(f"min_time_between_checks ({min_time}) must be less than or equal to max_time_between_checks ({max_time})") + raise ArchipelaPalError(f"min_time_between_checks ({min_time}) must be less than or equal to max_time_between_checks ({max_time})") if num_goal_items > min_expected_chests: - raise APBotError(f"num_goal_items ({num_goal_items}) must be less than or equal to the minimum expected number of chests ({min_expected_chests})") + raise ArchipelaPalError(f"num_goal_items ({num_goal_items}) must be less than or equal to the minimum expected number of chests ({min_expected_chests})") itempool = [] @@ -69,7 +69,7 @@ def generate_early(self) -> None: chest_name = f"Hub Chest {real_chest}" chest_code = CHEST_ITEM_OFFSET + real_chest - location = APBotLocation(self.player, chest_name, chest_code, hub) + location = ArchipelaPalLocation(self.player, chest_name, chest_code, hub) hub.locations.append(location) self.chests_per_region_result.append(num_sphere_0_chests.value) @@ -84,7 +84,7 @@ def generate_early(self) -> None: # Create Key for this region key_name = f"Key {region_display_num}" key_code = KEY_ITEM_OFFSET + region_display_num - key_item = APBotItem(key_name, ItemClassification.progression, key_code, self.player) + key_item = ArchipelaPalItem(key_name, ItemClassification.progression, key_code, self.player) itempool.append(key_item) self.item_table[key_name] = { "classification": ItemClassification.progression, @@ -101,7 +101,7 @@ def generate_early(self) -> None: chest_name = f"Chest {region_display_num}-{real_chest}" chest_code = CHEST_ITEM_OFFSET + (region_display_num << 8) + real_chest - location = APBotLocation(self.player, chest_name, chest_code, region_obj) + location = ArchipelaPalLocation(self.player, chest_name, chest_code, region_obj) region_obj.locations.append(location) self.multiworld.regions.append(region_obj) @@ -116,7 +116,7 @@ def rule(state, key_name=key_name): hub.connect(region_obj, None, rule) # Add Goal items - goal_item = APBotItem(GOAL_ITEM_NAME, ItemClassification.progression, GOAL_ITEM_OFFSET, self.player) + goal_item = ArchipelaPalItem(GOAL_ITEM_NAME, ItemClassification.progression, GOAL_ITEM_OFFSET, self.player) self.item_table[GOAL_ITEM_NAME] = { "classification": ItemClassification.progression, "code": GOAL_ITEM_OFFSET, @@ -138,7 +138,7 @@ def rule(state, key_name=key_name): "classification": ItemClassification.useful, "code": SPEED_BOOST_CODE, } - speed_boost_item = APBotItem(SPEED_BOOST_NAME, ItemClassification.useful, SPEED_BOOST_CODE, self.player) + speed_boost_item = ArchipelaPalItem(SPEED_BOOST_NAME, ItemClassification.useful, SPEED_BOOST_CODE, self.player) for speed_boost_num in range(num_speed_boosts): itempool.append(speed_boost_item) total_junk_items -= num_speed_boosts @@ -148,7 +148,7 @@ def rule(state, key_name=key_name): "classification": ItemClassification.filler, "code": JUNK_ITEM_CODE, } - junk_item = APBotItem(JUNK_ITEM_NAME, ItemClassification.filler, JUNK_ITEM_CODE, self.player) + junk_item = ArchipelaPalItem(JUNK_ITEM_NAME, ItemClassification.filler, JUNK_ITEM_CODE, self.player) for junk_num in range(total_junk_items - num_goal_items): itempool.append(junk_item) @@ -176,9 +176,9 @@ def create_regions(self) -> None: def create_items(self) -> None: pass - def create_item(self, name: str) -> APBotItem: + def create_item(self, name: str) -> ArchipelaPalItem: item = self.item_table[name] - return APBotItem(name, item.classification, item.code, self.player) + return ArchipelaPalItem(name, item.classification, item.code, self.player) def fill_slot_data(self): min_wait_time = self.options.min_time_between_checks.value diff --git a/world/apbot/utils.py b/world/archipelapal/utils.py similarity index 100% rename from world/apbot/utils.py rename to world/archipelapal/utils.py diff --git a/world/make_apworld.sh b/world/make_apworld.sh index aa0ad8c..cd56bbf 100755 --- a/world/make_apworld.sh +++ b/world/make_apworld.sh @@ -1 +1 @@ -zip -r apbot.apworld apbot +zip -r archipelapal.apworld archipelapal