Feature - Implemented Track moveable feast charges

adeyke

Member
The moveable feast's weight buff can be used each day on up to five familiars (only once per familiar). It'd be nice if KoLmafia tracked these charges. For example, there could be a function that takes a familiar as argument and tells you if you can still use the feast on that familiar. This would return false if that particular familiar has already feasted or if a total of five familiars have already feasted.
 

slyz

Developer
I guess we could have a comma-separated list of familiar the buff was used on in a daily preference. Would that be ok, instead of an ASH function?
 

Bale

Minion
I'm not sure that commas are safe. Jick sometimes uses them in items and I wouldn't be surprised if he eventually makes a familiar with a comma in its name. Generally KoLmafia uses semi-colons for this purpose and they have proven to be safer.

This should probably use semi-colons instead of commas. Could you change that before this preference is implemented in a well used script like harvest? For the sake of the future. (Watch, next month jick will make a familiar with a semi-colon in his name just to spite me...)
 

slyz

Developer
Other preferences use ";" or "|" as separators, I should have one of those right away.

r9855 changes _feastedFamiliars to be a semi-colon separated list.
 

roippi

Developer
Minor change: dailyDeedsVersion gets a bump in r9856 in order to push the new deed to everyone.
 

roippi

Developer
Yeah, it's a little obscured up towards the top and nobody's used it yet, so you get to be the guinea pig :)

But yup, this is a thing that we anticipated a while back: just adding a deed to dailyDeedsOptions in defaults.txt won't result in that deed appearing on everyone's dailyDeedsPanel, since by design the user is allowed to arbitrarily change their own dailyDeedsOptions. The compromise is the dailyDeedsVersion workaround here. I'm sure we'll see some complaints of "Hey, this button got added to the END of my dailyDeedsPanel, whereas if I run a new copy of mafia, it gets put in the middle like it should!" but.. we'll see, hah.
 

slyz

Developer
I was OK with the Feast deed appearing only in the Preferences -> Daily Deeds -> Built-In Deeds list, and let the users add it to their current deeds themselves. I used setShown( true ) so the button could appear even when the moveable is equipped. Letting the users add it themselves was a good way to fend off the "my daily deeds are too cluttered" posts.

Now we will simply explain show how they can remove it if they want, which is more constructive :)
 

roippi

Developer
Ah. Well, it wouldn't appear in the built-ins list since you didn't add it to dailyDeedsOptions in defaults.txt. :)

I also ninja changed the deed to setShown( have ) instead of setShown( true )... if there was a design decision behind the setShown( true ) feel free to revert that bit; I do not have a feast myself.
 

slyz

Developer
When you equip the feast on your familiar, which will often be the case in-run, the button goes away if we use setShown( have ) the way I left it. Since "use moveable feast" will retrieve it, the button might as well always appear, and be enabled.

I guess have should also be true when the feast is equipped on a familiar. I was too lazy to figure out how to check the equipment of all your familiars to see if one of them is using the feast. I'll try to work on that.

If we don't check if the feast is in your inventory or equipped on a familiar, the only downside with doing "use moveable feast" is that Mafia could try to buy one from the mall. If a user happens to have ~18m on hand, autoSatisfyWithMall set to true, and an autoBuyPriceLimit of more than 18m, Mafia will purchase it. An unlikely scenario. And perhaps even a profitable one!
 

slyz

Developer
Ok, I think I'm happy with r9858.

- The button will appear only if you have a Moveable Feast in your inventory, or if it is equipped on one of your familiars. That avoids the potential edge case of Mafia buying one from the mall.
- The button is greyed out once you have feasted 5 familiars.
 
Top