diff --git a/include/hack.h b/include/hack.h index 3e0b9c306..9af8a3fda 100644 --- a/include/hack.h +++ b/include/hack.h @@ -12,6 +12,7 @@ #include "lint.h" #include "align.h" +#include "nhconst.h" #include "dungeon.h" #include "stairs.h" #include "objclass.h" @@ -46,7 +47,6 @@ #define ON 1 #define OFF 0 #define BOLT_LIM 8 /* from this distance ranged attacks will be made */ -#define MAX_CARR_CAP 1000 /* so that boulders can be heavier */ #define DUMMY { 0 } /* array initializer, letting [1..N-1] default */ #define DEF_NOTHING ' ' /* default symbol for NOTHING and UNEXPLORED */ @@ -65,9 +65,6 @@ #define CXN_ARTICLE 8 /* include a/an/the prefix */ #define CXN_NOCORPSE 16 /* suppress " corpse" suffix */ -/* weight increment of heavy iron ball */ -#define IRON_BALL_W_INCR 160 - /* number of turns it takes for vault guard to show up */ #define VAULT_GUARD_TIME 30 diff --git a/include/monsters.h b/include/monsters.h index 14278e339..408f4a888 100644 --- a/include/monsters.h +++ b/include/monsters.h @@ -590,7 +590,7 @@ LVL(4, 0, 8, 10, 0), (G_GENO | 2), A(ATTK(AT_NONE, AD_COLD, 0, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(50, 20, MS_SILENT, MZ_MEDIUM), MR_COLD | MR_POISON, + SIZ(WT_JELLY, 20, MS_SILENT, MZ_MEDIUM), MR_COLD | MR_POISON, MR_COLD | MR_POISON, M1_BREATHLESS | M1_AMORPHOUS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_NOTAKE, @@ -600,7 +600,7 @@ LVL(5, 0, 8, 10, 0), (G_GENO | 1), A(ATTK(AT_NONE, AD_ACID, 0, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(50, 20, MS_SILENT, MZ_MEDIUM), + SIZ(WT_JELLY, 20, MS_SILENT, MZ_MEDIUM), MR_ACID | MR_STONE, MR_ACID | MR_STONE, M1_BREATHLESS | M1_AMORPHOUS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_ACID | M1_NOTAKE, @@ -610,7 +610,7 @@ LVL(6, 3, 8, 20, 0), (G_GENO | 2), A(ATTK(AT_ENGL, AD_ACID, 3, 6), ATTK(AT_NONE, AD_ACID, 3, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(50, 20, MS_SILENT, MZ_MEDIUM), + SIZ(WT_JELLY, 20, MS_SILENT, MZ_MEDIUM), MR_ACID | MR_STONE, MR_ACID | MR_STONE, M1_BREATHLESS | M1_AMORPHOUS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_ACID | M1_NOTAKE, @@ -701,14 +701,14 @@ LVL(3, 12, 9, 20, 0), (G_GENO | 2), A(ATTK(AT_CLAW, AD_SITM, 0, 0), ATTK(AT_CLAW, AD_SEDU, 0, 0), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(600, 300, MS_SEDUCE, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_TPORT, + SIZ(WT_NYMPH, 300, MS_SEDUCE, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_TPORT, M2_HOSTILE | M2_FEMALE | M2_COLLECT, M3_INFRAVISIBLE, 5, CLR_GREEN, WOOD_NYMPH), MON(NAM("water nymph"), S_NYMPH, LVL(3, 12, 9, 20, 0), (G_GENO | 2), A(ATTK(AT_CLAW, AD_SITM, 0, 0), ATTK(AT_CLAW, AD_SEDU, 0, 0), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(600, 300, MS_SEDUCE, MZ_HUMAN), 0, 0, + SIZ(WT_NYMPH, 300, MS_SEDUCE, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_TPORT | M1_SWIM, M2_HOSTILE | M2_FEMALE | M2_COLLECT, M3_INFRAVISIBLE, 5, CLR_BLUE, WATER_NYMPH), @@ -716,7 +716,7 @@ LVL(3, 12, 9, 20, 0), (G_GENO | 2), A(ATTK(AT_CLAW, AD_SITM, 0, 0), ATTK(AT_CLAW, AD_SEDU, 0, 0), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(600, 300, MS_SEDUCE, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_TPORT, + SIZ(WT_NYMPH, 300, MS_SEDUCE, MZ_HUMAN), 0, 0, M1_HUMANOID | M1_TPORT, M2_HOSTILE | M2_FEMALE | M2_COLLECT, M3_INFRAVISIBLE, 5, CLR_BROWN, MOUNTAIN_NYMPH), /* @@ -1052,7 +1052,7 @@ LVL(3, 1, 0, 0, 0), (G_GENO | G_NOCORPSE | 2), A(ATTK(AT_ENGL, AD_PHYS, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0, + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_AMORPHOUS | M1_UNSOLID, M2_HOSTILE | M2_NEUTER, 0, @@ -1061,7 +1061,7 @@ LVL(4, 20, 2, 30, 0), (G_GENO | G_NOCORPSE | 2), A(ATTK(AT_ENGL, AD_BLND, 2, 8), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0, + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS, M2_HOSTILE | M2_NEUTER, 0, @@ -1070,7 +1070,7 @@ LVL(5, 20, 2, 30, 0), (G_NOHELL | G_GENO | G_NOCORPSE | 1), A(ATTK(AT_ENGL, AD_COLD, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_HUGE), + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_HUGE), MR_COLD | MR_SLEEP | MR_POISON | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS, @@ -1080,7 +1080,7 @@ LVL(6, 20, 2, 30, 0), (G_GENO | G_NOCORPSE | 1), A(ATTK(AT_ENGL, AD_ELEC, 1, 6), ATTK(AT_ENGL, AD_DREN, 2, 6), ATTK(AT_NONE, AD_ELEC, 0, 4), NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_HUGE), + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_HUGE), MR_ELEC | MR_SLEEP | MR_DISINT | MR_POISON | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_UNSOLID, @@ -1090,7 +1090,7 @@ LVL(7, 22, 2, 30, 0), (G_HELL | G_GENO | G_NOCORPSE | 2), A(ATTK(AT_ENGL, AD_FIRE, 1, 8), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_HUGE), + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_HUGE), MR_FIRE | MR_SLEEP | MR_POISON | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_UNSOLID, @@ -1100,7 +1100,7 @@ LVL(8, 22, 2, 30, 0), (G_HELL | G_GENO | G_NOCORPSE | 1), A(ATTK(AT_ENGL, AD_FIRE, 1, 10), ATTK(AT_NONE, AD_FIRE, 0, 4), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_HUGE), + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_HUGE), MR_FIRE | MR_SLEEP | MR_POISON | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD | M1_MINDLESS | M1_UNSOLID, @@ -1168,7 +1168,7 @@ LVL(3, 15, 0, 0, 0), (G_NOCORPSE | G_GENO | 4), A(ATTK(AT_EXPL, AD_BLND, 10, 20), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_SMALL), + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_SMALL), MR_FIRE | MR_COLD | MR_ELEC | MR_DISINT | MR_SLEEP | MR_POISON | MR_ACID | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_AMORPHOUS | M1_NOEYES | M1_NOLIMBS @@ -1180,7 +1180,7 @@ LVL(5, 15, 0, 0, 0), (G_NOCORPSE | G_GENO | 2), A(ATTK(AT_EXPL, AD_HALU, 10, 12), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(0, 0, MS_SILENT, MZ_SMALL), + SIZ(WT_ETHEREAL, 0, MS_SILENT, MZ_SMALL), MR_FIRE | MR_COLD | MR_ELEC | MR_DISINT | MR_SLEEP | MR_POISON | MR_ACID | MR_STONE, 0, M1_FLY | M1_BREATHLESS | M1_AMORPHOUS | M1_NOEYES | M1_NOLIMBS @@ -1340,7 +1340,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), 0, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), 0, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_GRAY, BABY_GRAY_DRAGON), @@ -1348,7 +1348,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), 0, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), 0, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, M3_INFRAVISIBLE, 13, HI_GOLD, BABY_GOLD_DRAGON), @@ -1356,7 +1356,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), 0, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), 0, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, DRAGON_SILVER, BABY_SILVER_DRAGON), @@ -1366,7 +1366,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), 0, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), 0, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_CYAN, BABY_SHIMMERING_DRAGON), @@ -1375,7 +1375,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_FIRE, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_FIRE, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, M3_INFRAVISIBLE, 13, CLR_RED, BABY_RED_DRAGON), @@ -1383,7 +1383,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_COLD, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_COLD, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_WHITE, BABY_WHITE_DRAGON), @@ -1391,7 +1391,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_SLEEP, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_SLEEP, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_ORANGE, BABY_ORANGE_DRAGON), @@ -1399,7 +1399,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_DISINT, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_DISINT, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_BLACK, BABY_BLACK_DRAGON), @@ -1407,7 +1407,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_ELEC, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_ELEC, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_BLUE, BABY_BLUE_DRAGON), @@ -1415,7 +1415,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_POISON, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_POISON, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE | M1_POIS, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_GREEN, BABY_GREEN_DRAGON), @@ -1423,7 +1423,7 @@ LVL(12, 9, 2, 10, 0), G_GENO, A(ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), - SIZ(1500, 500, MS_ROAR, MZ_HUGE), MR_ACID | MR_STONE, 0, + SIZ(WT_BABY_DRAGON, 500, MS_ROAR, MZ_HUGE), MR_ACID | MR_STONE, 0, M1_FLY | M1_THICK_HIDE | M1_NOHANDS | M1_CARNIVORE | M1_ACID, M2_HOSTILE | M2_STRONG | M2_GREEDY | M2_JEWELS, 0, 13, CLR_YELLOW, BABY_YELLOW_DRAGON), diff --git a/include/nhconst.h b/include/nhconst.h new file mode 100644 index 000000000..2e074f3f9 --- /dev/null +++ b/include/nhconst.h @@ -0,0 +1,42 @@ +/* NetHack 3.7 nhconst.h $NHDT-Date: 1725653014 2024/09/06 20:03:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $ */ +/* Copyright (c) Michael Allison, 2025. */ +/* NetHack may be freely redistributed. See license for details. */ + +#ifndef NHCONST_H +#define NHCONST_H + +/* weight-related constants and thresholds */ +enum weight_constants { + WT_ETHEREAL = 0, + WT_SPLASH_THRESHOLD = 9, /* weight needed to make splash in water */ + WT_WEIGHTCAP_STRCON = 25, /* str + con multiplied by this for conv to + * carrying capacity in weight_cap() */ + WT_WEIGHTCAP_SPARE = 50, /* used in weight_cap calc */ + WT_JELLY = 50, /* weight of jelly body */ + WT_WOUNDEDLEG_REDUCT = 100, /* wounded legs reduce carrcap by this */ + WT_TO_DMG = 100, /* divisor to convert weight to dmg amt */ + WT_IRON_BALL_INCR = 160, /* weight increment of heavy iron ball */ + WT_IRON_BALL_BASE = 480, /* base starting weight of iron ball */ + WT_NOISY_INV = 500, /* inv_weight() max for noisy fumbling */ + WT_NYMPH = 600, /* weight of nymph body */ + WT_TOOMUCH_DIAGONAL = 600, /* weight_cap threshold for diag squeeze */ + WT_ELF = 800, /* weight of elf body */ + WT_SQUEEZABLE_INV = 850, /* inv_weight() maximum for squeezing */ + MAX_CARR_CAP = 1000, /* max carrying capacity, so that + * boulders can be heavier */ + WT_HUMAN = 1450, /* weight of human body */ + WT_BABY_DRAGON = 1500, /* weight ob baby dragon body */ + WT_DRAGON = 4500, /* weight of dragon body */ +}; + +enum monster_speeds { + VERY_SLOW = 3, + SLOW_SPEED = 9, + NORMAL_SPEED = 12, /* movement rates */ + FAST_SPEED = 15, + VERY_FAST = 24, +}; + +#endif /* NHCONST_H */ + + diff --git a/include/permonst.h b/include/permonst.h index 9f11bb1fc..a03e36b4b 100644 --- a/include/permonst.h +++ b/include/permonst.h @@ -47,12 +47,6 @@ struct attack { #define NATTK 6 -/* Weight of human body, elf, dragon - */ -#define WT_HUMAN 1450U -#define WT_ELF 800U -#define WT_DRAGON 4500U - #ifndef ALIGN_H #include "align.h" #endif @@ -86,10 +80,4 @@ struct permonst { extern NEARDATA struct permonst mons[NUMMONS + 1]; /* the master list of * monster types */ -#define VERY_SLOW 3 -#define SLOW_SPEED 9 -#define NORMAL_SPEED 12 /* movement rates */ -#define FAST_SPEED 15 -#define VERY_FAST 24 - #endif /* PERMONST_H */ diff --git a/src/do.c b/src/do.c index 41828b8ac..2d1d7d57b 100644 --- a/src/do.c +++ b/src/do.c @@ -275,7 +275,7 @@ flooreffects( * noise. Stuff dropped near fountains always misses */ if ((Blind || (Levitation || Flying)) && !Deaf && u_at(x, y)) { if (!Underwater) { - if (weight(obj) > 9) { + if (weight(obj) > WT_SPLASH_THRESHOLD) { pline("Splash!"); } else if (Levitation || Flying) { pline("Plop!"); diff --git a/src/dothrow.c b/src/dothrow.c index dac67ba82..fbc507c3c 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -823,7 +823,7 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y) && bad_rock(gy.youmonst.data, u.ux, y) && bad_rock(gy.youmonst.data, x, u.uy)) { boolean too_much = (gi.invent - && (inv_weight() + weight_cap() > 600)); + && (inv_weight() + weight_cap() > WT_TOOMUCH_DIAGONAL)); if (bigmonst(gy.youmonst.data) || too_much) { why = "wedging into a narrow crevice"; @@ -1347,7 +1347,7 @@ toss_up(struct obj *obj, boolean hitsroof) &dmg, rn1(18, 2)); if (!dmg) { /* probably wasn't a weapon; base damage on weight */ - dmg = ((int) obj->owt + 99) / 100; + dmg = ((int) obj->owt + (WT_TO_DMG - 1)) / WT_TO_DMG; dmg = (dmg <= 1) ? 1 : rnd(dmg); if (dmg > 6) dmg = 6; @@ -1770,7 +1770,8 @@ throwit(struct obj *obj, || (is_lava(gb.bhitpos.x, gb.bhitpos.y) && !is_flammable(obj))) { Soundeffect(se_splash, 50); - pline((weight(obj) > 9) ? "Splash!" : "Plop!"); + pline((weight(obj) > WT_SPLASH_THRESHOLD) + ? "Splash!" : "Plop!"); } } if (flooreffects(obj, gb.bhitpos.x, gb.bhitpos.y, "fall")) { diff --git a/src/hack.c b/src/hack.c index 6bd838e16..908f9e5e9 100644 --- a/src/hack.c +++ b/src/hack.c @@ -135,7 +135,8 @@ revive_nasty(coordxy x, coordxy y, const char *msg) return revived; } -#define squeezeablylightinvent() (!gi.invent || inv_weight() <= -850) +#define squeezeablylightinvent() (!gi.invent \ + || inv_weight() <= (WT_SQUEEZABLE_INV * -1)) /* can hero move onto a spot containing one or more boulders? used for m and travel and during boulder push failure */ @@ -4195,7 +4196,8 @@ weight_cap(void) functions enough in that situation to enhance carrying capacity */ BLevitation &= ~I_SPECIAL; - carrcap = 25 * (ACURRSTR + ACURR(A_CON)) + 50; + carrcap = (WT_WEIGHTCAP_STRCON * (ACURRSTR + ACURR(A_CON))) + + WT_WEIGHTCAP_SPARE; if (Upolyd) { /* consistent with can_carry() in mon.c */ if (gy.youmonst.data->mlet == S_NYMPH) @@ -4216,9 +4218,9 @@ weight_cap(void) carrcap = MAX_CARR_CAP; if (!Flying) { if (EWounded_legs & LEFT_SIDE) - carrcap -= 100; + carrcap -= WT_WOUNDEDLEG_REDUCT; if (EWounded_legs & RIGHT_SIDE) - carrcap -= 100; + carrcap -= WT_WOUNDEDLEG_REDUCT; } } diff --git a/src/monst.c b/src/monst.c index 4b7f57fb1..30eec13b5 100644 --- a/src/monst.c +++ b/src/monst.c @@ -4,6 +4,7 @@ /* NetHack may be freely redistributed. See license for details. */ #include "config.h" +#include "nhconst.h" #include "permonst.h" #include "wintype.h" #include "sym.h" diff --git a/src/mthrowu.c b/src/mthrowu.c index a0d462efd..13a76175d 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1439,10 +1439,10 @@ hit_bars( if (your_fault && (otmp->otyp == WAR_HAMMER || otmp->otyp == HEAVY_IRON_BALL)) { /* iron ball isn't a weapon or wep-tool so doesn't use obj->spe; - weight is normally 480 but can be increased by increments - of 160 (scrolls of punishment read while already punished) */ + weight is normally 48000 but can be increased by increments + of 16000 (scrolls of punishment read while already punished) */ int spe = ((otmp->otyp == HEAVY_IRON_BALL) /* 3+ for iron ball */ - ? ((int) otmp->owt / IRON_BALL_W_INCR) + ? ((int) otmp->owt / WT_IRON_BALL_INCR) : otmp->spe); /* chance: used in saving throw for the bars; more likely to break those when 'chance' is _lower_; acurrstr(): 3..25 */ diff --git a/src/objects.c b/src/objects.c index 45ceaeeab..f9646a54d 100644 --- a/src/objects.c +++ b/src/objects.c @@ -3,6 +3,7 @@ /* NetHack may be freely redistributed. See license for details. */ #include "config.h" +#include "nhconst.h" #include "obj.h" #include "prop.h" diff --git a/src/objnam.c b/src/objnam.c index b4e4ae8dd..d3ce48ffb 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -5357,7 +5357,7 @@ readobjnam(char *bp, struct obj *no_wish) } d.otmp->owt = weight(d.otmp); if (d.very && d.otmp->otyp == HEAVY_IRON_BALL) - d.otmp->owt += IRON_BALL_W_INCR; + d.otmp->owt += WT_IRON_BALL_INCR; return d.otmp; } diff --git a/src/read.c b/src/read.c index f4cc95ac6..9f0383de7 100644 --- a/src/read.c +++ b/src/read.c @@ -2938,7 +2938,7 @@ punish(struct obj *sobj) You("are being punished for your misbehavior!"); if (Punished) { Your("iron ball gets heavier."); - uball->owt += IRON_BALL_W_INCR * (1 + cursed_levy); + uball->owt += WT_IRON_BALL_INCR * (1 + cursed_levy); return; } if (amorphous(gy.youmonst.data) || is_whirly(gy.youmonst.data) diff --git a/src/timeout.c b/src/timeout.c index 58c575fd1..81f62d531 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -910,7 +910,7 @@ nh_timeout(void) * are to make noise when you fumble. Adjustments * to this number must be thoroughly play tested. */ - if ((inv_weight() > -500)) { + if ((inv_weight() > (WT_NOISY_INV * -1))) { if (!Deaf) You("make a lot of noise!"); wake_nearby(FALSE); diff --git a/src/trap.c b/src/trap.c index b26c471a8..21adb2314 100644 --- a/src/trap.c +++ b/src/trap.c @@ -5366,7 +5366,7 @@ try_disarm( /* duplicate tight-space checks from test_move */ if (u.dx && u.dy && bad_rock(gy.youmonst.data, u.ux, ttmp->ty) && bad_rock(gy.youmonst.data, ttmp->tx, u.uy)) { - if ((gi.invent && (inv_weight() + weight_cap() > 600)) + if ((gi.invent && (inv_weight() + weight_cap() > WT_TOOMUCH_DIAGONAL)) || bigmonst(gy.youmonst.data)) { /* don't allow untrap if they can't get thru to it */ You("are unable to reach the %s!", trapname(ttype, FALSE)); diff --git a/src/weapon.c b/src/weapon.c index 12e5b5d99..c2da65a58 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -310,7 +310,7 @@ dmgval(struct obj *otmp, struct monst *mon) int wt = (int) objects[HEAVY_IRON_BALL].oc_weight; if ((int) otmp->owt > wt) { - wt = ((int) otmp->owt - wt) / IRON_BALL_W_INCR; + wt = ((int) otmp->owt - wt) / WT_IRON_BALL_INCR; tmp += rnd(4 * wt); if (tmp > 25) tmp = 25; /* objects[].oc_wldam */ diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 9ed3b27a2..727e56534 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -415,11 +415,11 @@ DECL_H = $(YOU_H) $(INCL)/spell.h $(INCL)/color.h \ GLOBAL_H = $(PCCONF_H) $(INCL)/coord.h $(INCL)/global.h HACK_H = $(CONFIG_H) $(INCL)/context.h $(DUNGEON_H) \ $(DECL_H) $(DISPLAY_H) $(INCL)/sym.h \ - $(INCL)/defsym.h $(INCL)/mkroom.h $(INCL)/objclass.h \ - $(INCL)/trap.h $(INCL)/flag.h $(RM_H) \ - $(INCL)/vision.h $(INCL)/wintype.h $(INCL)/engrave.h \ - $(INCL)/rect.h $(INCL)/hack.h $(REGION_H) \ - $(INCL)/sys.h + $(INCL)/defsym.h $(INCL)/mkroom.h $(INCL)/nhconst.h \ + $(INCL)/objclass.h $(INCL)/trap.h $(INCL)/flag.h \ + $(RM_H) $(INCL)/vision.h $(INCL)/wintype.h \ + $(INCL)/engrave.h $(INCL)/rect.h $(INCL)/hack.h \ + $(REGION_H) $(INCL)/sys.h DLB_H = $(INCL)/dlb.h ifeq ($(SUPPRESS_GRAPHICS),Y) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 7532dc098..92f89912e 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -564,11 +564,11 @@ HACKINCL = align.h artifact.h artilist.h attrib.h botl.h \ display.h dlb.h dungeon.h engrave.h extern.h flag.h fnamesiz.h \ func_tab.h global.h warnings.h hack.h lint.h mextra.h mfndpos.h \ micro.h mkroom.h monattk.h mondata.h monflag.h monst.h monsters.h \ - nhmd4.h obj.h objects.h objclass.h optlist.h patchlevel.h pcconf.h \ - permonst.h prop.h rect.h region.h selvar.h sym.h defsym.h rm.h sp_lev.h \ - spell.h sndprocs.h seffects.h stairs.h sys.h tcap.h timeout.h \ - tradstdc.h trap.h unixconf.h vision.h vmsconf.h wintty.h wincurs.h \ - winX.h winprocs.h wintype.h you.h youprop.h cstd.h + nhconst.h nhmd4.h obj.h objects.h objclass.h optlist.h patchlevel.h \ + pcconf.h permonst.h prop.h rect.h region.h selvar.h sym.h defsym.h \ + rm.h sp_lev.h spell.h sndprocs.h seffects.h stairs.h sys.h tcap.h \ + timeout.h tradstdc.h trap.h unixconf.h vision.h vmsconf.h wintty.h \ + wincurs.h winX.h winprocs.h wintype.h you.h youprop.h cstd.h HSOURCES = $(HACKINCL) dgn_file.h @@ -883,15 +883,15 @@ $(HACK_H): $(CONFIG_H) ../include/align.h ../include/artilist.h \ ../include/hack.h ../include/lint.h ../include/mextra.h \ ../include/mkroom.h ../include/monattk.h ../include/mondata.h \ ../include/monflag.h ../include/monst.h ../include/monsters.h \ - ../include/nhlua.h ../include/obj.h ../include/objclass.h \ - ../include/objects.h ../include/permonst.h ../include/prop.h \ - ../include/quest.h ../include/rect.h ../include/region.h \ - ../include/rm.h ../include/seffects.h ../include/selvar.h \ - ../include/skills.h ../include/sndprocs.h ../include/spell.h \ - ../include/stairs.h ../include/sym.h ../include/sys.h \ - ../include/timeout.h ../include/trap.h ../include/vision.h \ - ../include/winprocs.h ../include/wintype.h ../include/you.h \ - ../include/youprop.h + ../include/nhconst.h ../include/nhlua.h ../include/obj.h \ + ../include/objclass.h ../include/objects.h ../include/permonst.h \ + ../include/prop.h ../include/quest.h ../include/rect.h \ + ../include/region.h ../include/rm.h ../include/seffects.h \ + ../include/selvar.h ../include/skills.h ../include/sndprocs.h \ + ../include/spell.h ../include/stairs.h ../include/sym.h \ + ../include/sys.h ../include/timeout.h ../include/trap.h \ + ../include/vision.h ../include/winprocs.h ../include/wintype.h \ + ../include/you.h ../include/youprop.h touch $(HACK_H) # $(TARGETPFX)cppregex.o: ../sys/share/cppregex.cpp $(CONFIG_H) diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index df797c38c..6635a5690 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -393,7 +393,7 @@ $(HACK_H) : $(INC)hack.h $(CONFIG_H) $(INC)align.h \ $(INC)dungeon.h $(INC)sym.h $(INC)defsym.h $(INC)mkroom.h \ $(INC)objclass.h $(INC)youprop.h $(INC)prop.h \ $(INC)permonst.h $(INC)monattk.h \ - $(INC)monflag.h $(INC)mondata.h $(INC)pm.h \ + $(INC)monflag.h $(INC)mondata.h $(INC)nhconst.h $(INC)pm.h \ $(INC)wintype.h $(INC)context.h $(INC)decl.h $(INC)quest.h \ $(INC)spell.h $(INC)color.h $(INC)obj.h \ $(INC)you.h $(INC)attrib.h $(INC)monst.h \ diff --git a/sys/windows/Makefile.nmake b/sys/windows/Makefile.nmake index 40fe46230..b25fbb208 100644 --- a/sys/windows/Makefile.nmake +++ b/sys/windows/Makefile.nmake @@ -1121,15 +1121,15 @@ HACK_H = $(CONFIG_H) $(INCL)align.h $(INCL)artilist.h \ $(INCL)hack.h $(INCL)lint.h $(INCL)mextra.h \ $(INCL)mkroom.h $(INCL)monattk.h $(INCL)mondata.h \ $(INCL)monflag.h $(INCL)monst.h $(INCL)monsters.h \ - $(INCL)nhlua.h $(INCL)obj.h $(INCL)objclass.h \ - $(INCL)objects.h $(INCL)permonst.h $(INCL)prop.h \ - $(INCL)quest.h $(INCL)rect.h $(INCL)region.h \ - $(INCL)rm.h $(INCL)seffects.h $(INCL)selvar.h \ - $(INCL)skills.h $(INCL)sndprocs.h $(INCL)spell.h \ - $(INCL)stairs.h $(INCL)sym.h $(INCL)sys.h \ - $(INCL)timeout.h $(INCL)trap.h $(INCL)vision.h \ - $(INCL)winprocs.h $(INCL)wintype.h $(INCL)you.h \ - $(INCL)youprop.h + $(INCL)nhconst.h $(INCL)nhlua.h $(INCL)obj.h \ + $(INCL)objclass.h $(INCL)objects.h $(INCL)permonst.h \ + $(INCL)prop.h $(INCL)quest.h $(INCL)rect.h \ + $(INCL)region.h $(INCL)rm.h $(INCL)seffects.h \ + $(INCL)selvar.h $(INCL)skills.h $(INCL)sndprocs.h \ + $(INCL)spell.h $(INCL)stairs.h $(INCL)sym.h \ + $(INCL)sys.h $(INCL)timeout.h $(INCL)trap.h \ + $(INCL)vision.h $(INCL)winprocs.h $(INCL)wintype.h \ + $(INCL)you.h $(INCL)youprop.h TILE_H = $(WSHR)tile.h