tutorial tweaks
Replace tests against tutorial_dnum with 'In_tutorial()' predicate. Give a message when entering the tutorial (via level change mechanism). Likewise, give a message when resuming regular play. If player uses #quit or ^C in the tutorial, ask whether to cut the tutorial short and resume regular play; skip "Really quit?" if the answer is yes. Behavior is a bit odd for ^C + yes; it just sits there until player types something.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 dungeon.h $NHDT-Date: 1596498535 2020/08/03 23:48:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.39 $ */
|
||||
/* NetHack 3.7 dungeon.h $NHDT-Date: 1685863327 2023/06/04 07:22:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.47 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -139,6 +139,7 @@ typedef struct branch {
|
||||
#define In_sokoban(x) ((x)->dnum == sokoban_dnum)
|
||||
#define Inhell In_hell(&u.uz) /* now gehennom */
|
||||
#define In_endgame(x) ((x)->dnum == astral_level.dnum)
|
||||
#define In_tutorial(x) ((x)->dnum == tutorial_dnum)
|
||||
|
||||
#define within_bounded_area(X, Y, LX, LY, HX, HY) \
|
||||
((X) >= (LX) && (X) <= (HX) && (Y) >= (LY) && (Y) <= (HY))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 allmain.c $NHDT-Date: 1652831519 2022/05/17 23:51:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.185 $ */
|
||||
/* NetHack 3.7 allmain.c $NHDT-Date: 1685863328 2023/06/04 07:22:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.218 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -520,7 +520,8 @@ maybe_do_tutorial(void)
|
||||
if (ask_do_tutorial()) {
|
||||
assign_level(&u.ucamefrom, &u.uz);
|
||||
iflags.nofollowers = TRUE;
|
||||
schedule_goto(&sp->dlevel, UTOTYPE_NONE, (char *) 0, (char *) 0);
|
||||
schedule_goto(&sp->dlevel, UTOTYPE_NONE,
|
||||
"Entering the tutorial.", (char *) 0);
|
||||
deferred_goto();
|
||||
vision_recalc(0);
|
||||
docrt();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 botl.c $NHDT-Date: 1646171622 2022/03/01 21:53:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.209 $ */
|
||||
/* NetHack 3.7 botl.c $NHDT-Date: 1685863332 2023/06/04 07:22:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.233 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -445,10 +445,9 @@ describe_level(
|
||||
addbranch = FALSE;
|
||||
} else {
|
||||
/* ports with more room may expand this one */
|
||||
if (u.uz.dnum == tutorial_dnum)
|
||||
Sprintf(buf, "Tutorial:%-2d", depth(&u.uz));
|
||||
else if (!addbranch)
|
||||
Sprintf(buf, "Dlvl:%-2d", depth(&u.uz));
|
||||
if (!addbranch)
|
||||
Sprintf(buf, "%s:%-2d", /* "Dlvl:n" (grep fodder) */
|
||||
In_tutorial(&u.uz) ? "Tutorial" : "Dlvl", depth(&u.uz));
|
||||
else
|
||||
Sprintf(buf, "level %d", depth(&u.uz));
|
||||
ret = 0;
|
||||
|
||||
6
src/do.c
6
src/do.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 do.c $NHDT-Date: 1683832317 2023/05/11 19:11:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.352 $ */
|
||||
/* NetHack 3.7 do.c $NHDT-Date: 1685863330 2023/06/04 07:22:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.355 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1417,9 +1417,9 @@ goto_level(
|
||||
return; /* must have the Amulet */
|
||||
if (!wizard) /* wizard ^V can bypass Earth level */
|
||||
assign_level(newlevel, &earth_level); /* (redundant) */
|
||||
} else if (newlevel->dnum == tutorial_dnum) {
|
||||
} else if (In_tutorial(newlevel)) {
|
||||
tutorial(TRUE); /* entering tutorial */
|
||||
} else if (u.uz.dnum == tutorial_dnum) {
|
||||
} else if (In_tutorial(&u.uz)) {
|
||||
tutorial(FALSE); /* leaving tutorial */
|
||||
up = FALSE; /* re-enter level 1 as if starting new game */
|
||||
/* TODO: remove tutorial level(s) from #overview data */
|
||||
|
||||
15
src/end.c
15
src/end.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 end.c $NHDT-Date: 1674546299 2023/01/24 07:44:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.265 $ */
|
||||
/* NetHack 3.7 end.c $NHDT-Date: 1685863329 2023/06/04 07:22:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.274 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -327,7 +327,13 @@ done1(int sig_unused UNUSED)
|
||||
int
|
||||
done2(void)
|
||||
{
|
||||
if (!paranoid_query(ParanoidQuit, "Really quit?")) {
|
||||
boolean abandon_tutorial = FALSE;
|
||||
|
||||
if (In_tutorial(&u.uz)
|
||||
&& y_n("Switch from the tutorial back to regular play?") == 'y')
|
||||
abandon_tutorial = TRUE;
|
||||
|
||||
if (abandon_tutorial || !paranoid_query(ParanoidQuit, "Really quit?")) {
|
||||
#ifndef NO_SIGNAL
|
||||
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
|
||||
#endif
|
||||
@@ -340,8 +346,13 @@ done2(void)
|
||||
u.uinvulnerable = FALSE; /* avoid ctrl-C bug -dlc */
|
||||
u.usleep = 0;
|
||||
}
|
||||
|
||||
if (abandon_tutorial)
|
||||
schedule_goto(&u.ucamefrom, UTOTYPE_ATSTAIRS,
|
||||
"Resuming regular play", (char *) 0);
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
#if (defined(UNIX) || defined(VMS) || defined(LATTICE))
|
||||
if (wizard) {
|
||||
int c;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 teleport.c $NHDT-Date: 1684374686 2023/05/18 01:51:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.202 $ */
|
||||
/* NetHack 3.7 teleport.c $NHDT-Date: 1685863331 2023/06/04 07:22:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.206 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1421,9 +1421,10 @@ domagicportal(struct trap *ttmp)
|
||||
target_level = ttmp->dst;
|
||||
|
||||
/* coming back from tutorial doesn't trigger stunning */
|
||||
if (u.uz.dnum == tutorial_dnum && target_level.dnum != tutorial_dnum) {
|
||||
if (In_tutorial(&u.uz) && !In_tutorial(&target_level)) {
|
||||
/* returning to normal play => arrive on level 1 stairs */
|
||||
totype = UTOTYPE_ATSTAIRS;
|
||||
stunmsg = "Resuming regular play.";
|
||||
} else {
|
||||
totype = UTOTYPE_PORTAL;
|
||||
stunmsg = !Stunned ? "You feel slightly dizzy."
|
||||
|
||||
Reference in New Issue
Block a user