X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=events.c;h=641b77ad65f325944a9842f0ca345f7a8b052cb9;hb=93ede5b2bb8928b8aa17e750f48e6c5e59b81ab1;hp=c3f22f5d0996b7d0b1d43384c4471e6fba3dbb6e;hpb=2a0411c349010501abd2f907b8965a8ca9b4e80c;p=super-star-trek.git diff --git a/events.c b/events.c index c3f22f5..641b77a 100644 --- a/events.c +++ b/events.c @@ -2,10 +2,8 @@ #include void events(void) { - - int ictbeam=0, ipage=0, istract=0, line, i, j, k, l, ixhold, iyhold; - double fintim = game.state.date + Time, datemin, xtime, repair, yank; - + int ictbeam=0, ipage=0, istract=0, line, i=0, j, k, l, ixhold=0, iyhold=0; + double fintim = game.state.date + Time, datemin, xtime, repair, yank=0; #ifdef DEBUG if (idebug) prout("EVENTS"); @@ -25,7 +23,7 @@ void events(void) { if (alldone) return; datemin = fintim; for (l=1; l<=NEVENTS; l++) - if (game.future[l] <= datemin) { + if (game.future[l] < datemin) { line = l; datemin = game.future[l]; } @@ -64,7 +62,7 @@ void events(void) { for (j=1; j <= 8; j++) if (game.starch[i][j] > 999) game.starch[i][j] = 1; if (iseenit==0) { - attakreport(); + attakreport(0); iseenit = 1; } skip(1); @@ -75,7 +73,7 @@ void events(void) { Time -= xtime; switch (line) { case FSNOVA: /* Supernova */ - if (ipage==0) pause(1); + if (ipage==0) pause_game(1); ipage=1; snova(0,0); game.future[FSNOVA] = game.state.date + expran(0.5*intime); @@ -114,7 +112,7 @@ void events(void) { } /* tractor beaming cases merge here */ yank = sqrt(yank); - if (ipage==0) pause(1); + if (ipage==0) pause_game(1); ipage=1; Time = (10.0/(7.5*7.5))*yank; /* 7.5 is yank rate (warp 7.5) */ ictbeam = 1; @@ -170,6 +168,7 @@ void events(void) { newqad(0); /* Adjust finish time to time of tractor beaming */ fintim = game.state.date+Time; + attack(0); if (game.state.remcom <= 0) game.future[FTBEAM] = 1e30; else game.future[FTBEAM] = game.state.date+Time+expran(1.5*intime/game.state.remcom); break; @@ -212,18 +211,18 @@ void events(void) { if (game.damage[DRADIO] != 0.0 && condit != IHDOCKED) break; /* No warning :-( */ iseenit = 1; - if (ipage==0) pause(1); + if (ipage==0) pause_game(1); ipage = 1; skip(1); proutn("Lt. Uhura- \"Captain, the starbase in "); prout(cramlc(quadrant, batx, baty)); - prout(" reports that it is under atttack and that it can"); + prout(" reports that it is under attack and that it can"); proutn(" hold out only until stardate %d", (int)game.future[FCDBAS]); prout(".\""); if (resting) { skip(1); - proutn("Mr. Spock- \"Captain, shall we cancel the rest period?\""); + proutn("Mr. Spock- \"Captain, shall we cancel the rest period?\" "); if (ja()) { resting = 0; Time = 0.0; @@ -267,7 +266,7 @@ void events(void) { else if (game.state.rembase != 1 && (game.damage[DRADIO] <= 0.0 || condit == IHDOCKED)) { /* Get word via subspace radio */ - if (ipage==0) pause(1); + if (ipage==0) pause_game(1); ipage = 1; skip(1); prout("Lt. Uhura- \"Captain, Starfleet Command reports that"); @@ -314,7 +313,7 @@ void events(void) { game.state.galaxy[probecx][probecy] == 1000) { // Left galaxy or ran into supernova if (game.damage[DRADIO]==0.0 || condit == IHDOCKED) { - if (ipage==0) pause(1); + if (ipage==0) pause_game(1); ipage = 1; skip(1); proutn("Lt. Uhura- \"The deep space probe "); @@ -328,7 +327,7 @@ void events(void) { break; } if (game.damage[DRADIO]==0.0 || condit == IHDOCKED) { - if (ipage==0) pause(1); + if (ipage==0) pause_game(1); ipage = 1; skip(1); proutn("Lt. Uhura- \"The deep space probe is now in "); @@ -373,7 +372,7 @@ void wait(void) { origTime = delay = aaitem; if (delay <= 0.0) return; if (delay >= game.state.remtime || nenhere != 0) { - prout("Are you sure? "); + proutn("Are you sure? "); if (ja() == 0) return; } @@ -394,7 +393,6 @@ void wait(void) { Time = temp; } if (Time < delay) attack(0); - if (nenhere==0) movetho(); if (alldone) return; events(); ididit = 1; @@ -412,7 +410,7 @@ void wait(void) { void nova(int ix, int iy) { static double course[] = {0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5}; - int bot, top, top2, burst, hits[11][3], kount, icx, icy, mm, nn, j; + int bot, top, top2, hits[11][3], kount, icx, icy, mm, nn, j; int iquad, iquad1, i, ll, newcx, newcy, ii, jj; if (Rand() < 0.05) { /* Wow! We've supernova'ed */ @@ -580,14 +578,14 @@ void nova(int ix, int iy) { skip(1); prout("Force of nova displaces starship."); iattak=2; /* Eliminates recursion problem */ - move(); + imove(); Time = 10.0*dist/16.0; return; } void snova(int insx, int insy) { - int comdead, nqx, nqy, nsx, nsy, num, kldead, iscdead; + int comdead, nqx=0, nqy=0, nsx, nsy, num, kldead, iscdead; int nrmdead, npdead; int insipient=0; @@ -635,7 +633,7 @@ void snova(int insx, int insy) { if (game.damage[DRADIO] == 0.0 || condit == IHDOCKED) { skip(1); prout("Message from Starfleet Command Stardate %.2f", game.state.date); - proutn(" Supernova in %s; caution advised.", + prout(" Supernova in %s; caution advised.", cramlc(quadrant, nqx, nqy)); } }