1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-04-07 09:00:43 +01:00

Adjust belts to be their own object class rather than armor

Less jank.
This commit is contained in:
ChrisANG 2024-11-17 09:07:08 -05:00
parent 664cab3f76
commit f383f16871
15 changed files with 29 additions and 14 deletions

View file

@ -1072,7 +1072,7 @@ struct obj {
objects[otmp->otyp].oc_armcat == ARM_SHIRT)
#define is_suit(otmp) (otmp->oclass == ARMOR_CLASS && \
objects[otmp->otyp].oc_armcat == ARM_SUIT)
#define is_belt(otmp) (otmp->oclass == ARMOR_CLASS && \
#define is_belt(otmp) (otmp->oclass == BELT_CLASS && \
objects[otmp->otyp].oc_armcat == ARM_BELT)
#define is_harmonium_armor(otmp) is_harmonium_otyp((otmp)->otyp)

View file

@ -294,7 +294,8 @@ extern NEARDATA struct colorTextClr LightsaberColor[];
#define TILE_CLASS 18
#define BED_CLASS 19
#define SCOIN_CLASS 20
#define MAXOCLASSES 21
#define BELT_CLASS 21
#define MAXOCLASSES 22
#define ALLOW_COUNT (MAXOCLASSES+1) /* Can be used in the object class */
#define ALL_CLASSES (MAXOCLASSES+2) /* input to getobj(). */
@ -314,6 +315,7 @@ extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */
#define ILLOBJ_SYM ']' /* also used for mimics */
#define WEAPON_SYM ')'
#define ARMOR_SYM '['
#define BELT_SYM '['
#define RING_SYM '='
#define AMULET_SYM '"'
#define TOOL_SYM '('

View file

@ -1518,7 +1518,7 @@ cancel_don()
}
static NEARDATA const char clothes[] = {ARMOR_CLASS, 0};
static NEARDATA const char accessories[] = {ARMOR_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, 0};
static NEARDATA const char accessories[] = {BELT_CLASS, RING_CLASS, AMULET_CLASS, TOOL_CLASS, FOOD_CLASS, 0};
/* the 'T' command */
int

View file

@ -50,7 +50,8 @@ const char def_oc_syms[MAXOCLASSES] = {
VENOM_SYM,
TILE_SYM,
BED_SYM,
SCOIN_SYM
SCOIN_SYM,
BELT_SYM,
};
const char invisexplain[] = "remembered, unseen, creature";
@ -1184,7 +1185,8 @@ static const uchar IBM_r_oc_syms[MAXOCLASSES] = { /* a la EPYX Rogue */
VENOM_SYM,
TILE_SYM,
BED_SYM,
SCOIN_SYM
SCOIN_SYM,
BELT_SYM,
};
# endif /* ASCIIGRAPH */

View file

@ -59,7 +59,7 @@ STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 };
STATIC_OVL NEARDATA const char allobj[] = {
COIN_CLASS, WEAPON_CLASS, ARMOR_CLASS, POTION_CLASS, SCROLL_CLASS, TILE_CLASS,
WAND_CLASS, RING_CLASS, AMULET_CLASS, FOOD_CLASS, TOOL_CLASS,
GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, SPBOOK_CLASS, BED_CLASS, SCOIN_CLASS, 0 };
GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, SPBOOK_CLASS, BED_CLASS, SCOIN_CLASS, BELT_CLASS, 0 };
STATIC_OVL boolean force_save_hs = FALSE;

View file

@ -2068,6 +2068,10 @@ int mode;
}
break;
case BELT_CLASS:
type = DUST;
break;
case ARMOR_CLASS:
if (is_boots(otmp)) {
type = DUST;

View file

@ -1200,14 +1200,11 @@ register const char *let,*word;
*/
else if ((!strcmp(word, "put on") &&
((otmp->oclass == FOOD_CLASS && otmp->otyp != MEAT_RING) ||
(otmp->oclass == ARMOR_CLASS && !is_belt(otmp)) ||
(otmp->oclass == TOOL_CLASS &&
otyp != BLINDFOLD && otyp != MASK && otyp != R_LYEHIAN_FACEPLATE &&
otyp != TOWEL && otyp != ANDROID_VISOR && otyp != LIVING_MASK && otyp != LENSES && otyp != SUNGLASSES && otyp != SOUL_LENS) ||
(otmp->oclass == CHAIN_CLASS)
))
|| (!strcmp(word, "wear") &&
(otmp->oclass == ARMOR_CLASS && is_belt(otmp)))
|| (!strcmp(word, "wield") &&
((otmp->oclass == TOOL_CLASS && !is_weptool(otmp)) ||
(otmp->oclass == CHAIN_CLASS && otmp->otyp != CHAIN)))
@ -3763,7 +3760,7 @@ winid *datawin;
OBJPUTSTR(buf2);
}
}
if (olet == ARMOR_CLASS) {
if (olet == ARMOR_CLASS || olet == BELT_CLASS) {
/* Armor type */
/* Indexes here correspond to ARM_SHIELD, etc; not the W_* masks.
* Expects ARM_SUIT = 0, all the way up to ARM_SHIRT = 6. */
@ -5706,7 +5703,8 @@ STATIC_VAR NEARDATA const char *names[] = { 0,
"Illegal objects", "Weapons", "Armor", "Rings", "Amulets",
"Tools", "Comestibles", "Potions", "Scrolls", "Spellbooks",
"Wands", "Coins", "Gems", "Boulders/Statues", "Iron balls",
"Scrap", "Venoms", "Tiles", "Furnature", "Strange coins"
"Scrap", "Venoms", "Tiles", "Furnature", "Strange coins",
"Belts"
};
STATIC_VAR NEARDATA const char *bogusclasses[] = {

View file

@ -1658,6 +1658,7 @@ int mkflags;
case COIN_CLASS:
case TILE_CLASS:
case SCOIN_CLASS:
case BELT_CLASS:
break; /* do nothing */
default:
impossible("impossible mkobj %d, sym '%c'.", otmp->otyp,

View file

@ -2345,7 +2345,7 @@ struct monst *guardian;
static NEARDATA const char practical[] = { WEAPON_CLASS, ARMOR_CLASS, GEM_CLASS, FOOD_CLASS, 0 };
static NEARDATA const char magical[] = {
AMULET_CLASS, POTION_CLASS, SCROLL_CLASS, WAND_CLASS, RING_CLASS,
SPBOOK_CLASS, TILE_CLASS, SCOIN_CLASS, 0 };
SPBOOK_CLASS, TILE_CLASS, SCOIN_CLASS, BELT_CLASS, 0 };
static NEARDATA const char indigestion[] = { BALL_CLASS, ROCK_CLASS, 0 };
static NEARDATA const char boulder_class[] = { ROCK_CLASS, 0 };
static NEARDATA const char gem_class[] = { GEM_CLASS, 0 };

View file

@ -489,6 +489,7 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */
hits = (obj_type == MEAT_STICK ||
obj_type == MASSIVE_CHUNK_OF_MEAT);
break;
case BELT_CLASS:
case SPBOOK_CLASS:
case WAND_CLASS:
case BALL_CLASS:

View file

@ -2861,6 +2861,7 @@ struct obj *obj;
switch(obj->oclass){
case WEAPON_CLASS:
return likes_objs(ptr);
case BELT_CLASS:
case ARMOR_CLASS:
return !mad_no_armor(mon) && likes_objs(ptr);
case RING_CLASS:

View file

@ -191,6 +191,7 @@ shuffle_all()
oclass != WEAPON_CLASS &&
oclass != ARMOR_CLASS &&
oclass != SCOIN_CLASS &&
oclass != BELT_CLASS &&
oclass != GEM_CLASS) {
int j = last-1;

View file

@ -765,7 +765,10 @@ BOW(("bladed bow"), 1, MZ_LARGE, 0, 60, 75, 0, IRON, P_BOW, HI_METAL, O_TRAIT
#define BOOTS(names,kn,mgc,prob,delay,wt,cost,ac,dr,can,metal,c,...) \
ARMOR(names, kn, mgc, MZ_SMALL, 0, {0}, prob, delay, wt, cost, ac, dr, can, LEG_DR, ARM_BOOTS, metal, c, __VA_ARGS__)
#define BELT(names,kn,mgc,prob,wt,cost,ac,dr,can,metal,c,...) \
ARMOR(names, kn, mgc, MZ_SMALL, 0, {0}, prob, 1, wt, cost, ac, dr, can, LEG_DR, ARM_BELT, metal, c, __VA_ARGS__)
OBJECT( \
names, BITS(kn,0,1,0,mgc,1,0,0,MZ_SMALL,0,0,0,LOWER_TORSO_DR,ARM_BELT,metal,0), {0}, \
BELT_CLASS, prob, 0, wt, cost, \
{0}, {0}, 10 - ac, can, dr, wt, c, __VA_ARGS__ )
/* helmets */
HELM(("sedge hat", "wide conical hat"), /*Needs encyc entry*//*Needs tile*/
@ -1142,6 +1145,7 @@ BOOTS(("fumble boots", "riding boots"),
0, 1, 12, 2, 20, 30, 10, 1, 0, LEATHER, HI_LEATHER, O_POWER(FUMBLING)),
BOOTS(("flying boots", "snow boots"),
0, 1, 12, 2, 15, 30, 9, 1, 0, LEATHER, HI_LEATHER, O_POWER(FLYING)),
BELT(("belt of power", "segmented belt"),
0, 1, 0, 15, 30, 10, 0, 0, IRON, CLR_BROWN),
#undef SUIT

View file

@ -2284,6 +2284,7 @@ weapon:
}
break;
case ARMOR_CLASS:
case BELT_CLASS:
if (obj->owornmask & (W_ARMOR|W_BELT))
Strcat(buf, (obj == uskin) ? " (embedded in your skin)" :
" (being worn)");

View file

@ -498,7 +498,7 @@ extern char ttycolors[CLR_MAX]; /* in sys/msdos/video.c */
#endif
static char def_inv_order[MAXOCLASSES] = {
COIN_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS,
COIN_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, BELT_CLASS, FOOD_CLASS,
SCROLL_CLASS, TILE_CLASS, SPBOOK_CLASS, POTION_CLASS, RING_CLASS, WAND_CLASS,
TOOL_CLASS, GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, BED_CLASS, SCOIN_CLASS, 0,
};