crystal helmet

Discussed a long time ago, change helm of brilliance from iron to
crystal so that it doesn't need to be a special case for metallic
armor's affect on spell casting.  It now has a fixed description of
"crystal helmet" but is not pre-discovered.

Add new helm of caution to retain the "etched helmet" description
among the shuffled helms.  Wearing it confers the Warning attribute.
That's fairly lame but not necessarily useless.  It's iron and gets
half the former probability for a random piece of armor being helm
of brilliance so is not likely to be popular.

Helm of caution keeps the old helm of brilliance tile and new helm
of brilliance is basically the same image with different color and
pointed on the top.

Not changed:  the etched helmet was marked as green and is drawn
that way for text but the tile doesn't actually use green for it.
Crystal helmet started as hi_glass (rendered as 'bright cyan') but
has been changed to clr_white to match crystal plate mail.

Old save and bones files are invalidated.
This commit is contained in:
PatR
2023-04-29 02:18:29 -07:00
parent 90155cd857
commit f9a35132d6
6 changed files with 432 additions and 398 deletions

View File

@@ -400,6 +400,9 @@ Helmet_on(void)
case ORCISH_HELM:
case HELM_OF_TELEPATHY:
break;
case HELM_OF_CAUTION:
see_monsters();
break;
case HELM_OF_BRILLIANCE:
adj_abon(uarmh, uarmh->spe);
break;
@@ -486,6 +489,7 @@ Helmet_off(void)
}
break;
case HELM_OF_TELEPATHY:
case HELM_OF_CAUTION:
/* need to update ability before calling see_monsters() */
setworn((struct obj *) 0, W_ARMH);
see_monsters();
@@ -1400,7 +1404,7 @@ Blindf_off(struct obj *otmp)
also used by poly_obj() when a worn item gets transformed */
void
set_wear(struct obj *obj) /* if null, do all worn items;
otherwise just obj itself */
* otherwise just obj itself */
{
gi.initial_don = !obj;
@@ -2078,7 +2082,7 @@ accessory_or_armor_on(struct obj *obj)
You("are suddenly overcome with shame and change your mind.");
u.ublessed = 0; /* lose your god's protection */
makeknown(obj->otyp);
gc.context.botl = 1; /*for AC after zeroing u.ublessed */
gc.context.botl = 1; /* for AC after zeroing u.ublessed */
return ECMD_TIME;
}
} else {

View File

@@ -1630,7 +1630,8 @@ sortspells(void)
}
/* usual case, sort the index rather than the spells themselves */
qsort((genericptr_t) gs.spl_orderindx, n, sizeof *gs.spl_orderindx, spell_cmp);
qsort((genericptr_t) gs.spl_orderindx, n,
sizeof *gs.spl_orderindx, spell_cmp);
return;
}
@@ -1662,7 +1663,8 @@ spellsortmenu(void)
any.a_int = i + 1;
add_menu(tmpwin, &nul_glyphinfo, &any, let, 0,
ATR_NONE, clr, spl_sortchoices[i],
(i == gs.spl_sortmode) ? MENU_ITEMFLAGS_SELECTED : MENU_ITEMFLAGS_NONE);
(i == gs.spl_sortmode) ? MENU_ITEMFLAGS_SELECTED
: MENU_ITEMFLAGS_NONE);
}
end_menu(tmpwin, "View known spells list sorted");
@@ -1823,10 +1825,10 @@ percent_success(int spell)
*/
int chance, splcaster, special, statused;
int difficulty;
int skill;
int skill, skilltype = spell_skilltype(spellid(spell));
/* Knights don't get metal armor penalty for clerical spells */
boolean paladin_bonus = Role_if(PM_KNIGHT)
&& spell_skilltype(spellid(spell)) == P_CLERIC_SPELL;
boolean paladin_bonus = (Role_if(PM_KNIGHT)
&& skilltype == P_CLERIC_SPELL);
/* Calculate intrinsic ability (splcaster) */
@@ -1843,7 +1845,7 @@ percent_success(int spell)
splcaster += gu.urole.spelshld;
if (!paladin_bonus) {
if (uarmh && is_metallic(uarmh) && uarmh->otyp != HELM_OF_BRILLIANCE)
if (uarmh && is_metallic(uarmh)) /* && otyp != HELM_OF_BRILLIANCE */
splcaster += uarmhbon;
if (uarmg && is_metallic(uarmg))
splcaster += uarmgbon;
@@ -1877,7 +1879,7 @@ percent_success(int spell)
* The difficulty is based on the hero's level and their skill level
* in that spell type.
*/
skill = P_SKILL(spell_skilltype(spellid(spell)));
skill = P_SKILL(skilltype);
skill = max(skill, P_UNSKILLED) - 1; /* unskilled => 0 */
difficulty =
(spellev(spell) - 1) * 4 - ((skill * 6) + (u.ulevel / 3) + 1);