// getpipes -- specifically gets not-a-pipes, more robustly than previously
// gets moxie in the event that something interferes with your pipe-getting
// by default, gets enough to fill your spleen; otherwise, gets specified num
import <zlib.ash>
boolean single_pipe(location where) {
boolean intact = true;
if (my_adventures() < 10) return vprint("You need a minimum of 10 adventures.",-2);
cli_execute("conditions clear");
switch(have_effect($effect[absinthe-minded])) {
case 0: if (have_effect($effect[Absinthe-Minded]) == 0) {
if (item_amount($item[tiny bottle of absinthe]) == 0) buy(1,$item[tiny bottle of absinthe]);
use(1,$item[tiny bottle of absinthe]);
}
if (have_effect($effect[Absinthe-Minded]) == 0) return vprint("Unable to use absinthe.",-2);
case 10: adventure(1,where);
case 9:
case 8:
case 7: while (have_effect($effect[Absinthe-Minded]) > 6 && have_effect($effect[Spirit of Alph]) == 0)
adventure(1,$location[Stately Pleasure Dome]);
if (have_effect($effect[Spirit of Alph]) == 0)
intact = vprint("Something prevented your being imbued with the essence of Alph. Getting moxie instead...",-3);
case 6: adventure(have_effect($effect[Absinthe-Minded])-5,where);
case 5:
case 4:
case 3: set_property("choiceAdventure168",to_string(1+to_int(intact)));
if (intact) {
while (have_effect($effect[Absinthe-Minded]) > 2 && have_effect($effect[Feelin Philosophical]) == 0)
adventure(1,$location[Mouldering Mansion]);
if (have_effect($effect[Feelin Philosophical]) == 0)
intact = vprint("Something hindered your approaching of the Cat. Getting moxie instead...",-3);
} else {
cli_execute("conditions clear; conditions add 1 choiceadv");
if (adventure(have_effect($effect[Absinthe-Minded])-1,$location[Mouldering Mansion]))
vprint("Something hindered your getting the proper choice. Phooey. At least you can get a bit of moxie.",-3);
}
case 2: adventure(have_effect($effect[Absinthe-Minded])-1,where);
case 1: if (intact) adventure(1,$location[Rogue Windmill]);
else {
set_property("choiceAdventure166","2");
adventure(1,$location[Stately Pleasure Dome]);
}
}
if (intact && item_amount($item[not-a-pipe]) > 0 && my_spleen_use() < spleen_limit() - 3) use(1,$item[not-a-pipe]);
return intact;
}
void main(int howmany,location where) {
if (howmany < 1) {
while (floor((spleen_limit()-my_spleen_use()) / 4) > 0) single_pipe(where);
} else for i from 1 to howmany
single_pipe(where);
}