Updating dunbash.h
authorfluffymormegil <mpread@chiark.greenend.org.uk>
Fri, 16 Mar 2012 17:19:06 +0000 (17:19 +0000)
committerfluffymormegil <mpread@chiark.greenend.org.uk>
Fri, 16 Mar 2012 17:19:06 +0000 (17:19 +0000)
dunbash.h

index 9881353..df2a25b 100644 (file)
--- a/dunbash.h
+++ b/dunbash.h
@@ -28,6 +28,7 @@
 #define DUNBASH_H
 
 #include <stdlib.h>
+#include <stdint.h>
 #include <stdio.h>
 
 /* change WIZARD_MODE to 1 if you want the wizard mode commands. */
@@ -50,7 +51,7 @@ enum game_cmd {
     TAKE_OFF_ARMOUR, PUT_ON_RING, REMOVE_RING, GIVE_HELP,
     ATTACK, GET_ITEM, QUIT, GO_DOWN_STAIRS, STAND_STILL, EAT_FOOD,
     DUMP_CHARA, INSPECT_ITEM, EXAMINE_MONSTER, RNG_TEST, SHOW_TERRAIN,
-    SHOW_DISCOVERIES, WIZARD_LEVELUP, WIZARD_DESCEND
+    WIZARD_LEVELUP, WIZARD_DESCEND
 };
 
 /* XXX enum terrain_num */
@@ -100,7 +101,7 @@ struct player {
     int withering;     /* Vile withering curse */
     int armourmelt;    /* Armour-like-dust curse */
     int speed;
-    unsigned int resistances[DT_COUNT];        /* Resistances to damage types. */
+    uint32_t resistances[DT_COUNT];    /* Resistances to damage types. */
     int level; /* Each level gets you +1 body, +1 agility, +1 random
                   point, and +(10+body/10) hit points */
     int gold;
@@ -252,8 +253,6 @@ struct permobj {
     int power; /* AC for armour; damage for weapons; colour/title for
                 * scrolls and potions and rings and such. */
     int used;  /* Set to 1 for valid entries. */
-    int known; /* Set to 1 for items recognised at startup. Updated
-                * during play when items identified. */
     int depth; /* If greater than 1, this item cannot be given out
                 * by get_random_pobj() before the specified depth. */
 };
@@ -274,6 +273,7 @@ struct mon {
     int mdam;  /* Improved by OOD rating at 1:5. */
     int rdam;  /* Improved by OOD rating at 1:5. */
     int awake;
+    int next_summon;
 };
 
 /* XXX struct obj */
@@ -292,10 +292,8 @@ struct obj {
 #define NUM_OF_PERMOBJS 300
 extern struct permobj permobjs[NUM_OF_PERMOBJS];
 
-/* Treasure generation limit plus inventory limit means this should be
- * enough.  When I evolve to the "fully-fledged" version, I'll use a Tatham
- * tree instead. */
-extern struct mon monsters[100];
+#define MONSTERS_IN_PLAY 100
+extern struct mon monsters[MONSTERS_IN_PLAY];
 
 /* XXX display.c data and funcs */
 extern int read_input(char *buffer, int length);
@@ -330,7 +328,7 @@ extern int one_die(int sides);      /* 1..n */
 extern int dice(int count, int sides);
 extern int zero_die(int sides);        /* 0..n-1 */
 extern int do_command(enum game_cmd command);
-extern unsigned int convert_range(int dy, int dx);
+extern uint32_t convert_range(int dy, int dx);
 extern int game_finished;
 extern int game_tick;
 extern int wizard_mode;
@@ -374,7 +372,8 @@ extern int create_obj(int po_idx, int quantity, int with_you, int y, int x);
 extern int drop_obj(int inv_idx);
 extern int create_obj_class(enum poclass_num pocl, int quantity, int with_you, int y, int x);
 extern int create_obj_random(int y, int x);
-extern struct obj objects[100];        /* SHould be enough. */
+#define OBJECTS_IN_PLAY 100
+extern struct obj objects[OBJECTS_IN_PLAY];
 extern int read_scroll(int obj);
 extern int quaff_potion(int obj);
 extern int eat_food(int obj);
@@ -391,9 +390,9 @@ extern struct permon permons[NUM_OF_PERMONS];
 
 /* XXX rng.c data and funcs */
 #define RNG_MAX 0xFFFFFFFFu
-extern unsigned int rng_state[5];
-extern unsigned int saved_state[5];
-extern unsigned int rng(void);
+extern uint32_t rng_state[5];
+extern uint32_t saved_state[5];
+extern uint32_t rng(void);
 extern void rng_init(void);
 
 /* XXX vector.c data and funcs */