Skip to content

Commit 68511a7

Browse files
committed
Update blue chus location to use blue chu count
1 parent d81759c commit 68511a7

6 files changed

Lines changed: 91 additions & 8 deletions

File tree

src/services/__snapshots__/logic-tweaks.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ exports[`LogicTweaks applyTweaks when no options are set updates the locations 1
24892489
"types": "Short Sidequest",
24902490
},
24912491
"Chu Jelly Juice Shop - Give 15 Blue Chu Jelly": {
2492-
"need": "Can Obtain 15 Blue Chu Jelly",
2492+
"need": "Blue Chu Jelly x15",
24932493
"originalItem": "Blue Potion",
24942494
"types": "Spoils Trading, Long Sidequest",
24952495
},

src/services/__snapshots__/tracker-controller.test.js.snap

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

src/services/logic-calculation.test.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,4 +2111,77 @@ describe('LogicCalculation', () => {
21112111
});
21122112
});
21132113
});
2114+
2115+
describe('blue chus', () => {
2116+
beforeEach(() => {
2117+
fullSetup();
2118+
});
2119+
2120+
describe('when the player has no blue chus', () => {
2121+
test('blue chus location is unavailable', () => {
2122+
const isBlueChusLocationAvailable = logic.isLocationAvailable(
2123+
'Windfall Island',
2124+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
2125+
);
2126+
expect(isBlueChusLocationAvailable).toEqual(false);
2127+
});
2128+
});
2129+
2130+
describe('when the player collects 1 blue chu', () => {
2131+
beforeEach(() => {
2132+
logic = new LogicCalculation(
2133+
logic.state().incrementItem('Second Blue Chu Near Chest'),
2134+
);
2135+
});
2136+
2137+
test('blue chus location is unavailable', () => {
2138+
const isBlueChusLocationAvailable = logic.isLocationAvailable(
2139+
'Windfall Island',
2140+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
2141+
);
2142+
expect(isBlueChusLocationAvailable).toEqual(false);
2143+
});
2144+
2145+
test('blue chu count is 1', () => {
2146+
const blueChuCount = logic.state().getItemValue(LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM);
2147+
expect(blueChuCount).toEqual(1);
2148+
});
2149+
});
2150+
2151+
describe('when the player collects 15 blue chus', () => {
2152+
beforeEach(() => {
2153+
logic = new LogicCalculation(
2154+
logic.state()
2155+
.incrementItem('Blue Chu Underneath Boulder')
2156+
.incrementItem('Blue Chu Near Northern Fairy Tree')
2157+
.incrementItem('First Blue Chu Near Chest')
2158+
.incrementItem('Blue Chu on High Ledge')
2159+
.incrementItem('Blue Chu on Highest Point')
2160+
.incrementItem('Blue Chu Near Southern Fairy Tree')
2161+
.incrementItem('Blue Chu on Highest Isle')
2162+
.incrementItem('Blue Chu Near Second Hole at Night')
2163+
.incrementItem('Blue Chu Near Peak Chest')
2164+
.incrementItem('Blue Chu Near Cave Entrance')
2165+
.incrementItem('Blue Chu Atop Northeast Statue')
2166+
.incrementItem('Blue Chu Near Western Fairy Tree')
2167+
.incrementItem('Blue Chu Near Final Rock Spire')
2168+
.incrementItem('Blue Chu Near Wooden Sign')
2169+
.incrementItem('Second Blue Chu Near Chest'),
2170+
);
2171+
});
2172+
2173+
test('blue chus location is available', () => {
2174+
const isBlueChusLocationAvailable = logic.isLocationAvailable(
2175+
'Windfall Island',
2176+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
2177+
);
2178+
expect(isBlueChusLocationAvailable).toEqual(true);
2179+
});
2180+
2181+
test('blue chu count is 15', () => {
2182+
const blueChuCount = logic.state().getItemValue(LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM);
2183+
expect(blueChuCount).toEqual(15);
2184+
});
2185+
});
2186+
});
21142187
});

src/services/logic-helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class LogicHelper {
141141
TRIFORCE: 'Triforce',
142142
};
143143

144-
static BLUE_CHUS_REQUIREMENT = 15;
144+
static BLUE_CHU_JELLY_COUNT_REQUIRED = 15;
145145

146146
static BLUE_CHU_JELLY_COUNT_ITEM = 'Blue Chu Jelly';
147147

@@ -342,7 +342,7 @@ class LogicHelper {
342342
}
343343

344344
static parseItemCountRequirement(requirement) {
345-
const itemCountRequirementMatch = requirement.match(/((?:\w|\s)+) x(\d)/);
345+
const itemCountRequirementMatch = requirement.match(/((?:\w|\s)+) x(\d+)/);
346346

347347
if (itemCountRequirementMatch) {
348348
return {

src/services/logic-tweaks.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class LogicTweaks {
5050
static #updateLocations() {
5151
this.#addDefeatGanondorf();
5252
this.#updateTingleStatueReward();
53+
this.#updateBlueChuJelly();
5354
this.#updateSunkenTriforceTypes();
5455
this.applyHasAccessedLocationTweaksForLocations();
5556
}
@@ -80,6 +81,15 @@ class LogicTweaks {
8081
);
8182
}
8283

84+
static #updateBlueChuJelly() {
85+
Locations.setLocation(
86+
LogicHelper.ISLANDS.WINDFALL_ISLAND,
87+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
88+
Locations.KEYS.NEED,
89+
`${LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM} x${LogicHelper.BLUE_CHU_JELLY_COUNT_REQUIRED}`,
90+
);
91+
}
92+
8393
static #updateSunkenTriforceTypes() {
8494
if (Settings.getOptionValue(Permalink.OPTIONS.RANDOMIZE_CHARTS)) {
8595
return;

src/ui/items-table.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ class ItemsTable extends React.PureComponent {
8686
return null;
8787
}
8888
const image = _.get(Images.IMAGES, ['BLUE_CHU_JELLY_COUNT']);
89-
const count = trackerState.getItemValue(LogicHelper.ITEMS.BLUE_CHU_JELLY);
90-
const textClass = count >= LogicHelper.BLUE_CHUS_REQUIREMENT ? 'chu-text-gold' : 'chu-text-white';
89+
const count = trackerState.getItemValue(LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM);
90+
const textClass = count >= LogicHelper.BLUE_CHU_JELLY_COUNT_REQUIRED ? 'chu-text-gold' : 'chu-text-white';
9191
return (
9292
<div className="chu-count-container">
9393
<Item
@@ -96,7 +96,7 @@ class ItemsTable extends React.PureComponent {
9696
images={image}
9797
incrementItem={() => {}}
9898
itemCount={0}
99-
itemName={`Blue Chu Jelly (${count}/${LogicHelper.BLUE_CHUS_REQUIREMENT})`}
99+
itemName={`Blue Chu Jelly (${count}/${LogicHelper.BLUE_CHU_JELLY_COUNT_REQUIRED})`}
100100
locations={[]}
101101
setSelectedItem={this.setSelectedItem}
102102
spheres={spheres}

0 commit comments

Comments
 (0)