diff --git a/ccmod.json b/ccmod.json index fcbc19c..d5dffb6 100644 --- a/ccmod.json +++ b/ccmod.json @@ -1,12 +1,15 @@ { "id": "mw-rando", - "version": "0.5.0", + "version": "0.5.1", "title": "Multiworld randomizer", "description": "Client for CrossCode Archipelago Integration", "repository": "https://github.com/CodeTriangle/CCMultiworldRandomizer", "tags": ["puzzle", "speedrun"], "authors": "CodeTriangle", "plugin": "mw-rando/plugin.js", + "icons": { + "24": "icon-24.png" + }, "dependencies": { "open-world": ">=0.3.2", "nax-ccuilib": ">=1.2.4" diff --git a/data/in/cutscenes.json b/data/in/cutscenes.json index cbad5bd..a80c9d4 100644 --- a/data/in/cutscenes.json +++ b/data/in/cutscenes.json @@ -199,7 +199,7 @@ }, "region": { "linear": "27", - "open": "open14.4" + "open": "open14.5" }, "reward": [ [ "item", "Azure Drop Shade", 1 ] @@ -283,7 +283,7 @@ }, "region": { "linear": "27", - "open": "open14.4" + "open": "open14.5" }, "reward": [ [ "item", "Circuit Override", 1 ] diff --git a/data/in/elements.json b/data/in/elements.json index d47b009..d047690 100644 --- a/data/in/elements.json +++ b/data/in/elements.json @@ -33,7 +33,7 @@ }, "region": { "linear": "27", - "open": "open14.5" + "open": "open14.4" }, "reward": [ ["element", "Shock"] diff --git a/data/in/quests-qr.json b/data/in/quests-qr.json index f8b9509..7a5e378 100644 --- a/data/in/quests-qr.json +++ b/data/in/quests-qr.json @@ -85,6 +85,37 @@ 1 ] ] + }, + "Bergen Trail - Horncave": { + "location": { + "map": "bergen-trail.cave.cave-7-1-1-goat2", + "mapId": 142 + }, + "clearance": "Default", + "region": { + "linear": "3", + "open": "open3" + }, + "condition": [ + [ "quest", "Kidding Around" ] + ], + "reward": [ + [ "item", "Vanilla Ice Cream", 2 ] + ] + }, + "Gaia's Garden - Chilled Den": { + "location": { + "map": "jungle.caves.questcave-snowman-1", + "mapId": 247 + }, + "clearance": "Silver", + "region": { + "linear": "10", + "open": "open10" + }, + "reward": [ + [ "item", "Perforated Tophat", 5 ] + ] } }, "quests": { diff --git a/data/out/data.json b/data/out/data.json index cd52cf8..db9701b 100644 --- a/data/out/data.json +++ b/data/out/data.json @@ -2966,6 +2966,26 @@ } } }, + "bergen-trail.cave.cave-7-1-1-goat2": { + "chests": { + "142": { + "name": "Bergen Trail - Horncave", + "mwids": [ + 3235824522 + ] + } + } + }, + "jungle.caves.questcave-snowman-1": { + "chests": { + "247": { + "name": "Gaia's Garden - Chilled Den", + "mwids": [ + 3235824523 + ] + } + } + }, "bergen.mine-entrance": { "cutscenes": { "316": [ diff --git a/data/out/locations.json b/data/out/locations.json index 0eeb303..c07b673 100644 --- a/data/out/locations.json +++ b/data/out/locations.json @@ -344,6 +344,8 @@ "So'najiz Temple - Fast Conveyance": 3235824343, "So'najiz Temple - Flaming Conveyance": 3235824344, "Bergen Village - Omni Gilders Basement Left (Bronze)": 3235824077, + "Bergen Trail - Horncave": 3235824522, + "Gaia's Garden - Chilled Den": 3235824523, "Talatu Introductions": 3235824345, "Schneider Guild Pass": 3235824346, "Bergen Mine Guard": 3235824347, diff --git a/icon-24.png b/icon-24.png new file mode 100644 index 0000000..99cedc9 Binary files /dev/null and b/icon-24.png differ diff --git a/src/patches/chest.ts b/src/patches/chest.ts index 43a2fdd..eac61de 100644 --- a/src/patches/chest.ts +++ b/src/patches/chest.ts @@ -142,6 +142,10 @@ export function patch(plugin: MwRandomizer) { } }, + isQuickMenuVisible() { + return this.mwCheck && this.rawChest; + }, + _reallyOpenUp() { if ( this.mwCheck === undefined || diff --git a/src/patches/quest.ts b/src/patches/quest.ts index 7797229..fd3750f 100644 --- a/src/patches/quest.ts +++ b/src/patches/quest.ts @@ -20,6 +20,26 @@ export function patch(plugin: MwRandomizer) { let quests = plugin.randoData?.quests; sc.QuestModel.inject({ _collectRewards(quest: sc.Quest) { + const previousItemAmounts: Record = {}; + + if (quest.rewards.items) { + for (const item of quest.rewards.items) { + previousItemAmounts[item.id] = sc.model.player.getItemAmount(item.id); + } + } + + this.parent(quest); + + if (quest.rewards.items) { + for (const item of quest.rewards.items) { + const toTakeAway = sc.model.player.getItemAmount(item.id) - previousItemAmounts[item.id]; + + if (toTakeAway > 0) { + sc.model.player.removeItem(item.id, toTakeAway); + } + } + } + const check = quests?.[quest.id]; if ( check == undefined ||