New Content - Implemented Dice

Veracity

Developer
Staff member
Whoa. the new dice - d4, d6, d8, d10, d12, d20 - are both combat usable and multi-usable.
If you use a single d4, d6, or d8, you get quantities of restoratives.

But if you use 3 d6s at once - you roll 3d6 - you get stats. For example:

You roll for your Strength.
You gain 23 Beefiness.

If you use 2 d10s at once - you roll percentile dice - you get an adventure. This can fail:

no adventures:
You don't have time to go on an adventure. Even an imaginary one.
drunk:
Your imagination is too drunk right now.

Otherwise, you gain stats or, perhaps, a "dungeon dragon chest" - a usable not-yet-implemented item.

This thread is for reminding me (us) that work needs to be done to support these things. And who knows what else remains to be found?
 

matt.chugg

Moderator
D12 is mutli usable but is only consumed if used individually

using 1:
Code:
<centeR><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor="#660066"><b>Results:</b></td></tr><tr><td style="padding: 5px; border: 1px solid #660066;"><center><table><tr><td>You decide to get a new weapon, so you roll your d12 and consult the Random Weapon Chart.<p>It comes up <b>9</b> which is... a <b>bastard ice sickle</b>!  How convenient!<center><table><tr><td><img class=hand src="/images/itemimages/d12.gif" onClick='eff("68ee3c6a89d6df3bfb0f71b0121b579b");' width=30 height=30 alt="Bastard!" title="Bastard!"></td><td valign=center class=effect>You acquire an effect: <b>Bastard!</b><br>(duration: 10 Adventures)</td></tr></table></center></blockquote></td></tr></table></center>

consumed

using 2 - 104
You pull out a longbow (where'd you get a longbow?) and nock an arrow. You draw the bow and roll xd12 to see how far the arrow flies. It goes y feet, and doesn't hit anything interesting. You grumble and put the dice away.

x = quantity used, y = a number proportional to x but not always the same distance

x = 2: y = 10, 15, 14, 17, 12 probably others
x = 100: y = 688, 681, 687, 699, 618 probably others

Not sure exact relationship of x to y, but thats more wiki spading than kolmafia spading since it doesn't actually seem to do anything!

so to summarize, if you gain bastard efect item is comsumed, if "You grumble and put the dice away." it isn't consumed

tested for quantities 1 to 104
 

matt.chugg

Moderator
D20 is mutli usable but is similar to d12:

using 1: without effect Natural 20 or Natural 1:
Code:
You roll for initiative...

A 20!
You acquire an effect: Natural 20 (duration: 1 Adventure) (or Natural 1)

using 1: with effect Natural 20 or natural 1:
You already rolled for initiative. (not consumed)

using 2 - 19:
You can't figure out a good way to roll that quantity of 20-sided dice. Maybe you should've paid less attention in gym class.(not consumed)


using 20:
You roll 20d20 and consult the chart. Unfortunately, the only chart you have handy is an eye chart. Fortunately, it says your vision is perfect!
You acquire an effect: 20/20 Vision (duration: 227 Adventures)
This is still doable even if you have the effect, not like the one above, the duration is random (consumed)

using 21 - 64:
You can't figure out a good way to roll that quantity of 20-sided dice. Maybe you should've paid less attention in gym class. (not consumed)

not tested any higher, since I had to double use 20 to test if it worked with the effect active!
 
Last edited:

matt.chugg

Moderator
I think this should do the trick for the 12 and 20
Code:
### Eclipse Workspace Patch 1.0
#P kolmafia
Index: src/net/sourceforge/kolmafia/request/UseItemRequest.java
===================================================================
--- src/net/sourceforge/kolmafia/request/UseItemRequest.java	(revision 9830)
+++ src/net/sourceforge/kolmafia/request/UseItemRequest.java	(working copy)
@@ -3157,7 +3157,33 @@
 			}
 
 			return;
+			
+		case ItemPool.D12:
+			// D12 not consumed if You pull out a longbow (where'd you get a longbow?) and nock an arrow. You draw the bow and roll xd12 to see how far the arrow flies. It goes y feet, and doesn't hit anything interesting. You grumble and put the dice away.
+			if ( responseText.indexOf( "You grumble and put the dice away." ) != -1 )
+			{
+				KoLmafia.updateDisplay("You grumble and put the dice away.");
+				ResultProcessor.processResult( item );
+			}
+			return;
+			
+		case ItemPool.D20:
+			// D20 not consumed if you already have the effect
+			// You already rolled for initiative
+			// or if You can't figure out a good way to roll that quantity of 20-sided dice. Maybe you should've paid less attention in gym class.
+			if ( responseText.indexOf( "You already rolled for initiative" ) != -1 )
+			{
+				UseItemRequest.lastUpdate = "You already rolled for initiative.";
+				KoLmafia.updateDisplay( KoLConstants.ERROR_STATE, UseItemRequest.lastUpdate );
+				ResultProcessor.processResult( item );
+			} else if (responseText.indexOf( "can't figure out a good way to roll" ) != -1 ) {
+				KoLmafia.updateDisplay("You can't figure out a good way to roll that quantity of 20-sided dice.");
+				ResultProcessor.processResult( item );
+			}
+			return;
+			
 
+			
 		case ItemPool.BRICKO_OOZE:
 		case ItemPool.BRICKO_BAT:
 		case ItemPool.BRICKO_OYSTER:

I have a question though, what is UseItemRequest.lastUpdate used for? is it checked again later for something to see what happened last time one was used?
 

Bale

Minion
d20 doesn't only give "Natural 20". It can also give "Natural 1" if you're unlucky. I don't think that impacts your code, I'm just throwing that out there.
 

matt.chugg

Moderator
d20 doesn't only give "Natural 20". It can also give "Natural 1" if you're unlucky. I don't think that impacts your code, I'm just throwing that out there.

It may do if the response text for using d20 whilst "natural 1" is active differs from "natural 20"

edit: it doesn't but I have edited #3 to include your info!
 

Veracity

Developer
Staff member
I have a question though, what is UseItemRequest.lastUpdate used for? is it checked again later for something to see what happened last time one was used?
When you use an item, it will either succeed or fail. If it fails, we undo the consumption and sometimes print a message. Sometimes that message puts KoLmafia into an error state and stops scripts. Sometimes it is informational.

The "use" command returns true or false depending on whether the usage succeeded or not, regardless of the error state. It figures that out from lastUpdate.

Revision 9031 should do the right thing with usage failures for d10, d12, and d20. They all put the GUI into an error (red) state. I'm not actually sure that's necessary, since I think it will do that even if you use the dice in the Relay Browser. But I do think we should probably stop scripts if they fail to use a 2nd d20, say, and that's how we do it.
 

matt.chugg

Moderator
When you use an item, it will either succeed or fail. If it fails, we undo the consumption and sometimes print a message. Sometimes that message puts KoLmafia into an error state and stops scripts. Sometimes it is informational.

The "use" command returns true or false depending on whether the usage succeeded or not, regardless of the error state. It figures that out from lastUpdate.

Revision 9031 should do the right thing with usage failures for d10, d12, and d20. They all put the GUI into an error (red) state. I'm not actually sure that's necessary, since I think it will do that even if you use the dice in the Relay Browser. But I do think we should probably stop scripts if they fail to use a 2nd d20, say, and that's how we do it.

Thanks for the update, and answering my question!
 

Veracity

Developer
Staff member
I think we support all that is currently implemented for this. Eventually, the dungeon dragon chest and, perhaps, rolling something other than 2d10 will be implemented in KoL and we will adapt.
 

matt.chugg

Moderator
I think we support all that is currently implemented for this. Eventually, the dungeon dragon chest and, perhaps, rolling something other than 2d10 will be implemented in KoL and we will adapt.

I think multi-using 100 d4 does something new, accoring to speculation in GD and some wiki gibberish, wish i'd kept the ones I had early on now, mall price just hit 70k

I think, rolling 100D4 gives a combat, which can drop a familiar hatchling, from what I can gather the drop rate is pretty low, I think I saw somewhere 6 attempts with +300% item, i'll be back with more accurate information when I get 100 d4, (I sold all dice I owned!)
 

Sentrion

Member
It gives combat with a family of kobolds, which drops a kobold treasure hoard, which upon opening, has a chance of giving you a newborn kobold, which grows into a feral kobold.
 

slyz

Developer
The monster you get to fight when you multi-use 100 d4s is a family of kobolds. It drops a kobold treasure hoard, which sometimes give you a familiar hatchling, the newborn kobold. The hatchling becomes a Feral Kobold.

Everyone seems to be scrambling to sell their d4s, I don't think many people are spading this ^^
 
Top