X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.c;h=8d30bde57ded84a318f15e690932dad7359a5020;hb=9c0363af79ae8a6218a031cb37750d89e76f2cbb;hp=f6b21c7c2be6c419ee4446bcaae68672649a8084;hpb=5952a98d5a83ad6ed9dfe7821ed427504f280af1;p=super-star-trek.git diff --git a/sst.c b/sst.c index f6b21c7..8d30bde 100644 --- a/sst.c +++ b/sst.c @@ -87,10 +87,15 @@ Here are Stas Sergeev's changes: Eric Raymond's changes: + Mainly, I translated this C code out of FORTRAN into C -- created #defines + for a lot of magic numbers. + 1. "sos" and "call" becomes "mayday", "freeze" and "save" are both good. 2. Status report now indicates when dilithium crystals are on board. + 3. Can now report starbases left in scrscan. + */ /* the input queue */ @@ -367,7 +372,7 @@ static void makemoves(void) { score(); break; case SENSORS: // sensors - sensor(); + sensor(TRUE); break; case ORBIT: // orbit orbit(); @@ -418,7 +423,7 @@ static void makemoves(void) { case SAVE: // Save Game freeze(FALSE); clrscr(); - if (skill > 3) + if (skill > SKILL_GOOD) prout("WARNING--Saved games produce no plaques!"); break; case DEATHRAY: // Try a desparation measure @@ -454,14 +459,14 @@ static void makemoves(void) { events(); if (alldone) break; // Events did us in } - if (game.state.galaxy[quadx][quady] == 1000) { // Galaxy went Nova! + if (game.state.galaxy[quadx][quady] == SUPERNOVA_PLACE) { // Galaxy went Nova! atover(0); continue; } if (hitme && justin==0) { attack(2); if (alldone) break; - if (game.state.galaxy[quadx][quady] == 1000) { // went NOVA! + if (game.state.galaxy[quadx][quady] == SUPERNOVA_PLACE) { // went NOVA! atover(0); hitme = TRUE; continue; @@ -586,14 +591,9 @@ double Rand(void) { return rand()/(1.0 + (double)RAND_MAX); } -void iran8(int *i, int *j) { - *i = Rand()*8.0 + 1.0; - *j = Rand()*8.0 + 1.0; -} - -void iran10(int *i, int *j) { - *i = Rand()*10.0 + 1.0; - *j = Rand()*10.0 + 1.0; +void iran(int size, int *i, int *j) { + *i = Rand()*(size*1.0) + 1.0; + *j = Rand()*(size*1.0) + 1.0; } void chew(void) {