From: Eric S. Raymond Date: Thu, 28 Sep 2006 08:20:52 +0000 (+0000) Subject: Change some ugly and misleading names. X-Git-Tag: 2.0~191 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=2e04509ec9be1e3ad2a1f8a7e84552d6896f89ab;p=super-star-trek.git Change some ugly and misleading names. --- diff --git a/src/ai.c b/src/ai.c index 99024df..1ea8cfa 100644 --- 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) diff --git a/src/battle.c b/src/battle.c index 387bfa9..3f3accd 100644 --- a/src/battle.c +++ b/src/battle.c @@ -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)) diff --git a/src/events.c b/src/events.c index 3a93a84..746911a 100644 --- a/src/events.c +++ b/src/events.c @@ -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 */ diff --git a/src/moving.c b/src/moving.c index 44a4945..b68c78b 100644 --- a/src/moving.c +++ b/src/moving.c @@ -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!")); diff --git a/src/planets.c b/src/planets.c index 2a68878..215a50c 100644 --- a/src/planets.c +++ b/src/planets.c @@ -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.")); diff --git a/src/reports.c b/src/reports.c index 93a525d..f273cff 100644 --- a/src/reports.c +++ b/src/reports.c @@ -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")); diff --git a/src/setup.c b/src/setup.c index 8963b6c..1948b8a 100644 --- a/src/setup.c +++ b/src/setup.c @@ -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); diff --git a/src/sst.h b/src/sst.h index f9676f8..ce4c679 100644 --- 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); diff --git a/src/sst.py b/src/sst.py index 477c05a..2ad0241 100644 --- a/src/sst.py +++ b/src/sst.py @@ -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":