Bug - Fixed You can only buy one abridged dictionary per ascension

Cool12309

Member
Code:
> ash retrieve_item(1, $item[abridged dictionary])

Purchasing abridged dictionary (1 @ 950)...
Desired purchase quantity not reached (wanted 1, got 0)
Verifying ingredients for abridged dictionary (1)...
You need 1 more abridged dictionary to continue.

(I was already in the Swashbuckling Getup outfit) Perhaps mafia should recognize that this is not available for purchase more than once per ascension so that it does not attempt to purchase it?
 

Bale

Minion
It doesn't seem a problem as long as you trap the error condition if you do that in a script. It's not as though this is the only item in the game that could fail a retrieve_item().
 

Cool12309

Member
This is true, though I thought mafia wanted to prevent buying things that you cannot, as that wastes server hits. It shouldn't be much more than storing it in a preference (lastAscensionBought<itemid>?) and then checking against that, should it?
 

Bale

Minion
True enough that saving server hits is a goal of KoLmafia. How many other items are there that can only be bought once per ascension or per day?

I know that miracle whip can only be bought once per ascension. What are the others?
 

xKiv

Active member
cheap toaster, massive Manual of Marauder Mockery, forged identification documents (probably?), damp old boot?

sewing kit can only be bought if it isn't in inventory
desert bus pass can only be bought if you don't already have beach access
 

Veracity

Developer
Staff member
I thought I might have fixed this with recent work, but apparently not.

Code:
[color=green]> ash retrieve_item(1, $item[abridged dictionary])[/color]

Putting on outfit: Swashbuckling Getup
Equipment changed.
Purchasing abridged dictionary (1 @ 950)...
Desired purchase quantity not reached (wanted 1, got 0)
Verifying ingredients for abridged dictionary (1)...
[color=red]You need 1 more abridged dictionary to continue.[/color]
Returned: false
Also notice that it left me in the Swashbuckling Getup.
 

Veracity

Developer
Staff member
Ha.

Code:
[color=green]> acquire abridged dictionary[/color]

Verifying ingredients for abridged dictionary (1)...
[color=red]You need 1 more abridged dictionary to continue.[/color]

[color=green]> ash retrieve_item(1, $item[abridged dictionary])[/color]

Verifying ingredients for abridged dictionary (1)...
[color=red]You need 1 more abridged dictionary to continue.[/color]
Returned: false
I did "fix" this by making it unavailable if you have an abridged dictionary or a dictionary - not not if you have a facsimile dictionary. The actual way to check that is if you have completed the Baron's quest, not looking to see if the item is in your inventory.

Revision 17408 adds that.

I'm leaving this open since there are other things worth looking at in the comments...
 

Veracity

Developer
Staff member
cheap toaster, massive Manual of Marauder Mockery, forged identification documents (probably?), damp old boot?

sewing kit can only be bought if it isn't in inventory
desert bus pass can only be bought if you don't already have beach access
We already track the damp old boot.
We now track forged identification documents.

I am surprised that the Massive Manual of Marauder Mockery is limited, considering that the Big Book of Pirate Insults is not. Are you sure?

desert bus pass would be easy to limit.
So would sewing kit - Vending machine is a coinmaster

toaster is one/ascension? We'd need a setting to track that. Given that, easy enough - The Shore Gift Shop is a Coinmaster.
How about the UV-resistant compass - which is a quest item? Easy.

(By the way, did you know that if you click on The Shore at the Desert Beach while overdrunk, you get Drunken Stupor? Seems pretty hostile, since you are not actually using adventures to go in there - only when you take a vacation. You can still go directly to the gift shop using KoLmafia.)
 

Veracity

Developer
Staff member
Revision 17409 does this:

sewing kit can only be bought if it isn't in inventory
Ditto for UV-resistant compass

Near as I can tell, we already checked for the desert bus pass. I turned an if-then-else chain into a switch, for clarity.

I did nothing for the Massive Manual of Marauder Mockery since I don't have any additional evidence that it is limited; I assume it is like the Big Book of Pirate Insults.

That leaves the toaster, since I didn't feel like dealing with it. We could make a reset-on-ascension setting - "toasterPurchased" or something - set it when you purchase it or when we notice the toaster is not available when we visit the Shore Gift Shop. I just didn't feel motivated.

I am also not interested in Mayo stuff, but it looks like we have a "mayoWhipRented" setting which already tracks this.

I'm going to declare this done, since it does what the OP asked for - and more.

If someone wants us to track buying a cheap toaster once-per-ascension, please open a new Bug Report. Thanks. :)
 

Bale

Minion
I feel like there should be more uniformity with these many preferences so that they can be more easily tracked and handled.

Could they be named boughtItemXXXXXX where "XXXXXX" is the item number of an item that can only be bought once per ascension?

Outside of KoLmafia I don't think that any script are yet paying attention to these preferences so it shouldn't be important to worry about script compatibility with the change.

In terms of consistency this is similar to how we have preferences that track the level of skills that can be bought multiple times. And recipes that need to be learned.
 
Last edited:

Veracity

Developer
Staff member
That seems reasonable. We only track a few, so far; most of the "one per ascension" things are quest items and I detect them via inventory, rather than settings.

What about things like Tales of Dread, which is one-ever? Same convention?
 

Bale

Minion
Awww... I was preparing to add more argument, but you already agreed. Anyway, preferences for other reasons that have similar conventions are
  • skillBurn#
  • skillLevel#
  • unknownRecipe#


That seems reasonable. We only track a few, so far; most of the "one per ascension" things are quest items and I detect them via inventory, rather than settings.

What about things like Tales of Dread, which is one-ever? Same convention?

I think that would be good. It's nice to keep them in one easily searchable list, unless you want to have two related formats:
  • itemBoughtPerAscension#
  • itemBoughtPerCharacter#

That is actually a good idea since it will help people separate such things if they need to update...

There's no need to have such a preference for Tales of Dread though, is it? I mean, mafia should know if the character owns one. Is there a case where you can buy such a thing, once for a character, and it then goes away, not to be found in inventory?
 

Veracity

Developer
Staff member
Well, we have pseudo-items which you "buy" but do not appear in inventory. Maps to locations in The Sea, for example. Those are once per ascension, not once per character. We have the following setting for those:

user mapToAnemoneMinePurchased false
user mapToMadnessReefPurchased false
user mapToTheDiveBarPurchased false
user mapToTheMarinaraTrenchPurchased false
user mapToTheSkateParkPurchased false

I could make all of those "itemBoughtPerAscension#" things. I have a feeling that non-ascenders like frono would squawk at this non-backward-compatible change, though.

InventoryManager is able to look in "accessible" places - but those depend on your settings - and we never look in the Display Case. Mafia "should know" - but only inventory, closet, and storage (and free pulls) are "free" places to look.

Can you buy another Tales of Dread if your other copy is in the Display Case?
 

Veracity

Developer
Staff member
I renamed 4 settings and added one:

itemBoughtPerAscension637 (cheap toaster)
hasTalesOfDread -> itemBoughtPerCharacter6424
hasBrassDreadFlask -> itemBoughtPerCharacter6428
hasSilverDreadFlask -> itemBoughtPerCharacter6429
mayoWhipRented -> itemBoughtPerAscension8266

As you can see, there are not actually that many that we need to track via setting; quest items can be detected in inventory, for example.
 

Bale

Minion
Well, we have pseudo-items which you "buy" but do not appear in inventory. Maps to locations in The Sea, for example. Those are once per ascension, not once per character. We have the following setting for those:

user mapToAnemoneMinePurchased false
user mapToMadnessReefPurchased false
user mapToTheDiveBarPurchased false
user mapToTheMarinaraTrenchPurchased false
user mapToTheSkateParkPurchased false

I could make all of those "itemBoughtPerAscension#" things. I have a feeling that non-ascenders like frono would squawk at this non-backward-compatible change, though.

I've been thinking about this. I believe it should be okay as long as there is code to recognize the presence of those locations when the sea floor zone is loaded. Though I would like to hear the viewpoint of fronobulax and other non-ascending types.
 

fronobulax

Developer
Staff member
I missed the first shout out. AFAIK my non-ascending character is not using those preferences in any scripts, so there is no backwards to be compatible with. I am also used to being an edge case with that character and expect mafia changes to sometimes require intervention with a text editor for scripts and settings. So I think I'm good.
 
Top