1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-05-05 06:45:10 +01:00

Shield Patch

Incorporates a modified version of the Dragon Scale Shield patch.

Dragon scales shields are heavy, but offer high AC and resistances.

If the player wears a matching set of armor and shield, they can use the corresponding dragon breath weapon with #monster.

Some shields now add 1 (Uruk-hai, large, dwarvish) or 2 (elven) points to the players MC level

Confused enchant armor will convert worn scales into a scale shield.
This commit is contained in:
Chris-plus-alphanumericgibberish 2014-03-15 20:18:53 -04:00
parent 84ce43d2ce
commit f3e9c36a57
12 changed files with 306 additions and 20 deletions

View file

@ -1731,7 +1731,7 @@ E void NDECL(change_sex);
E void FDECL(polyself, (BOOLEAN_P));
E int FDECL(polymon, (int));
E void NDECL(rehumanize);
E int NDECL(dobreathe);
E int FDECL(dobreathe, (struct permonst *));
E int NDECL(dospit);
E int NDECL(doremove);
E int NDECL(dospinweb);

View file

@ -292,12 +292,18 @@ struct obj {
(obj)->otyp <= YELLOW_DRAGON_SCALES)
#define Is_dragon_mail(obj) ((obj)->otyp >= GRAY_DRAGON_SCALE_MAIL && \
(obj)->otyp <= YELLOW_DRAGON_SCALE_MAIL)
#define Is_dragon_armor(obj) (Is_dragon_scales(obj) || Is_dragon_mail(obj))
#define Is_dragon_shield(obj) ((obj)->otyp >= GRAY_DRAGON_SCALE_SHIELD && \
(obj)->otyp <= YELLOW_DRAGON_SCALE_SHIELD)
#define Is_dragon_armor(obj) (Is_dragon_scales(obj) || Is_dragon_mail(obj) || Is_dragon_shield(obj))
#define Dragon_scales_to_pm(obj) &mons[PM_GRAY_DRAGON + (obj)->otyp \
- GRAY_DRAGON_SCALES]
#define Dragon_mail_to_pm(obj) &mons[PM_GRAY_DRAGON + (obj)->otyp \
- GRAY_DRAGON_SCALE_MAIL]
#define Dragon_shield_to_pm(obj) &mons[PM_GRAY_DRAGON + (obj)->otyp \
- GRAY_DRAGON_SCALE_SHIELD]
#define Dragon_to_scales(pm) (GRAY_DRAGON_SCALES + (pm - mons))
#define Have_same_dragon_armor_and_shield ((Is_dragon_scales(uarm) && Dragon_scales_to_pm(uarm) == Dragon_shield_to_pm(uarms)) ||\
(Is_dragon_mail(uarm) && Dragon_mail_to_pm(uarm) == Dragon_shield_to_pm(uarms)) )
/* Elven gear */
#define is_elven_weapon(otmp) ((otmp)->otyp == ELVEN_ARROW\

View file

@ -474,8 +474,20 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */
STATIC_PTR int
domonability()
{
if (can_breathe(youmonst.data)) return dobreathe();
else if (attacktype(youmonst.data, AT_SPIT)) return dospit();
if (can_breathe(youmonst.data)) return dobreathe(youmonst.data);
else if(uarm && uarms &&
Is_dragon_armor(uarm) && Is_dragon_shield(uarms) &&
Have_same_dragon_armor_and_shield &&
uarm->age < monstermoves && uarms->age < monstermoves &&
yn("Use dragonbreath?") == 'y'
){
int res;
if(res = dobreathe(Dragon_shield_to_pm(uarms))){
uarm->age = monstermoves + (long)(rnz(100)*(Role_if(PM_CAVEMAN) ? .8 : 1));
uarms->age= monstermoves + (long)(rnz(100)*(Role_if(PM_CAVEMAN) ? .8 : 1));
}
return res;
} else if (attacktype(youmonst.data, AT_SPIT)) return dospit();
else if (attacktype(youmonst.data, AT_MAGC))
return castum((struct monst *)0,
&youmonst.data->mattk[attackindex(youmonst.data,

View file

@ -986,6 +986,8 @@ struct monst *mon;
if(armpro < cpro) armpro = cpro;
}
armor = (mon == &youmonst) ? uarmh : which_armor(mon, W_ARMH);
if(mon == &youmonst && !uarmc &&
uwep && uwep->oartifact==ART_TENSA_ZANGETSU) armpro = max(armpro, 2); //magic cancelation for tensa zangetsu
if (armor && armpro < objects[armor->otyp].a_can)
armpro = objects[armor->otyp].a_can;
@ -1003,8 +1005,9 @@ struct monst *mon;
if (armor && armpro < objects[armor->otyp].a_can)
armpro = objects[armor->otyp].a_can;
armor = (mon == &youmonst) ? uarms : which_armor(mon, W_ARMS);
if (armor && armpro < objects[armor->otyp].a_can)
armpro = objects[armor->otyp].a_can;
if (armor && armpro < 3){
armpro = min(3, armpro+objects[armor->otyp].a_can);
}
#ifdef STEED
/* this one is really a stretch... */
@ -1012,8 +1015,6 @@ struct monst *mon;
if (armor && armpro < objects[armor->otyp].a_can)
armpro = objects[armor->otyp].a_can;
#endif
if(mon == &youmonst && !uarmc &&
uwep && uwep->oartifact==ART_TENSA_ZANGETSU) armpro = max(armpro, 2); //magic cancelation for tensa zangetsu
return armpro;
}

View file

@ -1132,7 +1132,7 @@ register struct obj *obj;
wt *= 2; //300
}
else if(obj->oartifact == ART_DRAGON_PLATE){
wt = (int)(wt * 1.5); //450
wt = (int)(wt * 1.5); //225
}
if(obj->oartifact == ART_TREASURY_OF_PROTEUS){

View file

@ -132,8 +132,8 @@ register boolean special;
rnd_class(OILSKIN_CLOAK, CLOAK_OF_DISPLACEMENT);
short helm = !rn2(8) ? STRANGE_OBJECT :
rnd_class(ELVEN_LEATHER_HELM, HELM_OF_TELEPATHY);
short shield = !rn2(8) ? STRANGE_OBJECT :
rnd_class(ELVEN_SHIELD, SHIELD_OF_REFLECTION);
short shield = !rn2(2) ? rnd_class(GRAY_DRAGON_SCALE_SHIELD, YELLOW_DRAGON_SCALE_SHIELD)
: (!rn2(8) ? STRANGE_OBJECT : rnd_class(ELVEN_SHIELD, SHIELD_OF_REFLECTION));
int quan;
struct obj *otmp;

View file

@ -2253,10 +2253,12 @@ const char *str;
{
struct obj *orefl = which_armor(mon, W_ARMS);
if (orefl && orefl->otyp == SHIELD_OF_REFLECTION) {
if (orefl &&
(orefl->otyp == SHIELD_OF_REFLECTION ||
orefl->otyp == SILVER_DRAGON_SCALE_SHIELD)) {
if (str) {
pline(str, s_suffix(mon_nam(mon)), "shield");
makeknown(SHIELD_OF_REFLECTION);
makeknown(orefl->otyp);
}
return TRUE;
} else if (arti_reflects(MON_WEP(mon))) {

View file

@ -344,7 +344,7 @@ HELM("helm of telepathy", "visored helmet",
* the same defined in monst.c.
*/
#define DRGN_ARMR(name,mgc,power,cost,ac,color) \
ARMOR(name,(char *)0,1,mgc,1,power,0,5,300,cost,ac,0,ARM_SUIT,DRAGON_HIDE,color)
ARMOR(name,(char *)0,1,mgc,1,power,0,5,150,cost,ac,0,ARM_SUIT,DRAGON_HIDE,color)
/* 3.4.1: dragon scale mail reclassified as "magic" since magic is
needed to create them */
DRGN_ARMR("gray dragon scale mail", 1, ANTIMAGIC, 1200, 1, CLR_GRAY),
@ -474,17 +474,34 @@ CLOAK("cloak of displacement", "piece of cloth",
SHIELD("small shield", (char *)0,
1, 0, 0, 0, 6, 0, 30, 3, 9, 0, WOOD, HI_WOOD),
SHIELD("elven shield", "blue and green shield",
0, 0, 0, 0, 2, 0, 40, 7, 8, 0, WOOD, CLR_GREEN),
0, 0, 0, 0, 2, 0, 40, 7, 8, 2, WOOD, CLR_GREEN),
SHIELD("Uruk-hai shield", "white-handed shield",
0, 0, 0, 0, 2, 0, 50, 7, 8, 0, IRON, HI_METAL),
0, 0, 0, 0, 2, 0, 50, 7, 8, 1, IRON, HI_METAL),
SHIELD("orcish shield", "red-eyed shield",
0, 0, 0, 0, 2, 0, 50, 7, 9, 0, IRON, CLR_RED),
SHIELD("large shield", (char *)0,
1, 0, 1, 0, 7, 0,100, 10, 8, 0, IRON, HI_METAL),
1, 0, 1, 0, 7, 0,100, 10, 8, 1, IRON, HI_METAL),
SHIELD("dwarvish roundshield", "large round shield",
0, 0, 0, 0, 4, 0,100, 10, 7, 0, IRON, HI_METAL),
0, 0, 0, 0, 4, 0, 80, 10, 7, 1, IRON, HI_METAL),
SHIELD("shield of reflection", "polished silver shield",
0, 1, 0, REFLECTING, 3, 0, 50, 50, 8, 0, SILVER, HI_SILVER),
/*#define SHIELD(name,desc,kn,mgc,blk,power,prob,delay,wt,cost,ac,can,metal,c) \
ARMOR(name,desc,kn,mgc,blk,power,prob,delay,wt,cost,ac,can,ARM_SHIELD,metal,c) */
#define DRGN_SHIELD(name,mgc,power,cost,ac,color) \
ARMOR(name,(char *)0,1,mgc,1,power,0,0,150,cost,ac,0,ARM_SHIELD,DRAGON_HIDE,color)
/* 3.4.1: dragon scale mail reclassified as "magic" since magic is
needed to create them */
DRGN_SHIELD("gray dragon scale shield", 1, ANTIMAGIC, 1200, 7, CLR_GRAY),
DRGN_SHIELD("silver dragon scale shield", 1, REFLECTING, 1200, 7, DRAGON_SILVER),
DRGN_SHIELD("shimmering dragon scale shield", 1, DISPLACED, 1200, 7, CLR_CYAN),
DRGN_SHIELD("deep dragon scale shield", 1, DRAIN_RES, 1200, 7, CLR_MAGENTA),
DRGN_SHIELD("red dragon scale shield", 1, FIRE_RES, 900, 7, CLR_RED),
DRGN_SHIELD("white dragon scale shield", 1, COLD_RES, 900, 7, CLR_WHITE),
DRGN_SHIELD("orange dragon scale shield", 1, SLEEP_RES, 900, 7, CLR_ORANGE),
DRGN_SHIELD("black dragon scale shield", 1, DISINT_RES, 1200, 7, CLR_BLACK),
DRGN_SHIELD("blue dragon scale shield", 1, SHOCK_RES, 900, 7, CLR_BLUE),
DRGN_SHIELD("green dragon scale shield", 1, POISON_RES, 900, 7, CLR_GREEN),
DRGN_SHIELD("yellow dragon scale shield", 1, ACID_RES, 900, 7, CLR_YELLOW),
/* gloves */
/* these have their color but not material shuffled, so the IRON must stay

View file

@ -1697,6 +1697,10 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = {
#endif
{ "dragon scales",
ARMOR_CLASS, GRAY_DRAGON_SCALES, YELLOW_DRAGON_SCALES },
{ "dragon scale shield",
ARMOR_CLASS, GRAY_DRAGON_SCALE_SHIELD, YELLOW_DRAGON_SCALE_SHIELD },
{ "scale shield",
ARMOR_CLASS, LARGE_SHIELD, LARGE_SHIELD },
{ "dragon scale mail",
ARMOR_CLASS, GRAY_DRAGON_SCALE_MAIL, YELLOW_DRAGON_SCALE_MAIL },
{ "sword", WEAPON_CLASS, SHORT_SWORD, KATANA },
@ -1902,6 +1906,7 @@ struct alt_spellings {
{ "saber", SILVER_SABER },
{ "silver sabre", SILVER_SABER },
{ "smooth shield", SHIELD_OF_REFLECTION },
{ "grey dragon scale shield", GRAY_DRAGON_SCALE_SHIELD },
{ "grey dragon scale mail", GRAY_DRAGON_SCALE_MAIL },
{ "grey dragon scales", GRAY_DRAGON_SCALES },
{ "enchant armour", SCR_ENCHANT_ARMOR },
@ -2987,6 +2992,14 @@ typfnd:
otmp->otyp = GRAY_DRAGON_SCALE_MAIL +
mntmp - PM_GRAY_DRAGON;
break;
case LARGE_SHIELD:
/* Dragon shield - depends on the order of objects */
/* & dragons. */
if (mntmp >= PM_GRAY_DRAGON &&
mntmp <= PM_YELLOW_DRAGON)
otmp->otyp = GRAY_DRAGON_SCALE_SHIELD +
mntmp - PM_GRAY_DRAGON;
break;
}
}

View file

@ -831,7 +831,8 @@ rehumanize()
}
int
dobreathe()
dobreathe(mdat)
struct permonst *mdat;
{
struct attack *mattk;
@ -848,7 +849,7 @@ dobreathe()
if (!getdir((char *)0)) return(0);
mattk = attacktype_fordmg(youmonst.data, AT_BREA, AD_ANY);
mattk = attacktype_fordmg(mdat, AT_BREA, AD_ANY);
if (!mattk)
impossible("bad breath attack?"); /* mouthwash needed... */
else

View file

@ -929,6 +929,28 @@ struct obj *sobj;
}
if(confused) {
otmp->oerodeproof = !(sobj->cursed);
if (otmp->otyp >= GRAY_DRAGON_SCALES &&
otmp->otyp <= YELLOW_DRAGON_SCALES) {
/* dragon scales get turned into dragon scale shield */
if(Blind) {
Your("%s %s harder!", xname(otmp), otense(otmp, "feel"));
} else {
Your("%s merges and hardens!", xname(otmp));
}
setworn((struct obj *)0, W_ARMS);
setworn((struct obj *)0, W_ARM);
/* assumes same order */
otmp->otyp = GRAY_DRAGON_SCALE_SHIELD +
otmp->otyp - GRAY_DRAGON_SCALES;
otmp->cursed = 0;
if (sobj->blessed) {
otmp->spe++;
otmp->blessed = 1;
}
otmp->known = 1;
setworn(otmp, W_ARMS);
break;
} else {
if(Blind) {
otmp->rknown = FALSE;
Your("%s %s warm for a moment.",
@ -949,6 +971,7 @@ struct obj *sobj;
xname(otmp),
otense(otmp, Blind ? "feel" : "look"));
}
}
break;
}
/* elven armor vibrates warningly when enchanted beyond a limit */
@ -963,10 +986,12 @@ struct obj *sobj;
if (sobj->cursed)
same_color =
(otmp->otyp == BLACK_DRAGON_SCALE_MAIL ||
otmp->otyp == BLACK_DRAGON_SCALE_SHIELD ||
otmp->otyp == BLACK_DRAGON_SCALES);
else
same_color =
(otmp->otyp == SILVER_DRAGON_SCALE_MAIL ||
otmp->otyp == SILVER_DRAGON_SCALE_SHIELD ||
otmp->otyp == SILVER_DRAGON_SCALES ||
otmp->otyp == SHIELD_OF_REFLECTION);
if (Blind) same_color = FALSE;

View file

@ -2959,6 +2959,215 @@ P = (108, 145, 182)
MMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM
}
# tile 82 (gray dragon scale shield)
{
MMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM
MMMNMNNNOOOMOMMM
MMMNNNNNOOOOOMMM
MMMNMMPMMMPMOAMM
MMMNMPMMMPMMOAMM
MMMNPMMMPMMMOAMM
MMMNMMMPMMMPOAMM
MMMNMMPMMMPMOAMM
MMMMNPMMMPMOAAMM
MMMMMNMMPMOAAMMM
MMMMMMNPMOAAMMMM
MMMMMMMNOAAMMMMM
MMMMMMMMAAMMMMMM
MMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM
}
# tile 83 (silver dragon scale shield)
{
MMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM
MMMNMNNNOOOMOMMM
MMMNNNNNOOBOOMMM
MMMNOBNOOBNOBAMM
MMMNBNOOBNOBBAMM
MMMNNOOBNOBBBAMM
MMMNOOBNOBBNBAMM
MMMNOBNOBBNBBAMM
MMMMNNOBBNBBAAMM
MMMMMNBBNBBAAMMM
MMMMMMNNBBAAMMMM
MMMMMMMNBAAMMMMM
MMMMMMMMAAMMMMMM
MMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM
}
# tile 84 (shimmering dragon scale shield)
{
MMMMMMMMM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