New Content - Implemented New item in swagger shop

Veracity

Developer
Staff member
Here is my understanding of what we know about this item.

- The skill is once per day. Like every other skill of that sort, ascending allows you to cast it again. Therefore, a simple "_" setting suffices to track whether you can currently cast it. This is done.
- The skill gives a chat effect for the next thing you type in chat. If you cast it, ascend, and cast it again, it stacks and affects the next two things you type. Presumably you could chain casual ascensions and get even more stackings. That qualifies as a "stunt"...
- ... because the counter s reset at rollover.

Given the above, I see no reason whatsoever to track the count of how many times the chat effect will activate. I cannot imagine that anybody will ever cast this without knowing exactly what they want to say to activate the effect - and if they ascend between castings, I am quite sure that they know which two things they want to say. And if they want to pull a stunt with multiple casual ascensions, again, it will all be planned and they do not need KoLmafia to track it.

- The item appears in the Swagger Shop if and only if you have never bought it before. A tiny number of people managed to buy two, before that was fixed. We do not need to put in special code to support that; I am sure that the item no longer appears in the Swagger Shop for them.
- I assume - but we will not know for another 50 days - that it will appear in the shop, whether or not it is a pirate season, until you buy it. It will still require you to have earned swagger during a "pirate season" in order to purchase it, but if you earn 1,000 this season and then spend them all on something else and then earn another 1,000 next (non-pirate) season, I expect the item is still unlocked for you; you will still have earned 1,000 swagger "during a pirate season".

Given the above, we can tell that you have already purchased the item in several ways:

- it is in inventory, closet, or storage (or your display case, but that takes a server hit to check)
- you have the skill (although presumably you don't see it on avatar paths)
- the item is not in the Swagger shop.

Given the above, I guess the way I want the Swagger Shop to work in the Coinmasters frame is this:

- If the item is available for purchase, show it.
- If you don't have enough swagger to buy it, grey it out (just like all other unaffordable items in Coinmasters)
- If you have not unlocked it by getting 1,000 pirateSwagger (detectable when we visit), grey it out.

I suppose we could have a setting - blackBartsBooty - which is true or false depending on whether you've bought the item. Visiting the Swagger Shop and seeing if it is on offer would definitively answer that, but purchasing the item - or using it, or seeing the skill in your known skills - could also let us definitively set that setting.

To be honest, I'm not sure it's worth it; right now, we always show the item and I am sure that if you try to buy it, we detect that it didn't work and leave your swagger balance untouched. Seems mostly cosmetic - and prevents a server hit if you intentionally try to buy the item a second time, even though you certainly know you already did it once.
 

Veracity

Developer
Staff member
We'll see. If so, then "show it only if visiting the swagger shop shows it" would be the simplest solution. Sort of like how we don't show you what Mr. Store has on offer until you visit it.
 

Bale

Minion
Given the above, I see no reason whatsoever to track the count of how many times the chat effect will activate. I cannot imagine that anybody will ever cast this without knowing exactly what they want to say to activate the effect - and if they ascend between castings, I am quite sure that they know which two things they want to say. And if they want to pull a stunt with multiple casual ascensions, again, it will all be planned and they do not need KoLmafia to track it.

You are correct. I gracefully withdraw my request as both unnecessary and excessive.
 

Veracity

Developer
Staff member
I think this is done.

- We assume that the item is available.
- If you visit the shop and don't see it, we remember that it is not available.
- If you buy it (or use it), we remember that it is unavailable.
- The Coinmaster for the Swagger Shop will not show the item if it is either unavailable or if you have not earned enough swagger in a pirate season.
 

Veracity

Developer
Staff member
Yes. But this is whether or not the item is "unlocked", not whether or not you can afford it.

If you have not unlocked the item by earning 1,000 swagger in a pirate season, we don't show it to you.
If you have unlocked it but have spent your swagger on other things and have less than 1,000 left, we show it in grey.

I thought very carefully about this exact thing and this what what I decided. :)
 
Ah, ok, now I get it. Thanks for clarifying ;-)

Then there's the game grid shop - that shows items which haven't been unlocked? Not that these are important matters.
 

Veracity

Developer
Staff member
Does the game grid shop show you items that you have not unlocked? If not, we could use the same mechanism and suppress unavailable items in the Coinmaster, too.

Until I refactored things, the only "conditional" items we showed were the Lighthouse Keeper's bombs in the Dimemaster or Quartersmaster, depending on whose side you did the beach quest for. I generalized that and now you can have a custom item filter for each Coinmaster in the Coinmaster GUI which will decide whether a particular item is totally unavailable or not.

I'm not completely happy with it, since if we decide an item is unavailable, it renders an empty line, rather than completely suppressing it. But, that was how the pyro items worked and I didn't have the time to come up with an alternate method, right now. But, it would be easy to add a filter to the Game Grid shop coinmaster, if someone were to feel motivated. :)
 
The shop itself does not show unlocked items. I actually like seeing the non-unlocked items in mafia, but that's me, I like to see what I'm missing. Borders on the spoilerish, perhaps. Maybe use a different text treatment for non-unlocked items?

This discussion is wandering into overall coinmaster feature revision territory (my derail). For my part, anyway, this isn't much of a priority, just my OCD kicking in ;-)
 

lostcalpolydude

Developer
Staff member
I have code written for that (and for having a folder holder equipped to buy the folder), minus parsing in TicketCounterRequest to actually set some values to track whether things are unlocked (which wouldn't be hard to write, and I propose lockedItemXXXX similar to unknownRecipe settings for tracking that type of thing). However, the presence of blank lines that can't be shoved to the bottom of the list makes it probably not desirable.
 

Veracity

Developer
Staff member
I'll poke at it and see if I can suppress the lines entirely. I took the idea of a filter from LockableListModel, but I expect I need a way to apply it to a line before the renderer is called, rather than in the renderer. As I said, that was how it was done for the Pyro items - but I wrote that code very early on in my experience with Swing. I know more now.

Edit: Oooh. LockableListModel.getMirrorImage( filter ) exists exactly for this purpose. Assuming the sold items are LockableListModels (I think they are), I can use that directly. Stay tuned.
 
Last edited:

Veracity

Developer
Staff member
Oh, ick. I can set a Filter on the LockableListModel, but when we wrap it in the AutoFilterTextField, another one is imposed and it loses the one I initialized it with.
 

Veracity

Developer
Staff member
OK, turns out that the AutoFilterTextField lets you supply your own filter method - and the CoinmastersFrame was already using that for Big Brother, to filter out black glass, maps that you have already bought, and so on. Whoever did that didn't bother to refactor the Lighthouse bombs from the Dimemaster and Quartersmaster to use the new mechanism.

I did so - and also the Swagger Shop. So, now it should show you Black Bart's Booty if you can buy it and not otherwise, with no blank lines.

Given that, I now think that it should show it if it is in the Swagger Shop, but disable it if you have not earned enough Pirate Season swagger. I.e., separate the two conditions. Ick.

Revision 14633 uses the new mechanism - which ought to work well for lost's new code too, I'd think.
 

Veracity

Developer
Staff member
Well, revision 14635 attempts to separate the conditions; the Coinmasters frame will show Black Bart's Booty in the Swagger Shop if, in fact, it is visible there but if you have not accumulated at least 1,000 swagger in a pirate season (also as reported by the shop), it will be greyed out and unpurchasable, regardless of how much swagger you have.

Untested.
 

Veracity

Developer
Staff member
I played with this and (aside from the fact that you did not submit your change to ItemPool;)) I noticed that it wasn't quite what
I expected. This is because we have two classes - ArcadeRequest and TicketCounterRequest - that want to deal with (some of) arcade.php. If you visit the Arcade in the relay browser, Arcade Request had a chance to parse the response, and next time you opened the Coinmasters Frame, everything was there, but I wanted the "visit" button in the Coinmasters Frame to visit the ticket counter, see what was unlocked, and refresh the list. For several reasons, that didn't work: it was visiting arcade.php, not arcade.php?ticketcounter=1, even if it had done that latter, ArcadeReqeust wasn't being given the chance to look at the response, since it was an internal request, not an external request, and so on.

Revision 14637 makes a variety of tweaks and now you can check what is unlocked with the "visit" button.

Thanks for doing the hard work for this feature.
 
Top