projects
/
super-star-trek.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4be633b
)
Remove some dependencies from battle.c.
author
Eric S. Raymond
<esr@thyrsus.com>
Fri, 4 Feb 2005 04:04:51 +0000
(
04:04
+0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Fri, 4 Feb 2005 04:04:51 +0000
(
04:04
+0000)
battle.c
patch
|
blob
|
history
diff --git
a/battle.c
b/battle.c
index 1e6123fb3835257be1249ba2b82e647bfcfc6793..d8dce472a4d38367118265a5b1b3d96c008a12b2 100644
(file)
--- a/
battle.c
+++ b/
battle.c
@@
-176,10
+176,8
@@
void ram(int ibumpd, int ienm, int ix, int iy) {
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll;
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll;
-#ifdef SERGEEV
int crx,cry;
int crx,cry;
-#endif /* SERGEEV */
double ac=course + 0.25*r;
double angle = (15.0-ac)*0.5235988;
double bullseye = (15.0 - course)*0.5235988;
double ac=course + 0.25*r;
double angle = (15.0-ac)*0.5235988;
double bullseye = (15.0 - course)*0.5235988;
@@
-190,12
+188,10
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
if (fabs(deltay) > bigger) bigger = fabs(deltay);
deltax /= bigger;
deltay /= bigger;
if (fabs(deltay) > bigger) bigger = fabs(deltay);
deltax /= bigger;
deltay /= bigger;
-#ifdef SERGEEV
crx=wherex();
cry=wherey();
if (game.damage[DSRSENS]==0 || condit==IHDOCKED) setwnd(LEFTUPPER_WINDOW);
else setwnd(LOWER_WINDOW);
crx=wherex();
cry=wherey();
if (game.damage[DSRSENS]==0 || condit==IHDOCKED) setwnd(LEFTUPPER_WINDOW);
else setwnd(LOWER_WINDOW);
-#endif /* SERGEEV */
/* Loop to move a single torpedo */
for (l=1; l <= 15; l++) {
x += deltax;
/* Loop to move a single torpedo */
for (l=1; l <= 15; l++) {
x += deltax;
@@
-204,12
+200,11
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
y += deltay;
iy = y + 0.5;
if (iy < 1 || iy > 10) break;
y += deltay;
iy = y + 0.5;
if (iy < 1 || iy > 10) break;
+ iquad=game.quad[ix][iy];
#ifndef SERGEEV
if (l==4 || l==9) skip(1);
proutn("%d - %d ", (int)x, (int)y);
#ifndef SERGEEV
if (l==4 || l==9) skip(1);
proutn("%d - %d ", (int)x, (int)y);
- iquad=game.quad[ix][iy];
#else
#else
- iquad=game.quad[ix][iy];
if (game.damage[DSRSENS]==0 || condit==IHDOCKED){
drawmaps(2);
delay((wait!=1)*400);
if (game.damage[DSRSENS]==0 || condit==IHDOCKED){
drawmaps(2);
delay((wait!=1)*400);
@@
-241,12
+236,8
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
#endif /* SERGEEV */
if (iquad==IHDOT) continue;
/* hit something */
#endif /* SERGEEV */
if (iquad==IHDOT) continue;
/* hit something */
-#ifndef SERGEEV
- skip(1);
-#else
setwnd(LOWER_WINDOW);
gotoxy(crx,cry);
setwnd(LOWER_WINDOW);
gotoxy(crx,cry);
-#endif
switch(iquad) {
case IHE: /* Hit our ship */
case IHF:
switch(iquad) {
case IHE: /* Hit our ship */
case IHF:
@@
-446,12
+437,10
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
}
break;
}
}
break;
}
-#ifdef SERGEEV
if(curwnd!=LOWER_WINDOW) {
setwnd(LOWER_WINDOW);
gotoxy(crx,cry);
}
if(curwnd!=LOWER_WINDOW) {
setwnd(LOWER_WINDOW);
gotoxy(crx,cry);
}
-#endif /* SERGEEV */
if (shoved) {
game.quad[jx][jy]=iquad;
game.quad[ix][iy]=IHDOT;
if (shoved) {
game.quad[jx][jy]=iquad;
game.quad[ix][iy]=IHDOT;
@@
-461,9
+450,7
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
sortkl();
return;
}
sortkl();
return;
}
-#ifndef SERGEEV
skip(1);
skip(1);
-#endif /* SERGEEV */
prout("Torpedo missed.");
return;
}
prout("Torpedo missed.");
return;
}
@@
-1228,9
+1215,6
@@
void phasers(void) {
void hittem(double *hits) {
double kp, kpow, wham, hit, dustfac, kpini;
void hittem(double *hits) {
double kp, kpow, wham, hit, dustfac, kpini;
-#ifdef SERGEEV
- int crx, cry;
-#endif /* SERGEEV */
int nenhr2=nenhere, k=1, kk=1, ii, jj, ienm;
skip(1);
int nenhr2=nenhere, k=1, kk=1, ii, jj, ienm;
skip(1);
@@
-1248,6
+1232,7
@@
void hittem(double *hits) {
jj = game.ky[kk];
if (hit > 0.005) {
#ifdef SERGEEV
jj = game.ky[kk];
if (hit > 0.005) {
#ifdef SERGEEV
+ int crx, cry;
if (game.damage[DSRSENS]==0){
crx=wherex();
cry=wherey();
if (game.damage[DSRSENS]==0){
crx=wherex();
cry=wherey();