projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added a TO-DO list.
[super-star-trek.git]
/
moving.c
diff --git
a/moving.c
b/moving.c
index 0b9ecbed686f32c5b5997607e835ec29fc4fe9dc..c48ded55789c8ccbd9c472482910857dc5f21d92 100644
(file)
--- a/
moving.c
+++ b/
moving.c
@@
-98,9
+98,9
@@
void move(void) {
quady = (iy+9)/10;
\r
sectx = ix - 10*(quadx-1);
\r
secty = iy - 10*(quady-1);
\r
quady = (iy+9)/10;
\r
sectx = ix - 10*(quadx-1);
\r
secty = iy - 10*(quady-1);
\r
- prout
n("\nEntering
");
\r
- cramlc(1, quadx, quady);
\r
-
skip(1
);
\r
+ prout
("
");
\r
+ prout("Entering %s.",
\r
+
cramlc(quadrant, quadx, quady)
);
\r
game.quad[sectx][secty] = ship;
\r
newqad(0);
\r
return;
\r
game.quad[sectx][secty] = ship;
\r
newqad(0);
\r
return;
\r
@@
-129,9
+129,8
@@
void move(void) {
skip(1);
\r
proutn("***");
\r
crmshp();
\r
skip(1);
\r
proutn("***");
\r
crmshp();
\r
- proutn(" pulled into black hole at");
\r
- cramlc(2, ix, iy);
\r
- skip(1);
\r
+ proutn(" pulled into black hole at ");
\r
+ prout(cramlc(sector, ix, iy));
\r
finish(FHOLE);
\r
return;
\r
default:
\r
finish(FHOLE);
\r
return;
\r
default:
\r
@@
-139,14
+138,13
@@
void move(void) {
skip(1);
\r
crmshp();
\r
if (iquad == IHWEB)
\r
skip(1);
\r
crmshp();
\r
if (iquad == IHWEB)
\r
- proutn(" encounters Tholian web at");
\r
+ proutn(" encounters Tholian web at
");
\r
else
\r
else
\r
- proutn(" blocked by object at");
\r
-
cramlc(2, ix,iy
);
\r
+ proutn(" blocked by object at
");
\r
+
proutn(cramlc(sector, ix,iy)
);
\r
prout(";");
\r
proutn("Emergency stop required ");
\r
prout(";");
\r
proutn("Emergency stop required ");
\r
- cramf(stopegy, 0, 2);
\r
- prout(" units of energy.");
\r
+ prout("%2d units of energy.", (int)stopegy);
\r
energy -= stopegy;
\r
finalx = x-deltax+0.5;
\r
sectx = finalx;
\r
energy -= stopegy;
\r
finalx = x-deltax+0.5;
\r
sectx = finalx;
\r
@@
-357,9
+355,8
@@
static void getcd(int isprobe, int akey) {
if (!isprobe) {
\r
if (itemp) {
\r
if (iprompt) {
\r
if (!isprobe) {
\r
if (itemp) {
\r
if (iprompt) {
\r
- proutn("Helmsman Sulu- \"Course locked in for");
\r
- cramlc(2, irows, icols);
\r
- prout(".\"");
\r
+ proutn("Helmsman Sulu- \"Course locked in for %s.\"",
\r
+ cramlc(sector, irows, icols));
\r
}
\r
}
\r
else prout("Ensign Chekov- \"Course laid in, Captain.\"");
\r
}
\r
}
\r
else prout("Ensign Chekov- \"Course laid in, Captain.\"");
\r
@@
-431,8
+428,8
@@
void impuls(void) {
prout("First Officer Spock- \"Captain, the impulse engines");
\r
prout("require 20.0 units to engage, plus 100.0 units per");
\r
if (energy > 30) {
\r
prout("First Officer Spock- \"Captain, the impulse engines");
\r
prout("require 20.0 units to engage, plus 100.0 units per");
\r
if (energy > 30) {
\r
- proutn("quadrant. We can go, therefore, a maximum of
");
\r
-
cramf(0.01 * (energy-20.0)-0.05, 0, 1
);
\r
+ proutn("quadrant. We can go, therefore, a maximum of
%d",
\r
+
(int)(0.01 * (energy-20.0)-0.05)
);
\r
prout(" quadrants.\"");
\r
}
\r
else {
\r
prout(" quadrants.\"");
\r
}
\r
else {
\r
@@
-500,10
+497,11
@@
void warp(int i) {
prout("We can't do it, Captain. We haven't the energy.");
\r
}
\r
else {
\r
prout("We can't do it, Captain. We haven't the energy.");
\r
}
\r
else {
\r
- proutn("We haven't the energy, but we could do it at warp ");
\r
- crami(iwarp, 1);
\r
- if (shldup)
\r
- prout(",\nif you'll lower the shields.");
\r
+ proutn("We haven't the energy, but we could do it at warp %d", iwarp);
\r
+ if (shldup) {
\r
+ prout(",");
\r
+ prout("if you'll lower the shields.");
\r
+ }
\r
else
\r
prout(".");
\r
}
\r
else
\r
prout(".");
\r
}
\r
@@
-518,8
+516,8
@@
void warp(int i) {
if (Time >= 0.8*game.state.remtime) {
\r
skip(1);
\r
prout("First Officer Spock- \"Captain, I compute that such");
\r
if (Time >= 0.8*game.state.remtime) {
\r
skip(1);
\r
prout("First Officer Spock- \"Captain, I compute that such");
\r
- proutn(" a trip would require approximately
");
\r
-
cramf(100.0*Time/game.state.remtime, 0, 2
);
\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
prout(" percent of our");
\r
prout(" remaining time. Are you sure this is wise?\"");
\r
if (ja() == 0) { ididit = 0; return;}
\r
@@
-630,9
+628,8
@@
void setwrp(void) {
warpfac = aaitem;
\r
wfacsq=warpfac*warpfac;
\r
if (warpfac <= oldfac || warpfac <= 6.0) {
\r
warpfac = aaitem;
\r
wfacsq=warpfac*warpfac;
\r
if (warpfac <= oldfac || warpfac <= 6.0) {
\r
- proutn("Helmsman Sulu- \"Warp factor ");
\r
- cramf(warpfac, 0, 1);
\r
- prout(", Captain.\"");
\r
+ proutn("Helmsman Sulu- \"Warp factor %do, Captain.\"",
\r
+ (int)warpfac);
\r
return;
\r
}
\r
if (warpfac < 8.00) {
\r
return;
\r
}
\r
if (warpfac < 8.00) {
\r
@@
-714,9
+711,7
@@
void atover(int igrab) {
}
\r
warpfac = 6.0+2.0*Rand();
\r
wfacsq = warpfac * warpfac;
\r
}
\r
warpfac = 6.0+2.0*Rand();
\r
wfacsq = warpfac * warpfac;
\r
- proutn("Warp factor set to ");
\r
- cramf(warpfac, 1, 1);
\r
- skip(1);
\r
+ prout("Warp factor set to %d", (int)warpfac);
\r
power = 0.75*energy;
\r
dist = power/(warpfac*warpfac*warpfac*(shldup+1));
\r
distreq = 1.4142+Rand();
\r
power = 0.75*energy;
\r
dist = power/(warpfac*warpfac*warpfac*(shldup+1));
\r
distreq = 1.4142+Rand();
\r
@@
-744,9
+739,8
@@
void timwrp() {
prout("***TIME WARP ENTERED.");
\r
if (game.state.snap && Rand() < 0.5) {
\r
/* Go back in time */
\r
prout("***TIME WARP ENTERED.");
\r
if (game.state.snap && Rand() < 0.5) {
\r
/* Go back in time */
\r
- proutn("You are traveling backwards in time ");
\r
- cramf(game.state.date-game.snapsht.date, 0, 2);
\r
- prout(" stardates.");
\r
+ prout("You are traveling backwards in time %d stardates.",
\r
+ (int)(game.state.date-game.snapsht.date));
\r
game.state = game.snapsht;
\r
game.state.snap = 0;
\r
if (game.state.remcom) {
\r
game.state = game.snapsht;
\r
game.state.snap = 0;
\r
if (game.state.remcom) {
\r
@@
-793,9
+787,7
@@
void timwrp() {
else {
\r
/* Go forward in time */
\r
Time = -0.5*intime*log(Rand());
\r
else {
\r
/* Go forward in time */
\r
Time = -0.5*intime*log(Rand());
\r
- proutn("You are traveling forward in time ");
\r
- cramf(Time, 1, 2);
\r
- prout(" stardates.");
\r
+ prout("You are traveling forward in time %d stardates.", (int)Time);
\r
/* cheat to make sure no tractor beams occur during time warp */
\r
game.future[FTBEAM] += Time;
\r
game.damage[DRADIO] += Time;
\r
/* cheat to make sure no tractor beams occur during time warp */
\r
game.future[FTBEAM] += Time;
\r
game.damage[DRADIO] += Time;
\r
@@
-837,8
+829,7
@@
void probe(void) {
\r
if (key == IHEOL) {
\r
/* slow mode, so let Kirk know how many probes there are left */
\r
\r
if (key == IHEOL) {
\r
/* slow mode, so let Kirk know how many probes there are left */
\r
- crami(nprobes,1);
\r
- prout(nprobes==1 ? " probe left." : " probes left.");
\r
+ prout(nprobes==1 ? "%d probe left." : "%d probes left.", nprobes);
\r
proutn("Are you sure you want to fire a probe? ");
\r
if (ja()==0) return;
\r
}
\r
proutn("Are you sure you want to fire a probe? ");
\r
if (ja()==0) return;
\r
}
\r
@@
-922,9
+913,8
@@
void help(void) {
}
\r
/* dematerialize starship */
\r
game.quad[sectx][secty]=IHDOT;
\r
}
\r
/* dematerialize starship */
\r
game.quad[sectx][secty]=IHDOT;
\r
- proutn("Starbase in");
\r
- cramlc(1, quadx, quady);
\r
- proutn(" responds--");
\r
+ proutn("Starbase in %s responds--", cramlc(quadrant, quadx, quady));
\r
+ proutn("");
\r
crmshp();
\r
prout(" dematerializes.");
\r
/* Give starbase three chances to rematerialize starship */
\r
crmshp();
\r
prout(" dematerializes.");
\r
/* Give starbase three chances to rematerialize starship */
\r