Feature Better Free Rest tracking

Mafia can tell me how many Free Rests a day I'm entitled to, and stores how many times I've rested that day as a property.

What it cannot currently tell me is how many Free Rests I have used today.

For example - Today in a DB run I used all my free rests, then used a couple more to chateau-powerlevel to level 11. I then purchased Adventurer of Leisure.
My daily deed Free Rests button was greyed out, presumably because Mafia knew I was now entitled to 13 free rests, and had already rested 13 times that day. However I still had 2 free rests available that I could use manually, as I had only used 11 free rests.
 
Last edited:
Actually, it can tell you how many you have used in preference "timesRested".

The reason it stayed greyed out appears to be that whilst losing a skill does trigger a skill change event that should update that button, gaining one doesn't seem to. I have a local fix in for that (as I was looking at Daily Deeds anyway), which I'll test and submit tomorrow.

You should have found that "timesRested" said 11, and that if you free rested once, the button would have ungreyed, and shown 12/13.
 
Actually, I'm pretty sure darkcodelagsniper is right. It looks like timesRested is incremented even for non-free rests, and there is no effort to avoid doing that, so Daily Deeds likely said 13/13 after using 11 free and 2 non-free rests.
 
Hmm, that's probably true, though it also wouldn't have ungreyed I think from getting more free rests, as gaining skill didn't trigger an update. Hmm, how would we actually detect if a rest was free or not? Is there a different message.
 
my timesRested property is currently on 15 which is why I assumed it counted both non-free and free rests.

If it's only meant to count free rests, then I guess that means something has gone wrong with that tracking?

heh ninjaed.
 
Edit - No, I was wrong.

CampgroundRequest.getAdventuresUsed() returns the number of adventures used when resting. We could just increment freerests by ( 1 - that ) at Campground and Chateau when resting, which should work. I notice each url can include "free" to indicate it is, is that also there on the return when we parse them, or is it redirected? If it's still there, it should be trivial to parse.
 
Last edited:
I notice each url can include "free" to indicate it is, is that also there on the return when we parse them, or is it redirected? If it's still there, it should be trivial to parse.

Campground resting never has "free" in the URL. Chateau resting may or may not have it. Either way, that isn't something that can be used.
 
Back
Top