ashq
import <zlib.ash>
string badstring = "max";
string searchstring;
record combat_rec {
string ufname;
string dmg;
string pdmg;
string special;
};
static {
combat_rec [string, int] factors;
record {
int turns;
string img;
}[string] banishers;
}
load_current_map("batfactors",factors);
matcher rng = create_matcher("\\{.+?,(.+?),.+?}",""); string deranged(string sane) { rng.reset(sane); while (rng.find()) sane = sane.replace_string(rng.group(0),rng.group(1)); return replace_string(sane, "prismatic", "hot,cold,spooky,sleaze,stench"); }
foreach te,it,rd in factors {
searchstring = rd.dmg;
if (index_of(searchstring, "{") != -1 && substring(searchstring, searchstring.index_of("{"), searchstring.index_of("}")).contains_text(badstring)) print("Looks like "+te+" "+it+" has a bad dmg - "+deranged(searchstring));
searchstring = rd.pdmg;
if (index_of(searchstring, "{") != -1 && substring(searchstring, searchstring.index_of("{"), searchstring.index_of("}")).contains_text(badstring)) print("Looks like "+te+" "+it+" has a bad pdmg - "+deranged(searchstring));
searchstring = rd.special;
if (index_of(searchstring, "{") != -1 && substring(searchstring, searchstring.index_of("{"), searchstring.index_of("}")).contains_text(badstring)) print("Looks like "+te+" "+it+" has a bad special - "+deranged(searchstring));
}