home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!cs.ubc.ca!bcsystems!spruce.pfc.forestry.ca!news.u.washington.edu!raven.alaska.edu!acad2.alaska.edu!asdmf
- Newsgroups: vmsnet.sources.games
- Subject: Vmsnetrek 35/47
- Message-ID: <1992Nov20.201736.1@acad2.alaska.edu>
- From: asdmf@acad2.alaska.edu
- Date: Sat, 21 Nov 1992 00:17:36 GMT
- Sender: news@raven.alaska.edu (USENET News System)
- Organization: University of Alaska
- Nntp-Posting-Host: acad2.alaska.edu
- Lines: 408
-
- -+-+-+-+-+-+-+-+ START OF PART 35 -+-+-+-+-+-+-+-+
- X`009for (h=0, pt = &plasmatorps`091MAXPLASMA * i + h`093; h < MAXPLASMA; h++
- V, pt++) `123
- X`009 if (!pt->pt_status)
- X`009`009continue;
- X`009 dx = pt->pt_x - me->p_x;
- X`009 dy = pt->pt_y - me->p_y;
- X`009 if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -
- Vview)
- X`009`009continue;
- X`009 dx = dx / SCALE + WINSIDE / 2;
- X`009 dy = dy / SCALE + WINSIDE / 2;
- X`009 if (pt->pt_status == PTEXPLODE) `123
- X`009`009pt->pt_fuse--;
- X`009`009if (pt->pt_fuse <= 0) `123
- X`009`009 pt->pt_status=PTFREE;
- X`009`009 j->p_nplasmatorp--;
- X`009`009 continue;
- X`009`009`125
- X`009`009if (pt->pt_fuse>=NUMDETFRAMES) `123
- X`009`009 pt->pt_fuse=NUMDETFRAMES-1;
- X`009`009`125
- X`009`009W_WriteBitmap(dx - (plasmacloud_width/2),
- X`009`009 dy - (plasmacloud_height/2),`032
- X`009`009 plasmacloud`091pt->pt_fuse`093, plasmatorpColor(pt));
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (plasmacloud_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (plasmacloud_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = plasmacloud_width;
- X`009`009clearzone`0913`093`091clearcount`093 = plasmacloud_height;
- X`009`009clearcount++;
- X`009 `125
- X`009 else if (pt->pt_owner != me->p_no && ((pt->pt_war & me->p_team) `124
- V`124
- X`009`009 (players`091pt->pt_owner`093.p_team & (me->p_hostile `124 me->
- Vp_swar))))
- X`009 `123
- X`009`009W_WriteBitmap(dx - (eplasmatorp_width/2),
- X`009`009 dy - (eplasmatorp_height/2),`032
- X`009`009 eplasmatorp, plasmatorpColor(pt));
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (eplasmatorp_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (eplasmatorp_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = eplasmatorp_width;
- X`009`009clearzone`0913`093`091clearcount`093 = eplasmatorp_height;
- X`009`009clearcount++;
- X`009 `125
- X`009 else `123
- X`009`009W_WriteBitmap(dx - (mplasmatorp_width/2),
- X`009`009 dy - (mplasmatorp_height/2),`032
- X`009`009 mplasmatorp, plasmatorpColor(pt));
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (mplasmatorp_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (mplasmatorp_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = mplasmatorp_width;
- X`009`009clearzone`0913`093`091clearcount`093 = mplasmatorp_height;
- X`009`009clearcount++;
- X`009 `125
- X`009`125
- X `125
- X /* Draw Edges */
- X if (me->p_x < (WINSIDE / 2) * SCALE) `123
- X`009int`009sy, ey;
- X
- X`009dx = (WINSIDE / 2) - (me->p_x) / SCALE;
- X`009sy = (WINSIDE / 2) + (0 - me->p_y) / SCALE;
- X`009ey = (WINSIDE / 2) + (GWIDTH - me->p_y) / SCALE;
- X`009if (sy < 0) sy = 0;
- X`009if (ey > WINSIDE - 1) ey = WINSIDE - 1;
- X`009W_MakeLine(w, dx, sy, dx, ey, warningColor);
- X`009clearline`0910`093`091clearlcount`093 = dx;
- X`009clearline`0911`093`091clearlcount`093 = sy;
- X`009clearline`0912`093`091clearlcount`093 = dx;
- X`009clearline`0913`093`091clearlcount`093 = ey;
- X`009clearlcount++;
- X `125
- X if ((GWIDTH - me->p_x) < (WINSIDE / 2) * SCALE) `123
- X`009int`009sy, ey;
- X
- X`009dx = (WINSIDE / 2) + (GWIDTH - me->p_x) / SCALE;
- X`009sy = (WINSIDE / 2) + (0 - me->p_y) / SCALE;
- X`009ey = (WINSIDE / 2) + (GWIDTH - me->p_y) / SCALE;
- X`009if (sy < 0) sy = 0;
- X`009if (ey > WINSIDE - 1) ey = WINSIDE - 1;
- X`009W_MakeLine(w, dx, sy, dx, ey, warningColor);
- X`009clearline`0910`093`091clearlcount`093 = dx;
- X`009clearline`0911`093`091clearlcount`093 = sy;
- X`009clearline`0912`093`091clearlcount`093 = dx;
- X`009clearline`0913`093`091clearlcount`093 = ey;
- X`009clearlcount++;
- X `125
- X if (me->p_y < (WINSIDE / 2) * SCALE) `123
- X`009int`009sx, ex;
- X
- X`009dy = (WINSIDE / 2) - (me->p_y) / SCALE;
- X`009sx = (WINSIDE / 2) + (0 - me->p_x) / SCALE;
- X`009ex = (WINSIDE / 2) + (GWIDTH - me->p_x) / SCALE;
- X`009if (sx < 0) sx = 0;
- X`009if (ex > WINSIDE - 1) ex = WINSIDE - 1;
- X`009W_MakeLine(w, sx, dy, ex, dy, warningColor);
- X`009clearline`0910`093`091clearlcount`093 = sx;
- X`009clearline`0911`093`091clearlcount`093 = dy;
- X`009clearline`0912`093`091clearlcount`093 = ex;
- X`009clearline`0913`093`091clearlcount`093 = dy;
- X`009clearlcount++;
- X `125
- X if ((GWIDTH - me->p_y) < (WINSIDE / 2) * SCALE) `123
- X`009int`009sx, ex;
- X
- X`009dy = (WINSIDE / 2) + (GWIDTH - me->p_y) / SCALE;
- X`009sx = (WINSIDE / 2) + (0 - me->p_x) / SCALE;
- X`009ex = (WINSIDE / 2) + (GWIDTH - me->p_x) / SCALE;
- X`009if (sx < 0) sx = 0;
- X`009if (ex > WINSIDE - 1) ex = WINSIDE - 1;
- X`009W_MakeLine(w, sx, dy, ex, dy, warningColor);
- X`009clearline`0910`093`091clearlcount`093 = sx;
- X`009clearline`0911`093`091clearlcount`093 = dy;
- X`009clearline`0912`093`091clearlcount`093 = ex;
- X`009clearline`0913`093`091clearlcount`093 = dy;
- X`009clearlcount++;
- X `125
- X
- X /* Change border color to signify alert status */
- X
- X if (oldalert != (me->p_flags & (PFGREEN`124PFYELLOW`124PFRED))) `123
- X oldalert = (me->p_flags & (PFGREEN`124PFYELLOW`124PFRED));
- X`009switch (oldalert) `123
- X`009 case PFGREEN:
- X`009`009W_ChangeBorder(baseWin, gColor);
- X`009`009W_ChangeBorder(iconWin, gColor);
- X`009`009break;
- X`009 case PFYELLOW:
- X`009`009W_ChangeBorder(baseWin, yColor);
- X`009`009W_ChangeBorder(iconWin, yColor);
- X`009`009break;
- X`009 case PFRED:
- X`009`009W_ChangeBorder(baseWin, rColor);
- X`009`009W_ChangeBorder(iconWin, rColor);
- X`009`009break;
- X`009`125
- X `125
- X`125
- X
- Xmap()
- X`123
- X register int i;
- X register struct player *j;
- X register struct planet *l;
- X int dx, dy;
- X
- X if (redrawall) W_ClearWindow(mapw);
- X /* Erase ships */
- X else for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
- X`009lastUpdate`091i`093++;
- X`009/* Erase the guy if:
- X`009 * redrawPlayer`091i`093 is set and the mapmode setting allows it.
- X`009 */
- X`009if (!redrawPlayer`091i`093 `124`124 (mapmode==1 && lastUpdate`091i`093<5
- V))
- X`009 continue;
- X`009lastUpdate`091i`093=0;
- X`009/* Clear his old image... */
- X`009if (mclearzone`0912`093`091i`093) `123
- X`009 W_ClearArea(mapw, mclearzone`0910`093`091i`093, mclearzone`0911`093`
- V091i`093,
- X`009`009mclearzone`0912`093`091i`093, mclearzone`0913`093`091i`093, backColo
- Vr);
- X`009 /* Redraw the hole just left next update */
- X`009 checkRedraw(mclearzone`0914`093`091i`093, mclearzone`0915`093`091i`0
- V93);
- X`009 mclearzone`0912`093`091i`093=0;
- X`009`125
- X `125
- X /* Draw Planets */
- X for (i = 0, l = &planets`091i`093; i < MAXPLANETS; i++, l++) `123
- X`009if (!(l->pl_flags & PLREDRAW) && (!redrawall))
- X`009 continue;
- X`009l->pl_flags &= `126PLREDRAW; `009/* Turn redraw flag off! */
- X`009dx = l->pl_x * WINSIDE / GWIDTH;
- X`009dy = l->pl_y * WINSIDE / GWIDTH;
- X`009W_ClearArea(mapw, dx - (mplanet_width/2), dy - (mplanet_height/2),`032
- X`009 mplanet_width, mplanet_height, backColor);
- X`009W_WriteBitmap(dx - (mplanet_width/2), dy - (mplanet_height/2),
- X`009 planetmBitmap(l), planetColor(l));
- X`009W_WriteText(mapw, dx - (mplanet_width/2), dy + (mplanet_height/2),
- X`009 planetColor(l), l->pl_name, 3, planetFont(l));
- X `125
- X /* Draw ships */
- X for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
- X`009/* We draw the guy if redrawall, or we just erased him.
- X`009 * Also, we redraw if we haven't drawn for 30 frames.
- X`009 * (in case he was erased by other ships).
- X`009 */
- X`009if (lastUpdate`091i`093!=0 && (!redrawall) && lastUpdate`091i`093<30)`03
- V2
- X`009 continue;
- X`009if (j->p_status != PALIVE)`032
- X`009 continue;
- X`009lastUpdate`091i`093=0;
- X`009dx = j->p_x * WINSIDE / GWIDTH;
- X`009dy = j->p_y * WINSIDE / GWIDTH;
- X`009if (j->p_flags & PFCLOAK) `123
- X`009 W_WriteText(mapw, dx - W_Textwidth,
- X`009`009dy - W_Textheight/2, unColor, "??", 2, W_RegularFont);
- X`009`125 else `123
- X`009 W_WriteText(mapw, dx - W_Textwidth,`032
- X`009`009dy - W_Textheight/2, playerColor(j), j->p_mapchars, 2,
- X`009`009shipFont(j));
- X`009`125
- X
- X`009mclearzone`0910`093`091i`093 = dx - W_Textwidth;
- X`009mclearzone`0911`093`091i`093 = dy - W_Textheight/2;
- X`009mclearzone`0912`093`091i`093 = W_Textwidth * 2;
- X`009mclearzone`0913`093`091i`093 = W_Textheight;
- X`009/* Set these so we can checkRedraw() next time */
- X`009mclearzone`0914`093`091i`093 = j->p_x;
- X`009mclearzone`0915`093`091i`093 = j->p_y;
- X`009redrawPlayer`091i`093=0;
- X `125
- X redrawall = 0;
- X`125
- X
- Xstline(flag)
- Xint flag;
- X`123
- X static char buf1`09180`093;
- X static char buf2`09180`093;
- X static char whichbuf=0;
- X register char *buf, *oldbuf;
- X register char *s;
- X register int i,j;
- X int k;
- X
- X /* Instead of one sprintf, we do all this by hand for optimization */
- X
- X if (flag) whichbuf=0;`009/* We must completely refresh */
- X
- X if (whichbuf!=2) `123
- X`009buf=buf1;
- X`009oldbuf=buf2;
- X `125 else `123
- X`009buf=buf2;
- X`009oldbuf=buf1;
- X `125
- X buf`0910`093 = (me->p_flags & PFSHIELD ? 'S': ' ');
- X if (me->p_flags & PFGREEN)
- X`009buf`0911`093 = 'G';
- X else if (me->p_flags & PFYELLOW)
- X`009buf`0911`093 = 'Y';
- X else if (me->p_flags & PFRED)
- X`009buf`0911`093 = 'R';
- X buf`0912`093 = (me->p_flags & (PFPLLOCK `124 PFPLOCK) ? 'L': ' ');
- X buf`0913`093 = (me->p_flags & PFREPAIR ? 'R': ' ');
- X buf`0914`093 = (me->p_flags & PFBOMB ? 'B': ' ');
- X buf`0915`093 = (me->p_flags & PFORBIT ? 'O': ' ');
- X if (me->p_ship.s_type == STARBASE)
- X`009buf`0916`093 = (me->p_flags & PFDOCKOK ? 'D' : ' ');
- X else
- X`009buf`0916`093 = (me->p_flags & PFDOCK ? 'D' : ' ');
- X buf`0917`093 = (me->p_flags & PFCLOAK ? 'C': ' ');
- X buf`0918`093 = (me->p_flags & PFWEP ? 'W': ' ');
- X buf`0919`093 = (me->p_flags & PFENG ? 'E': ' ');
- X if (me->p_flags & PFPRESS)
- X buf`09110`093 = 'P';
- X else if (me->p_flags & PFTRACT)
- X buf`09110`093 = 'T';
- X else
- X buf`09110`093 = ' ';
- X if (me->p_flags & PFBEAMUP)
- X`009buf`09111`093 = 'u';
- X else if (me->p_flags & PFBEAMDOWN)
- X`009buf`09111`093 = 'd';
- X else
- X`009buf`09111`093 = ' ';
- X buf`09112`093 = (status->tourn) ? 't' : ' ';
- X buf`09113`093 = ' ';
- X buf`09114`093 = '0' + ((me->p_speed % 100) / 10);
- X if (buf`09114`093 == '0')
- X`009buf`09114`093 = ' ';
- X buf`09115`093 = '0' + (me->p_speed % 10);`009/* speed */
- X buf`09116`093 = ' ';
- X buf`09117`093 = ' ';
- X buf`09118`093 = '0' + (me->p_damage / 100);
- X if (buf`09118`093 == '0')
- X`009buf`09118`093 = ' ';
- X buf`09119`093 = '0' + ((me->p_damage % 100) / 10);
- X if ((buf`09119`093 == '0') && (me->p_damage < 100))
- X`009buf`09119`093 = ' ';
- X buf`09120`093 = '0' + (me->p_damage % 10);
- X buf`09121`093 = ' ';
- X buf`09122`093 = '0' + (me->p_shield / 100);
- X if (buf`09122`093 == '0')
- X`009buf`09122`093 = ' ';
- X buf`09123`093 = '0' + ((me->p_shield % 100) / 10);
- X if ((buf`09123`093 == '0') && (me->p_shield < 100))
- X`009buf`09123`093 = ' ';
- X buf`09124`093 = '0' + (me->p_shield % 10);
- X buf`09125`093 = ' ';
- X buf`09126`093 = ' ';
- X buf`09127`093 = '0' + ((me->p_ntorp % 100) / 10);
- X if (buf`09127`093 == '0')
- X`009buf`09127`093 = ' ';
- X buf`09128`093 = '0' + (me->p_ntorp % 10);
- X buf`09129`093 = ' ';
- X buf`09130`093 = ' ';
- X buf`09131`093 = ' ';
- X buf`09132`093 = ' ';
- X buf`09133`093 = '0' + ((int) (me->p_kills / 10));
- X if (buf`09133`093 == '0')
- X`009buf`09133`093 = ' ';
- X buf`09134`093 = '0' + (((int) me->p_kills) % 10);
- X buf`09135`093 = '.';
- X buf`09136`093 = '0' + (((int) (me->p_kills * 10)) % 10);
- X buf`09137`093 = '0' + (((int) (me->p_kills * 100)) % 10);
- X buf`09138`093 = ' ';
- X buf`09139`093 = ' ';
- X buf`09140`093 = ' ';
- X buf`09141`093 = '0' + ((me->p_armies % 100) / 10);
- X if (buf`09141`093 == '0')
- X`009buf`09141`093 = ' ';
- X buf`09142`093 = '0' + (me->p_armies % 10);
- X buf`09143`093 = ' ';
- X buf`09144`093 = ' ';
- X buf`09145`093 = ' ';
- X
- X buf`09146`093 = '0' + (me->p_fuel / 100000);
- X if (buf`09146`093 == '0')
- X`009buf`09146`093 = ' ';
- X buf`09147`093 = '0' + ((me->p_fuel % 100000) / 10000);
- X if ((buf`09147`093 == '0') && (me->p_fuel < 100000))
- X`009buf`09147`093 = ' ';
- X buf`09148`093 = '0' + ((me->p_fuel % 10000) / 1000);
- X if ((buf`09148`093 == '0') && (me->p_fuel < 10000))
- X`009buf`09148`093 = ' ';
- X buf`09149`093 = '0' + ((me->p_fuel % 1000) / 100);
- X if ((buf`09149`093 == '0') && (me->p_fuel < 1000))
- X`009buf`09149`093 = ' ';
- X buf`09150`093 = '0' + ((me->p_fuel % 100) / 10);
- X if ((buf`09150`093 == '0') && (me->p_fuel < 100))
- X`009buf`09150`093 = ' ';
- X buf`09151`093 = '0' + (me->p_fuel % 10);
- X buf`09152`093 = ' ';
- X buf`09153`093 = ' ';
- X buf`09154`093 = ' ';
- X
- X buf`09155`093 = '0' + ((me->p_wtemp / 10) / 100);
- X if (buf`09155`093 == '0')
- X`009buf`09155`093 = ' ';
- X buf`09156`093 = '0' + (((me->p_wtemp / 10) % 100) / 10);
- X if ((buf`09156`093 == '0') && (me->p_wtemp < 1000))
- X`009buf`09156`093 = ' ';
- X buf`09157`093 = '0' + ((me->p_wtemp / 10) % 10);
- X
- X buf`09158`093 = ' ';
- X buf`09159`093 = ' ';
- X buf`09160`093 = ' ';
- X
- X buf`09161`093 = '0' + ((me->p_etemp / 10) / 100);
- X if (buf`09161`093 == '0')
- X`009buf`09161`093 = ' ';
- X buf`09162`093 = '0' + (((me->p_etemp / 10) % 100) / 10);
- X if ((buf`09162`093 == '0') && (me->p_etemp < 1000))
- X`009buf`09162`093 = ' ';
- X buf`09163`093 = '0' + ((me->p_etemp / 10) % 10);
- X
- X if (whichbuf==0) `123
- X`009/* Draw status line */
- X`009W_WriteText(tstatw, 50, 16, textColor, buf, 64, W_RegularFont);
- X`009whichbuf=1;
- X `125 else `123`009/* Hacks to make it print only what is necessary */
- X`009whichbuf=3-whichbuf;
- X`009j= -1;
- X`009for (i=0; i<64; i++) `123
- X`009 if (*(buf++) != *(oldbuf++)) `123
- X`009`009/* Different string */
- X`009`009if (j==-1) `123
- X`009`009 k=i;
- X`009`009 s=buf-1;
- X`009`009`125
- X`009`009j=0;
- X`009 `125 else `123
- X`009`009/* Same string */
- X`009`009if (j==-1) continue;
- X`009`009j++;
- X`009`009if (j==20) `123`009/* Random number */
- X`009`009 W_WriteText(tstatw, 50+W_Textwidth*k, 16, textColor,
- X`009`009`009s, i-k-19, W_RegularFont);
- X`009`009 j= -1;
- X`009`009`125
- X`009 `125
- X`009`125
- X`009if (j!=-1) `123
- X`009 W_WriteText(tstatw, 50+W_Textwidth*k, 16, textColor, s, i-k-j,
- X`009`009W_RegularFont);
- X`009`125
- X `125
- X`125
- X
- Xnewcourse(x, y)
- Xint x, y;
- X`123
- X return((unsigned char) (atan2((double) (x - me->p_x),
- X`009(double) (me->p_y - y)) / 3.14159 * 128.));
- X`125
- X
- XredrawTstats()
- X`123
- X char`009buf`091BUFSIZ`093;
- X
- X W_ClearWindow(tstatw);
- +-+-+-+-+-+-+-+- END OF PART 35 +-+-+-+-+-+-+-+-
-