Skip to content

Commit 305ec72

Browse files
committed
Fix blue chus logic
1 parent 6a03eac commit 305ec72

4 files changed

Lines changed: 56 additions & 4 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": "Blue Chu Jelly x15",
2492+
"need": "(Spoils Bag & Blue Chu Jelly x15) | Can Obtain 15 Blue Chu Jelly",
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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,6 +2115,10 @@ describe('LogicCalculation', () => {
21152115
describe('blue chus', () => {
21162116
beforeEach(() => {
21172117
fullSetup();
2118+
2119+
logic = new LogicCalculation(
2120+
logic.state().incrementItem('Spoils Bag'),
2121+
);
21182122
});
21192123

21202124
describe('when the player has no blue chus', () => {
@@ -2148,6 +2152,27 @@ describe('LogicCalculation', () => {
21482152
});
21492153
});
21502154

2155+
describe('when the player is able to obtain 15 blue chus', () => {
2156+
beforeEach(() => {
2157+
logic = new LogicCalculation(
2158+
logic.state().decrementItem('Deku Leaf'),
2159+
);
2160+
});
2161+
2162+
test('blue chus location is available', () => {
2163+
const isBlueChusLocationAvailable = logic.isLocationAvailable(
2164+
'Windfall Island',
2165+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
2166+
);
2167+
expect(isBlueChusLocationAvailable).toEqual(true);
2168+
});
2169+
2170+
test('blue chu count is 0', () => {
2171+
const blueChuCount = logic.state().getItemValue(LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM);
2172+
expect(blueChuCount).toEqual(0);
2173+
});
2174+
});
2175+
21512176
describe('when the player collects 15 blue chus', () => {
21522177
beforeEach(() => {
21532178
logic = new LogicCalculation(
@@ -2182,6 +2207,27 @@ describe('LogicCalculation', () => {
21822207
const blueChuCount = logic.state().getItemValue(LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM);
21832208
expect(blueChuCount).toEqual(15);
21842209
});
2210+
2211+
describe('when the player does not have spoils bag', () => {
2212+
beforeEach(() => {
2213+
logic = new LogicCalculation(
2214+
logic.state().decrementItem('Spoils Bag'),
2215+
);
2216+
});
2217+
2218+
test('blue chus location is unavailable', () => {
2219+
const isBlueChusLocationAvailable = logic.isLocationAvailable(
2220+
'Windfall Island',
2221+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
2222+
);
2223+
expect(isBlueChusLocationAvailable).toEqual(false);
2224+
});
2225+
2226+
test('blue chu count is 15', () => {
2227+
const blueChuCount = logic.state().getItemValue(LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM);
2228+
expect(blueChuCount).toEqual(15);
2229+
});
2230+
});
21852231
});
21862232
});
21872233
});

src/services/logic-tweaks.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,17 @@ class LogicTweaks {
8282
}
8383

8484
static #updateBlueChuJelly() {
85+
const originalRequirement = Locations.getLocation(
86+
LogicHelper.ISLANDS.WINDFALL_ISLAND,
87+
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
88+
Locations.KEYS.NEED,
89+
);
90+
8591
Locations.setLocation(
8692
LogicHelper.ISLANDS.WINDFALL_ISLAND,
8793
'Chu Jelly Juice Shop - Give 15 Blue Chu Jelly',
8894
Locations.KEYS.NEED,
89-
`${LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM} x${LogicHelper.BLUE_CHU_JELLY_COUNT_REQUIRED}`,
95+
`(${LogicHelper.ITEMS.SPOILS_BAG} & ${LogicHelper.BLUE_CHU_JELLY_COUNT_ITEM} x${LogicHelper.BLUE_CHU_JELLY_COUNT_REQUIRED}) | ${originalRequirement}`,
9096
);
9197
}
9298

0 commit comments

Comments
 (0)