From: nhmall Date: Sat, 18 Sep 2021 14:04:25 +0000 (-0400) Subject: rename explosion symbols X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b577843488ee6997a3d7fc37f50e163c976152f;p=nethack 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 --- diff --git a/dat/symbols b/dat/symbols index 05cea7087..2852a7b0f 100644 --- a/dat/symbols +++ b/dat/symbols @@ -127,15 +127,15 @@ start: NHAccess S_sw_bl: \092 S_sw_bc: \045 S_sw_br: \047 - S_explode1: \047 - S_explode2: \045 - S_explode3: \092 - S_explode4: \058 - S_explode5: \032 - S_explode6: \058 - S_explode7: \092 - S_explode8: \045 - S_explode9: \047 + S_expl_tl: \047 + S_expl_tc: \045 + S_expl_tr: \092 + S_expl_ml: \058 + S_expl_mc: \032 + S_expl_mr: \058 + S_expl_bl: \092 + S_expl_bc: \045 + S_expl_br: \047 finish # All symbols are spaces @@ -180,15 +180,15 @@ start: Blank S_dragon: \032 S_eel: \032 S_elemental: \032 - S_explode1: \032 - S_explode2: \032 - S_explode3: \032 - S_explode4: \032 - S_explode5: \032 - S_explode6: \032 - S_explode7: \032 - S_explode8: \032 - S_explode9: \032 + S_expl_tl: \032 + S_expl_tc: \032 + S_expl_tr: \032 + S_expl_ml: \032 + S_expl_mc: \032 + S_expl_mr: \032 + S_expl_bl: \032 + S_expl_bc: \032 + S_expl_br: \032 S_eye: \032 S_falling_rock_trap: \032 S_feline: \032 @@ -355,8 +355,8 @@ start: IBMgraphics S_hbeam: \xc4 # meta-D, horizontal rule S_sw_ml: \xb3 # meta-3, vertical rule S_sw_mr: \xb3 # meta-3, vertical rule - S_explode4: \xb3 # meta-3, vertical rule - S_explode6: \xb3 # meta-3, vertical rule + S_expl_ml: \xb3 # meta-3, vertical rule + S_expl_mr: \xb3 # meta-3, vertical rule finish start: IBMGraphics_1 @@ -377,8 +377,8 @@ start: IBMGraphics_1 S_hbeam: \xc4 # meta-D, horizontal rule S_sw_ml: \xb3 # meta-3, vertical rule S_sw_mr: \xb3 # meta-3, vertical rule - S_explode4: \xb3 # meta-3, vertical rule - S_explode6: \xb3 # meta-3, vertical rule + S_expl_ml: \xb3 # meta-3, vertical rule + S_expl_mr: \xb3 # meta-3, vertical rule finish start: IBMGraphics_2 @@ -403,8 +403,8 @@ start: IBMGraphics_2 S_hbeam: \xc4 # meta-D, horizontal rule S_sw_ml: \xb3 # meta-3, vertical rule S_sw_mr: \xb3 # meta-3, vertical rule - S_explode4: \xb3 # meta-3, vertical rule - S_explode6: \xb3 # meta-3, vertical rule + S_expl_ml: \xb3 # meta-3, vertical rule + S_expl_mr: \xb3 # meta-3, vertical rule finish start: RogueIBM @@ -574,8 +574,8 @@ start: curses S_hbeam: \xf1 # meta-D, horizontal rule S_sw_ml: \xf8 # meta-3, vertical rule S_sw_mr: \xf8 # meta-3, vertical rule - S_explode4: \xf8 # meta-3, vertical rule - S_explode6: \xf8 # meta-3, vertical rule + S_expl_ml: \xf8 # meta-3, vertical rule + S_expl_mr: \xf8 # meta-3, vertical rule finish start: DECgraphics @@ -616,10 +616,10 @@ start: DECgraphics S_sw_ml: \xf8 # meta-x, vertical rule S_sw_mr: \xf8 # meta-x, vertical rule S_sw_bc: \xf3 # meta-s, low horizontal line - S_explode2: \xef # meta-o, high horizontal line - S_explode4: \xf8 # meta-x, vertical rule - S_explode6: \xf8 # meta-x, vertical rule - S_explode8: \xf3 # meta-s, low horizontal line + S_expl_tc: \xef # meta-o, high horizontal line + S_expl_ml: \xf8 # meta-x, vertical rule + S_expl_mr: \xf8 # meta-x, vertical rule + S_expl_bc: \xf3 # meta-s, low horizontal line finish start: MACgraphics diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 0a9e81c47..587c35a66 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -5301,15 +5301,15 @@ d S_dog (dog or other canine) D S_dragon (dragon) ; S_eel (sea monster) E S_elemental (elemental) -/ S_explode1 (explosion top left) -\- S_explode2 (explosion top center) -\\ S_explode3 (explosion top right) -| S_explode4 (explosion middle left) -\ S_explode5 (explosion middle center) -| S_explode6 (explosion middle right) -\\ S_explode7 (explosion bottom left) -\- S_explode8 (explosion bottom center) -/ S_explode9 (explosion bottom right) +/ S_expl_tl (explosion top left) +\- S_expl_tc (explosion top center) +\\ S_expl_tr (explosion top right) +| S_expl_ml (explosion middle left) +\ S_expl_mc (explosion middle center) +| S_expl_mr (explosion middle right) +\\ S_expl_bl (explosion bottom left) +\- S_expl_bc (explosion bottom center) +/ S_expl_br (explosion bottom right) e S_eye (eye or sphere) \(ha S_falling_rock_trap (falling rock trap) f S_feline (cat or other feline) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index c30e70016..2df0b11f4 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -5801,15 +5801,15 @@ Default & Symbol Name & Description\\ \verb@D@ & S\verb+_+dragon & (dragon)\\ \verb@;@ & S\verb+_+eel & (sea monster)\\ \verb@E@ & S\verb+_+elemental & (elemental)\\ -\verb@/@ & S\verb+_+explode1 & (explosion top left)\\ -\verb@-@ & S\verb+_+explode2 & (explosion top center)\\ -\verb@\@ & S\verb+_+explode3 & (explosion top right)\\ -\verb@|@ & S\verb+_+explode4 & (explosion middle left)\\ -\verb@ @ & S\verb+_+explode5 & (explosion middle center)\\ -\verb@|@ & S\verb+_+explode6 & (explosion middle right)\\ -\verb@\@ & S\verb+_+explode7 & (explosion bottom left)\\ -\verb@-@ & S\verb+_+explode8 & (explosion bottom center)\\ -\verb@/@ & S\verb+_+explode9 & (explosion bottom right)\\ +\verb@/@ & S\verb+_+expl\verb+_+tl & (explosion top left)\\ +\verb@-@ & S\verb+_+expl\verb+_+tc & (explosion top center)\\ +\verb@\@ & S\verb+_+expl\verb+_+tr & (explosion top right)\\ +\verb@|@ & S\verb+_+expl\verb+_+ml & (explosion middle left)\\ +\verb@ @ & S\verb+_+expl\verb+_+mc & (explosion middle center)\\ +\verb@|@ & S\verb+_+expl\verb+_+mr & (explosion middle right)\\ +\verb@\@ & S\verb+_+expl\verb+_+bl & (explosion bottom left)\\ +\verb@-@ & S\verb+_+expl\verb+_+bc & (explosion bottom center)\\ +\verb@/@ & S\verb+_+expl\verb+_+br & (explosion bottom right)\\ \verb@e@ & S\verb+_+eye & (eye or sphere)\\ \verb@^@ & S\verb+_+falling\verb+_+rock\verb+_+trap & (falling rock trap)\\ \verb@f@ & S\verb+_+feline & (cat or other feline)\\ diff --git a/include/defsym.h b/include/defsym.h index a69458611..5076e2260 100644 --- a/include/defsym.h +++ b/include/defsym.h @@ -221,15 +221,15 @@ /* |@| */ /* \-/ */ /* */ - PCHAR2(91, '/', S_explode1, "explosion top left", "", CLR(CLR_ORANGE)) - PCHAR2(92, '-', S_explode2, "explosion top center", "", CLR(CLR_ORANGE)) - PCHAR2(93, '\\', S_explode3, "explosion top right", "", CLR(CLR_ORANGE)) - PCHAR2(94, '|', S_explode4, "explosion middle left", "", CLR(CLR_ORANGE)) - PCHAR2(95, ' ', S_explode5, "explosion middle center", "", CLR(CLR_ORANGE)) - PCHAR2(96, '|', S_explode6, "explosion middle right", "", CLR(CLR_ORANGE)) - PCHAR2(97, '\\', S_explode7, "explosion bottom left", "", CLR(CLR_ORANGE)) - PCHAR2(98, '-', S_explode8, "explosion bottom center", "", CLR(CLR_ORANGE)) - PCHAR2(99, '/', S_explode9, "explosion bottom right", "", CLR(CLR_ORANGE)) + PCHAR2(91, '/', S_expl_tl, "explosion top left", "", CLR(CLR_ORANGE)) + PCHAR2(92, '-', S_expl_tc, "explosion top center", "", CLR(CLR_ORANGE)) + PCHAR2(93, '\\', S_expl_tr, "explosion top right", "", CLR(CLR_ORANGE)) + PCHAR2(94, '|', S_expl_ml, "explosion middle left", "", CLR(CLR_ORANGE)) + PCHAR2(95, ' ', S_expl_mc, "explosion middle center", "", CLR(CLR_ORANGE)) + PCHAR2(96, '|', S_expl_mr, "explosion middle right", "", CLR(CLR_ORANGE)) + PCHAR2(97, '\\', S_expl_bl, "explosion bottom left", "", CLR(CLR_ORANGE)) + PCHAR2(98, '-', S_expl_bc, "explosion bottom center", "", CLR(CLR_ORANGE)) + PCHAR2(99, '/', S_expl_br, "explosion bottom right", "", CLR(CLR_ORANGE)) #undef PCHAR #undef PCHAR2 #endif /* PCHAR_S_ENUM || PCHAR_PARSE || PCHAR_DRAWING || PCHAR_TILES */ diff --git a/include/display.h b/include/display.h index a32469c89..cde1499b1 100644 --- a/include/display.h +++ b/include/display.h @@ -379,7 +379,7 @@ enum explosion_types { #define cmap_to_glyph(cmap_idx) ((int) (cmap_idx) + GLYPH_CMAP_OFF) #define explosion_to_glyph(expltype, idx) \ - ((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF) + ((((expltype) * MAXEXPCHARS) + ((idx) - S_expl_tl)) + GLYPH_EXPLODE_OFF) #define trap_to_glyph(trap) \ cmap_to_glyph(trap_to_defsym((trap)->ttyp)) diff --git a/include/sym.h b/include/sym.h index 3e6d7e821..6d8aa1f46 100644 --- a/include/sym.h +++ b/include/sym.h @@ -76,7 +76,7 @@ struct symsetentry { #define MAXDCHARS (S_water - S_stone + 1) /* mapped dungeon characters */ #define MAXTCHARS (S_vibrating_square - S_arrow_trap + 1) /* trap chars */ -#define MAXECHARS (S_explode9 - S_vbeam + 1) /* mapped effects characters */ +#define MAXECHARS (S_expl_br - S_vbeam + 1) /* mapped effects characters */ #define MAXEXPCHARS 9 /* number of explosion characters */ #define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom) diff --git a/src/display.c b/src/display.c index a9555d0c4..5dae71118 100644 --- a/src/display.c +++ b/src/display.c @@ -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; diff --git a/src/explode.c b/src/explode.c index f1a5e89ae..73ae23cd8 100644 --- a/src/explode.c +++ b/src/explode.c @@ -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. diff --git a/src/options.c b/src/options.c index b2841bd37..913494e6d 100644 --- a/src/options.c +++ b/src/options.c @@ -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;