Reformat .h files.
I did my best to exempt some of the bigger aligned blocks from the reformatting using the /* clang-format off */ and /* clang-format on */ tags. Probably some that shouldn't have been formatted were anyway; if you encounter them, please fix. The clang-format tags were left in on the basis that it's much easier to prune those out later than to put them back in, and it means that, modulo my custom version of clang-format, I should be able to run clang-format on the source tree again without changing anything, now that Pat has fixed the VA_DECL issues.
This commit is contained in:
174
include/mextra.h
174
include/mextra.h
@@ -15,16 +15,19 @@
|
||||
*
|
||||
* 1. Add the structure definition and any required macros in this file
|
||||
* above the mextra struct.
|
||||
* 2. Add a pointer to your new struct to the mextra struct in this file.
|
||||
* 3. Add a referencing macro at the bottom of this file after the mextra
|
||||
* 2. Add a pointer to your new struct to the mextra struct in this
|
||||
*file.
|
||||
* 3. Add a referencing macro at the bottom of this file after the
|
||||
*mextra
|
||||
* struct (see MNAME, EGD, EPRI, ESHK, EMIN, or EDOG for examples).
|
||||
* 4. Create a newXX(mtmp) function and possibly a free_XX(mtmp) function
|
||||
* 4. Create a newXX(mtmp) function and possibly a free_XX(mtmp)
|
||||
*function
|
||||
* in an appropriate new or existing source file and add a prototype
|
||||
* for it to include/extern.h.
|
||||
*
|
||||
* void FDECL(newXX, (struct monst *));
|
||||
* void FDECL(free_XX, (struct monst *));
|
||||
*
|
||||
*
|
||||
* void
|
||||
* newXX(mtmp)
|
||||
* struct monst *mtmp;
|
||||
@@ -36,8 +39,9 @@
|
||||
* 0, sizeof(struct XX));
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* 5. Consider adding a new makemon flag MM_XX flag to include/hack.h and
|
||||
*
|
||||
* 5. Consider adding a new makemon flag MM_XX flag to include/hack.h
|
||||
*and
|
||||
* a corresponding change to makemon() if you require your structure
|
||||
* to be added at monster creation time. Initialize your struct
|
||||
* after a successful return from makemon().
|
||||
@@ -55,43 +59,43 @@
|
||||
* 10. Adjust savemon() in src/save.c to deal with your
|
||||
* struct or data during a save.
|
||||
*/
|
||||
|
||||
|
||||
/***
|
||||
** formerly vault.h -- vault guard extension
|
||||
*/
|
||||
#define FCSIZ (ROWNO+COLNO)
|
||||
#define GD_EATGOLD 0x01
|
||||
#define GD_DESTROYGOLD 0x02
|
||||
#define FCSIZ (ROWNO + COLNO)
|
||||
#define GD_EATGOLD 0x01
|
||||
#define GD_DESTROYGOLD 0x02
|
||||
|
||||
struct fakecorridor {
|
||||
xchar fx, fy, ftyp;
|
||||
xchar fx, fy, ftyp;
|
||||
};
|
||||
|
||||
struct egd {
|
||||
int fcbeg, fcend; /* fcend: first unused pos */
|
||||
int vroom; /* room number of the vault */
|
||||
xchar gdx, gdy; /* goal of guard's walk */
|
||||
xchar ogx, ogy; /* guard's last position */
|
||||
d_level gdlevel; /* level (& dungeon) guard was created in */
|
||||
xchar warncnt; /* number of warnings to follow */
|
||||
Bitfield(gddone,1); /* true iff guard has released player */
|
||||
Bitfield(witness,2); /* the guard saw you do something */
|
||||
Bitfield(unused,5);
|
||||
struct fakecorridor fakecorr[FCSIZ];
|
||||
int fcbeg, fcend; /* fcend: first unused pos */
|
||||
int vroom; /* room number of the vault */
|
||||
xchar gdx, gdy; /* goal of guard's walk */
|
||||
xchar ogx, ogy; /* guard's last position */
|
||||
d_level gdlevel; /* level (& dungeon) guard was created in */
|
||||
xchar warncnt; /* number of warnings to follow */
|
||||
Bitfield(gddone, 1); /* true iff guard has released player */
|
||||
Bitfield(witness, 2); /* the guard saw you do something */
|
||||
Bitfield(unused, 5);
|
||||
struct fakecorridor fakecorr[FCSIZ];
|
||||
};
|
||||
|
||||
/***
|
||||
** formerly epri.h -- temple priest extension
|
||||
*/
|
||||
struct epri {
|
||||
aligntyp shralign; /* alignment of priest's shrine */
|
||||
schar shroom; /* index in rooms */
|
||||
coord shrpos; /* position of shrine */
|
||||
d_level shrlevel; /* level (& dungeon) of shrine */
|
||||
long intone_time, /* used to limit verbosity +*/
|
||||
enter_time, /*+ of temple entry messages */
|
||||
hostile_time, /* forbidding feeling */
|
||||
peaceful_time; /* sense of peace */
|
||||
aligntyp shralign; /* alignment of priest's shrine */
|
||||
schar shroom; /* index in rooms */
|
||||
coord shrpos; /* position of shrine */
|
||||
d_level shrlevel; /* level (& dungeon) of shrine */
|
||||
long intone_time, /* used to limit verbosity +*/
|
||||
enter_time, /*+ of temple entry messages */
|
||||
hostile_time, /* forbidding feeling */
|
||||
peaceful_time; /* sense of peace */
|
||||
};
|
||||
/* note: roaming priests (no shrine) switch from ispriest to isminion
|
||||
(and emin extension) */
|
||||
@@ -99,44 +103,44 @@ struct epri {
|
||||
/***
|
||||
** formerly eshk.h -- shopkeeper extension
|
||||
*/
|
||||
#define REPAIR_DELAY 5 /* minimum delay between shop damage & repair */
|
||||
#define BILLSZ 200
|
||||
#define REPAIR_DELAY 5 /* minimum delay between shop damage & repair */
|
||||
#define BILLSZ 200
|
||||
|
||||
struct bill_x {
|
||||
unsigned bo_id;
|
||||
boolean useup;
|
||||
long price; /* price per unit */
|
||||
long bquan; /* amount used up */
|
||||
unsigned bo_id;
|
||||
boolean useup;
|
||||
long price; /* price per unit */
|
||||
long bquan; /* amount used up */
|
||||
};
|
||||
|
||||
struct eshk {
|
||||
long robbed; /* amount stolen by most recent customer */
|
||||
long credit; /* amount credited to customer */
|
||||
long debit; /* amount of debt for using unpaid items */
|
||||
long loan; /* shop-gold picked (part of debit) */
|
||||
int shoptype; /* the value of rooms[shoproom].rtype */
|
||||
schar shoproom; /* index in rooms; set by inshop() */
|
||||
schar unused; /* to force alignment for stupid compilers */
|
||||
boolean following; /* following customer since he owes us sth */
|
||||
boolean surcharge; /* angry shk inflates prices */
|
||||
boolean dismiss_kops; /* pacified shk sends kops away */
|
||||
coord shk; /* usual position shopkeeper */
|
||||
coord shd; /* position shop door */
|
||||
d_level shoplevel; /* level (& dungeon) of his shop */
|
||||
int billct; /* no. of entries of bill[] in use */
|
||||
struct bill_x bill[BILLSZ];
|
||||
struct bill_x *bill_p;
|
||||
int visitct; /* nr of visits by most recent customer */
|
||||
char customer[PL_NSIZ]; /* most recent customer */
|
||||
char shknam[PL_NSIZ];
|
||||
long robbed; /* amount stolen by most recent customer */
|
||||
long credit; /* amount credited to customer */
|
||||
long debit; /* amount of debt for using unpaid items */
|
||||
long loan; /* shop-gold picked (part of debit) */
|
||||
int shoptype; /* the value of rooms[shoproom].rtype */
|
||||
schar shoproom; /* index in rooms; set by inshop() */
|
||||
schar unused; /* to force alignment for stupid compilers */
|
||||
boolean following; /* following customer since he owes us sth */
|
||||
boolean surcharge; /* angry shk inflates prices */
|
||||
boolean dismiss_kops; /* pacified shk sends kops away */
|
||||
coord shk; /* usual position shopkeeper */
|
||||
coord shd; /* position shop door */
|
||||
d_level shoplevel; /* level (& dungeon) of his shop */
|
||||
int billct; /* no. of entries of bill[] in use */
|
||||
struct bill_x bill[BILLSZ];
|
||||
struct bill_x *bill_p;
|
||||
int visitct; /* nr of visits by most recent customer */
|
||||
char customer[PL_NSIZ]; /* most recent customer */
|
||||
char shknam[PL_NSIZ];
|
||||
};
|
||||
|
||||
/***
|
||||
** formerly emin.h -- minion extension
|
||||
*/
|
||||
struct emin {
|
||||
aligntyp min_align; /* alignment of minion */
|
||||
boolean renegade; /* hostile co-aligned priest or Angel */
|
||||
aligntyp min_align; /* alignment of minion */
|
||||
boolean renegade; /* hostile co-aligned priest or Angel */
|
||||
};
|
||||
|
||||
/***
|
||||
@@ -147,46 +151,46 @@ struct emin {
|
||||
#define CADAVER 1
|
||||
#define ACCFOOD 2
|
||||
#define MANFOOD 3
|
||||
#define APPORT 4
|
||||
#define POISON 5
|
||||
#define UNDEF 6
|
||||
#define TABU 7
|
||||
#define APPORT 4
|
||||
#define POISON 5
|
||||
#define UNDEF 6
|
||||
#define TABU 7
|
||||
|
||||
struct edog {
|
||||
long droptime; /* moment dog dropped object */
|
||||
unsigned dropdist; /* dist of drpped obj from @ */
|
||||
int apport; /* amount of training */
|
||||
long whistletime; /* last time he whistled */
|
||||
long hungrytime; /* will get hungry at this time */
|
||||
coord ogoal; /* previous goal location */
|
||||
int abuse; /* track abuses to this pet */
|
||||
int revivals; /* count pet deaths */
|
||||
int mhpmax_penalty; /* while starving, points reduced */
|
||||
Bitfield(killed_by_u, 1); /* you attempted to kill him */
|
||||
long droptime; /* moment dog dropped object */
|
||||
unsigned dropdist; /* dist of drpped obj from @ */
|
||||
int apport; /* amount of training */
|
||||
long whistletime; /* last time he whistled */
|
||||
long hungrytime; /* will get hungry at this time */
|
||||
coord ogoal; /* previous goal location */
|
||||
int abuse; /* track abuses to this pet */
|
||||
int revivals; /* count pet deaths */
|
||||
int mhpmax_penalty; /* while starving, points reduced */
|
||||
Bitfield(killed_by_u, 1); /* you attempted to kill him */
|
||||
};
|
||||
|
||||
/***
|
||||
** mextra.h -- collection of all monster extensions
|
||||
*/
|
||||
struct mextra {
|
||||
char *mname;
|
||||
struct egd *egd;
|
||||
struct epri *epri;
|
||||
struct eshk *eshk;
|
||||
struct emin *emin;
|
||||
struct edog *edog;
|
||||
int mcorpsenm; /* obj->corpsenm for mimic posing as statue or corpse */
|
||||
char *mname;
|
||||
struct egd *egd;
|
||||
struct epri *epri;
|
||||
struct eshk *eshk;
|
||||
struct emin *emin;
|
||||
struct edog *edog;
|
||||
int mcorpsenm; /* obj->corpsenm for mimic posing as statue or corpse */
|
||||
};
|
||||
|
||||
#define MNAME(mon) ((mon)->mextra->mname)
|
||||
#define EGD(mon) ((mon)->mextra->egd)
|
||||
#define EPRI(mon) ((mon)->mextra->epri)
|
||||
#define ESHK(mon) ((mon)->mextra->eshk)
|
||||
#define EMIN(mon) ((mon)->mextra->emin)
|
||||
#define EDOG(mon) ((mon)->mextra->edog)
|
||||
#define MCORPSENM(mon) ((mon)->mextra->mcorpsenm)
|
||||
#define MNAME(mon) ((mon)->mextra->mname)
|
||||
#define EGD(mon) ((mon)->mextra->egd)
|
||||
#define EPRI(mon) ((mon)->mextra->epri)
|
||||
#define ESHK(mon) ((mon)->mextra->eshk)
|
||||
#define EMIN(mon) ((mon)->mextra->emin)
|
||||
#define EDOG(mon) ((mon)->mextra->edog)
|
||||
#define MCORPSENM(mon) ((mon)->mextra->mcorpsenm)
|
||||
|
||||
#define has_mname(mon) ((mon)->mextra && MNAME(mon))
|
||||
#define has_mname(mon) ((mon)->mextra && MNAME(mon))
|
||||
#define has_mcorpsenm(mon) ((mon)->mextra && MCORPSENM(mon) != NON_PM)
|
||||
|
||||
#endif /* MEXTRA_H */
|
||||
|
||||
Reference in New Issue
Block a user