static void _shield_of_water_spell(int cmd, variant *res) { int lvl = p_ptr->lev; /* Boost if _on_mirror? */ switch (cmd) { case SPELL_NAME: var_set_string(res, "Shield of Water"); break; case SPELL_DESC: if (lvl >= 40) var_set_string(res, "Gives a bonus to AC, reflection and magic resistance."); else if (lvl >= 32) var_set_string(res, "Gives a bonus to AC and reflection."); else var_set_string(res, "Gives a bonus to AC."); break; case SPELL_CAST: set_shield(20 + randint1(20), FALSE); if (lvl >= 32) set_tim_reflect(20 + randint1(20), FALSE); if (lvl >= 40) set_resist_magic(20 + randint1(20),FALSE); var_set_bool(res, TRUE); break; default: default_spell(cmd, res); break; } }
void _wild_magic_resist_off(void) { if (p_ptr->resist_magic) set_resist_magic(0, TRUE); if (!IS_RESIST_MAGIC()) msg_print("You no longer feel resistant to magic."); }