Change some ugly and misleading names.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 28 Sep 2006 08:20:52 +0000 (08:20 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 28 Sep 2006 08:20:52 +0000 (08:20 +0000)
src/ai.c
src/battle.c
src/events.c
src/moving.c
src/planets.c
src/reports.c
src/setup.c
src/sst.h
src/sst.py

index 99024df9acddcd8b0c05c7ae222de6fad5ee2f9d..1ea8cfa288b329569b8a69a274067be432084ebc 100644 (file)
--- a/src/ai.c
+++ b/src/ai.c
@@ -267,7 +267,7 @@ static void movebaddy(coord com, int loccom, feature ienm)
     }
 }
 
-void movcom(void) 
+void moveklings(void) 
 /* move a commander */
 {
     coord w; 
@@ -351,10 +351,10 @@ static bool movescom(coord iq, bool flag, bool *ipage)
     }
     /* check for a helpful planet */
     for (i = 0; i < game.inplan; i++) {
-       if (same(game.state.plnets[i].w, game.state.kscmdr) &&
-           game.state.plnets[i].crystals == present) {
+       if (same(game.state.planets[i].w, game.state.kscmdr) &&
+           game.state.planets[i].crystals == present) {
            /* destroy the planet */
-           DESTROY(&game.state.plnets[i]);
+           DESTROY(&game.state.planets[i]);
            game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].planet = NOPLANET;
            if (!damaged(DRADIO) || game.condition == docked) {
                if (!*ipage)
index 387bfa9f88449353b2b5f7bc321669981a0adf45..3f3accdc830832195953156a69630264feb385a0 100644 (file)
@@ -399,7 +399,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
            prout(_(" destroyed."));
            game.state.nplankl++;
            q->planet = NOPLANET;
-           DESTROY(&game.state.plnets[game.iplnet]);
+           DESTROY(&game.state.planets[game.iplnet]);
            game.iplnet = 0;
            invalidate(game.plnet);
            game.quad[w.x][w.y] = IHDOT;
@@ -413,7 +413,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n)
            prout(_(" destroyed."));
            game.state.nworldkl++;
            q->planet = NOPLANET;
-           DESTROY(&game.state.plnets[game.iplnet]);
+           DESTROY(&game.state.planets[game.iplnet]);
            game.iplnet = 0;
            invalidate(game.plnet);
            game.quad[w.x][w.y] = IHDOT;
@@ -579,7 +579,7 @@ void attack(bool torps_ok)
 
     /* commanders get a chance to tac-move towards you */
     if ((((game.comhere || game.ishere) && !game.justin) || game.skill == SKILL_EMERITUS) && torps_ok) 
-       movcom();
+       moveklings();
 
     /* if no enemies remain after movement, we're done */
     if (game.nenhere==0 || (game.nenhere==1 && iqhere && !iqengry)) 
index 3a93a84cf0320c7c85d062e79e80624efb959084..746911a3b9ff60071eb4bb4b16c535ee4df7f325 100644 (file)
@@ -701,7 +701,7 @@ void nova(coord nov)
                        game.state.nplankl++;
                        crmena(true, IHP, sector, scratch);
                        prout(_(" destroyed."));
-                       DESTROY(&game.state.plnets[game.iplnet]);
+                       DESTROY(&game.state.planets[game.iplnet]);
                        game.iplnet = 0;
                        invalidate(game.plnet);
                        if (game.landed) {
@@ -931,8 +931,8 @@ void snova(bool induced, coord *w)
     if (npdead) {
        int loop;
        for (loop = 0; loop < game.inplan; loop++)
-           if (same(game.state.plnets[loop].w, nq)) {
-               DESTROY(&game.state.plnets[loop]);
+           if (same(game.state.planets[loop].w, nq)) {
+               DESTROY(&game.state.planets[loop]);
            }
     }
     /* Destroy any base in supernovaed quadrant */
index 44a4945040bf8c006f255cf84b19f1188964a2be..b68c78be3f8ee291f75ce496a76a6cae44a185b3 100644 (file)
@@ -823,7 +823,7 @@ void timwrp()
           when on planet, which would give us two Galileos! */
        gotit = false;
        for (l = 0; l < game.inplan; l++) {
-           if (game.state.plnets[l].known == shuttle_down) {
+           if (game.state.planets[l].known == shuttle_down) {
                gotit = true;
                if (game.iscraft == onship && game.ship==IHE) {
                    prout(_("Checkov-  \"Security reports the Galileo has disappeared, Sir!"));
index 2a68878e633ed0c8211eeebcf6153175fe7265c3..215a50c49e549388b46eb819704cb58ac1341d94 100644 (file)
@@ -22,21 +22,21 @@ void preport(void)
     prout(_("Spock-  \"Planet report follows, Captain.\""));
     skip(1);
     for (i = 0; i < game.inplan; i++) {
-       if ((game.state.plnets[i].known != unknown
-           && game.state.plnets[i].inhabited == UNINHABITED)
-           || (idebug && game.state.plnets[i].w.x !=0)
+       if ((game.state.planets[i].known != unknown
+           && game.state.planets[i].inhabited == UNINHABITED)
+           || (idebug && game.state.planets[i].w.x !=0)
            ) {
            iknow = true;
-           if (idebug && game.state.plnets[i].known==unknown)
+           if (idebug && game.state.planets[i].known==unknown)
                proutn("(Unknown) ");
-           proutn(cramlc(quadrant, game.state.plnets[i].w));
+           proutn(cramlc(quadrant, game.state.planets[i].w));
            proutn(_("   class "));
-           proutn(classes[game.state.plnets[i].pclass]);
+           proutn(classes[game.state.planets[i].pclass]);
            proutn("   ");
-           if (game.state.plnets[i].crystals != present)
+           if (game.state.planets[i].crystals != present)
                proutn(_("no "));
            prout(_("dilithium crystals present."));
-           if (game.state.plnets[i].known==shuttle_down) 
+           if (game.state.planets[i].known==shuttle_down) 
                prout(_("    Shuttle Craft Galileo on surface."));
        }
     }
@@ -87,20 +87,20 @@ void sensor(void)
        prout(_("Spock- \"No planet in this quadrant, Captain.\""));
        return;
     }
-    if ((game.plnet.x != 0)&& (game.state.plnets[game.iplnet].known == unknown)) {
+    if ((game.plnet.x != 0)&& (game.state.planets[game.iplnet].known == unknown)) {
        prout(_("Spock-  \"Sensor scan for %s-"), cramlc(quadrant, game.quadrant));
        skip(1);
        prout(_("         Planet at %s is of class %s."),
              cramlc(sector,game.plnet),
-             classes[game.state.plnets[game.iplnet].pclass]);
-       if (game.state.plnets[game.iplnet].known==shuttle_down) 
+             classes[game.state.planets[game.iplnet].pclass]);
+       if (game.state.planets[game.iplnet].known==shuttle_down) 
            prout(_("         Sensors show Galileo still on surface."));
        proutn(_("         Readings indicate"));
-       if (game.state.plnets[game.iplnet].crystals != present)
+       if (game.state.planets[game.iplnet].crystals != present)
            proutn(_(" no"));
        prout(_(" dilithium crystals present.\""));
-       if (game.state.plnets[game.iplnet].known == unknown)
-           game.state.plnets[game.iplnet].known = known;
+       if (game.state.planets[game.iplnet].known == unknown)
+           game.state.planets[game.iplnet].known = known;
     }
 }
 
@@ -111,7 +111,7 @@ void beam(void)
     skip(1);
     if (damaged(DTRANSP)) {
        prout(_("Transporter damaged."));
-       if (!damaged(DSHUTTL) && (game.state.plnets[game.iplnet].known==shuttle_down || game.iscraft == onship)) {
+       if (!damaged(DSHUTTL) && (game.state.planets[game.iplnet].known==shuttle_down || game.iscraft == onship)) {
            skip(1);
            proutn(_("Spock-  \"May I suggest the shuttle craft, Sir?\" "));
            if (ja() == true)
@@ -128,7 +128,7 @@ void beam(void)
        prout(_("Impossible to transport through shields."));
        return;
     }
-    if (game.state.plnets[game.iplnet].known==unknown) {
+    if (game.state.planets[game.iplnet].known==unknown) {
        prout(_("Spock-  \"Captain, we have no information on this planet"));
        prout(_("  and Starfleet Regulations clearly state that in this situation"));
        prout(_("  you may not go down.\""));
@@ -136,7 +136,7 @@ void beam(void)
     }
     if (game.landed) {
        /* Coming from planet */
-       if (game.state.plnets[game.iplnet].known==shuttle_down) {
+       if (game.state.planets[game.iplnet].known==shuttle_down) {
            proutn(_("Spock-  \"Wouldn't you rather take the Galileo?\" "));
            if (ja() == true) {
                chew();
@@ -153,7 +153,7 @@ void beam(void)
     }
     else {
        /* Going to planet */
-       if (game.state.plnets[game.iplnet].crystals==absent) {
+       if (game.state.planets[game.iplnet].crystals==absent) {
            prout(_("Spock-  \"Captain, I fail to see the logic in"));
            prout(_("  exploring a planet with no dilithium crystals."));
            proutn(_("  Are you sure this is wise?\" "));
@@ -183,7 +183,7 @@ void beam(void)
     skip(2);
     prout(_("Transport complete."));
     game.landed = !game.landed;
-    if (game.landed && game.state.plnets[game.iplnet].known==shuttle_down) {
+    if (game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
        prout(_("The shuttle craft Galileo is here!"));
     }
     if (!game.landed && game.imine) {
@@ -203,11 +203,11 @@ void mine(void)
        prout(_("Mining party not on planet."));
        return;
     }
-    if (game.state.plnets[game.iplnet].crystals == mined) {
+    if (game.state.planets[game.iplnet].crystals == mined) {
        prout(_("This planet has already been strip-mined for dilithium."));
        return;
     }
-    else if (game.state.plnets[game.iplnet].crystals == absent) {
+    else if (game.state.planets[game.iplnet].crystals == absent) {
        prout(_("No dilithium crystals on this planet."));
        return;
     }
@@ -222,11 +222,11 @@ void mine(void)
        prout(_("there's no reason to mine more at this time."));
        return;
     }
-    game.optime = (0.1+0.2*Rand())*game.state.plnets[game.iplnet].pclass;
+    game.optime = (0.1+0.2*Rand())*game.state.planets[game.iplnet].pclass;
     if (consumeTime())
        return;
     prout(_("Mining operation complete."));
-    game.state.plnets[game.iplnet].crystals = mined;
+    game.state.planets[game.iplnet].crystals = mined;
     game.imine = game.ididit = true;
 }
 
@@ -289,7 +289,7 @@ void shuttle(void)
     skip(1);
     if(damaged(DSHUTTL)) {
        if (game.damage[DSHUTTL] == -1.0) {
-           if (game.inorbit && game.state.plnets[game.iplnet].known == shuttle_down)
+           if (game.inorbit && game.state.planets[game.iplnet].known == shuttle_down)
                prout(_("Ye Faerie Queene has no shuttle craft bay to dock it at."));
            else
                prout(_("Ye Faerie Queene had no shuttle craft."));
@@ -305,11 +305,11 @@ void shuttle(void)
        prout(_(" not in standard orbit."));
        return;
     }
-    if ((game.state.plnets[game.iplnet].known != shuttle_down) && game.iscraft != onship) {
+    if ((game.state.planets[game.iplnet].known != shuttle_down) && game.iscraft != onship) {
        prout(_("Shuttle craft not currently available."));
        return;
     }
-    if (!game.landed && game.state.plnets[game.iplnet].known==shuttle_down) {
+    if (!game.landed && game.state.planets[game.iplnet].known==shuttle_down) {
        prout(_("You will have to beam down to retrieve the shuttle craft."));
        return;
     }
@@ -317,7 +317,7 @@ void shuttle(void)
        prout(_("Shuttle craft cannot pass through shields."));
        return;
     }
-    if (game.state.plnets[game.iplnet].known==unknown) {
+    if (game.state.planets[game.iplnet].known==unknown) {
        prout(_("Spock-  \"Captain, we have no information on this planet"));
        prout(_("  and Starfleet Regulations clearly state that in this situation"));
        prout(_("  you may not fly down.\""));
@@ -354,7 +354,7 @@ void shuttle(void)
            skip(1);
            if (consumeTime())
                return;
-           game.state.plnets[game.iplnet].known=shuttle_down;
+           game.state.planets[game.iplnet].known=shuttle_down;
            prout(_("Trip complete."));
            return;
        }
@@ -364,7 +364,7 @@ void shuttle(void)
            prout(_("shuttle craft for the trip back to the Enterprise."));
            skip(1);
            prout(_("The short hop begins . . ."));
-           game.state.plnets[game.iplnet].known=known;
+           game.state.planets[game.iplnet].known=known;
            game.icraft = true;
            skip(1);
            game.landed = false;
@@ -393,7 +393,7 @@ void shuttle(void)
        game.iscraft = offship;
        if (consumeTime())
            return;
-       game.state.plnets[game.iplnet].known = shuttle_down;
+       game.state.planets[game.iplnet].known = shuttle_down;
        game.landed = true;
        game.icraft = false;
        prout(_("Trip complete."));
index 93a525d8abc0bbb1d706b6bb7fc051955e2965eb..f273cffcccd7c086656adde556da8bf090cc560e 100644 (file)
@@ -350,7 +350,7 @@ void status(int req)
     RQ(10,
        if (game.options & OPTION_WORLDS) {
            int plnet = game.state.galaxy[game.quadrant.x][game.quadrant.y].planet;
-           if (plnet != NOPLANET && game.state.plnets[plnet].inhabited != UNINHABITED)
+           if (plnet != NOPLANET && game.state.planets[plnet].inhabited != UNINHABITED)
                prstat(_("Major system"), "%s", systnames[plnet]);
            else
                prout(_("Sector is uninhabited"));
index 8963b6ce383866edb28c38655fcabe4aa35bb2e4..1948b8a90305e452acd075035e80d20a4428f8cf 100644 (file)
@@ -335,17 +335,17 @@ void setup(bool needprompt)
     for (i = 0; i < game.inplan; i++) {
        do w = randplace(GALSIZE); 
        while (game.state.galaxy[w.x][w.y].planet != NOPLANET);
-       game.state.plnets[i].w = w;
+       game.state.planets[i].w = w;
        if (i < NINHAB) {
-           game.state.plnets[i].pclass = M;    // All inhabited planets are class M
-           game.state.plnets[i].crystals = absent;
-           game.state.plnets[i].known = known;
-           game.state.plnets[i].inhabited = i;
+           game.state.planets[i].pclass = M;   // All inhabited planets are class M
+           game.state.planets[i].crystals = absent;
+           game.state.planets[i].known = known;
+           game.state.planets[i].inhabited = i;
        } else {
-           game.state.plnets[i].pclass = Rand()*3.0; // Planet class M N or O
-           game.state.plnets[i].crystals = Rand()*1.5;         // 1 in 3 chance of crystals
-           game.state.plnets[i].known = unknown;
-           game.state.plnets[i].inhabited = UNINHABITED;
+           game.state.planets[i].pclass = Rand()*3.0; // Planet class M N or O
+           game.state.planets[i].crystals = Rand()*1.5;                // 1 in 3 chance of crystals
+           game.state.planets[i].known = unknown;
+           game.state.planets[i].inhabited = UNINHABITED;
        }
        if ((game.options & OPTION_WORLDS) || i >= NINHAB)
            game.state.galaxy[w.x][w.y].planet = i;
@@ -657,7 +657,7 @@ void newqad(bool shutup)
     // If quadrant needs a planet, put it in
     if (q->planet != NOPLANET) {
        game.iplnet = q->planet;
-       if (game.state.plnets[q->planet].inhabited == UNINHABITED)
+       if (game.state.planets[q->planet].inhabited == UNINHABITED)
            game.plnet = dropin(IHP);
        else
            game.plnet = dropin(IHW);
@@ -669,7 +669,7 @@ void newqad(bool shutup)
        dropin(IHSTAR);
 
     // Check for RNZ
-    if (game.irhere > 0 && game.klhere == 0 && (q->planet == NOPLANET || game.state.plnets[q->planet].inhabited == UNINHABITED)) {
+    if (game.irhere > 0 && game.klhere == 0 && (q->planet == NOPLANET || game.state.planets[q->planet].inhabited == UNINHABITED)) {
        game.neutz = true;
        if (!damaged(DRADIO)) {
            skip(1);
index f9676f83cb2813eadf7468594a8e6611c69f6fcb..ce4c6792e345dd260de57a7dea7e67290af92901 100644 (file)
--- a/src/sst.h
+++ b/src/sst.h
@@ -81,8 +81,8 @@ typedef enum {
 } feature;
 
 typedef struct {
-    bool snap;         // snapshot taken
-    int crew,          // crew complement
+    bool snap;                 // snapshot taken
+    int crew,                  // crew complement
 #define FULLCREW       428     /* BSD Trek was 387, that's wrong */
        remkl,                  // remaining klingons
        remcom,                 // remaining commanders
@@ -93,9 +93,9 @@ typedef struct {
        nromrem,                // Romulans remaining
        nplankl,                // destroyed uninhabited planets
        nworldkl;               // destroyed inhabited planets
-    planet plnets[PLNETMAX];  // Planet information
+    planet planets[PLNETMAX];  // Planet information
     double date,               // stardate
-       remres,         // remaining resources
+       remres,                 // remaining resources
        remtime;                // remaining time
     coord baseq[BASEMAX+1];    // Base quadrant coordinates
     coord kcmdr[QUADSIZE+1];   // Commander quadrant coordinates
@@ -403,7 +403,7 @@ void ram(bool, feature, coord);
 void crmena(bool, feature, enum loctype, coord w);
 void deadkl(coord, feature, coord);
 void timwrp(void);
-void movcom(void);
+void moveklings(void);
 void torpedo(double, double, coord, double *, int, int);
 void huh(void);
 void pause_game(bool);
index 477c05ab0765159e13f32b2b0b5b7859f5067514..2ad02411b701b35920fc09269cd8872a03fbbf4f 100644 (file)
@@ -297,7 +297,7 @@ class game:
 
 def communicating():
     "Are we in communication with Starfleet Command?"
-    return (not damaged("DRADIO")) or game.condition == docked
+    return (not damaged("DRADIO")) or game.condition == "docked"
 
 # Code corresponding to ai.c begins here
 
@@ -523,7 +523,7 @@ def movebaddy(ship):
                 prout(" retreats to sector %s" % ship.location)
         ship.sectormove(next)
 
-def movcom(): 
+def moveklings(): 
     "Allow enemies to move."
     for enemy in self.quad.enemies():
         if enemy.type == "Commander":