Moved pray.c globals to instance_globals.
This commit is contained in:
@@ -464,6 +464,14 @@ struct instance_globals {
|
|||||||
|
|
||||||
/* muse.c */
|
/* muse.c */
|
||||||
boolean m_using; /* kludge to use mondided instead of killed */
|
boolean m_using; /* kludge to use mondided instead of killed */
|
||||||
|
int trapx;
|
||||||
|
int trapy;
|
||||||
|
boolean zap_oseen; /* for wands which use mbhitm and are zapped at
|
||||||
|
* players. We usually want an oseen local to
|
||||||
|
* the function, but this is impossible since the
|
||||||
|
* function mbhitm has to be compatible with the
|
||||||
|
* normal zap routines, and those routines don't
|
||||||
|
* remember who zapped the wand. */
|
||||||
|
|
||||||
/* objname.c */
|
/* objname.c */
|
||||||
/* distantname used by distant_name() to pass extra information to
|
/* distantname used by distant_name() to pass extra information to
|
||||||
@@ -498,6 +506,13 @@ struct instance_globals {
|
|||||||
int potion_nothing;
|
int potion_nothing;
|
||||||
int potion_unkn;
|
int potion_unkn;
|
||||||
|
|
||||||
|
/* pray.c */
|
||||||
|
/* values calculated when prayer starts, and used when completed */
|
||||||
|
aligntyp p_aligntyp;
|
||||||
|
int p_trouble;
|
||||||
|
int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */
|
||||||
|
|
||||||
|
|
||||||
/* read.c */
|
/* read.c */
|
||||||
boolean known;
|
boolean known;
|
||||||
|
|
||||||
|
|||||||
@@ -1432,6 +1432,7 @@ E boolean FDECL(angry_guards, (BOOLEAN_P));
|
|||||||
E void NDECL(pacify_guards);
|
E void NDECL(pacify_guards);
|
||||||
E void FDECL(decide_to_shapeshift, (struct monst *, int));
|
E void FDECL(decide_to_shapeshift, (struct monst *, int));
|
||||||
E boolean FDECL(vamp_stone, (struct monst *));
|
E boolean FDECL(vamp_stone, (struct monst *));
|
||||||
|
E void NDECL(monst_globals_init);
|
||||||
|
|
||||||
/* ### mondata.c ### */
|
/* ### mondata.c ### */
|
||||||
|
|
||||||
@@ -1504,8 +1505,6 @@ E boolean FDECL(undesirable_disp, (struct monst *, XCHAR_P, XCHAR_P));
|
|||||||
|
|
||||||
/* ### monst.c ### */
|
/* ### monst.c ### */
|
||||||
|
|
||||||
E void NDECL(monst_init);
|
|
||||||
|
|
||||||
/* ### monstr.c ### */
|
/* ### monstr.c ### */
|
||||||
|
|
||||||
E void NDECL(monstr_init);
|
E void NDECL(monstr_init);
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ boolean resuming;
|
|||||||
int moveamt = 0, wtcap = 0, change = 0;
|
int moveamt = 0, wtcap = 0, change = 0;
|
||||||
boolean monscanmove = FALSE;
|
boolean monscanmove = FALSE;
|
||||||
|
|
||||||
/* Note: these initializers don't do anything except guarantee that
|
|
||||||
we're linked properly.
|
|
||||||
*/
|
|
||||||
monst_init();
|
|
||||||
|
|
||||||
/* if a save file created in normal mode is now being restored in
|
/* if a save file created in normal mode is now being restored in
|
||||||
explore mode, treat it as normal restore followed by 'X' command
|
explore mode, treat it as normal restore followed by 'X' command
|
||||||
to use up the save file and require confirmation for explore mode */
|
to use up the save file and require confirmation for explore mode */
|
||||||
|
|||||||
@@ -338,6 +338,9 @@ const struct instance_globals g_init = {
|
|||||||
|
|
||||||
/* mused.c */
|
/* mused.c */
|
||||||
FALSE, /* m_using */
|
FALSE, /* m_using */
|
||||||
|
UNDEFINED_VALUE, /* trapx */
|
||||||
|
UNDEFINED_VALUE, /* trapy */
|
||||||
|
UNDEFINED_VALUE, /* zap_oseen */
|
||||||
|
|
||||||
/* objname.c */
|
/* objname.c */
|
||||||
0, /* distantname */
|
0, /* distantname */
|
||||||
@@ -363,6 +366,11 @@ const struct instance_globals g_init = {
|
|||||||
UNDEFINED_VALUE, /* potion_nothing */
|
UNDEFINED_VALUE, /* potion_nothing */
|
||||||
UNDEFINED_VALUE, /* potion_unkn */
|
UNDEFINED_VALUE, /* potion_unkn */
|
||||||
|
|
||||||
|
/* pray.c */
|
||||||
|
UNDEFINED_VALUE, /* p_aligntyp */
|
||||||
|
UNDEFINED_VALUE, /* p_trouble */
|
||||||
|
UNDEFINED_VALUE, /* p_type */
|
||||||
|
|
||||||
/* read.c */
|
/* read.c */
|
||||||
UNDEFINED_VALUE, /* known */
|
UNDEFINED_VALUE, /* known */
|
||||||
|
|
||||||
|
|||||||
10
src/monst.c
10
src/monst.c
@@ -27,7 +27,6 @@
|
|||||||
#define C(color)
|
#define C(color)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void NDECL(monst_init);
|
|
||||||
/*
|
/*
|
||||||
* Entry Format: (from permonst.h)
|
* Entry Format: (from permonst.h)
|
||||||
*
|
*
|
||||||
@@ -101,7 +100,7 @@ void NDECL(monst_init);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SPLITMON_2
|
#ifndef SPLITMON_2
|
||||||
NEARDATA struct permonst mons[] = {
|
NEARDATA struct permonst mons_init[] = {
|
||||||
/*
|
/*
|
||||||
* ants
|
* ants
|
||||||
*/
|
*/
|
||||||
@@ -3228,10 +3227,13 @@ struct permonst _mons2[] = {
|
|||||||
#endif /* !SPLITMON_1 */
|
#endif /* !SPLITMON_1 */
|
||||||
|
|
||||||
#ifndef SPLITMON_1
|
#ifndef SPLITMON_1
|
||||||
/* dummy routine used to force linkage */
|
|
||||||
|
struct permonst mons[SIZE(mons_init)];
|
||||||
|
|
||||||
void
|
void
|
||||||
monst_init()
|
monst_globals_init()
|
||||||
{
|
{
|
||||||
|
memcpy(mons, mons_init, sizeof(mons));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
59
src/muse.c
59
src/muse.c
@@ -44,13 +44,6 @@ static struct musable {
|
|||||||
* If it's an object, the object is also set (it's 0 otherwise).
|
* If it's an object, the object is also set (it's 0 otherwise).
|
||||||
*/
|
*/
|
||||||
} m;
|
} m;
|
||||||
static int trapx, trapy;
|
|
||||||
static boolean zap_oseen; /* for wands which use mbhitm and are zapped at
|
|
||||||
* players. We usually want an oseen local to
|
|
||||||
* the function, but this is impossible since the
|
|
||||||
* function mbhitm has to be compatible with the
|
|
||||||
* normal zap routines, and those routines don't
|
|
||||||
* remember who zapped the wand. */
|
|
||||||
|
|
||||||
/* Any preliminary checks which may result in the monster being unable to use
|
/* Any preliminary checks which may result in the monster being unable to use
|
||||||
* the item. Returns 0 if nothing happened, 2 if the monster can't do
|
* the item. Returns 0 if nothing happened, 2 if the monster can't do
|
||||||
@@ -439,13 +432,13 @@ struct monst *mtmp;
|
|||||||
&& !is_floater(mtmp->data)
|
&& !is_floater(mtmp->data)
|
||||||
&& !mtmp->isshk && !mtmp->isgd && !mtmp->ispriest
|
&& !mtmp->isshk && !mtmp->isgd && !mtmp->ispriest
|
||||||
&& Can_fall_thru(&u.uz)) {
|
&& Can_fall_thru(&u.uz)) {
|
||||||
trapx = xx;
|
g.trapx = xx;
|
||||||
trapy = yy;
|
g.trapy = yy;
|
||||||
m.has_defense = MUSE_TRAPDOOR;
|
m.has_defense = MUSE_TRAPDOOR;
|
||||||
break; /* no need to look at any other spots */
|
break; /* no need to look at any other spots */
|
||||||
} else if (t->ttyp == TELEP_TRAP) {
|
} else if (t->ttyp == TELEP_TRAP) {
|
||||||
trapx = xx;
|
g.trapx = xx;
|
||||||
trapy = yy;
|
g.trapy = yy;
|
||||||
m.has_defense = MUSE_TELEPORT_TRAP;
|
m.has_defense = MUSE_TELEPORT_TRAP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -665,7 +658,7 @@ struct monst *mtmp;
|
|||||||
(void) rloc(mtmp, TRUE);
|
(void) rloc(mtmp, TRUE);
|
||||||
return 2;
|
return 2;
|
||||||
case MUSE_WAN_TELEPORTATION:
|
case MUSE_WAN_TELEPORTATION:
|
||||||
zap_oseen = oseen;
|
g.zap_oseen = oseen;
|
||||||
mzapmsg(mtmp, otmp, FALSE);
|
mzapmsg(mtmp, otmp, FALSE);
|
||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
g.m_using = TRUE;
|
g.m_using = TRUE;
|
||||||
@@ -813,26 +806,26 @@ struct monst *mtmp;
|
|||||||
return 0;
|
return 0;
|
||||||
m_flee(mtmp);
|
m_flee(mtmp);
|
||||||
if (vis) {
|
if (vis) {
|
||||||
struct trap *t = t_at(trapx, trapy);
|
struct trap *t = t_at(g.trapx, g.trapy);
|
||||||
|
|
||||||
Mnam = Monnam(mtmp);
|
Mnam = Monnam(mtmp);
|
||||||
pline("%s %s into a %s!", Mnam,
|
pline("%s %s into a %s!", Mnam,
|
||||||
vtense(Mnam, locomotion(mtmp->data, "jump")),
|
vtense(Mnam, locomotion(mtmp->data, "jump")),
|
||||||
(t->ttyp == TRAPDOOR) ? "trap door" : "hole");
|
(t->ttyp == TRAPDOOR) ? "trap door" : "hole");
|
||||||
if (levl[trapx][trapy].typ == SCORR) {
|
if (levl[g.trapx][g.trapy].typ == SCORR) {
|
||||||
levl[trapx][trapy].typ = CORR;
|
levl[g.trapx][g.trapy].typ = CORR;
|
||||||
unblock_point(trapx, trapy);
|
unblock_point(g.trapx, g.trapy);
|
||||||
}
|
}
|
||||||
seetrap(t_at(trapx, trapy));
|
seetrap(t_at(g.trapx, g.trapy));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* don't use rloc_to() because worm tails must "move" */
|
/* don't use rloc_to() because worm tails must "move" */
|
||||||
remove_monster(mtmp->mx, mtmp->my);
|
remove_monster(mtmp->mx, mtmp->my);
|
||||||
newsym(mtmp->mx, mtmp->my); /* update old location */
|
newsym(mtmp->mx, mtmp->my); /* update old location */
|
||||||
place_monster(mtmp, trapx, trapy);
|
place_monster(mtmp, g.trapx, g.trapy);
|
||||||
if (mtmp->wormno)
|
if (mtmp->wormno)
|
||||||
worm_move(mtmp);
|
worm_move(mtmp);
|
||||||
newsym(trapx, trapy);
|
newsym(g.trapx, g.trapy);
|
||||||
|
|
||||||
migrate_to_level(mtmp, ledger_no(&u.uz) + 1, MIGR_RANDOM,
|
migrate_to_level(mtmp, ledger_no(&u.uz) + 1, MIGR_RANDOM,
|
||||||
(coord *) 0);
|
(coord *) 0);
|
||||||
@@ -915,15 +908,15 @@ struct monst *mtmp;
|
|||||||
Mnam = Monnam(mtmp);
|
Mnam = Monnam(mtmp);
|
||||||
pline("%s %s onto a teleport trap!", Mnam,
|
pline("%s %s onto a teleport trap!", Mnam,
|
||||||
vtense(Mnam, locomotion(mtmp->data, "jump")));
|
vtense(Mnam, locomotion(mtmp->data, "jump")));
|
||||||
seetrap(t_at(trapx, trapy));
|
seetrap(t_at(g.trapx, g.trapy));
|
||||||
}
|
}
|
||||||
/* don't use rloc_to() because worm tails must "move" */
|
/* don't use rloc_to() because worm tails must "move" */
|
||||||
remove_monster(mtmp->mx, mtmp->my);
|
remove_monster(mtmp->mx, mtmp->my);
|
||||||
newsym(mtmp->mx, mtmp->my); /* update old location */
|
newsym(mtmp->mx, mtmp->my); /* update old location */
|
||||||
place_monster(mtmp, trapx, trapy);
|
place_monster(mtmp, g.trapx, g.trapy);
|
||||||
if (mtmp->wormno)
|
if (mtmp->wormno)
|
||||||
worm_move(mtmp);
|
worm_move(mtmp);
|
||||||
newsym(trapx, trapy);
|
newsym(g.trapx, g.trapy);
|
||||||
|
|
||||||
goto mon_tele;
|
goto mon_tele;
|
||||||
case MUSE_POT_HEALING:
|
case MUSE_POT_HEALING:
|
||||||
@@ -1217,7 +1210,7 @@ register struct obj *otmp;
|
|||||||
case WAN_STRIKING:
|
case WAN_STRIKING:
|
||||||
reveal_invis = TRUE;
|
reveal_invis = TRUE;
|
||||||
if (mtmp == &youmonst) {
|
if (mtmp == &youmonst) {
|
||||||
if (zap_oseen)
|
if (g.zap_oseen)
|
||||||
makeknown(WAN_STRIKING);
|
makeknown(WAN_STRIKING);
|
||||||
if (Antimagic) {
|
if (Antimagic) {
|
||||||
shieldeff(u.ux, u.uy);
|
shieldeff(u.ux, u.uy);
|
||||||
@@ -1239,18 +1232,18 @@ register struct obj *otmp;
|
|||||||
tmp = d(2, 12);
|
tmp = d(2, 12);
|
||||||
hit("wand", mtmp, exclam(tmp));
|
hit("wand", mtmp, exclam(tmp));
|
||||||
(void) resist(mtmp, otmp->oclass, tmp, TELL);
|
(void) resist(mtmp, otmp->oclass, tmp, TELL);
|
||||||
if (cansee(mtmp->mx, mtmp->my) && zap_oseen)
|
if (cansee(mtmp->mx, mtmp->my) && g.zap_oseen)
|
||||||
makeknown(WAN_STRIKING);
|
makeknown(WAN_STRIKING);
|
||||||
} else {
|
} else {
|
||||||
miss("wand", mtmp);
|
miss("wand", mtmp);
|
||||||
if (cansee(mtmp->mx, mtmp->my) && zap_oseen)
|
if (cansee(mtmp->mx, mtmp->my) && g.zap_oseen)
|
||||||
makeknown(WAN_STRIKING);
|
makeknown(WAN_STRIKING);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if 0 /* disabled because find_offensive() never picks WAN_TELEPORTATION */
|
#if 0 /* disabled because find_offensive() never picks WAN_TELEPORTATION */
|
||||||
case WAN_TELEPORTATION:
|
case WAN_TELEPORTATION:
|
||||||
if (mtmp == &youmonst) {
|
if (mtmp == &youmonst) {
|
||||||
if (zap_oseen)
|
if (g.zap_oseen)
|
||||||
makeknown(WAN_TELEPORTATION);
|
makeknown(WAN_TELEPORTATION);
|
||||||
tele();
|
tele();
|
||||||
} else {
|
} else {
|
||||||
@@ -1349,7 +1342,7 @@ struct obj *obj; /* 2nd arg to fhitm/fhito */
|
|||||||
case WAN_LOCKING:
|
case WAN_LOCKING:
|
||||||
case WAN_STRIKING:
|
case WAN_STRIKING:
|
||||||
if (doorlock(obj, bhitpos.x, bhitpos.y)) {
|
if (doorlock(obj, bhitpos.x, bhitpos.y)) {
|
||||||
if (zap_oseen)
|
if (g.zap_oseen)
|
||||||
makeknown(obj->otyp);
|
makeknown(obj->otyp);
|
||||||
/* if a shop door gets broken, add it to
|
/* if a shop door gets broken, add it to
|
||||||
the shk's fix list (no cost to player) */
|
the shk's fix list (no cost to player) */
|
||||||
@@ -1419,7 +1412,7 @@ struct monst *mtmp;
|
|||||||
return (DEADMONSTER(mtmp)) ? 1 : 2;
|
return (DEADMONSTER(mtmp)) ? 1 : 2;
|
||||||
case MUSE_WAN_TELEPORTATION:
|
case MUSE_WAN_TELEPORTATION:
|
||||||
case MUSE_WAN_STRIKING:
|
case MUSE_WAN_STRIKING:
|
||||||
zap_oseen = oseen;
|
g.zap_oseen = oseen;
|
||||||
mzapmsg(mtmp, otmp, FALSE);
|
mzapmsg(mtmp, otmp, FALSE);
|
||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
g.m_using = TRUE;
|
g.m_using = TRUE;
|
||||||
@@ -1647,8 +1640,8 @@ struct monst *mtmp;
|
|||||||
&& !onscary(xx, yy, mtmp)) {
|
&& !onscary(xx, yy, mtmp)) {
|
||||||
/* use trap if it's the correct type */
|
/* use trap if it's the correct type */
|
||||||
if (t->ttyp == POLY_TRAP) {
|
if (t->ttyp == POLY_TRAP) {
|
||||||
trapx = xx;
|
g.trapx = xx;
|
||||||
trapy = yy;
|
g.trapy = yy;
|
||||||
m.has_misc = MUSE_POLY_TRAP;
|
m.has_misc = MUSE_POLY_TRAP;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -1876,15 +1869,15 @@ struct monst *mtmp;
|
|||||||
vtense(Mnam, locomotion(mtmp->data, "jump")));
|
vtense(Mnam, locomotion(mtmp->data, "jump")));
|
||||||
}
|
}
|
||||||
if (vis)
|
if (vis)
|
||||||
seetrap(t_at(trapx, trapy));
|
seetrap(t_at(g.trapx, g.trapy));
|
||||||
|
|
||||||
/* don't use rloc() due to worms */
|
/* don't use rloc() due to worms */
|
||||||
remove_monster(mtmp->mx, mtmp->my);
|
remove_monster(mtmp->mx, mtmp->my);
|
||||||
newsym(mtmp->mx, mtmp->my);
|
newsym(mtmp->mx, mtmp->my);
|
||||||
place_monster(mtmp, trapx, trapy);
|
place_monster(mtmp, g.trapx, g.trapy);
|
||||||
if (mtmp->wormno)
|
if (mtmp->wormno)
|
||||||
worm_move(mtmp);
|
worm_move(mtmp);
|
||||||
newsym(trapx, trapy);
|
newsym(g.trapx, g.trapy);
|
||||||
|
|
||||||
(void) newcham(mtmp, (struct permonst *) 0, FALSE, FALSE);
|
(void) newcham(mtmp, (struct permonst *) 0, FALSE, FALSE);
|
||||||
return 2;
|
return 2;
|
||||||
|
|||||||
61
src/pray.c
61
src/pray.c
@@ -47,11 +47,6 @@ static const char *godvoices[] = {
|
|||||||
"booms out", "thunders", "rings out", "booms",
|
"booms out", "thunders", "rings out", "booms",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* values calculated when prayer starts, and used when completed */
|
|
||||||
static aligntyp p_aligntyp;
|
|
||||||
static int p_trouble;
|
|
||||||
static int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */
|
|
||||||
|
|
||||||
#define PIOUS 20
|
#define PIOUS 20
|
||||||
#define DEVOUT 14
|
#define DEVOUT 14
|
||||||
#define FERVENT 9
|
#define FERVENT 9
|
||||||
@@ -907,7 +902,7 @@ aligntyp g_align;
|
|||||||
: Hallucination ? "full" : "satisfied");
|
: Hallucination ? "full" : "satisfied");
|
||||||
|
|
||||||
/* not your deity */
|
/* not your deity */
|
||||||
if (on_altar() && p_aligntyp != u.ualign.type) {
|
if (on_altar() && g.p_aligntyp != u.ualign.type) {
|
||||||
adjalign(-1);
|
adjalign(-1);
|
||||||
return;
|
return;
|
||||||
} else if (u.ualign.record < 2 && trouble <= 0)
|
} else if (u.ualign.record < 2 && trouble <= 0)
|
||||||
@@ -929,7 +924,7 @@ aligntyp g_align;
|
|||||||
*/
|
*/
|
||||||
if (!trouble && u.ualign.record >= DEVOUT) {
|
if (!trouble && u.ualign.record >= DEVOUT) {
|
||||||
/* if hero was in trouble, but got better, no special favor */
|
/* if hero was in trouble, but got better, no special favor */
|
||||||
if (p_trouble == 0)
|
if (g.p_trouble == 0)
|
||||||
pat_on_head = 1;
|
pat_on_head = 1;
|
||||||
} else {
|
} else {
|
||||||
int action, prayer_luck;
|
int action, prayer_luck;
|
||||||
@@ -1768,47 +1763,47 @@ boolean praying; /* false means no messages should be given */
|
|||||||
{
|
{
|
||||||
int alignment;
|
int alignment;
|
||||||
|
|
||||||
p_aligntyp = on_altar() ? a_align(u.ux, u.uy) : u.ualign.type;
|
g.p_aligntyp = on_altar() ? a_align(u.ux, u.uy) : u.ualign.type;
|
||||||
p_trouble = in_trouble();
|
g.p_trouble = in_trouble();
|
||||||
|
|
||||||
if (is_demon(youmonst.data) && (p_aligntyp != A_CHAOTIC)) {
|
if (is_demon(youmonst.data) && (g.p_aligntyp != A_CHAOTIC)) {
|
||||||
if (praying)
|
if (praying)
|
||||||
pline_The("very idea of praying to a %s god is repugnant to you.",
|
pline_The("very idea of praying to a %s god is repugnant to you.",
|
||||||
p_aligntyp ? "lawful" : "neutral");
|
g.p_aligntyp ? "lawful" : "neutral");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (praying)
|
if (praying)
|
||||||
You("begin praying to %s.", align_gname(p_aligntyp));
|
You("begin praying to %s.", align_gname(g.p_aligntyp));
|
||||||
|
|
||||||
if (u.ualign.type && u.ualign.type == -p_aligntyp)
|
if (u.ualign.type && u.ualign.type == -g.p_aligntyp)
|
||||||
alignment = -u.ualign.record; /* Opposite alignment altar */
|
alignment = -u.ualign.record; /* Opposite alignment altar */
|
||||||
else if (u.ualign.type != p_aligntyp)
|
else if (u.ualign.type != g.p_aligntyp)
|
||||||
alignment = u.ualign.record / 2; /* Different alignment altar */
|
alignment = u.ualign.record / 2; /* Different alignment altar */
|
||||||
else
|
else
|
||||||
alignment = u.ualign.record;
|
alignment = u.ualign.record;
|
||||||
|
|
||||||
if ((p_trouble > 0) ? (u.ublesscnt > 200) /* big trouble */
|
if ((g.p_trouble > 0) ? (u.ublesscnt > 200) /* big trouble */
|
||||||
: (p_trouble < 0) ? (u.ublesscnt > 100) /* minor difficulties */
|
: (g.p_trouble < 0) ? (u.ublesscnt > 100) /* minor difficulties */
|
||||||
: (u.ublesscnt > 0)) /* not in trouble */
|
: (u.ublesscnt > 0)) /* not in trouble */
|
||||||
p_type = 0; /* too soon... */
|
g.p_type = 0; /* too soon... */
|
||||||
else if ((int) Luck < 0 || u.ugangr || alignment < 0)
|
else if ((int) Luck < 0 || u.ugangr || alignment < 0)
|
||||||
p_type = 1; /* too naughty... */
|
g.p_type = 1; /* too naughty... */
|
||||||
else /* alignment >= 0 */ {
|
else /* alignment >= 0 */ {
|
||||||
if (on_altar() && u.ualign.type != p_aligntyp)
|
if (on_altar() && u.ualign.type != g.p_aligntyp)
|
||||||
p_type = 2;
|
g.p_type = 2;
|
||||||
else
|
else
|
||||||
p_type = 3;
|
g.p_type = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_undead(youmonst.data) && !Inhell
|
if (is_undead(youmonst.data) && !Inhell
|
||||||
&& (p_aligntyp == A_LAWFUL || (p_aligntyp == A_NEUTRAL && !rn2(10))))
|
&& (g.p_aligntyp == A_LAWFUL || (g.p_aligntyp == A_NEUTRAL && !rn2(10))))
|
||||||
p_type = -1;
|
g.p_type = -1;
|
||||||
/* Note: when !praying, the random factor for neutrals makes the
|
/* Note: when !praying, the random factor for neutrals makes the
|
||||||
return value a non-deterministic approximation for enlightenment.
|
return value a non-deterministic approximation for enlightenment.
|
||||||
This case should be uncommon enough to live with... */
|
This case should be uncommon enough to live with... */
|
||||||
|
|
||||||
return !praying ? (boolean) (p_type == 3 && !Inhell) : TRUE;
|
return !praying ? (boolean) (g.p_type == 3 && !Inhell) : TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #pray commmand */
|
/* #pray commmand */
|
||||||
@@ -1825,7 +1820,7 @@ dopray()
|
|||||||
if (!can_pray(TRUE))
|
if (!can_pray(TRUE))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (wizard && p_type >= 0) {
|
if (wizard && g.p_type >= 0) {
|
||||||
if (yn("Force the gods to be pleased?") == 'y') {
|
if (yn("Force the gods to be pleased?") == 'y') {
|
||||||
u.ublesscnt = 0;
|
u.ublesscnt = 0;
|
||||||
if (u.uluck < 0)
|
if (u.uluck < 0)
|
||||||
@@ -1833,8 +1828,8 @@ dopray()
|
|||||||
if (u.ualign.record <= 0)
|
if (u.ualign.record <= 0)
|
||||||
u.ualign.record = 1;
|
u.ualign.record = 1;
|
||||||
u.ugangr = 0;
|
u.ugangr = 0;
|
||||||
if (p_type < 2)
|
if (g.p_type < 2)
|
||||||
p_type = 3;
|
g.p_type = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nomul(-3);
|
nomul(-3);
|
||||||
@@ -1842,7 +1837,7 @@ dopray()
|
|||||||
nomovemsg = "You finish your prayer.";
|
nomovemsg = "You finish your prayer.";
|
||||||
afternmv = prayer_done;
|
afternmv = prayer_done;
|
||||||
|
|
||||||
if (p_type == 3 && !Inhell) {
|
if (g.p_type == 3 && !Inhell) {
|
||||||
/* if you've been true to your god you can't die while you pray */
|
/* if you've been true to your god you can't die while you pray */
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
You("are surrounded by a shimmering light.");
|
You("are surrounded by a shimmering light.");
|
||||||
@@ -1855,10 +1850,10 @@ dopray()
|
|||||||
STATIC_PTR int
|
STATIC_PTR int
|
||||||
prayer_done() /* M. Stephenson (1.0.3b) */
|
prayer_done() /* M. Stephenson (1.0.3b) */
|
||||||
{
|
{
|
||||||
aligntyp alignment = p_aligntyp;
|
aligntyp alignment = g.p_aligntyp;
|
||||||
|
|
||||||
u.uinvulnerable = FALSE;
|
u.uinvulnerable = FALSE;
|
||||||
if (p_type == -1) {
|
if (g.p_type == -1) {
|
||||||
godvoice(alignment,
|
godvoice(alignment,
|
||||||
(alignment == A_LAWFUL)
|
(alignment == A_LAWFUL)
|
||||||
? "Vile creature, thou durst call upon me?"
|
? "Vile creature, thou durst call upon me?"
|
||||||
@@ -1880,17 +1875,17 @@ prayer_done() /* M. Stephenson (1.0.3b) */
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_type == 0) {
|
if (g.p_type == 0) {
|
||||||
if (on_altar() && u.ualign.type != alignment)
|
if (on_altar() && u.ualign.type != alignment)
|
||||||
(void) water_prayer(FALSE);
|
(void) water_prayer(FALSE);
|
||||||
u.ublesscnt += rnz(250);
|
u.ublesscnt += rnz(250);
|
||||||
change_luck(-3);
|
change_luck(-3);
|
||||||
gods_upset(u.ualign.type);
|
gods_upset(u.ualign.type);
|
||||||
} else if (p_type == 1) {
|
} else if (g.p_type == 1) {
|
||||||
if (on_altar() && u.ualign.type != alignment)
|
if (on_altar() && u.ualign.type != alignment)
|
||||||
(void) water_prayer(FALSE);
|
(void) water_prayer(FALSE);
|
||||||
angrygods(u.ualign.type); /* naughty */
|
angrygods(u.ualign.type); /* naughty */
|
||||||
} else if (p_type == 2) {
|
} else if (g.p_type == 2) {
|
||||||
if (water_prayer(FALSE)) {
|
if (water_prayer(FALSE)) {
|
||||||
/* attempted water prayer on a non-coaligned altar */
|
/* attempted water prayer on a non-coaligned altar */
|
||||||
u.ublesscnt += rnz(250);
|
u.ublesscnt += rnz(250);
|
||||||
|
|||||||
@@ -108,9 +108,6 @@ struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *, char *, int));
|
|||||||
|
|
||||||
void FDECL(splev_add_from, (sp_lev *, sp_lev *));
|
void FDECL(splev_add_from, (sp_lev *, sp_lev *));
|
||||||
|
|
||||||
extern void NDECL(monst_init);
|
|
||||||
extern void NDECL(objects_globals_init);
|
|
||||||
|
|
||||||
void FDECL(add_opcode, (sp_lev *, int, genericptr_t));
|
void FDECL(add_opcode, (sp_lev *, int, genericptr_t));
|
||||||
|
|
||||||
static boolean FDECL(write_common_data, (int));
|
static boolean FDECL(write_common_data, (int));
|
||||||
@@ -258,11 +255,7 @@ char **argv;
|
|||||||
|
|
||||||
decl_globals_init();
|
decl_globals_init();
|
||||||
objects_globals_init();
|
objects_globals_init();
|
||||||
|
monst_globals_init();
|
||||||
/* Note: these initializers don't do anything except guarantee that
|
|
||||||
* we're linked properly.
|
|
||||||
*/
|
|
||||||
monst_init();
|
|
||||||
|
|
||||||
/* this one does something... */
|
/* this one does something... */
|
||||||
init_obj_classes();
|
init_obj_classes();
|
||||||
|
|||||||
@@ -175,10 +175,9 @@ void NDECL(do_vision);
|
|||||||
void NDECL(do_fix_sampleconfig);
|
void NDECL(do_fix_sampleconfig);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void NDECL(monst_init); /* monst.c */
|
extern void NDECL(monst_globals_init); /* monst.c */
|
||||||
extern void NDECL(objects_globals_init); /* objects.c */
|
extern void NDECL(objects_globals_init); /* objects.c */
|
||||||
|
|
||||||
static void NDECL(link_sanity_check);
|
|
||||||
static char *FDECL(name_file, (const char *, const char *));
|
static char *FDECL(name_file, (const char *, const char *));
|
||||||
static void FDECL(delete_file, (const char *template, const char *));
|
static void FDECL(delete_file, (const char *template, const char *));
|
||||||
static FILE *FDECL(getfp, (const char *, const char *, const char *));
|
static FILE *FDECL(getfp, (const char *, const char *, const char *));
|
||||||
@@ -301,16 +300,6 @@ char *argv[];
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
|
||||||
link_sanity_check()
|
|
||||||
{
|
|
||||||
/* Note: these initializers don't do anything except guarantee that
|
|
||||||
we're linked properly.
|
|
||||||
*/
|
|
||||||
monst_init();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
do_makedefs(options)
|
do_makedefs(options)
|
||||||
char *options;
|
char *options;
|
||||||
@@ -318,8 +307,7 @@ char *options;
|
|||||||
boolean more_than_one;
|
boolean more_than_one;
|
||||||
|
|
||||||
objects_globals_init();
|
objects_globals_init();
|
||||||
|
monst_globals_init();
|
||||||
link_sanity_check();
|
|
||||||
|
|
||||||
/* construct the current version number */
|
/* construct the current version number */
|
||||||
make_version();
|
make_version();
|
||||||
@@ -469,8 +457,6 @@ do_ext_makedefs(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int todo = 0;
|
int todo = 0;
|
||||||
|
|
||||||
link_sanity_check();
|
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++; /* skip program name */
|
argv++; /* skip program name */
|
||||||
|
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ char *argv[];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
objects_globals_init();
|
objects_globals_init();
|
||||||
|
monst_globals_init();
|
||||||
|
|
||||||
tilecount = 0;
|
tilecount = 0;
|
||||||
xoffset = yoffset = 0;
|
xoffset = yoffset = 0;
|
||||||
|
|||||||
@@ -109,10 +109,6 @@ int set, entry;
|
|||||||
int i, j, condnum, tilenum;
|
int i, j, condnum, tilenum;
|
||||||
static char buf[BUFSZ];
|
static char buf[BUFSZ];
|
||||||
|
|
||||||
/* Note: these initializers don't do anything except guarantee that
|
|
||||||
we're linked properly.
|
|
||||||
*/
|
|
||||||
monst_init();
|
|
||||||
(void) def_char_to_objclass(']');
|
(void) def_char_to_objclass(']');
|
||||||
|
|
||||||
condnum = tilenum = 0;
|
condnum = tilenum = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user