polywarn (trunk only)
This patch increments editlevel making existing save and bones files useless. Add polywarn() code to grant the ability to detect certain monster types while polymorphed into other specific monster types. If you polymorph into a vampire or vampire lord, you are able to sense humans. And just for fun, if you polymorph into a purple worm, you are able to sense shriekers :-)
This commit is contained in:
@@ -65,8 +65,14 @@ struct victual_info {
|
||||
Bitfield(doreset,1); /* stop eating at end of turn */
|
||||
};
|
||||
|
||||
struct warntype_info {
|
||||
unsigned long obj; /* object warn_of_mon monster type M2 */
|
||||
unsigned long polyd; /* warn_of_mon monster type M2 due to poly */
|
||||
struct permonst *species; /* particular species due to poly */
|
||||
short speciesidx; /* index of above in mons[] (for save/restore) */
|
||||
};
|
||||
|
||||
struct context_info {
|
||||
unsigned long warntype; /* warn_of_mon monster type M2 */
|
||||
unsigned ident; /* social security number for each monster */
|
||||
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
|
||||
unsigned run; /* 0: h (etc), 1: H (etc), 2: fh (etc) */
|
||||
@@ -94,6 +100,7 @@ struct context_info {
|
||||
struct tin_info tin;
|
||||
struct book_info spbook;
|
||||
struct takeoff_info takeoff;
|
||||
struct warntype_info warntype;
|
||||
};
|
||||
|
||||
extern NEARDATA struct context_info context;
|
||||
|
||||
@@ -101,8 +101,13 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
|
||||
#define FLASHED_LIGHT 3
|
||||
#define INVIS_BEAM 4
|
||||
|
||||
#define MATCH_WARN_OF_MON(mon) (Warn_of_mon && context.warntype && \
|
||||
(context.warntype & (mon)->data->mflags2))
|
||||
#define MATCH_WARN_OF_MON(mon) (Warn_of_mon && \
|
||||
((context.warntype.obj && \
|
||||
(context.warntype.obj & (mon)->data->mflags2)) || \
|
||||
(context.warntype.polyd && \
|
||||
(context.warntype.polyd & (mon)->data->mflags2)) || \
|
||||
(context.warntype.species && \
|
||||
(context.warntype.species == (mon)->data))))
|
||||
|
||||
#include "trap.h"
|
||||
#include "flag.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||
* and save files.
|
||||
*/
|
||||
#define EDITLEVEL 10
|
||||
#define EDITLEVEL 11
|
||||
|
||||
#define COPYRIGHT_BANNER_A \
|
||||
"NetHack, Copyright 1985-2004"
|
||||
|
||||
Reference in New Issue
Block a user