New Content - Implemented Spring 2020 Challenge Path - Path of the Plumber

Veracity

Developer
Staff member
Revision 19782 comments out that warning. If KoL decides to let us keep some coin-purchasable items after breaking the prism, I'll uncomment it.
 

Veracity

Developer
Staff member
By the way - eliminating plumber items includes equipped items. I am no longer wearing power pants. I ascended as an AT and want to open my guild. Better equip some pants before I do that, eh?
 

Jeparo

New member
Can King Boo be marked as a boss?

Also,

> ash get_monsters($location[summoning chamber])

Returned: aggregate monster [1]
0 => Lord Spookyraven

Would it be possible to have this return the list [King Boo] in Path of the Plumber? Currently this requires some special-casing in autoscend.
 

Veracity

Developer
Staff member
Can King Boo be marked as a boss?
Revision 19783

Would it be possible to have this return the list [King Boo] in Path of the Plumber? Currently this requires some special-casing in autoscend.
Special coding for Path of the Plumber, Dark Gyffte, Pocket Familiars, Heavy Rains, Actually Ed the Undying ...
In my opinion, the special casing might as well be in your script, rather than inventing a new mechanism within KoLmafia. ;)
 

Jeparo

New member
Special coding for Path of the Plumber, Dark Gyffte, Pocket Familiars, Heavy Rains, Actually Ed the Undying ...
In my opinion, the special casing might as well be in your script, rather than inventing a new mechanism within KoLmafia. ;)

Oof! Very reasonable, I wasn't sure if this was already supported for other paths. I'll definitely change it on my end, thanks for clarifying :)
 

Veracity

Developer
Staff member
I did spend 30 minutes or so looking through the code to see if we had this mechanism. I know that Darzil used to do stuff about modifying monster rate appearances in various zones depending of this or that - banishing, quest progress, whatever. I found nothing about wholesale overriding bosses in various zones based on the path.

I was open to adding this path, if we had such a mechanism, but I was unable to find one. Sorry!
 

Veracity

Developer
Staff member
Having said that, after thinking more about it, I'm coming around to the view that it'd be better to have the "boss mapping by path" stuff centralized in KoLmafia, rather than in multiple scripts that need it. I'll think about it tomorrow after I am done with Mysterious Boxes (whatever that entails) and am ready to ascend into another Plumber run.
 

Veracity

Developer
Staff member
Revision 19791 makes "recover hp" do something sensible in Path of the Plumber

- The only items it considers are mushroom, deluxe mushroom, super deluxe mushroom.
- You cannot configure which of those to consider in the HP/MP Usage pane on the list of HP restores checkboxes; those checkboxes (and associated property) are used for non-Plumbers.
- Plumbers will consider all three of the items. They will do the same needed healing vs. provided healing vs. cost calculation (in coins) as non plumbers use (in Meat).
- This WILL spend coins to buy healing items. If you don't want to do that, don't call "recover hp" (or click the "recover hp" link on the charpane).
- As always, "recover hp" will use items in inventory first before buying items.

I did a major refactoring of RecoveryManager.recover() and RestoreItems; having generic code which had a list of either HPRestoreItem or MPRestoreItem, but treated them as simple Objects using instanceof and casting to figure out what to do was a blatant failure of object-oriented programming. It's a lot cleaner now. And I got to use Java 7's diamond operator. :)

I tested both as a Plumber and as a non-Plumber. I saw no errors, but given the refactoring, it's always possible I introduced a bug. Let me know if things don't work for you.

(Something I noticed in the code is that we call a recovery script - Universal Recovery, say - before (or in place of) internal recovery. Such scripts probably look at your recovery method configuration to decide what you are willing to use. Such scripts will definitely need special handling for Plumbers.)
 

Veracity

Developer
Staff member
Hmm. I see a bug in optimizing restores to use.

I was at 154/359 HP.
Desired result: Use 2 super deluxe mushrooms @ 100 HP and 1 mushroom @ 10 HP.
Actual result:

Code:
> restore hp

Verifying ingredients for super deluxe mushroom (2)...
Purchasing super deluxe mushroom (2 @ 20 coins)...
Visiting the Mushroom District Item Shop...
You acquire super deluxe mushroom (2)
Mushroom District Item Shop successfully looted!
Successfully created super deluxe mushroom (2)
Using 2 super deluxe mushroom...
You gain 200 hit points
Finished using 2 super deluxe mushroom.
Verifying ingredients for super deluxe mushroom (1)...
Purchasing super deluxe mushroom (1 @ 20 coins)...
Visiting the Mushroom District Item Shop...
You acquire an item: super deluxe mushroom
Mushroom District Item Shop successfully looted!
Successfully created super deluxe mushroom (1)
Using 1 super deluxe mushroom...
You gain 100 hit points
Finished using 1 super deluxe mushroom.
Needing 205 HP:

It purchased 2 100 HP restores and used them.

Needing 5 HP:

It purchased 1 100 HP restore - rather than a 10 HP restore - and used it.
 

Veracity

Developer
Staff member
Revision 19792 tries to be smarter about picking the most cost effective mushrooms to heal with.
 

Veracity

Developer
Staff member
> ash get_monsters($location[summoning chamber])

Returned: aggregate monster [1]
0 => Lord Spookyraven

Would it be possible to have this return the list [King Boo] in Path of the Plumber? Currently this requires some special-casing in autoscend.
I did this for you - and more.

Revision 19794 adds new functions:

int to_int monster ) -> returns monster id
monster [monster] get_monster_mapping() -> returns map from monster to monster for your current path
monster [monster] get_monster_mapping( string ) -> returns map from monster to monster for specified path

And if you are on a path where some monsters are mapped, get_monsters( location ) and ge_location_monsters( location ) will include the mapped monsters.

Code:
[color=green]> ash get_monster_mapping()[/color]

Returned: aggregate monster [monster]
Boss Bat => Koopa Paratroopa
Knob Goblin King => Hammer Brother
Bonerdagon => Very Dry Bones
Naughty Sorceress => Wa%playername/lowercase%
Protector Spectre => Kamek
Dr. Awkward => Birdo
Lord Spookyraven => King Boo
The Big Wisniewski => Bowser
The Man => Bowser
Groar => Angry Sun

[color=green]> ash get_monster_mapping( "Dark Gyffte" )[/color]

Returned: aggregate monster [monster]
Boss Bat => Steve Belmont
Knob Goblin King => Ricardo Belmont
Bonerdagon => Jayden Belmont
Your Shadow => Your Lack of Reflection
Naughty Sorceress => %alucard%
Protector Spectre => Sylvia Belgrande
Dr. Awkward => Travis Belmont
Lord Spookyraven => Greg Dagreasy
The Big Wisniewski => Jake Norris
The Man => Chad Alacarte
Groar => Sharona

[color=green]> ash get_monster_mapping( "Pocket Familiars" )[/color]

Returned: aggregate monster [monster]
Boss Bat => Jerry Bradford
Knob Goblin King => Jerry Bradford
Bonerdagon => Jerry Bradford
Naughty Sorceress => Jerry Bradford, Pokéfam World Champion
Protector Spectre => Jerry Bradford
Dr. Awkward => Jerry Bradford
Lord Spookyraven => Jerry Bradford
The Big Wisniewski => Jerry Bradford
The Man => Jerry Bradford
Groar => Jerry Bradford

[color=green]> ash get_monster_mapping( "Heavy Rains" )[/color]

Returned: aggregate monster [monster]
Boss Bat => Aquabat
Knob Goblin King => Aquagoblin
Bonerdagon => Auqadargon
Naughty Sorceress => The Rain King
Protector Spectre => Protector Spurt
Dr. Awkward => Dr. Aquard
Lord Spookyraven => Lord Soggyraven
The Big Wisniewski => Big Wisnaqua
The Man => The Aquaman
Groar => Gurgle

[color=green]> ash get_monster_mapping( "Actually Ed the Undying" )[/color]

Returned: aggregate monster [monster]
Boss Bat => Boss Bat?
Knob Goblin King => new Knob Goblin King
Bonerdagon => Donerbagon
Naughty Sorceress => You the Adventurer
Groar => Your winged yeti

[color=green]> ash get_monsters( $location[ summoning chamber ] )[/color]

Returned: aggregate monster [1]
0 => King Boo

[color=green]> ash get_location_monsters( $location[ summoning chamber ] )[/color]

Returned: aggregate boolean [monster]
King Boo => true

[color=green]> ash get_location_monsters( $location[ The Briny Deeps ] )[/color]

Returned: aggregate boolean [monster]
school of wizardfish => true
pumped-up bass => true
funk sole brother => true
And, yes - the monsters with identical names have different monster IDs.

Code:
[color=green]> ash get_monster_mapping()[ $monster[ The Big Wisniewski ] ].to_int()[/color]

Returned: 2172

[color=green]> ash get_monster_mapping()[ $monster[ The Man ] ].to_int()[/color]

Returned: 2173
Those are both "Bowser".
 

Ryo_Sangnoir

Developer
Staff member
Here's Warmed Up (Juggle Fireballs level 1):
Code:
--------------------
2558	Warmed Up	mario_juggle.gif	9fea199e3a5fd92b82e46f9e0ecc203c	neutral	none
Effect	Warmed Up	Muscle Percent: +100, Mysticality Percent: +100, Moxie Percent: +100
--------------------
 

Veracity

Developer
Staff member
Are stat gains from food multiplied by 10? That's what the Wiki says.

It would be nice if the Food panel took that into account when displaying what is available.

ConsumablesDatabase.getMuscleRange()
ConsumablesDatabase.getMysticalityRange()
ConsumablesDatabase.getMoxieRange()
 

Veracity

Developer
Staff member
Revision 19837 displays stat gains multiplied by 10 in the Food panel.

I think the following are still not finished:

What is the max value for plumberPoints?
Disambiguate skills with duplicate names in ASH $skill[] and to_skill( string)

Anything else?
 

Veracity

Developer
Staff member
Path of the Plumber adds monsters with duplicate names and skills with duplicate names.
I added the infrastructure to handle both of those and hooked ASH up to use it, just as it already did for items and effects.

So, $Item[xxx], $effect[xxx], $monster[xxx], $skill[xxx], to_item( "xxx" ), to_effect( "xxx" ), to_monster( "xxx" ), and to_skill( "xxx" ) will now give "zarqon warnings" (a.k.a "friendly warnings" that zarqon pushed me to implement :) ) if "xxx" is a duplicate name.

Revision 19857 adds "test" commands to try that out.

Code:
[color=green]> test monsterids triffid[/color]

triffid has 1 monsterid: 342

[color=green]> test monsterids Bowser[/color]

Bowser has 2 monsterids: 2172, 2173

[color=green]> test skillids Leash of Linguini[/color]

Leash of Linguini has 1 skillid: 3010

[color=green]> test skillids Multi-Bounce[/color]

Multi-Bounce has 2 skillids: 7336, 25006
We already had commands for items and effects:

Code:
[color=green]> test itemids Eye of Ed[/color]

Eye of Ed has 2 itemids: 2286, 7962

[color=green]> test effectids A Little Bit Evil[/color]

A Little Bit Evil has 6 effectids: 597, 598, 599, 600, 601, 602
We are almost done supporting this path.

1) Maximum number of plumberPoints

2) I'd like to optimize HP restoration a bit.

We try to use mushrooms on hand first, and then buy mushrooms with coins. I'm happy with that, but when using mushrooms on hand, it uses them in order super deluxe mushroom, deluxe mushroom, mushroom. I'd like it to take how much restoration you need. E.g., if you need 40, use a deluxe mushroom and a mushroom, rather than a super deluxe mushroom. Similarly, if you don't have mushrooms, it should buy those two mushrooms. It already takes "efficiency" into account - one super deluxe mushroom is more "efficient" at healing 35 than 2 deluxe mushrooms or 4 mushrooms, but it won't look at combos. For 35, 1 deluxe mushroom and 1 mushroom will do it for fewer coins.

This is probably more work than is worth it, considering that by the time I'm doing "restore HP", I have plenty of coins.

I'll probably move plumber restoration into a new method, which can be tinkered with as desired. Maybe by me, maybe not. :)

Is there anything else whatsoever that you wish KoLmafia did for you to make your life easier as a Plumber?
 

Crowther

Active member
I couldn't quite get this to work. autoscend uses adv1() and a combat handler. With a recent update, mafia requested I use skill numbers with things like Multi-Bounce. I put these in and mafia recognizes them correctly, but instead of doing Multi-Bounce, it attacks instead. I tried to make a simple test script to show this, but clearly lack the skill to write a 10 line combat handler. Below you can see where it attacks and my debug line saying it was going to use Multi-Bounce.
Code:
[72] The Haunted Kitchen
Encounter: zombie chef
Round 0: Crowther wins initiative!
> [INFO] - auto_combatHandler: 0
Round 1: Crowther casts BECOME A CLOUD OF MIST!
You acquire an effect: Misty Form (1)
> Test Multi
> Use Multi
Round 2: Crowther attacks!
You lose 2 hit points
> Test Multi
Round 3: Crowther casts JUMP ATTACK!
Round 4: zombie chef takes 110 damage.
Round 4: Crowther wins the fight!
 

Veracity

Developer
Staff member
By "combat handler", you mean a "combat filter", I assume. VMF uses combat filters.

Combat filters are called with ( int round, monster mon, string page )
They return a "combat action" - a string - of the sort you put in a CCS.
If they return "", KoLmafia carries on with your CCS.

A combat filter for a Plumber would return something like "skill Multi-Bounce".

How did "mafia request I use skill numbers with things like Multi-Bounce"? If you were useing $skill[ Multi-Bounce ] or to_skill( "Multi-Bounce" to get a skill, sure - you should use numbers to disambiguate the string in order to create the correct skill object.

But a combat filter is not using a skill object. It passes back a string.

How does KoLmafia's name disambiguation affect the string you are passing back from the combat filter?
Show me the code that returns the combat action, please.

Thanks.
 
Top