Abstract all references to the future array (outside of events.c) away.
[super-star-trek.git] / src / sst.h
index 7e7d1d30dd0e9067e334a7df1f9f255c9a4de56b..8e6e7c458cce3670ebda4916b1d2f27a1e88711f 100644 (file)
--- a/src/sst.h
+++ b/src/sst.h
@@ -4,6 +4,8 @@
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
+#include <locale.h>
+#include <libintl.h>
 #include <curses.h>
 
 #ifdef DATA_DIR
@@ -12,6 +14,8 @@
 #define SSTDOC DOC_NAME
 #endif
 
+#define _(str) gettext(str)
+
 #define min(x, y)      ((x)<(y)?(x):(y))
 #define max(x, y)      ((x)>(y)?(x):(y))
 
@@ -68,7 +72,7 @@ typedef struct {
        double date,            // stardate
            remres,             // remaining resources
            remtime;            // remaining time
-    struct {
+    struct quadrant {
        int stars;
        planet *planet;
        int starbase;
@@ -76,6 +80,9 @@ typedef struct {
        int romulans;
        int supernova;
        int charted;
+#ifdef EXPERIMENTAL
+       enum {secure, distressed, enslaved} status;
+#endif /* EXPERIMENTAL */
     } galaxy[GALSIZE+1][GALSIZE+1];    // The Galaxy (subscript 0 not used)
     struct {
        int stars;
@@ -148,7 +155,28 @@ typedef struct {
 #define FSCMOVE 6   // Supercommander moves (might attack base)
 #define FSCDBAS 7   // Supercommander destroys base
 #define FDSPROB 8   // Move deep space probe
+#ifndef EXPERIMENTAL
 #define NEVENTS (9)
+#else /* EXPERIMENTAL */
+#define FDISTR 9   // Emit distress call from an inhabited world 
+#define FENSLV 10  // Inhabited word is enslaved */
+#define FREPRO 11  // Klingons build a ship in an enslaved system
+#define NEVENTS (12)
+#endif /* EXPERIMENTAL */
+
+/*
+ * abstract out the event handling -- underlying data structures will change
+ * when we implement stateful events
+ */
+extern void unschedule(int);
+extern int is_scheduled(int);
+extern void schedule(int, double);
+extern void postpone(int, double);
+extern double scheduled(int);
+
+#ifdef EXPERIMENTAL
+#define        MAXDISTR        5       /* maximum concurrent distress calls */
+#endif /* EXPERIMENTAL */
 
 #define SSTMAGIC       "SST2.0\n"
 
@@ -224,6 +252,9 @@ struct game {
        ithx,           // coordinates of Tholian
        ithy,           //
        iseenit,        // seen base attack report
+#ifdef EXPERIMENTAL
+       ndistr,         //* count of distress calls */ 
+#endif /* EXPERIMENTAL */
        probecx,        // current probe quadrant
        probecy,        //
        proben,         // number of moves for probe
@@ -285,6 +316,7 @@ enum loctype {neither, quadrant, sector};
 #define IHS 'S'
 #define IHSTAR '*'
 #define IHP 'P'
+#define IHW '@'
 #define IHB 'B'
 #define IHBLANK ' '
 #define IHDOT '.'
@@ -326,7 +358,7 @@ void setwrp(void);
 void events(void);
 void report(void);
 void eta(void);
-void help(void);
+void mayday(void);
 void abandn(void);
 void finish(FINTYPE);
 void dstrct(void);
@@ -396,6 +428,7 @@ void commandhook(char *, int);
 void makechart(void);
 void enqueue(char *);
 char *systemname(planet *);
+void newkling(int, int *, int *);
 
 /* mode arguments for srscan() */
 #define SCAN_FULL              1