// completes the junkyard sidequest
boolean junkyard_sq() {
print("Step "+step+": Junkyard sidequest","blue");
// returns the html from visiting yossarian
string visit_yossarian() {
print("Visiting Yossarian...");
dress_apropos(plan[step].hippy_frat);
return visit_url("bigisland.php?action=junkman&pwd=");
}
// converts currentJunkyardLocation into the adventuring number
int which_place() {
string loc = get_property("currentJunkyardLocation");
if (contains_text(loc,"barrel")) return 182;
if (contains_text(loc,"refrigerator")) return 183;
if (contains_text(loc,"tires")) return 184;
if (contains_text(loc,"rusted-out")) return 185;
else die("Bizarro error, no junkyard sublocation."); return 0;
}
boolean attack;
string url;
// kick things off
if (item_amount($item[molybdenum magnet]) == 0) visit_yossarian();
if (item_amount(stasis_item) == 0)
die("OCW is set to stasis using a '"+to_string(stasis_item)+"', which you lack. Get one or edit the 'stasis_item' variable.");
if (have_effect($effect[purple tongue]) == 0) use_upto(1,$item[purple snowcone],true);
if (have_effect($effect[purple tongue]) == 0) use_upto(1,$item[purple-frosted astral cupcake],true);
if (get_property("currentJunkyardTool") != "") gearup_apropos();
// main loop
while (item_amount($item[molybdenum hammer]) + item_amount($item[molybdenum crescent wrench]) +
item_amount($item[molybdenum pliers]) + item_amount($item[molybdenum screwdriver]) < 4) {
if (my_adventures() == 0) die("You're fresh out of adventures.");
if (get_property("currentJunkyardTool") == "") {
url = visit_yossarian();
if (contains_text(url,"the next shipment of cars")) return (check_step(step));
print("getting "+get_property("currentJunkyardTool")+"...","blue");
if (!gearup_apropos()) wait(5);
}
if (have_effect($effect[purple tongue]) == 0 && have_effect($effect[tiny bubbles in the cupcake]) == 0 &&
have_effect($effect[heart of orange]) == 0)
use_upto(1,$item[orange candy heart],true);
// slay a gremlin!
attack = false;
url = visit_url("adventure.php?snarfblat="+which_place());
print("visited url="+which_place());
while(!contains_text(url,"You win the fight!") && my_hp() > 0)
{
if (contains_text(url, "hammer") || contains_text(url, "wrench") ||
contains_text(url, "pliers") || contains_text(url, "screwdriver"))
{
print("Item detected! using magnet...","green");
url = throw_item($item[molybdenum magnet]); // use the magnet
}
else
{
if (!attack) attack = (contains_text(url,"A.M.C. gremlin") || contains_text(url,"does a bombing run") ||
contains_text(url,"picks a beet") || contains_text(url,"picks a radish") ||
contains_text(url,"bites you in the fibula") || contains_text(url,"make an automatic eyeball"));
if ((attack) || (my_hp() <= hp_safety)) { run_combat(); url = "You win the fight!"; }
else url = throw_item(stasis_item);
}
}
// post-combat
cli_execute("mood execute");
restore_hp(0);
cli_execute("burn extra mp");
restore_mp(0);
}
visit_yossarian();
return (check_step(step));
}