add two new types of amulet: flying and guarding
We haven't added any new objects or monsters in a really long time. This adds two new useful amulets, putting more pressure on the decision over which type of amulet to wear. amulet of flying: idea from slash'em, implemented from scratch. Should be self-explanatory. Polymorphing into a form capable of eating amulets and then eating one does not confer intrinsic flight. (I've no idea how slash'em behaves is in that regard.) amulet of guarding: adds +2 AC, which is fairly negligible, also +2 MC, which is not. Initially called amulet of protection but MC of 2 is referred to as 'guarded' by enlightenment so I changed it. (By that reasoning, rings of protection ought to be called rings of warding; oh, well.) Successfully eating one confers +2 AC without any MC benefit. When wearing one of these, rings of protection only confer AC, their +1 MC gets superseded rather than combined. Monsters will wear an amulet of guarding and gain both the AC and MC benefit, but if not cursed and they acquire one of life-saving or reflection, they'll swap. They won't wear an amulet of flying. I cloned two extra copies of the tile for one of the existing amulets and ran sys/share/objects.txt through renumtiles.pl. The result appears to be ok but on X11 the tiles map ends up looking psychedelic so something beyond the tile art itself needs to be fixed here.
This commit is contained in:
+48
-2
@@ -784,7 +784,31 @@ Amulet_on()
|
||||
gotten set by previously eating one of these amulets */
|
||||
if (newnap < oldnap || oldnap == 0L)
|
||||
HSleepy = (HSleepy & ~TIMEOUT) | newnap;
|
||||
} break;
|
||||
break;
|
||||
}
|
||||
case AMULET_OF_FLYING:
|
||||
/* setworn() has already set extrinisic flying */
|
||||
float_vs_flight(); /* block flying if levitating */
|
||||
if (Flying) {
|
||||
boolean already_flying;
|
||||
|
||||
/* to determine whether this flight is new we have to muck
|
||||
about in the Flying intrinsic (actually extrinsic) */
|
||||
EFlying &= ~W_AMUL;
|
||||
already_flying = !!Flying;
|
||||
EFlying |= W_AMUL;
|
||||
|
||||
if (!already_flying) {
|
||||
makeknown(AMULET_OF_FLYING);
|
||||
g.context.botl = TRUE; /* status: 'Fly' On */
|
||||
You("are now in flight.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AMULET_OF_GUARDING:
|
||||
makeknown(AMULET_OF_GUARDING);
|
||||
find_ac();
|
||||
break;
|
||||
case AMULET_OF_YENDOR:
|
||||
break;
|
||||
}
|
||||
@@ -838,6 +862,26 @@ Amulet_off()
|
||||
if (!ESleepy && !(HSleepy & ~TIMEOUT))
|
||||
HSleepy &= ~TIMEOUT; /* clear timeout bits */
|
||||
return;
|
||||
case AMULET_OF_FLYING: {
|
||||
boolean was_flying = !!Flying;
|
||||
|
||||
/* remove amulet 'early' to determine whether Flying changes */
|
||||
setworn((struct obj *) 0, W_AMUL);
|
||||
float_vs_flight(); /* probably not needed here */
|
||||
if (was_flying && !Flying) {
|
||||
makeknown(AMULET_OF_FLYING);
|
||||
g.context.botl = TRUE; /* status: 'Fly' Off */
|
||||
You("%s.", (is_pool_or_lava(u.ux, u.uy)
|
||||
|| Is_waterlevel(&u.uz) || Is_airlevel(&u.uz))
|
||||
? "stop flying"
|
||||
: "land");
|
||||
spoteffects(TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AMULET_OF_GUARDING:
|
||||
find_ac();
|
||||
break;
|
||||
case AMULET_OF_YENDOR:
|
||||
break;
|
||||
}
|
||||
@@ -2056,7 +2100,7 @@ struct obj *obj;
|
||||
g.multi_reason = "dressing up";
|
||||
g.nomovemsg = "You finish your dressing maneuver.";
|
||||
} else {
|
||||
unmul(""); /* call (*g.aftermv)(), clear it+g.nomovemsg+g.multi_reason */
|
||||
unmul(""); /* call aftermv, clear it+nomovemsg+multi_reason */
|
||||
on_msg(obj);
|
||||
}
|
||||
g.context.takeoff.mask = g.context.takeoff.what = 0L;
|
||||
@@ -2151,6 +2195,8 @@ find_ac()
|
||||
uac -= uleft->spe;
|
||||
if (uright && uright->otyp == RIN_PROTECTION)
|
||||
uac -= uright->spe;
|
||||
if (uamul && uamul->otyp == AMULET_OF_GUARDING)
|
||||
uac -= 2; /* fixed amount; main benefit is to MC */
|
||||
|
||||
/* armor class from other sources */
|
||||
if (HProtection & INTRINSIC)
|
||||
|
||||
Reference in New Issue
Block a user