The name given is now a simple name (fast, clever, etc) matching the enumeration name, rather than the description of when you first get the mutation.
The name can be "any" to get a random mutation, or "xom" to get a random Xom mutation.
If the player has the resist mutation mutation, the command asks if you want to get rid of it.
You can force a mutation to happen, so that it will happen in spite of mutation resistance mutation, mutation resistance amulet, already being covered in too many scales, and so on.
Other wizard command improvements:
The dismiss all (genocide) command can now take a regex of the monsters to dismiss, rather than dismissing all of them.
The heal and super-heal wizard commands now never make you engorged.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2155 c06c8d41-db1a-0410-9941-cceddc491573
3FBKOX4Y5QYPMBOCSAMHNZXCY7Z75YDQDL4EJZHZIGDXL7RMZ7TAC
X5OHFTHRXTI5KHFIYFJ6DB3W5MY3JUJKNTL4HF37MKABYNCOBOZAC
JM7UAK777RAVDAVLQLEOBRTGNW2B47S5G55XITJXO243IUNZHVYQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
CMNLYUECIMEZSOYG4KOSINOPER5OM7PPCGIHCM7LQVWEO77XFUYQC
YCL3W2PFE6ILTGBFODCSXNPDIA46KVSZP2TI7HDMYAOEJT65RIEAC
BW3XFNOS6LDAQLHOZ6RXARCMKCY5JVLVDSXDSSAX4DSYM3FANQBAC
static const char *mutation_type_names[] = {
"tough skin",
"strong",
"clever",
"agile",
"green scales",
"black scales",
"grey scales",
"boney plates",
"repulsion field",
"poison resistance",
"carnivorous",
"herbivorous",
"heat resistance",
"cold resistance",
"shock resistance",
"regeneration",
"fast metabolism",
"slow metabolism",
"weak",
"dopey",
"clumsy",
"teleport control",
"teleport",
"magic resistance",
"fast",
"acute vision",
"deformed",
"teleport at will",
"spit poison",
"mapping",
"breathe flames",
"blink",
"horns",
"strong stiff",
"flexible weak",
"lost",
"clarity",
"berserk",
"deterioration",
"blurry vision",
"mutation resistance",
"frail",
"robust",
"torment resistance",
"negative energy resistance",
"summon minor demons",
"summon demons",
"hurl hellfire",
"call torment",
"raise dead",
"control demons",
"pandemonium",
"death strength",
"channel hell",
"drain life",
"throw flames",
"throw frost",
"smite",
"claws",
"hooves",
"fangs",
"breathe poison",
"stinger",
"big wings",
"blue marks",
"green marks",
"",
"",
"",
"",
"red scales",
"nacreous scales",
"grey2 scales",
"metallic scales",
"black2 scales",
"white scales",
"yellow scales",
"brown scales",
"blue scales",
"purple scales",
"speckled scales",
"orange scales",
"indigo scales",
"red2 scales",
"iridescent scales",
"patterned scales"
};
if ((sizeof(mutation_type_names) / sizeof(char*)) != NUM_MUTATIONS)
{
mprf("Mutation name list has %d entries, but there are %d "
"mutations total; update mutation_type_names in debug.cc "
"to reflect current list.",
(sizeof(mutation_type_names) / sizeof(char*)),
(int) NUM_MUTATIONS);
crawl_state.cancel_cmd_repeat();
return (false);
}
if (you.mutation[MUT_MUTATION_RESISTANCE] > 0)
{
const char* msg;
if (you.mutation[MUT_MUTATION_RESISTANCE] == 3)
msg = "You are immune to mutations, remove immunity?";
else
msg = "You are resistant to mutations, remove resistance?";
if (yesno(msg))
{
you.mutation[MUT_MUTATION_RESISTANCE] = 0;
crawl_state.cancel_cmd_repeat();
crawl_state.cancel_cmd_again();
}
}
bool force = yesno("Force mutation to happen?");
if (strcasecmp(specs, "any") == 0)
{
int old_resist = you.mutation[MUT_MUTATION_RESISTANCE];
success = mutate(RANDOM_MUTATION, true, force);
if (old_resist < you.mutation[MUT_MUTATION_RESISTANCE] && !force)
crawl_state.cancel_cmd_repeat("Your mutation resistance has "
"increased.");
return (success);
}
if (strcasecmp(specs, "xom") == 0)
return mutate(RANDOM_XOM_MUTATION, true, force);
char mut_name[80];
const mutation_type m = static_cast<mutation_type>(i);
strncpy( mut_name, mutation_name( m, 1 ), sizeof( mut_name ) );
char *ptr = strstr( strlwr(mut_name), strlwr(specs) );
if (ptr != NULL)
if (strcasecmp(specs, mutation_type_names[i]) == 0)
mpr("I can't warp you that way!");
{
if (partial_matches.size() == 1)
mutation = (mutation_type) partial_matches[0];
}
if (mutation == NUM_MUTATIONS)
{
crawl_state.cancel_cmd_repeat();
if (partial_matches.size() == 0)
mpr("No matching mutation names.");
else
{
std::vector<std::string> matches;
for (unsigned int i = 0, size = partial_matches.size();
i < size; i++)
{
matches.push_back(mutation_type_names[partial_matches[i]]);
}
std::string prefix = "No exact match for mutation '" +
std::string(specs) + "', possible matches are: ";
// Use mpr_comma_separated_list() because the list
// might be *LONG*.
mpr_comma_separated_list(prefix, matches, " and ", ", ",
MSGCH_DIAGNOSTICS);
}
return (false);
}
// Genocide... "unsummon" all the monsters from the level.
char buf[80];
mpr("Regex of monsters to dismiss (ENTER for all): ", MSGCH_PROMPT);
bool validline = !cancelable_get_line(buf, sizeof buf, 80);
if (!validline)
{
canned_msg( MSG_OK );
return;
}
// Dismiss all
if (buf[0] == '\0')
{
// Genocide... "unsummon" all the monsters from the level.
for (int mon = 0; mon < MAX_MONSTERS; mon++)
{
monsters *monster = &menv[mon];
if (monster->alive())
monster_die(monster, KILL_DISMISSED, 0);
}
return;
}
// Dismiss by regex
text_pattern tpat(buf);