+#include <unistd.h>\r
#include "sst.h"\r
\r
static void getcd(int, int);\r
\r
-void move(void) {\r
+void imove(void) {\r
double angle, deltax, deltay, bigger, x, y,\r
- finald, finalx, finaly, stopegy;\r
- int trbeam = 0, n, l, ix, iy, kink, kinks, iquad;\r
+ finald, finalx, finaly, stopegy, probf;\r
+ int trbeam = 0, n, l, ix=0, iy=0, kink, kinks, iquad;\r
\r
if (inorbit) {\r
prout("Helmsman Sulu- \"Leaving standard orbit.\"");\r
quady = (iy+9)/10;\r
sectx = ix - 10*(quadx-1);\r
secty = iy - 10*(quady-1);\r
- prout("");\r
- prout("Entering %s.",\r
+ proutn("\n\rEntering %s.",\r
cramlc(quadrant, quadx, quady));\r
game.quad[sectx][secty] = ship;\r
newqad(0);\r
+ if (skill>1) attack(0);\r
return;\r
}\r
iquad = game.quad[ix][iy];\r
case IHC:\r
case IHS:\r
case IHR:\r
+ case IHQUEST:\r
sectx = ix;\r
secty = iy;\r
ram(0, iquad, sectx, secty);\r
crmshp();\r
proutn(" pulled into black hole at ");\r
prout(cramlc(sector, ix, iy));\r
- finish(FHOLE);\r
+ /*\r
+ * Getting pulled into a black \r
+ * hole was certain death in\r
+ * Almy's original. Stas \r
+ * Sergeev added a possibility\r
+ * that you'll get timewarped\r
+ * instead.\r
+ */\r
+ n=0;\r
+ for (l=1;l<=NDEVICES+1;l++)\r
+ if (game.damage[l]>0) n++;\r
+ probf=pow(1.4,(energy+shield)/5000.0-1.0)*\r
+ pow(1.3,1.0/(n+1)-1.0);\r
+ if (Rand()>probf) \r
+ timwrp();\r
+ else \r
+ finish(FHOLE);\r
return;\r
default:\r
/* something else */\r
return;\r
}\r
\r
-void dock(void) {\r
+void dock(int l) {\r
chew();\r
- if (condit == IHDOCKED) {\r
+ if (condit == IHDOCKED && l) {\r
prout("Already docked.");\r
return;\r
}\r
(game.future[FCDBAS] < 1e30 || isatb == 1) && iseenit == 0) {\r
/* get attack report from base */\r
prout("Lt. Uhura- \"Captain, an important message from the starbase:\"");\r
- attakreport();\r
+ attakreport(0);\r
iseenit = 1;\r
}\r
}\r
are always displayed y - x, where +y is downward! */\r
\r
\r
- int irowq=quadx, icolq=quady, irows, icols, itemp=0, iprompt=0, key;\r
+ int irowq=quadx, icolq=quady, irows, icols, itemp=0, iprompt=0, key=0;\r
double xi, xj, xk, xl;\r
double deltax, deltay;\r
int automatic = -1;\r
if (Time >= game.state.remtime) {\r
prout("First Officer Spock- \"Captain, our speed under impulse");\r
prout("power is only 0.95 sectors per stardate. Are you sure");\r
- prout("we dare spend the time?\"");\r
+ proutn("we dare spend the time?\" ");\r
if (ja() == 0) return;\r
}\r
/* Activate impulse engines and pay the cost */\r
- move();\r
+ imove();\r
ididit = 1;\r
if (alldone) return;\r
power = 20.0 + 100.0*dist;\r
proutn(" a trip would require approximately %2.0f",\r
100.0*Time/game.state.remtime);\r
prout(" percent of our");\r
- prout(" remaining time. Are you sure this is wise?\"");\r
- if (ja() == 0) { ididit = 0; return;}\r
+ proutn(" remaining time. Are you sure this is wise?\" ");\r
+ if (ja() == 0) { ididit = 0; Time=0; return;}\r
}\r
}\r
/* Entry WARPX */\r
\r
\r
/* Activate Warp Engines and pay the cost */\r
- move();\r
+ imove();\r
if (alldone) return;\r
energy -= dist*warpfac*warpfac*warpfac*(shldup+1);\r
if (energy <= 0) finish(FNRG);\r
\r
while ((key=scan()) == IHEOL) {\r
chew();\r
- proutn("Warp factor-");\r
+ proutn("Warp factor- ");\r
}\r
chew();\r
if (key != IHREAL) {\r
warpfac = aaitem;\r
wfacsq=warpfac*warpfac;\r
if (warpfac <= oldfac || warpfac <= 6.0) {\r
- proutn("Helmsman Sulu- \"Warp factor %do, Captain.\"", \r
+ proutn("Helmsman Sulu- \"Warp factor %d, Captain.\"", \r
(int)warpfac);\r
return;\r
}\r
key = scan();\r
}\r
else if (key == IHEOL) {\r
- proutn("Arm NOVAMAX warhead?");\r
+ proutn("Arm NOVAMAX warhead? ");\r
isarmed = ja();\r
}\r
getcd(TRUE, key);\r
sectx=ix;\r
secty=iy;\r
game.quad[ix][iy]=ship;\r
- dock();\r
+ dock(0);\r
skip(1);\r
prout("Lt. Uhura- \"Captain, we made it!\"");\r
return;\r