Style cleanup.

This fixes indentation and spacing issues. Some too-long lines were kept
because I didn't want to wokr on reorganizing the code to make them
wrap.
This commit is contained in:
Sean Hunt
2016-06-20 00:15:58 -04:00
parent a3fa3d386c
commit f48fcf7a9d
+30 -19
View File
@@ -1635,15 +1635,20 @@ conway_islive(lvlp, x, y)
struct monst *mhere; struct monst *mhere;
/* Hero's levels don't count here since it's likely to be /* Hero's levels don't count here since it's likely to be
* much larger than the surrounding life. */ * much larger than the surrounding life. */
if(u.ux == x && u.uy == y){ if (u.ux == x && u.uy == y)
if(Upolyd && nonliving(youmonst.data)) return 0; {
return 1;
return !(Upolyd && nonliving(youmonst.data));
} }
mhere = m_at(x,y); mhere = m_at(x,y);
if(!mhere) return 0;
if(nonliving(mhere->data)) return 0; if (!mhere || nonliving(mhere->data))
if(lvlp) *lvlp += mhere->m_lev; return 0;
if (lvlp)
*lvlp += mhere->m_lev;
return 1; return 1;
} }
@@ -1671,8 +1676,8 @@ conway_findactive(){
while(CONWAY_WALL(COLNO/2, lls.ymax) && lls.ymax > ROWNO/2) while(CONWAY_WALL(COLNO/2, lls.ymax) && lls.ymax > ROWNO/2)
lls.ymax--; lls.ymax--;
#undef CONWAY_WALL #undef CONWAY_WALL
if(lls.xmin > COLNO/2 || lls.ymin > ROWNO/2 || if (lls.xmin > COLNO/2 || lls.ymin > ROWNO/2
lls.xmax < COLNO/2 || lls.ymax < ROWNO/2) || lls.xmax < COLNO/2 || lls.ymax < ROWNO/2)
panic("can't find active area in level"); panic("can't find active area in level");
#ifdef CONWAY_DEBUG #ifdef CONWAY_DEBUG
{ {
@@ -1724,7 +1729,8 @@ conway_setup(){
conway_restore(); conway_restore();
if (force) { if (force) {
int tmp = atoi(force); int tmp = atoi(force);
if(tmp>=0 && tmp <=2) subtype = tmp; if (tmp>=0 && tmp <=2)
subtype = tmp;
} }
switch(subtype) { switch(subtype) {
case 0: /* just the normal bigroom population */ case 0: /* just the normal bigroom population */
@@ -1823,12 +1829,15 @@ void
conway_update() { conway_update() {
int x, y; int x, y;
if(!lslev) panic("conway_update: lslev=null"); if (!lslev)
panic("conway_update: lslev=null");
/* Be unpredictable: Life updates about half of the time, but not on /* Be unpredictable: Life updates about half of the time, but not on
alternate moves. */ alternate moves. */
if(monstermoves % 16 < 5) return; if (monstermoves % 16 < 5)
if(rn2(11) < 3) return; return;
if (rn2(11) < 3)
return;
/* first, figure out what changes are needed for the next generation */ /* first, figure out what changes are needed for the next generation */
for(x=lls.xmin; x<=lls.xmax; x++) { for(x=lls.xmin; x<=lls.xmax; x++) {
for(y=lls.ymin; y<=lls.ymax; y++) { for(y=lls.ymin; y<=lls.ymax; y++) {
@@ -1924,7 +1933,8 @@ we don't want to put a monster.
dummy_m = conway_random_neighbor(x,y); dummy_m = conway_random_neighbor(x,y);
} else { } else {
dummy_m = newmonst(); dummy_m = newmonst();
(void) memset( (genericptr_t)dummy_m, 0, sizeof(*dummy_m)); (void) memset((genericptr_t) dummy_m, 0,
sizeof(*dummy_m));
dummy_m->data = &mons[PM_MILDEW]; dummy_m->data = &mons[PM_MILDEW];
} }
(void)mdamagem(dummy_m, mp, &dummy_a); (void)mdamagem(dummy_m, mp, &dummy_a);
@@ -1964,9 +1974,10 @@ we don't want to put a monster.
mhere = m_at(x,y); mhere = m_at(x,y);
if(mhere) { if(mhere) {
/* /*
Check the level of the surrounding monsters that are life vs the level Check the level of the surrounding monsters that are life vs
of the monster at this point (which may be the hero). If the current the level of the monster at this point (which may be the
monster is lower level, get absorbed by the borg else (maybe) gain level. hero). If the current monster is lower level, get absorbed
by the borg else (maybe) gain level.
*/ */
if (mhere->data != &mons[PM_MILDEW]) { if (mhere->data != &mons[PM_MILDEW]) {
/* The only justification for this intrinsic /* The only justification for this intrinsic
@@ -1978,13 +1989,13 @@ monster is lower level, get absorbed by the borg else (maybe) gain level.
} else { } else {
/* Use rn2() instead of keeping track of /* Use rn2() instead of keeping track of
* the age of each mildew. */ * the age of each mildew. */
if(rn2(100) < 40) grow_up(mhere, NULL); if (rn2(100) < 40)
grow_up(mhere, NULL);
} }
} else { } else {
if (HERO_AT(x,y) && !Upolyd && (u.umonnum != PM_MILDEW)) { if (HERO_AT(x,y) && !Upolyd && (u.umonnum != PM_MILDEW)) {
if (*lslev[x][y] > u.ulevel) { if (*lslev[x][y] > u.ulevel) {
if( (Unchanging && rn2(3)) || (rn2(100) < 50) if ((Unchanging && rn2(3)) || (rn2(100) < 50)) {
){
pline("You resist the urge to regress."); pline("You resist the urge to regress.");
} else { } else {
polymon(PM_MILDEW); polymon(PM_MILDEW);