+ break;
+ /* end treasure type 3 */
+
+ case 4: /* treasure type 4 */
+ addstr("You've found a scroll. Will you read it ? ");
+ ch = getanswer("NY", FALSE);
+ addstr("\n\n");
+
+ if (ch == 'Y')
+ switch ((int) ROLL(1, 6)) {
+ case 1:
+ addstr("It throws up a shield for you next monster.\n");
+ getyx(stdscr, whichtreasure, ch);
+ more(whichtreasure);
+ Shield =
+ (Player.p_maxenergy + Player.p_energy) * 5.5 + Circle * 50.0;
+ Whichmonster = pickmonster();
+ longjmp(Fightenv, 0);
+ /* NOTREACHED */
+
+ case 2:
+ addstr("It makes you invisible for you next monster.\n");
+ getyx(stdscr, whichtreasure, ch);
+ more(whichtreasure);
+ Player.p_speed = 1e6;
+ Whichmonster = pickmonster();
+ longjmp(Fightenv, 0);
+ /* NOTREACHED */
+
+ case 3:
+ addstr("It increases your strength ten fold to fight your next monster.\n");
+ getyx(stdscr, whichtreasure, ch);
+ more(whichtreasure);
+ Player.p_might *= 10.0;
+ Whichmonster = pickmonster();
+ longjmp(Fightenv, 0);
+ /* NOTREACHED */
+
+ case 4:
+ addstr("It is a general knowledge scroll.\n");
+ Player.p_brains += ROLL(2.0, Circle);
+ Player.p_magiclvl += ROLL(1.0, Circle / 2.0);
+ break;
+
+ case 5:
+ addstr("It tells you how to pick your next monster.\n");
+ addstr("Which monster do you want [0-99] ? ");
+ Whichmonster = (int) infloat();
+ Whichmonster = MIN(99, MAX(0, Whichmonster));
+ longjmp(Fightenv, 0);
+
+ case 6:
+ addstr("It was cursed!\n");
+ cursedtreasure();
+ break;
+ }
+ break;
+ /* end treasure type 4 */
+
+ case 5: /* treasure type 5 */
+ switch (whichtreasure) {
+ case 1:
+ dtemp = ROLL(Circle / 4.0 + 5.0, Circle / 2.0 + 9.0);
+ printw("You've discovered a +%.0f dagger.\n", dtemp);
+ if (dtemp >= Player.p_sword)
+ Player.p_sword = dtemp;
+ else
+ SOMEBETTER();
+ break;
+
+ case 2:
+ dtemp = ROLL(7.5 + Circle * 3.0, Circle * 2.0 + 160.0);
+ printw("You have found some +%.0f armour!\n", dtemp);
+ if (dtemp >= Player.p_shield)
+ Player.p_shield = dtemp;
+ else
+ SOMEBETTER();
+ break;
+
+ case 3:
+ addstr("You've found a tablet.\n");
+ Player.p_brains += 4.5 * Circle;
+ break;
+ }
+ break;
+ /* end treasure type 5 */
+
+ case 6: /* treasure type 6 */
+ switch (whichtreasure) {
+ case 1:
+ addstr("You've found a priest.\n");
+ Player.p_energy = Player.p_maxenergy + Player.p_shield;
+ Player.p_sin /= 2.0;
+ Player.p_mana += 24.0 * Circle;
+ Player.p_brains += Circle;
+ break;
+
+ case 2:
+ addstr("You have come upon Robin Hood!\n");
+ Player.p_shield += Circle * 2.0;
+ Player.p_strength += Circle / 2.5 + 1.0;
+ break;
+
+ case 3:
+ dtemp = ROLL(2.0 + Circle / 4.0, Circle / 1.2 + 10.0);
+ printw("You have found a +%.0f axe!\n", dtemp);
+ if (dtemp >= Player.p_sword)
+ Player.p_sword = dtemp;
+ else
+ SOMEBETTER();
+ break;
+ }
+ break;
+ /* end treasure type 6 */
+
+ case 7: /* treasure type 7 */
+ switch (whichtreasure) {
+ case 1:
+ addstr("You've discovered a charm!\n");
+ ++Player.p_charms;
+ break;
+
+ case 2:
+ addstr("You have encountered Merlyn!\n");
+ Player.p_brains += Circle + 5.0;
+ Player.p_magiclvl += Circle / 3.0 + 5.0;
+ Player.p_mana += Circle * 10.0;
+ break;
+
+ case 3:
+ dtemp = ROLL(5.0 + Circle / 3.0, Circle / 1.5 + 20.0);
+ printw("You have found a +%.0f war hammer!\n", dtemp);
+ if (dtemp >= Player.p_sword)
+ Player.p_sword = dtemp;
+ else
+ SOMEBETTER();
+ break;
+ }
+ break;
+ /* end treasure type 7 */
+
+ case 8: /* treasure type 8 */
+ switch (whichtreasure) {
+ case 1:
+ addstr("You have found a healing potion.\n");
+ Player.p_poison = MIN(-2.0, Player.p_poison - 2.0);
+ break;
+
+ case 2:
+ addstr("You have discovered a transporter. Do you wish to go anywhere ? ");
+ ch = getanswer("NY", FALSE);
+ addstr("\n\n");
+ if (ch == 'Y') {
+ double x, y;
+
+ addstr("X Y Coordinates ? ");
+ getstring(Databuf, SZ_DATABUF);
+ sscanf(Databuf, "%lf %lf", &x, &y);
+ altercoordinates(x, y, A_FORCED);
+ }
+ break;
+
+ case 3:
+ dtemp = ROLL(10.0 + Circle / 1.2, Circle * 3.0 + 30.0);
+ printw("You've found a +%.0f sword!\n", dtemp);
+ if (dtemp >= Player.p_sword)
+ Player.p_sword = dtemp;
+ else
+ SOMEBETTER();
+ break;
+ }
+ break;
+ /* end treasure type 8 */
+
+ case 10:
+ case 11:
+ case 12:
+ case 13: /* treasure types 10 - 13 */
+ if (drandom() < 0.33) {
+ if (Curmonster.m_treasuretype == 10) {
+ addstr("You've found a pair of elven boots!\n");
+ Player.p_quickness += 2.0;
+ break;
+ } else
+ if (Curmonster.m_treasuretype == 11
+ && !Player.p_palantir) {
+ addstr("You've acquired Saruman's palantir.\n");
+ Player.p_palantir = TRUE;
+ break;
+ } else
+ if (Player.p_ring.ring_type == R_NONE
+ && Player.p_specialtype < SC_COUNCIL
+ && (Curmonster.m_treasuretype == 12
+ || Curmonster.m_treasuretype == 13))
+ /* roll
+ * up
+ * a
+ * ring
+ * */
+ {
+ if (drandom() < 0.8)
+ /* r
+ * e
+ * g
+ * u
+ * l
+ * a
+ * r
+ *
+ * ri
+ * n
+ * g
+ * s
+ * */
+ {
+ if (Curmonster.m_treasuretype == 12) {
+ whichtreasure = R_NAZREG;
+ temp = 35;
+ } else {
+ whichtreasure = R_DLREG;
+ temp = 0;
+ }
+ } else
+ /* b
+ * a
+ * d
+ *
+ * ri
+ * n
+ * g
+ * s
+ * */
+ {
+ whichtreasure = R_BAD;
+ temp = 15 + Statptr->c_ringduration + (int) ROLL(0, 5);
+ }
+
+ addstr("You've discovered a ring. Will you pick it up ? ");
+ ch = getanswer("NY", FALSE);
+ addstr("\n\n");
+
+ if (ch == 'Y') {
+ Player.p_ring.ring_type = whichtreasure;
+ Player.p_ring.ring_duration = temp;
+ }
+ break;
+ }
+ }
+ /* end treasure types 10 - 13 */
+ /* fall through to treasure type 9 if
+ * no treasure from above */
+
+ case 9: /* treasure type 9 */
+ switch (whichtreasure) {
+ case 1:
+ if (Player.p_level <= 1000.0
+ && Player.p_crowns <= 3
+ && Player.p_level >= 10.0) {
+ addstr("You have found a golden crown!\n");
+ ++Player.p_crowns;
+ break;
+ }
+ /* fall through otherwise */
+
+ case 2:
+ addstr("You've been blessed!\n");
+ Player.p_blessing = TRUE;
+ Player.p_sin /= 3.0;
+ Player.p_energy = Player.p_maxenergy + Player.p_shield;
+ Player.p_mana += 100.0 * Circle;
+ break;
+
+ case 3:
+ dtemp = ROLL(1.0, Circle / 5.0 + 5.0);
+ dtemp = MIN(dtemp, 99.0);
+ printw("You have discovered some +%.0f quicksilver!\n", dtemp);
+ if (dtemp >= Player.p_quksilver)
+ Player.p_quksilver = dtemp;
+ else
+ SOMEBETTER();
+ break;
+ }
+ break;
+ /* end treasure type 9 */