New Content - Implemented Deck of Every Card

I will never have a 'gift card'.

Could you get a DEBUG log of using one in the Relay Browser, from the initial "use" through the final result, please? Thanks.
 
Eh, that's kind of a bit too wide, no? I mean, there's not a single item in the drop-down that's wider than "Deck of every card: ". As it is now, the card-count is almost entirely out of frame on the default panel on Windows, and I know it'll be a lot further out on my Linux machine (which I won't be on for a couple of weeks). In other words, the BLAHBLAH to widen the drop-down can probably be removed.
 
Eh, that's kind of a bit too wide, no? I mean, there's not a single item in the drop-down that's wider than "Deck of every card: ". As it is now, the card-count is almost entirely out of frame on the default panel on Windows, and I know it'll be a lot further out on my Linux machine (which I won't be on for a couple of weeks). In other words, the BLAHBLAH to widen the drop-down can probably be removed.

Yeah. I had about 15 minutes to deal with this and submitting with it wider than needed was my choice given that the alternative was to have it hanging over me and unsubmitted. My intention was to size the drop down to match the available hatter buffs drop down because that meant that the deck drop was not going to be driving size issues. The fact that size is determined by a string and the string is actually measured in the font used to render it means that I either can't count characters or guess how a proportional font is going to render. Before I ran out of time, I did observe that removing BLAHBLAH was not satisfactory. I suppose I will eventually get around to tuning the string so the sizing is better or just using the same size string as the hatter buffs and making a comment in the code as to why that is being done. But eventually is no sooner than several hours from now and possibly much longer :-(
 
It should be noted that the hatter sizing still leaves a bunch of them wider than the drop-down, but (like with the deck) it's not a big deal, since the detailed information is in the tool-tip. I think the longest deck item would be fight constellation, and I doubt it would bother many people if it was slightly cut off. Also, I can currently only vouch for this being accurate on Windows with the settings I am currently using. Ultimately, this isn't going to bother me much if it remains as is, because I can easily add it to my collection of UI personalizing hacks.
 
Necroing an old thread... So, someone mentioned in chat about having mafia track deck draws, I came up with something that seems ok (not that I know all of the implications of how ChoiceManager works). Could this be a thing?

Code:
--- src/data/defaults.txt	(revision 17293)
+++ src/data/defaults.txt	(working copy)
@@ -1220,6 +1226,7 @@
 user	_deluxeKlawSummons	0
 user	_defectiveTokenChecked	false
 user	_demandSandwich	0
+user	_deckCardsCheated
 user	_detectiveCasesCompleted	0
 user	_dinseyGarbageDisposed	false
 user	_discoKnife	false
--- src/net/sourceforge/kolmafia/session/ChoiceManager.java	(revision 17293)
+++ src/net/sourceforge/kolmafia/session/ChoiceManager.java	(working copy)
@@ -238,8 +238,9 @@
 	private static final Pattern ENLIGHTENMENT_PATTERN = Pattern.compile( "achieved <b>(\\d+)</b> enlightenment" );
 	private static final Pattern ORACLE_QUEST_PATTERN = Pattern.compile( "don't remember leaving any spoons in (.*?)"" );
 	private static final Pattern CASE_PATTERN = Pattern.compile( "\\((\\d+) more case" );
	private static final Pattern TIME_SPINNER_PATTERN = Pattern.compile( "have (\\d+) minute" );
 	private static final Pattern TIME_SPINNER_MEDALS_PATTERN = Pattern.compile( "memory of earning <b>(\\d+) medal" );
+	private static final Pattern DECK_OF_EVERY_CARD_CHEAT_PATTERN = Pattern.compile( "which=(\\d+)" );
 
 	public static final Pattern DECISION_BUTTON_PATTERN = Pattern.compile( "<input type=hidden name=option value=(\\d+)>(?:.*?)<input +class=button type=submit value=\"(.*?)\">" );
@@ -6681,6 +6701,23 @@
 				// The extra 1 will be covered in choice 1085
 				Preferences.increment( "_deckCardsDrawn", 4, 15, false );
 			}
+
+ 			if ( ChoiceManager.lastDecision == 1 && request.getURLString().contains( "which=" ) )
+			{
+				Matcher cheatMatcher = ChoiceManager.DECK_OF_EVERY_CARD_CHEAT_PATTERN.matcher( request.getURLString() );
+				if ( cheatMatcher.find() )
+				{
+					int cheatedCard = StringUtilities.parseInt( cheatMatcher.group( 1 ) );
+					String cardsCheated = Preferences.getString( "_deckCardsCheated" );
+					if ( !cardsCheated.isEmpty() )
+					{
+						cardsCheated += ",";
+					}
+					cardsCheated += cheatedCard;
+					Preferences.setString( "_deckCardsCheated", cardsCheated );
+				}
+			}
+
 			break;
 
 		case 1089: // Community Service
 
That would be very nice. (And solve a small problem of mine.)

Once we get an answer on this (thumbs up or down) the thread will be tagged as implemented. Finally.
 
Can you cheat an option after randomly drawing it? If not, the tracking is a bit more complicated. Especially when some options take you directly to a combat.

Only tracking cheats is probably good enough, even if it isn't actually correct...
 
Can you cheat an option after randomly drawing it? If not, the tracking is a bit more complicated. Especially when some options take you directly to a combat.

Only tracking cheats is probably good enough, even if it isn't actually correct...

If you randomly draw it, you can't cheat it.

All the draws appear to go to a card first and then you click through (I'm not sure what fast-play mode is, but I think that was just an animation?). So, I could put together a table of all of those results if someone wanted it. I'm not sure the current way that is handled in mafia as I am trying to match style as per the existing code.

But yeah, it is probably "good enough".
 
Last edited:
One aspect that still appears to be missing, is utilizing the 'gift card'. The CLI doesn't automate through using the gift card.
Revision 17390 adds a default of 1 to choice 1085. Having done that, "use 1 gift card" automates through fights and such, just as expected. (The fact that gift cards are now about 6K Meat in the mall made this easy to test,)

Are we done with this New Content now?
 
Or not. I see something from cheesecookie about tracking deck draws.

The only thing on my personal list was "look at gift cards" - which now works as expected.
 
If no dev has an interest in tracking cards drawn from the deck we can always close this. No rule says you have to make everyone happy. (Although I admit I'd like the feature as well.)
 
I would too, though no idea when I'll have time. It irritates me that maximizer suggests buffs from cards I cannot get as I have taken them already that day.
 
So, someone mentioned in chat about having mafia track deck draws, I came up with something that seems ok (not that I know all of the implications of how ChoiceManager works). Could this be a thing?
If you randomly draw it, you can't cheat it.
So it seems that what we want to track is all cards you have seen today, whether by drawing or cheating.

All the draws appear to go to a card first and then you click through (I'm not sure what fast-play mode is, but I think that was just an animation?). So, I could put together a table of all of those results if someone wanted it. I'm not sure the current way that is handled in mafia as I am trying to match style as per the existing code.
"Fast-play mode" is just animation. When you draw a card - either by play or cheat or a gift card, it shows you the card back. You can click and it will animate turning over the card. That animation is done by the browser in Javascript; it does not result in a request.

Some of the cards give you an effect right away. Others require you to take a choice to go into a fight or get items. Here are some examples from a session log yesterday when I did some testing.

Code:
[423886] gift card
Encounter: XXI - The World
You gain 500 Strengthliness

use 1 gift card

[423886] gift card
Encounter: Go Fish
Encounter: urchin urchin
Round 0: Tebryn wins initiative!
Round 1: Tebryn attacks!
Round 2: You lose 12 hit points
Round 2: Stubert climbs up and sits on your shoulder, and hands you some Meat. Huh, where did he find that?
You gain 56 Meat.
Round 2: Tebryn attacks!
Round 3: urchin urchin takes 2381 damage.
Round 3: Tebryn wins the fight!
After Battle: Wingwang whirls around picking up items, like a little couscous tornado.
You acquire an item: bazookafish bubble gum
After Battle: You gain 30 Strongness
After Battle: You gain 58 Magicalness
After Battle: You gain 18 Roguishness

use 1 gift card

[423887] gift card
Encounter: Two of Papayas
choice 1085/1: Grab 'em!
Took choice 1085/1: Grab 'em!
choice.php?whichchoice=1085&option=1&pwd
You acquire papaya (2)

use 1 gift card

[423887] gift card
Encounter: IX - The Hermit
Took choice 1085/1: You'll show him!
choice.php?whichchoice=1085&option=1&pwd
Encounter: The Hermit
Round 0: Tebryn wins initiative!
Round 1: Tebryn executes a macro!
Round 1: Tebryn uses the seal tooth!
Round 2: The Hermit takes 1 damage.
Round 2: You lose 1,031 hit points
Round 2: Tebryn uses the seal tooth!
Round 3: The Hermit takes 1 damage.
Round 3: You lose 869 hit points
Round 3: Tebryn uses the seal tooth!
Round 4: The Hermit takes 1 damage.
Round 4: You lose 1,248 hit points
Round 4: Tebryn uses the seal tooth!
Round 5: The Hermit takes 1 damage.
Round 5: You lose 1,248 hit points
You acquire an item: hermit factoid
I'll experiment some more and see what it will take to detect which card you got and add it to a list. As I said, we'll want cards drawn, not just cheated.
 
Revision 17391 should do it. Setting _deckCardsSeen has all the cards you've seen today, separated with the | character.
 
Really? Already?! You're amazing.

(Now I'm going to have to go back to my logScript and remove the part where I visit_url() to find out what the current cards are before I use up any unspent cheats.)

I am so tempted to add cheating to newLife now that mafia can confirm which cards are available... though there might be someone who doesn't want to spend a cheat on mainstat. (Or even someone in hardcore that doesn't want a Mickey Mantle card.)
 
My first day HC draws are Mine, Tower, and Ancestral Recall. I'm slow enough that I have never wished I had more Meat to start with than the 1,000 my Chateau desk gives me. Although, that will likely change, once the Chateau goes out of style...

This was trivial once I recalled the place which logs "Encounter: <card name>".
 
Back
Top