Index: src/net/sourceforge/kolmafia/persistence/ConcoctionDatabase.java
===================================================================
--- src/net/sourceforge/kolmafia/persistence/ConcoctionDatabase.java (revision 9485)
+++ src/net/sourceforge/kolmafia/persistence/ConcoctionDatabase.java (working copy)
@@ -621,7 +621,7 @@
int consumpt = ItemDatabase.getConsumptionType( id );
if ( c.getFullness() > 0 || consumpt == KoLConstants.CONSUME_FOOD_HELPER ||
- id == ItemPool.MUNCHIES_PILL )
+ id == ItemPool.MUNCHIES_PILL || id == ItemPool.DISTENTION_PILL )
{
queuedChanges = ConcoctionDatabase.queuedFoodChanges;
queuedIngredients = ConcoctionDatabase.queuedFoodIngredients;
Index: src/net/sourceforge/kolmafia/swingui/widget/ListCellRendererFactory.java
===================================================================
--- src/net/sourceforge/kolmafia/swingui/widget/ListCellRendererFactory.java (revision 9485)
+++ src/net/sourceforge/kolmafia/swingui/widget/ListCellRendererFactory.java (working copy)
@@ -243,6 +243,10 @@
switch ( item.getItemId() )
{
+ case ItemPool.DISTENTION_PILL:
+ stringForm.append( "-1 full from next food eaten" );
+ break;
+
case ItemPool.MUNCHIES_PILL:
stringForm.append( "+1-3 adv from next food eaten" );
break;
Index: src/net/sourceforge/kolmafia/swingui/panel/UseItemDequeuePanel.java
===================================================================
--- src/net/sourceforge/kolmafia/swingui/panel/UseItemDequeuePanel.java (revision 9485)
+++ src/net/sourceforge/kolmafia/swingui/panel/UseItemDequeuePanel.java (working copy)
@@ -251,8 +251,15 @@
return true;
}
break;
+
+ case KoLConstants.CONSUME_USE:
+ if ( UseItemDequeuePanel.this.food &&
+ creation.getItemId() == ItemPool.DISTENTION_PILL )
+ {
+ return true;
+ }
+ break;
}
-
return false;
}
}
Index: src/net/sourceforge/kolmafia/swingui/panel/UseItemEnqueuePanel.java
===================================================================
--- src/net/sourceforge/kolmafia/swingui/panel/UseItemEnqueuePanel.java (revision 9485)
+++ src/net/sourceforge/kolmafia/swingui/panel/UseItemEnqueuePanel.java (working copy)
@@ -459,6 +459,17 @@
return super.isVisible( element );
}
+ case KoLConstants.CONSUME_USE:
+ if ( !UseItemEnqueuePanel.this.food ||
+ creation.getItemId() != ItemPool.DISTENTION_PILL )
+ {
+ return false;
+ }
+ else
+ {
+ return super.isVisible( element );
+ }
+
default:
return false;
}
Index: src/net/sourceforge/kolmafia/swingui/panel/ItemManagePanel.java
===================================================================
--- src/net/sourceforge/kolmafia/swingui/panel/ItemManagePanel.java (revision 9485)
+++ src/net/sourceforge/kolmafia/swingui/panel/ItemManagePanel.java (working copy)
@@ -961,7 +961,8 @@
// are marked as expected.
isVisibleWithFilter = FilterItemField.this.other;
- if ( name.equalsIgnoreCase( "milk of magnesium" ) || name.equalsIgnoreCase( "munchies pills" ) )
+ if ( name.equalsIgnoreCase( "milk of magnesium" ) || name.equalsIgnoreCase( "munchies pills" )
+ || name.equalsIgnoreCase( "distention pill" ) );
{
isVisibleWithFilter |= FilterItemField.this.food;
}
Index: src/net/sourceforge/kolmafia/objectpool/ItemPool.java
===================================================================
--- src/net/sourceforge/kolmafia/objectpool/ItemPool.java (revision 9485)
+++ src/net/sourceforge/kolmafia/objectpool/ItemPool.java (working copy)
@@ -1260,6 +1260,7 @@
public static final int HONEYPOT = 5145;
public static final int SPOOKY_LITTLE_GIRL = 5165;
public static final int SYNTHETIC_DOG_HAIR_PILL = 5167;
+ public static final int DISTENTION_PILL = 5168;
public static final int TRANSPORTER_TRANSPONDER = 5170;
public static final int RONALD_SHELTER_MAP = 5171;
public static final int GRIMACE_SHELTER_MAP = 5172;
Index: src/net/sourceforge/kolmafia/request/UseItemRequest.java
===================================================================
--- src/net/sourceforge/kolmafia/request/UseItemRequest.java (revision 9485)
+++ src/net/sourceforge/kolmafia/request/UseItemRequest.java (working copy)
@@ -439,6 +439,19 @@
}
UseItemRequest.limiter = "daily limit";
return Preferences.getBoolean( "_syntheticDogHairPillUsed" ) ? 0 : 1;
+
+ case ItemPool.DISTENTION_PILL:
+ boolean stomachAvailable = ( KoLCharacter.getFullnessLimit() - KoLCharacter.getFullness() ) > 0;
+
+ //The distention pill is not usable when you're full.
+ //Even if you plan on eating a 1-full food.
+ if ( !stomachAvailable )
+ {
+ UseItemRequest.limiter = "remaining fullness";
+ return 0;
+ }
+ UseItemRequest.limiter = "daily limit";
+ return Preferences.getBoolean( "_distentionPillUsed" ) ? 0 : 1;
case ItemPool.BURROWGRUB_HIVE:
UseItemRequest.limiter = "daily limit";
@@ -1767,6 +1780,26 @@
return;
}
+ // If we ate a distention pill, the next thing we eat should
+ // detect the extra message and decrement fullness by 1.
+ if ( responseText.indexOf( "feel your stomach shrink" ) != -1 )
+ {
+ int fullness = ItemDatabase
+ .getFullness( item.getName() );
+ int count = item.getCount();
+
+ // If we got this message, we definitely used a pill
+ // today.
+ Preferences.setBoolean( "_distentionPillUsed", true );
+ Preferences.increment( "currentFullness", -1 );
+ String message = "Incrementing fullness by " + ( fullness * count - 1 )
+ + " instead of " + ( fullness * count )
+ + " because your stomach was distended.";
+ RequestLogger.updateSessionLog( message );
+ RequestLogger.printLine( message );
+ KoLCharacter.updateStatus();
+ }
+
// Check to make sure that it wasn't a food or drink
// that was consumed that resulted in nothing. Eating
// too much is flagged as a continuable state.
@@ -3206,6 +3239,22 @@
ConcoctionDatabase.getUsables().sort();
}
return;
+
+ case ItemPool.DISTENTION_PILL:
+
+ //Your stomach feels rather stretched out
+ if ( responseText.indexOf( "stomach feels rather stretched" ) != -1 )
+ {
+ Preferences.setBoolean( "_distentionPillUsed", true );
+ ConcoctionDatabase.getUsables().sort();
+ }
+ else if ( responseText.indexOf( "stomach can't take any more abuse" ) != -1 )
+ {
+ Preferences.setBoolean( "_distentionPillUsed", true );
+ KoLCharacter.updateStatus();
+ ConcoctionDatabase.getUsables().sort();
+ }
+ return;
case ItemPool.MILK_OF_MAGNESIUM:
Index: src/data/defaults.txt
===================================================================
--- src/data/defaults.txt (revision 9485)
+++ src/data/defaults.txt (working copy)
@@ -661,6 +661,7 @@
user _chipBags 0
user _crimboTree false
user _deluxeKlawSummons 0
+user _distentionPillUsed false
user _fingertrapArrows 0
user _gapBuffs 0
user _gibbererAdv 0