Bug - Fixed Fortune cookie warning does not activate for Rain Man

Darzil

Developer
I guess Rain Man should be added to the list of spells that cost an adventure. I'll do this, and it also needs a little re-write as this will make it the first skill to use more than one resource type at once.

And I also reckon this probably won't be enough, but we can check for SkillDatabase.getAdventureCost for fortune cookie warning rather than using custom code for Rain Man.
 

Darzil

Developer
r14647 does the adding Rain Man to the list of spells costing an adventure.

Not sure where we check for semi rare counters and not got time to look today.
 

Veracity

Developer
Staff member
I see SkillDatabase.getAdventureCost() - and I also see that we do not check that in TurnCounter.getTurnsUsed or in UseSkillRequest.getAdventuresUsed (which doesn't actually exist, to it defaults to GenericRequest.getAdventuresUsed).

The method in TurnCounter has code to look at the URL for Relay Requests, but it only seems to check for crafting and adventuring - not for item or skill usage.

I'll look at it more.
 

Bale

Minion
Rain Man does not cost an adventure. If I use it to summon a black crayon monster or use lightning strike to kill the monster I do not expend an adventure.

The fight costs an adventure, not the skill that summons the fight.

This fix is probably right to make, it's just that... it seems odd to me.
 

Veracity

Developer
Staff member
The same is true for using a free runaway on a summoned monster. Not that you would do so, but in all of the above cases, the only thing that KoLmafia knows is that you are about to go into a fight. It has no way of knowing whether you are going to complete the fight in a way that consumes a turn.

"The fight costs an adventure, not the skill" ... So, I guess you would say "Using a Spooky Putty sheet does not cost a turn. Only the fight costs a turn." Seems like a pointless distinction, to me; anything that MIGHT cost a turn gets logged in the session log with the current turn count and the name of the thing that leads to an encounter.

Therefore, the fact that it seems "odd" to you is irrelevant.
 

Veracity

Developer
Staff member
Revision 14649 makes TurnCounter call UseItemRequest.getAdventuresUsed( urlString) or UseSkillRequest.getAdventuresUsed( urlString ), as appropriate.

Untested. I'll try it tomorrow with a counter that I manually insert, rather than a fortune cookie.
 

Veracity

Developer
Staff member
Well, I just did "counters add 0" and tried casting Rain Man in the Relay Browser.

The browser requested

POST skills.php
pwd=xxx&action=Skillz&whichskill=16011&quantity=1

We displayed the warning screen. When I clicked on the image to say "go", the browser requested via GET:

GET /skills.php?pwd&action=Skillz&whichskill=16011&quantity=1&confirm0=on

KoL responded with a blank screen.

Obviously, this will require a bit more work. :)
 

Veracity

Developer
Staff member
Revision 14651 crafts a form that uses the POST method for the counter warning for skills.php. The message also talks about "using a skill" rather than "adventuring".
 

Veracity

Developer
Staff member
I'm marking this fixed. If there are unexpected side effects, I don't expect that people will think to report them on this thread, anyway. :)
 
Top