diff --git a/assets/media/font/icons-multiworld.png b/assets/media/font/icons-multiworld.png index 03c04d1..796aa01 100644 Binary files a/assets/media/font/icons-multiworld.png and b/assets/media/font/icons-multiworld.png differ diff --git a/ccmod.json b/ccmod.json index fde26db..c1c8b66 100644 --- a/ccmod.json +++ b/ccmod.json @@ -1,6 +1,6 @@ { "id": "mw-rando", - "version": "0.6.0-pre.5", + "version": "0.6.1", "title": "Multiworld randomizer", "description": "Client for CrossCode Archipelago Integration", "repository": "https://github.com/CodeTriangle/CCMultiworldRandomizer", diff --git a/data/in/quests-qr.json b/data/in/quests-qr.json index c12ff1b..eb985c7 100644 --- a/data/in/quests-qr.json +++ b/data/in/quests-qr.json @@ -97,7 +97,7 @@ "open": "open3" }, "condition": [ - [ "quest", "Kidding Around" ] + [ "quest", "The Goatfather" ] ], "reward": [ [ "item", "Vanilla Ice Cream", 2 ] @@ -878,6 +878,7 @@ "condition": [ [ "item", "Purple Bolt Shade", 1 ], [ "item", "Azure Drop Shade", 1 ], + [ "item", "Wave" ], [ "quest", "Lakeside Escort" ] ], "reward": [ @@ -1041,8 +1042,7 @@ "open": "open2" }, "condition": [ - [ "item", "Heat" ], - [ "item", "Cold" ], + [ "item", "Blue Ice Shade" ], [ "item", "Red Flame Shade", 1 ] ] }, @@ -1053,8 +1053,7 @@ "open": "open2" }, "condition": [ - [ "item", "Heat" ], - [ "item", "Cold" ], + [ "item", "Blue Ice Shade" ], [ "item", "Red Flame Shade", 1 ] ] @@ -1232,7 +1231,8 @@ }, "condition": [ [ "quest", "Intensive Tree Care" ], - [ "item", "Heat" ] + [ "item", "Heat" ], + [ "item", "Cold" ] ], "reward": [ [ "item", "Ginger Tom. Salad", 4 ], diff --git a/data/in/shops.json b/data/in/shops.json index 6278e81..fd7c878 100644 --- a/data/in/shops.json +++ b/data/in/shops.json @@ -554,6 +554,44 @@ "Willis Waldmahl", "Pumpkin Spice Cof." ] + }, + "Vermillion Weapons": { + "location": { + "shop": "aridWeapons" + }, + "region": { + "linear": "22", + "open": "open18" + }, + "slots": [ + "Steel Goggles", + "Steel Edge", + "Steel Mail", + "Steel Boots", + "Silver Goggles", + "Silver Edge", + "Silver Mail", + "Silver Boots" + ] + }, + "Vermillion Items": { + "location": { + "shop": "aridItems" + }, + "region": { + "linear": "22", + "open": "open18" + }, + "slots": [ + "Sandwich", + "Hi-Sandwich", + "Green Leaf Tea", + "Just Water", + "Spicy Bun", + "Fruit Drink", + "Rice Cracker", + "Veggie Sticks" + ] } } } diff --git a/data/out/data.json b/data/out/data.json index c4373a4..a666916 100644 --- a/data/out/data.json +++ b/data/out/data.json @@ -4075,6 +4075,26 @@ "496": 3235824767, "551": 3235824768, "637": 3235824769 + }, + "aridWeapons": { + "204": 3235824770, + "205": 3235824771, + "206": 3235824772, + "207": 3235824773, + "264": 3235824774, + "266": 3235824775, + "268": 3235824776, + "270": 3235824777 + }, + "aridItems": { + "1": 3235824778, + "27": 3235824779, + "2": 3235824780, + "366": 3235824781, + "64": 3235824782, + "70": 3235824783, + "73": 3235824784, + "67": 3235824785 } } }, @@ -4160,7 +4180,9 @@ "rhombusWeapons1": 3235924450, "rhombusItems1": 3235924459, "rhombusCurios": 3235924475, - "rhombusBacker": 3235924478 + "rhombusBacker": 3235924478, + "aridWeapons": 3235924491, + "aridItems": 3235924500 }, "byShopAndId": { "rookieHarborItems": { @@ -4389,6 +4411,26 @@ "496": 3235924488, "551": 3235924489, "637": 3235924490 + }, + "aridWeapons": { + "204": 3235924492, + "205": 3235924493, + "206": 3235924494, + "207": 3235924495, + "264": 3235924496, + "266": 3235924497, + "268": 3235924498, + "270": 3235924499 + }, + "aridItems": { + "1": 3235924501, + "27": 3235924502, + "2": 3235924503, + "366": 3235924504, + "64": 3235924505, + "70": 3235924506, + "73": 3235924507, + "67": 3235924508 } } } @@ -5207,6 +5249,60 @@ "3235924490": { "en_US": "Unlocks the slot selling \\c[3]Pumpkin Spice Cof.\\c[0] in \\c[3]Chef Backer Goods\\c[0]." }, + "3235924491": { + "en_US": "Unlocks \\c[3]all item slots\\c[0] in the shop \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924492": { + "en_US": "Unlocks the slot selling \\c[3]Steel Goggles\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924493": { + "en_US": "Unlocks the slot selling \\c[3]Steel Edge\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924494": { + "en_US": "Unlocks the slot selling \\c[3]Steel Mail\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924495": { + "en_US": "Unlocks the slot selling \\c[3]Steel Boots\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924496": { + "en_US": "Unlocks the slot selling \\c[3]Silver Goggles\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924497": { + "en_US": "Unlocks the slot selling \\c[3]Silver Edge\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924498": { + "en_US": "Unlocks the slot selling \\c[3]Silver Mail\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924499": { + "en_US": "Unlocks the slot selling \\c[3]Silver Boots\\c[0] in \\c[3]Vermillion Equipment\\c[0]." + }, + "3235924500": { + "en_US": "Unlocks \\c[3]all item slots\\c[0] in the shop \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924501": { + "en_US": "Unlocks the slot selling \\c[3]Sandwich\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924502": { + "en_US": "Unlocks the slot selling \\c[3]Hi-Sandwich\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924503": { + "en_US": "Unlocks the slot selling \\c[3]Green Leaf Tea\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924504": { + "en_US": "Unlocks the slot selling \\c[3]Just Water\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924505": { + "en_US": "Unlocks the slot selling \\c[3]Spicy Bun\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924506": { + "en_US": "Unlocks the slot selling \\c[3]Fruit Drink\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924507": { + "en_US": "Unlocks the slot selling \\c[3]Rice Cracker\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, + "3235924508": { + "en_US": "Unlocks the slot selling \\c[3]Veggie Sticks\\c[0] in \\c[3]Vermillion Consumables\\c[0]." + }, "3235824050": { "en_US": "Unlocks the next dungeon or overworld area in story order." }, diff --git a/data/out/items.json b/data/out/items.json index 57e5f39..995e068 100644 --- a/data/out/items.json +++ b/data/out/items.json @@ -264,5 +264,23 @@ "Slot Unlock: Mooncake (Rhombus Backer Items)": 3235924487, "Slot Unlock: Guacamole Toast (Rhombus Backer Items)": 3235924488, "Slot Unlock: Willis Waldmahl (Rhombus Backer Items)": 3235924489, - "Slot Unlock: Pumpkin Spice Cof. (Rhombus Backer Items)": 3235924490 + "Slot Unlock: Pumpkin Spice Cof. (Rhombus Backer Items)": 3235924490, + "Shop Unlock: Vermillion Weapons": 3235924491, + "Slot Unlock: Steel Goggles (Vermillion Weapons)": 3235924492, + "Slot Unlock: Steel Edge (Vermillion Weapons)": 3235924493, + "Slot Unlock: Steel Mail (Vermillion Weapons)": 3235924494, + "Slot Unlock: Steel Boots (Vermillion Weapons)": 3235924495, + "Slot Unlock: Silver Goggles (Vermillion Weapons)": 3235924496, + "Slot Unlock: Silver Edge (Vermillion Weapons)": 3235924497, + "Slot Unlock: Silver Mail (Vermillion Weapons)": 3235924498, + "Slot Unlock: Silver Boots (Vermillion Weapons)": 3235924499, + "Shop Unlock: Vermillion Items": 3235924500, + "Slot Unlock: Sandwich (Vermillion Items)": 3235924501, + "Slot Unlock: Hi-Sandwich (Vermillion Items)": 3235924502, + "Slot Unlock: Green Leaf Tea (Vermillion Items)": 3235924503, + "Slot Unlock: Just Water (Vermillion Items)": 3235924504, + "Slot Unlock: Spicy Bun (Vermillion Items)": 3235924505, + "Slot Unlock: Fruit Drink (Vermillion Items)": 3235924506, + "Slot Unlock: Rice Cracker (Vermillion Items)": 3235924507, + "Slot Unlock: Veggie Sticks (Vermillion Items)": 3235924508 } \ No newline at end of file diff --git a/data/out/locations.json b/data/out/locations.json index fc780ba..60e480e 100644 --- a/data/out/locations.json +++ b/data/out/locations.json @@ -767,5 +767,21 @@ "Shop Slot: Mooncake (Rhombus Backer Items)": 3235824766, "Shop Slot: Guacamole Toast (Rhombus Backer Items)": 3235824767, "Shop Slot: Willis Waldmahl (Rhombus Backer Items)": 3235824768, - "Shop Slot: Pumpkin Spice Cof. (Rhombus Backer Items)": 3235824769 + "Shop Slot: Pumpkin Spice Cof. (Rhombus Backer Items)": 3235824769, + "Shop Slot: Steel Goggles (Vermillion Weapons)": 3235824770, + "Shop Slot: Steel Edge (Vermillion Weapons)": 3235824771, + "Shop Slot: Steel Mail (Vermillion Weapons)": 3235824772, + "Shop Slot: Steel Boots (Vermillion Weapons)": 3235824773, + "Shop Slot: Silver Goggles (Vermillion Weapons)": 3235824774, + "Shop Slot: Silver Edge (Vermillion Weapons)": 3235824775, + "Shop Slot: Silver Mail (Vermillion Weapons)": 3235824776, + "Shop Slot: Silver Boots (Vermillion Weapons)": 3235824777, + "Shop Slot: Sandwich (Vermillion Items)": 3235824778, + "Shop Slot: Hi-Sandwich (Vermillion Items)": 3235824779, + "Shop Slot: Green Leaf Tea (Vermillion Items)": 3235824780, + "Shop Slot: Just Water (Vermillion Items)": 3235824781, + "Shop Slot: Spicy Bun (Vermillion Items)": 3235824782, + "Shop Slot: Fruit Drink (Vermillion Items)": 3235824783, + "Shop Slot: Rice Cracker (Vermillion Items)": 3235824784, + "Shop Slot: Veggie Sticks (Vermillion Items)": 3235824785 } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d75f4f3..db90e0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,8 @@ "devDependencies": { "@types/node": "^20.4.9", "esbuild": "^0.18.15", - "nax-ccuilib": "conorlawton/nax-ccuilib", - "nax-module-cache": "github:conorlawton/nax-module-cache", + "nax-ccuilib": "naxane/nax-ccuilib", + "nax-module-cache": "github:naxane/nax-module-cache", "nodemon": "^3.0.1", "typescript": "^5.1.6", "ultimate-crosscode-typedefs": "github:krypciak/ultimate-crosscode-typedefs" @@ -3279,30 +3279,14 @@ "license": "MIT" }, "node_modules/nax-ccuilib": { - "version": "1.2.4", - "resolved": "git+ssh://git@github.com/conorlawton/nax-ccuilib.git#27d04077163f304e2c80ed269d7dae929e9e91f3", + "version": "1.2.9", + "resolved": "git+ssh://git@github.com/naxane/nax-ccuilib.git#e7e55791be5eeab7d5e927680cfc0b19698276a6", "dev": true }, "node_modules/nax-module-cache": { - "version": "1.0.0", - "resolved": "git+ssh://git@github.com/conorlawton/nax-module-cache.git#ad208ceb06e11c82542f7c289ca26ba7ef44e6e3", - "dev": true, - "dependencies": { - "typescript": "^4.9.5" - } - }, - "node_modules/nax-module-cache/node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } + "version": "1.0.2", + "resolved": "git+ssh://git@github.com/naxane/nax-module-cache.git#6a89cf7b8cef9b9806358fcc2766b5a3c7a1437c", + "dev": true }, "node_modules/neo-async": { "version": "2.6.2", diff --git a/package.json b/package.json index ee3e44a..01e4cf1 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "devDependencies": { "@types/node": "^20.4.9", "esbuild": "^0.18.15", - "nax-ccuilib": "conorlawton/nax-ccuilib", - "nax-module-cache": "github:conorlawton/nax-module-cache", + "nax-ccuilib": "naxane/nax-ccuilib", + "nax-module-cache": "github:naxane/nax-module-cache", "nodemon": "^3.0.1", "typescript": "^5.1.6", "ultimate-crosscode-typedefs": "github:krypciak/ultimate-crosscode-typedefs" diff --git a/src/patches/shop.ts b/src/patches/shop.ts index 8b2a500..375fb2a 100644 --- a/src/patches/shop.ts +++ b/src/patches/shop.ts @@ -19,6 +19,10 @@ declare global { itemId: number | undefined; worldGui: sc.TextGui | undefined; slot: string | undefined; + lockedGui: sc.TextGui; + unlockItem?: number | null; + + showLockedMessage(this: this): void; } } } @@ -67,6 +71,17 @@ export function patch(plugin: MwRandomizer) { sc.ShopListMenu.inject({ menuGfx: new ig.Image("media/gui/menu.png"), + + init() { + this.parent(); + this.buttongroup?.addPressCallback((rawButton) => { + let button = rawButton as unknown as sc.ShopItemButton; + if (!button.active) { + button.showLockedMessage(); + } + }); + }, + scrapBuyList(shopItems) { this.parent(shopItems); const shopID = sc.menu.shopID; @@ -142,6 +157,11 @@ export function patch(plugin: MwRandomizer) { button.textChild.hook.pos.x = 5; button.addChildGui(button.textChild); + gui.lockedGui = new sc.TextGui("\\i[ap-locked]"); + gui.lockedGui.hook.align.x = ig.GUI_ALIGN.X_RIGHT; + gui.lockedGui.setPos(28, 1); + gui.addChildGui(gui.lockedGui); + const worldGui = new sc.TextGui(itemInfo.player, { "font": sc.fontsystem.tinyFont }); worldGui.hook.pos.x = 22; worldGui.hook.pos.y = button.hook.size.y; @@ -194,7 +214,7 @@ export function patch(plugin: MwRandomizer) { } } - if (gui.active && gui.itemId != undefined) { + if (gui.itemId != undefined) { let unlockItem: number | null = null; if (sc.multiworld.options.shopReceiveMode == "itemType") { unlockItem = sc.randoData.shops.unlocks.byId[gui.itemId]; @@ -204,8 +224,14 @@ export function patch(plugin: MwRandomizer) { unlockItem = sc.randoData.shops.unlocks.byShopAndId[shopID][gui.itemId]; } + gui.unlockItem = unlockItem; + if (unlockItem != null) { - gui.setActive(sc.multiworld.receivedItemMap[unlockItem] != undefined); + let hasUnlockItem = sc.multiworld.receivedItemMap[unlockItem] != undefined; + if (hasUnlockItem) { + gui.lockedGui.setText(""); + } + gui.setActive(gui.active && hasUnlockItem); } } } @@ -222,6 +248,11 @@ export function patch(plugin: MwRandomizer) { return this.parent(direction); } + if (!gui.active) { + gui.showLockedMessage(); + return; + } + const quantity = sc.menu.getItemQuantity(gui.itemId, gui.price); if ((quantity == 0 && direction == 1) || (quantity == 1 && direction == -1)) { this.playSound(direction, true); @@ -250,6 +281,14 @@ export function patch(plugin: MwRandomizer) { if (this.worldGui != undefined && this.slot != undefined) { this.worldGui.setText(this.slot); } + }, + + showLockedMessage() { + if (this.unlockItem != null && sc.multiworld.receivedItemMap[this.unlockItem] == undefined) { + let itemName = sc.multiworld.gamepackage.item_id_to_name[this.unlockItem]; + sc.menu.setInfoText(`Collect \\c[3]${itemName}\\c[0] to unlock this slot.`); + sc.menu.setBuffText(""); + } } }); } diff --git a/src/plugin.ts b/src/plugin.ts index 8947aa7..81642bb 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -126,6 +126,7 @@ export default class MwRandomizer { "ap-item-filler": [index, 4], "ap-item-useful": [index, 5], "ap-item-prog": [index, 6], + "ap-locked": [index, 7], }); sc.CrossCode.inject({