case $location[twin peak]:
int twinPeakProgress = to_int(get_property("twinPeakProgress"));
if (my_path() == "Bees Hate You") {
friendlyset(606,"6","");
friendlyset(618,"2","");
} else if ((twinPeakProgress & 1) == 0 && numeric_modifier("Stench Resistance") >= 4) {
friendlyset(606,"1","Investigate the stinky room.");
friendlyset(607,"1","");
} else if ((twinPeakProgress & 2) == 0 && foodDrop() >= 50) {
friendlyset(606,"2","Search for food.");
friendlyset(608,"1","");
} else if ((twinPeakProgress & 4) == 0 && item_amount($item[jar of oil]) > 0) {
friendlyset(606,"3","Follow the music with a jar of oil.");
friendlyset(609,"1","");
friendlyset(616,"1","");
} else if (twinPeakProgress == 7 && numeric_modifier("Initiative") >= 40) {
friendlyset(606,"4","Chase your doppleganger.");
friendlyset(610,"1","");
friendlyset(617,"1","");
} else friendlyset(606,"1","What to do here?");
return;
boolean throne(familiar fam) { return ( have_equipped($item[crown of thrones]) && my_enthroned_familiar() == fam ) ||
( have_equipped($item[buddy bjorn]) && my_bjorned_familiar() == fam ); }
...
case $familiar[grim brother]: if ( throne(f) && clim("_grimFairyTaleDropsCrown",2) ) return false; return clim("_grimFairyTaleDrops",5);
case $familiar[grimstone golem]: if ( throne(f) && clim("_grimstoneMaskDropsCrown",1) ) return false; return clim("_grimstoneMaskDrops",1);
void use_goalcontaining_items() {
if (my_path() == "Way of the Surprising Fist") cli_execute("use * teachings of the fist");
else if (!can_interact()) cli_execute("sell * meat stack; sell * dense meat stack");
cli_execute("use * evil eye");
void use_goalcontaining_items() {
if (my_path() == "Way of the Surprising Fist") cli_execute("use * teachings of the fist");
else if (!can_interact()) cli_execute("sell * meat stack; sell * dense meat stack");
cli_execute("use * evil eye");
cli_execute("use 1 rusty hedge trimmer");
And why in the world are those lines using cli_execute() inside of a CLI script instead of use()?
> ashq (cli_execute("ashq cli_execute(\"ashref\ hash\");"))
string my_hash( )
Ok, I excised the code for Flavour from my mood script. Granted, I wrote this a year or so back (I obviously didn't care about wasting 1MP here and there, which was one of several reasons my mood script was not shareable), but it has served me well. It skips Flavour if you have no Pastamancer or Sauceror spells. After that, it chooses the element to which the majority of the monsters in the zone are vulnerable, with some weight also given to the element you already have the most bonus spell damage in. It skips elements if any monsters in the zone are immune to that element, so for zones where all elements have an immune monster, it defaults to spirit of nothing.
At least, I think that's how it works. Haha.
PHP:// 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]); }
Have fun!
void flavour() {
// 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];
}
// Does the character have any active spirit?
boolean have_spirit() {
for i from 167 to 171
if(have_effect(to_effect(i)) > 0) return true;
return false;
}
//
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
float [element] vulns, res;
foreach el in $elements[cold, hot, sleaze, spooky, stench]
vulns[el] = 0;
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;
}
if(my_path() == "One Crazy Random Summer")
vulns[$element[cold]] -= 0.5;
foreach e in vulns
if(res contains e)
remove vulns[e];
// 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]);
}
}