rename explosion symbols

Use a slightly more meaningful name for each one rather than
a sequential numerical name.

S_explode1 to S_expl_tl
S_explode2 to S_expl_tc
S_explode3 to S_expl_tr
S_explode4 to S_expl_ml
S_explode5 to S_expl_mc
S_explode6 to S_expl_mr
S_explode7 to S_expl_bl
S_explode8 to S_expl_bc
S_explode9 to S_expl_br
This commit is contained in:
nhmall
2021-09-18 10:04:25 -04:00
parent 22b2ef8f2b
commit 9b57784348
9 changed files with 74 additions and 65 deletions

View File

@@ -2217,7 +2217,7 @@ map_glyphinfo(xchar x, xchar y, int glyph,
else
zap_color((offset >> 2));
} else if ((offset = (glyph - GLYPH_EXPLODE_OFF)) >= 0) { /* explosion */
idx = ((offset % MAXEXPCHARS) + S_explode1) + SYM_OFF_P;
idx = ((offset % MAXEXPCHARS) + S_expl_tl) + SYM_OFF_P;
explode_color(offset / MAXEXPCHARS);
} else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */
idx = offset + SYM_OFF_P;

View File

@@ -5,9 +5,10 @@
#include "hack.h"
/* Note: Arrays are column first, while the screen is row first */
static const int explosion[3][3] = { { S_explode1, S_explode4, S_explode7 },
{ S_explode2, S_explode5, S_explode8 },
{ S_explode3, S_explode6, S_explode9 } };
static const int explosion[3][3] = {
{ S_expl_tl, S_expl_ml, S_expl_bl },
{ S_expl_tc, S_expl_mc, S_expl_bc },
{ S_expl_tr, S_expl_mr, S_expl_br } };
/* Note: I had to choose one of three possible kinds of "type" when writing
* this function: a wand type (like in zap.c), an adtyp, or an object type.

View File

@@ -7827,9 +7827,17 @@ match_sym(char *buf)
const char *altnm;
const char *nm;
} alternates[] = {
{ "S_armour" , "S_armor"},
{ "S_armour" , "S_armor" },
{ "S_explode1" , "S_expl_tl" },
{ "S_explode2" , "S_expl_tc" },
{ "S_explode3" , "S_expl_tr" },
{ "S_explode4" , "S_expl_ml" },
{ "S_explode5" , "S_expl_mc" },
{ "S_explode6" , "S_expl_mr" },
{ "S_explode7" , "S_expl_bl" },
{ "S_explode8" , "S_expl_bc" },
{ "S_explode9" , "S_expl_br" },
};
size_t len = strlen(buf);
const char *p = index(buf, ':'), *q = index(buf, '=');
struct symparse *sp = loadsyms;