suggested booktribute mods
Changes to be committed: modified: include/extern.h modified: src/files.c modified: src/objects.c modified: src/spell.c - charge a little more. - no free read in the bookstore.
This commit is contained in:
@@ -753,7 +753,7 @@ E void NDECL(really_close);
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
E boolean FDECL(showdebug, (const char *));
|
E boolean FDECL(showdebug, (const char *));
|
||||||
#endif
|
#endif
|
||||||
E void FDECL(read_tribute, (const char *,const char *,int));
|
E boolean FDECL(read_tribute, (const char *,const char *,int));
|
||||||
|
|
||||||
/* ### fountain.c ### */
|
/* ### fountain.c ### */
|
||||||
|
|
||||||
|
|||||||
17
src/files.c
17
src/files.c
@@ -3331,13 +3331,17 @@ const char *filename;
|
|||||||
|
|
||||||
/* ---------- BEGIN TRIBUTE ----------- */
|
/* ---------- BEGIN TRIBUTE ----------- */
|
||||||
|
|
||||||
/* 3.6 tribute code */
|
/* 3.6 tribute code
|
||||||
|
*
|
||||||
|
* Returns TRUE if you were able to read something.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#define SECTIONSCOPE 1
|
#define SECTIONSCOPE 1
|
||||||
#define TITLESCOPE 2
|
#define TITLESCOPE 2
|
||||||
#define PASSAGESCOPE 3
|
#define PASSAGESCOPE 3
|
||||||
|
|
||||||
void
|
boolean
|
||||||
read_tribute(tribsection, tribtitle, tribpassage)
|
read_tribute(tribsection, tribtitle, tribpassage)
|
||||||
const char *tribsection, *tribtitle;
|
const char *tribsection, *tribtitle;
|
||||||
int tribpassage;
|
int tribpassage;
|
||||||
@@ -3351,12 +3355,13 @@ int tribpassage;
|
|||||||
const char *badtranslation = "an incomprehensible foreign translation";
|
const char *badtranslation = "an incomprehensible foreign translation";
|
||||||
boolean matchedsection = FALSE, matchedtitle = FALSE;
|
boolean matchedsection = FALSE, matchedtitle = FALSE;
|
||||||
winid tribwin = WIN_ERR;
|
winid tribwin = WIN_ERR;
|
||||||
|
boolean grasped = FALSE;
|
||||||
|
|
||||||
/* check for mandatories */
|
/* check for mandatories */
|
||||||
if (!tribsection || !tribtitle) {
|
if (!tribsection || !tribtitle) {
|
||||||
pline("It's %s of \"%s\"!",
|
pline("It's %s of \"%s\"!",
|
||||||
badtranslation, tribtitle);
|
badtranslation, tribtitle);
|
||||||
return;
|
return grasped;
|
||||||
}
|
}
|
||||||
|
|
||||||
debugpline3("read_tribute %s, %s, %d.", tribsection, tribtitle, tribpassage);
|
debugpline3("read_tribute %s, %s, %d.", tribsection, tribtitle, tribpassage);
|
||||||
@@ -3365,7 +3370,7 @@ int tribpassage;
|
|||||||
if (!fp) {
|
if (!fp) {
|
||||||
/* this is actually an error - cannot open tribute file! */
|
/* this is actually an error - cannot open tribute file! */
|
||||||
pline("You feel too overwhelmed to continue!");
|
pline("You feel too overwhelmed to continue!");
|
||||||
return;
|
return grasped;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3465,13 +3470,13 @@ cleanup:
|
|||||||
display_nhwindow(tribwin, FALSE);
|
display_nhwindow(tribwin, FALSE);
|
||||||
destroy_nhwindow(tribwin);
|
destroy_nhwindow(tribwin);
|
||||||
tribwin = WIN_ERR;
|
tribwin = WIN_ERR;
|
||||||
u.uconduct.literate++;
|
grasped = TRUE;
|
||||||
} else {
|
} else {
|
||||||
pline("It seems to be %s of \"%s\"!",
|
pline("It seems to be %s of \"%s\"!",
|
||||||
badtranslation, tribtitle);
|
badtranslation, tribtitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return grasped;
|
||||||
}
|
}
|
||||||
/* ---------- END TRIBUTE ----------- */
|
/* ---------- END TRIBUTE ----------- */
|
||||||
|
|
||||||
|
|||||||
@@ -829,7 +829,7 @@ SPELL("freeze sphere", "hardcover", P_MATTER_SPELL, 20, 2, 1, 1, NODIR, CLR
|
|||||||
SPELL("blank paper", "plain", P_NONE, 18, 0, 0, 0, 0, HI_PAPER),
|
SPELL("blank paper", "plain", P_NONE, 18, 0, 0, 0, 0, HI_PAPER),
|
||||||
/* tribute book for 3.6 */
|
/* tribute book for 3.6 */
|
||||||
OBJECT(OBJ("novel", "paperback"), BITS(0,0,1,0,0,0,0,1,0,0,0,P_NONE,HI_PAPER), 0,
|
OBJECT(OBJ("novel", "paperback"), BITS(0,0,1,0,0,0,0,1,0,0,0,P_NONE,HI_PAPER), 0,
|
||||||
SPBOOK_CLASS, 0, 0, 0, 1, 0, 0, 0, 1, 20, CLR_BRIGHT_BLUE),
|
SPBOOK_CLASS, 0, 0, 0, 20, 0, 0, 0, 1, 20, CLR_BRIGHT_BLUE),
|
||||||
/* a special, one of a kind, spellbook */
|
/* a special, one of a kind, spellbook */
|
||||||
OBJECT(OBJ("Book of the Dead", "papyrus"), BITS(0,0,1,0,1,0,1,1,0,0,0,P_NONE,PAPER), 0,
|
OBJECT(OBJ("Book of the Dead", "papyrus"), BITS(0,0,1,0,1,0,1,1,0,0,0,P_NONE,PAPER), 0,
|
||||||
SPBOOK_CLASS, 0, 0,20, 10000, 0, 0, 0, 7, 20, HI_PAPER),
|
SPBOOK_CLASS, 0, 0,20, 10000, 0, 0, 0, 7, 20, HI_PAPER),
|
||||||
|
|||||||
@@ -452,10 +452,12 @@ register struct obj *spellbook;
|
|||||||
|
|
||||||
/* 3.6.0 tribute */
|
/* 3.6.0 tribute */
|
||||||
if (booktype == SPE_NOVEL) {
|
if (booktype == SPE_NOVEL) {
|
||||||
/* Obtain current Terry Pratchett book
|
/* Obtain current Terry Pratchett book title */
|
||||||
title for the current game. */
|
|
||||||
const char *tribtitle = noveltitle(&spellbook->novelidx);
|
const char *tribtitle = noveltitle(&spellbook->novelidx);
|
||||||
read_tribute("books", tribtitle, 0);
|
if (read_tribute("books", tribtitle, 0)) {
|
||||||
|
u.uconduct.literate++;
|
||||||
|
check_unpaid(spellbook);
|
||||||
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user