Skip to content

Commit

Permalink
Whetstone (#1442)
Browse files Browse the repository at this point in the history
* whet stone adds +1 adv to next food eaten

* simplify
  • Loading branch information
Veracity0 committed Jan 17, 2023
1 parent fa0e420 commit da1510b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/data/defaults.txt
Expand Up @@ -1535,6 +1535,7 @@ user warehouseProgress 0
user watchedPreferences
user waxMonster
user welcomeBackAdv 0
user whetstonesUsed 0
user wildfireBarrelCaulked false
user wildfireDusted false
user wildfireFracked false
Expand Down
2 changes: 1 addition & 1 deletion src/data/items.txt
Expand Up @@ -11133,6 +11133,6 @@
11105 bolder boulder 697310877 rgboulder.gif usable t,d 25
11106 molehill mountain 671315172 rgmountain.gif reusable t,d 250
11107 whet stone 689119937 rgwhetstone.gif multiple t,d 5
11108 hard rock 878413969 rghardrock.gif usable t,d 25
11108 hard rock 878413969 rghardrock.gif multiple t,d 25
11109 strange stalagmite 720163663 rgstalagmite.gif reusable t,d 250
11110 chocolate covered ping-pong ball 997920598 ccppball.gif usable t,d 20
3 changes: 2 additions & 1 deletion src/net/sourceforge/kolmafia/objectpool/Concoction.java
Expand Up @@ -88,6 +88,7 @@ public class Concoction implements Comparable<Concoction> {
Set.of(
ItemPool.QUANTUM_TACO,
ItemPool.MUNCHIES_PILL,
ItemPool.WHETSTONE,
ItemPool.MAGICAL_SAUSAGE,
ItemPool.MAYONEX,
ItemPool.MAYODIOL,
Expand Down Expand Up @@ -199,7 +200,7 @@ public ConcoctionType computeType() {
return switch (ItemDatabase.getConsumptionType(itemId)) {
case FOOD_HELPER -> ConcoctionType.FOOD;
case DRINK_HELPER -> ConcoctionType.BOOZE;
case USE -> forceFood.contains(itemId)
case USE, USE_MULTIPLE -> forceFood.contains(itemId)
? ConcoctionType.FOOD
: forceBooze.contains(itemId) ? ConcoctionType.BOOZE : ConcoctionType.NONE;
case POTION, AVATAR_POTION -> ConcoctionType.POTION;
Expand Down
Expand Up @@ -429,6 +429,7 @@ public static final boolean canQueueFood(final int id) {
switch (id) {
case ItemPool.QUANTUM_TACO:
case ItemPool.MUNCHIES_PILL:
case ItemPool.WHETSTONE:
case ItemPool.MAGICAL_SAUSAGE:
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/net/sourceforge/kolmafia/preferences/Preferences.java
Expand Up @@ -472,6 +472,7 @@ public class Preferences {
"vintnerWineType",
"violetFogLayout",
"waxMonster",
"whetstonesUsed",
"wildfireBarrelCaulked",
"wildfireDusted",
"wildfireFracked",
Expand Down
11 changes: 11 additions & 0 deletions src/net/sourceforge/kolmafia/request/EatItemRequest.java
Expand Up @@ -1049,6 +1049,17 @@ public static final void handleFoodHelper(
ResultProcessor.processItem(ItemPool.SPECIAL_SEASONING, -itemsUsed);
}

// With your sharpened appetite, that really hits the spot.
if (responseText.contains("With your sharpened appetite")) {
int itemsUsed = Math.min(count, InventoryManager.getCount(ItemPool.WHETSTONE));
if (itemsUsed > 1) {
EatItemRequest.logConsumption("You used " + itemsUsed + " whetstones with your food");
} else {
EatItemRequest.logConsumption("You used a whetstone with your food");
}
Preferences.decrement("whetstonesUsed", itemsUsed);
}

// Satisfied, you let loose a nasty magnesium-flavored belch.
if (responseText.contains("magnesium-flavored belch")) {
EatItemRequest.logConsumption("Your milk of magnesium kicked in");
Expand Down
4 changes: 4 additions & 0 deletions src/net/sourceforge/kolmafia/request/UseItemRequest.java
Expand Up @@ -6439,6 +6439,10 @@ public static boolean registerRequest(final String urlString) {
Preferences.increment("munchiesPillsUsed", count);
break;

case ItemPool.WHETSTONE:
Preferences.increment("whetstonesUsed", count);
break;

case ItemPool.DRINK_ME_POTION:
Preferences.increment("pendingMapReflections", count);
break;
Expand Down
Expand Up @@ -379,6 +379,7 @@ private Component getRenderer(

switch (item.getItemId()) {
case ItemPool.MUNCHIES_PILL -> stringForm.append("+1-3 adv from next food");
case ItemPool.WHETSTONE -> stringForm.append("+1 adv from next food");
case ItemPool.SUSHI_DOILY -> stringForm.append(
"+3 adv from next sushi (automatically used from inventory)");
case ItemPool.GRAINS_OF_SALT -> stringForm.append(
Expand Down

0 comments on commit da1510b

Please sign in to comment.