replace some weight-related magic numbers
adds a header file include/nhconst.h (I'm open to a better name)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
42
include/nhconst.h
Normal file
42
include/nhconst.h
Normal file
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
2
src/do.c
2
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!");
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
10
src/hack.c
10
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<dir> 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user