I worked on a increase_stat() that goes through all the combinations of effects you don't have yet to find the cheapest one that buffs your stat enough to attain goal. I'm pretty proud of the result!
Considering only the effects you don't have yet, from a restricted list of potions, makes increase_stat() pretty fast. I guess the list of potions could be expanded to include a few cheap absolute increasing potions (for stats, hp or mp), but I imagine that considering *everything*, like the maximizer does, requires a handling way different than just testing everything, and cutting down branches of trees is something that is out of my league.
increase_stat will only use the potions once the best combination is found, so you won't buff with everything only to find out that it wasn't enough. it would be easy to do a 'simulation' mode, in order to decide if it's cheaper to use an elemental form potion or to buff muscle a little bit, for example.
You can see a verbose example of it in test_stat.ash (edit to change goal and stat).
I included my version of Rinn's autoBasement (based on version 1.5) to see how it is implemented.
There are a couple of changes/fixes in my version:
- fixed the have_outfit() returning false issue (Rinn did that already apparently)
- I maximize mainstat for combats in order to use love songs (Rinn has that covered already too).
- I added a maximize_outfit() container function for calls to maximize. Since I don't have a disembodied hand, I don't want the maximizer to choose an equipment for my familiars (wasting sugar shields). maximize_outfit() adds the correct ending to the maximizer command (switch disembodied hand if you have one, switch parrot for elemental tests if you have one, -familiar in other cases).
Rinn : I hope you will find this useful! It should be easy to track the meat used for buffing too in case you want to add this.
EDIT: Accidentally removed a line when including increase_stat() in autoBasement_slyz, added it back.
[57686] Fernswarthy's Basement (Level 11)
Encounter: 13-Dimensional Horror
Round 0: e85 wins initiative!
Round 1: e85 casts SPECTRAL SNAPPER!
Round 1: 13-dimensional horror takes 458 damage.
You lose 217 hit points
Round 2: e85 casts SPECTRAL SNAPPER!
Round 2: 13-dimensional horror takes 450 damage.
You lose 240 hit points
Round 3: e85 casts SPECTRAL SNAPPER!
Round 3: 13-dimensional horror takes 437 damage.
You lose 226 hit points
Round 4: e85 casts SPECTRAL SNAPPER!
Round 4: 13-dimensional horror takes 433 damage.
You lose 224 hit points
Round 5: e85 casts SPECTRAL SNAPPER!
Round 5: 13-dimensional horror takes 458 damage.
You gain 283 Muscleboundness
You gain 166 Magicalness
You gain a Mysticality point!
You gain 155 Smarm
Basement level 160: Stat reward
You can't wear that outfit.
Maximizing...
420 combinations checked, best score 8.5
Putting on chef's hat...
Equipment changed.
Wielding giant cactus quill...
Equipment changed.
Holding charged magnet...
Equipment changed.
Putting on hardened slime pants...
Equipment changed.
Putting on energy drink IV...
Equipment changed.
string page=visit_url("account_manageoutfits.php");
string[int] outfits;
outfits[1]="Mysticality";
outfits[2]="Muscle";
outfits[3]="Moxie";
outfits[4]="Gauntlet";
boolean outfit_exists(string page, string o) {
return contains_text(page,"value=\""+o+"\"");
}
foreach i in outfits {
if ( outfit_exists(page, outfits[i]) ) print("You have an outfit named "+outfits[i]);
}
You have an outfit named Mysticality
You have an outfit named Muscle
You have an outfit named Moxie
You have an outfit named Gauntlet
outfit("MPRegen");
cli_execute("maximize .5 MP Regen min, .5 MP Regen max, switch Disembodied Hand");
cli_execute("outfit save MPRegen");
outfit("MP Regen");
cli_execute("maximize .5 MP Regen min, .5 MP Regen max, switch Disembodied Hand");
cli_execute("outfit save MP Regen");
I've already added cost effectiveness of a buff in preparation for finding the most cost effect way to buff to a set goal
Both the duration and multiple stat effects are already taken into account. It's basically stat points increased per meat times duration times the number of stats it affects.Since only one of each potion is used, meat per stat isn't as appropriate here as in Bale's recovery script, for example, where the best meat per mp item is used until the condition is filled (simplifying things).
On the other hand, using a potion of gr8tness, for example, will pay off because it will certainly help for all the tests that you will encounter while you have the effect (5/10/15 turns). Maybe the duration should be taken into account in the cost, as well as the fact that potions of gr8tness and tomato power buff more than one stat.
EDIT: equalizers also have benefits to all stats
float cost_effectivness(_item value)
{
return ((value.percent_mod * my_basestat(my_primestat()) + value.absolute_mod) / value.cost * value.duration * value.effective_stats);
}
If you take out the space in maximize_mp_regen(), you need to take them out in lines 271-272 too. I'm starting to know this code by heart =)
It's also painfully obvious to me that outfit caching takes a long time now that I've hit 200 base stats, this suggestion from Bale for the maximizer would really, really, really be helpful.
I honestly have no idea.When I try to run the script, I just get:
["humorous" t-shirt] has no matches.
Then mafia turns red and nothing happens. What gives?