Weatherboy
Member
funny, I started making notes to do this myself here in the past couple days. I'd also really like to see the mood code.
// returns the element to which attacks would be best tuned for this zone
int[element] get_vulns() {
int[element] vulns, res;
foreach i,m in my_location().get_monsters() {
switch (m.defense_element) {
case $element[none]: continue;
case $element[hot]: vulns[$element[sleaze]] += 1; vulns[$element[stench]] += 1; break;
case $element[spooky]: vulns[$element[hot]] += 1; vulns[$element[stench]] += 1; break;
case $element[cold]: vulns[$element[hot]] += 1; vulns[$element[spooky]] += 1; break;
case $element[sleaze]: vulns[$element[cold]] += 1; vulns[$element[spooky]] += 1; break;
case $element[stench]: vulns[$element[cold]] += 1; vulns[$element[sleaze]] += 1; break;
}
res[m.defense_element] += 1;
}
foreach e in vulns if (res contains e) remove vulns[e];
if (count(vulns) == 0) foreach el in $elements[] if (!(res contains el)) vulns[el] += 1; // all elements are cool if none are
return vulns;
}
skill get_flavour(element e) {
switch (e) {
case $element[cold]: return $skill[spirit of peppermint];
case $element[hot]: return $skill[spirit of cayenne];
case $element[spooky]: return $skill[spirit of wormwood];
case $element[sleaze]: return $skill[spirit of bacon grease];
case $element[stench]: return $skill[spirit of garlic];
default: return $skill[spirit of nothing];
}
}
void intrinsics(){
// flavour of magic
boolean have_spells() { foreach s in $skills[] if (have_skill(s) && s.combat && $classes[pastamancer,sauceror] contains s.class) return true; return false; }
if (!have_skill($skill[flavour of magic]) || !have_spells()) return;
boolean have_spirit() { for i from 167 to 171 if (have_effect(to_effect(i)) > 0) return true; return false; }
int[element] vulns = get_vulns();
element[int] sorte;
foreach v in vulns sorte[count(sorte)] = v;
sort sorte by -(vulns[value] + numeric_modifier(value+" Spell Damage"));
if (count(sorte) > 0) {
if (have_effect(to_effect(get_flavour(sorte[0]))) == 0) use_skill(1,get_flavour(sorte[0]));
} else if (have_spirit()) use_skill(1,$skill[spirit of nothing]);
}
sort sorte by -(vulns[value] + numeric_modifier(value+" Spell Damage"));
void flavour() {
boolean have_spirit() {
for i from 167 to 171
if(have_effect(to_effect(i)) > 0) return true;
return false;
}
// Convert Element to Spirit
skill get_flavour(element e) {
switch (e) {
case $element[cold]: return $skill[spirit of peppermint];
case $element[hot]: return $skill[spirit of cayenne];
case $element[spooky]: return $skill[spirit of wormwood];
case $element[sleaze]: return $skill[spirit of bacon grease];
case $element[stench]: return $skill[spirit of garlic];
}
return $skill[spirit of nothing];
}
if(have_skill($skill[flavour of magic])) {
switch(my_location()) {
case $location[The Ancient Hobo Burial Ground]: // Everything here is immune to elemental dmg
if(have_spirit())
use_skill(1, $skill[spirit of nothing]);
case $location[Hobopolis Town Square]: // Don't interfere with Scarehobos
return;
}
// Find the element to which attacks would be best tuned for this zone
int [element] vulns, res;
foreach i,m in my_location().get_monsters() {
switch (m.defense_element) {
case $element[none]: continue;
case $element[hot]: vulns[$element[sleaze]] += 1; vulns[$element[stench]] += 1; break;
case $element[spooky]: vulns[$element[hot]] += 1; vulns[$element[stench]] += 1; break;
case $element[cold]: vulns[$element[hot]] += 1; vulns[$element[spooky]] += 1; break;
case $element[sleaze]: vulns[$element[cold]] += 1; vulns[$element[spooky]] += 1; break;
case $element[stench]: vulns[$element[cold]] += 1; vulns[$element[sleaze]] += 1; break;
}
res[m.defense_element] += 1;
}
foreach e in vulns
if(res contains e)
remove vulns[e];
if(count(vulns) == 0) // If there are no vulns, then any non res elements is good
foreach el in $elements[cold, hot, sleaze, spooky, stench]
if(!(res contains el)) vulns[el] = 1;
// Now, sort them
element [int] sorted;
foreach v in vulns
sorted[ count(sorted) ] = v;
if(count(sorted) > 0) {
sort sorted by -(vulns[value] * (numeric_modifier(value+" Spell Damage") + 1));
if(have_effect(to_effect(get_flavour(sorted[0]))) == 0)
use_skill(1, get_flavour(sorted[0]));
} else if (have_spirit()) use_skill(1,$skill[spirit of nothing]);
}
}
Question: Do I have to manually run this script every time I adventure?
case $location[the haunted bedroom]:
if (have_item($item[Lady Spookyraven's Finest Gown]) == 0) friendlyset(880,"1","Gown.");
else friendlyset(880,"2","Stick.");
if (have_item($item[Lord Spookyraven's Spectacles])== 0) friendlyset(878,"3","Spooky's specs.");
else if(have_item($item[disposable instant camera])==0) friendlyset(878,"4","Disposable instant camera.");
else friendlyset(878,"2","Mysticality.");
friendlyset(877,"1","Coin purse.");
if (is_goal($stat[muscle])) friendlyset(876,"2","Strength.");
else friendlyset(876,"1","Money.");
friendlyset(879,"1","Moxie.");
return;
familiar dropfam() {
if (my_location().zone == "The Sea" || $locations[none, the slime tube] contains my_location()) return my_familiar();
boolean has_more_drop(familiar f, int soft) {
boolean clim(string prop, int hard) { return to_int(get_property(prop)) < min(soft,hard); }
switch(f) {
case $familiar[adventurous spelunker]: return clim("_spelunkingTalesDrops",1);
case $familiar[angry jung man]: return clim("_jungDrops",1);
case $familiar[astral badger]: return clim("_astralDrops",5);
case $familiar[baby sandworm]: return clim("_aguaDrops",5);
case $familiar[blavious kloop]: return clim("_kloopDrops",5);
case $familiar[bloovian groose]: return clim("_grooseDrops",5);
case $familiar[fist turkey]: return clim("_turkeyBooze",5);
case $familiar[galloping grill]: return clim("_hotAshesDrops",5);
case $familiar[gelatinous cubeling]: return (available_amount($item[eleven-foot pole]) == 0 ||
available_amount($item[ring of detect boring doors]) == 0 || available_amount($item[pick-o-matic lockpicks]) == 0);
case $familiar[golden monkey]: return clim("_powderedGoldDrops",5);
case $familiar[green pixie]: if (have_effect($effect[absinthe-minded]) > 0) return false; return clim("_absintheDrops",5);
case $familiar[grim brother]: return clim("_grimFairyTaleDrops",5);
case $familiar[grimstone golem]: return clim("_grimstoneMaskDrops",1);
case $familiar[happy medium]: return clim("_mediumSiphons",20);
case $familiar[knob goblin organ grinder]: return clim("_pieDrops",5);
case $familiar[li'l xenomorph]: return clim("_transponderDrops",5);
case $familiar[llama lama]: return clim("_gongDrops",5);
case $familiar[artistic goth kid]: if (!hippy_stone_broken() && have_familiar($familiar[mini-hipster])) return false;
case $familiar[mini-hipster]: if (!contains_text(to_url(my_location()),"adventure.php")) return false; return clim("_hipsterAdv",7);
case $familiar[pair of stomping boots]: foreach i,m in get_monsters(my_location()) if (!($phyla[dude,none] contains m.phylum)) return clim("_pasteDrops",7); return false;
case $familiar[rogue program]: return clim("_tokenDrops",5);
case $familiar[unconscious collective]: return clim("_dreamJarDrops",5);
} return false;
}
for i from 1 upto 10
foreach f in $familiars[green pixie, li'l xenomorph, baby sandworm, grim brother, grimstone golem, astral badger, llama lama, mini-hipster,
bloovian groose, rogue program, blavious kloop, unconscious collective, angry jung man, happy medium,
knob goblin organ grinder, artistic goth kid, pair of stomping boots, gelatinous cubeling, adventurous spelunker, fist turkey, galloping grill, golden monkey]
if (have_familiar(f) && has_more_drop(f,i)) return f;
return my_familiar();
}
case $location[a massive ziggurat]:
int choiceAdventure = my_path() == "Actually Ed the Undying"? 1002: 791;
if(item_amount($item[stone triangle]) == 4)
friendlyset(choiceAdventure,"1","Fight the final Protector Spectre.");
else friendlyset(choiceAdventure,"6","Not enough triangles; skip the Protector Spectre.");
return;