home *** CD-ROM | disk | FTP | other *** search
- Path: 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 34/47
- Message-ID: <1992Nov20.200734.1@acad2.alaska.edu>
- From: asdmf@acad2.alaska.edu
- Date: Sat, 21 Nov 1992 00:07:34 GMT
- Sender: news@raven.alaska.edu (USENET News System)
- Organization: University of Alaska
- Nntp-Posting-Host: acad2.alaska.edu
- Lines: 401
- Xref: uunet vmsnet.sources.games:533
-
- -+-+-+-+-+-+-+-+ START OF PART 34 -+-+-+-+-+-+-+-+
- X if (mapmode) map();
- X
- X local();`009/* redraw local window */
- X
- X stline(0);
- X
- X if (W_IsMapped(statwin))
- X`009updateStats(statwin);
- X`125
- X
- XW_Icon planetBitmap(p)
- Xregister struct planet *p;
- X`123
- X int i;
- X
- X if (showlocal==2) `123
- X`009return(bplanets`0910`093);
- X `125 else if (p->pl_info & me->p_team) `123
- X`009if (showlocal==1) `123
- X`009 i=0;
- X`009 if (p->pl_armies > 4) i+=4;
- X`009 if (p->pl_flags & PLREPAIR) i+=2;
- X`009 if (p->pl_flags & PLFUEL) i+=1;
- X`009 return(bplanets2`091i`093);
- X`009`125 else `123
- X`009 return(bplanets`091remap`091p->pl_owner`093`093);
- X`009`125
- X `125 else `123
- X`009return(bplanets`0915`093);
- X `125
- X`125
- X
- X
- XW_Icon planetmBitmap(p)
- Xregister struct planet *p;
- X`123
- X int i;
- X
- X if (showgalactic==2) `123
- X`009return(mbplanets`0910`093);
- X `125 else if (p->pl_info & me->p_team) `123
- X`009if (showgalactic==1) `123
- X`009 i=0;
- X`009 if (p->pl_armies > 4) i+=4;
- X`009 if (p->pl_flags & PLREPAIR) i+=2;
- X`009 if (p->pl_flags & PLFUEL) i+=1;
- X`009 return(mbplanets2`091i`093);
- X`009`125 else `123
- X`009 return(mbplanets`091remap`091p->pl_owner`093`093);
- X`009`125
- X `125 else `123
- X`009return(mbplanets`0915`093);
- X `125
- X`125
- X
- Xlocal()
- X`123
- X register int h, i;
- X register struct player *j;
- X register struct torp *k;
- X register struct planet *l;
- X register struct phaser *php;
- X register struct plasmatorp *pt;
- X
- X int dx, dy;
- X int view;
- X char idbuf`0912`093;
- X W_Icon (*ship_bits)`091VIEWS`093;
- X
- X /* Kludge to try to fix missing ID chars on tactical (short range) displ
- Vay. */
- X idbuf`0910`093 = '0';
- X idbuf`0911`093 = '\0';
- X /* Draw Planets */
- X view = SCALE * WINSIDE / 2;
- X for (i = 0, l = &planets`091i`093; i < MAXPLANETS; i++, l++) `123
- X`009dx = l->pl_x - me->p_x;
- X`009dy = l->pl_y - me->p_y;
- X`009if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -view
- V)
- X`009 continue;
- X`009dx = dx / SCALE + WINSIDE / 2;
- X`009dy = dy / SCALE + WINSIDE / 2;
- X`009W_WriteBitmap(dx - (planet_width/2), dy - (planet_height/2),
- X`009 planetBitmap(l), planetColor(l));
- X`009if (namemode) `123
- X`009 W_MaskText(w, dx - (planet_width/2), dy + (planet_height/2),
- X`009`009planetColor(l), l->pl_name, l->pl_namelen,
- X`009`009planetFont(l));
- X`009 clearzone`0910`093`091clearcount`093 = dx - (planet_width/2);
- X`009 clearzone`0911`093`091clearcount`093 = dy + (planet_height/2);
- X`009 clearzone`0912`093`091clearcount`093 = W_Textwidth * l->pl_namelen;
- X`009 clearzone`0913`093`091clearcount`093 = W_Textheight;
- X`009 clearcount++;
- X`009`125
- X`009clearzone`0910`093`091clearcount`093 = dx - (planet_width/2);
- X`009clearzone`0911`093`091clearcount`093 = dy - (planet_height/2);
- X`009clearzone`0912`093`091clearcount`093 = planet_width;
- X`009clearzone`0913`093`091clearcount`093 = planet_height;
- X`009clearcount++;
- X `125
- X
- X /* Draw ships */
- X nplayers = 0;
- X view = SCALE * WINSIDE / 2;
- X for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
- X int tx, ty;
- X`009if ((j->p_status != PALIVE) && (j->p_status != PEXPLODE))
- X`009 continue;
- X`009nplayers++;
- X`009if (j->p_flags & PFCLOAK) `123
- X`009 if (j->p_cloakphase < (CLOAK_PHASES-1)) `123
- X`009`009j->p_cloakphase++;
- X`009 `125
- X`009`125 else `123
- X`009 if (j->p_cloakphase) `123
- X`009`009j->p_cloakphase--;
- X`009 `125
- X`009`125
- X`009dx = j->p_x - me->p_x;
- X`009dy = j->p_y - me->p_y;
- X`009if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -view
- V)`032
- X`009 continue;
- X`009dx = dx / SCALE + WINSIDE / 2;
- X`009dy = dy / SCALE + WINSIDE / 2;
- X`009if (j->p_flags & PFCLOAK && (j->p_cloakphase == (CLOAK_PHASES-1))) `123
- X`009 if (myPlayer(j)) `123
- X`009`009W_WriteBitmap(dx - (cloak_width/2), dy - (cloak_height/2),
- X`009`009 cloakicon, myColor);
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (shield_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (shield_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = shield_width;
- X`009`009clearzone`0913`093`091clearcount`093 = shield_height;
- X`009`009clearcount++;
- X`009 `125
- X`009 continue;
- X`009`125
- X`009if (j->p_status == PALIVE) `123
- X`009 switch (j->p_team) `123
- X`009`009case IND:
- X`009`009 ship_bits = ind_bitmaps;
- X`009`009 break;
- X`009`009case FED:
- X`009`009 ship_bits = fed_bitmaps;
- X`009`009 break;
- X`009`009case ROM:
- X`009`009 ship_bits = rom_bitmaps;
- X`009`009 break;
- X`009`009case KLI:
- X`009`009 ship_bits = kli_bitmaps;
- X`009`009 break;
- X`009`009case ORI:
- X`009`009default:
- X`009`009 ship_bits = ori_bitmaps;
- X`009`009 break;
- X`009 `125
- X
- X`009 clearzone`0910`093`091clearcount`093 = dx - (shield_width/2);
- X`009 clearzone`0911`093`091clearcount`093 = dy - (shield_height/2);
- X`009 clearzone`0912`093`091clearcount`093 = shield_width;
- X`009 clearzone`0913`093`091clearcount`093 = shield_height;
- X`009 clearcount++;
- X
- X`009 W_WriteBitmap(dx - (j->p_ship.s_width/2),
- X`009`009dy - (j->p_ship.s_height/2),
- X`009`009ship_bits`091j->p_ship.s_type`093`091rosette(j->p_dir)`093,
- X`009`009playerColor(j));
- X
- X if (j->p_cloakphase > 0) `123
- X`009`009W_WriteBitmap(dx - (cloak_width/2),
- X`009`009 dy - (cloak_height/2), cloakicon, playerColor(j));
- X`009`009continue;
- X`009 `125
- X
- X`009 if (showShields && (j->p_flags & PFSHIELD)) `123
- X`009`009W_WriteBitmap(dx - (shield_width/2),
- X`009`009 dy - (shield_height/2), shield, playerColor(j));
- X`009 `125
- X
- X`009 idbuf`0910`093 = *(shipnos+j->p_no);
- X
- X`009 W_MaskText(w, dx + (j->p_ship.s_width/2),`032
- X`009`009dy - (j->p_ship.s_height/2), playerColor(j),
- X`009`009idbuf, 1, shipFont(j));
- X`009 `032
- X`009 clearzone`0910`093`091clearcount`093 = dx + (j->p_ship.s_width/2);
- X`009 clearzone`0911`093`091clearcount`093 = dy - (j->p_ship.s_height/2);
- X`009 clearzone`0912`093`091clearcount`093 = W_Textwidth;
- X`009 clearzone`0913`093`091clearcount`093 = W_Textheight;
- X`009 clearcount++;
- X`009`125
- X`009else if (j->p_status == PEXPLODE) `123
- X`009 int i;
- X
- X`009 i=j->p_explode;
- X`009 if (i<EX_FRAMES `124`124 (i<SBEXPVIEWS && j->p_ship.s_type==STARBASE
- V)) `123
- X
- X`009`009if (j->p_ship.s_type == STARBASE) `123
- X`009`009 W_WriteBitmap(dx - (sbexp_width/2),`032
- X`009`009`009dy - (sbexp_height/2), sbexpview`091i`093,`032
- X`009`009`009playerColor(j));
- X`009`009 clearzone`0910`093`091clearcount`093 = dx - (sbexp_width/2);
- X`009`009 clearzone`0911`093`091clearcount`093 = dy - (sbexp_height/2);
- X`009`009 clearzone`0912`093`091clearcount`093 = sbexp_width;
- X`009`009 clearzone`0913`093`091clearcount`093 = sbexp_height;
- X`009`009`125 else `123
- X`009`009 W_WriteBitmap(dx - (ex_width/2), dy - (ex_height/2),
- X`009`009`009expview`091i`093, playerColor(j));
- X`009`009 clearzone`0910`093`091clearcount`093 = dx - (ex_width/2);
- X`009`009 clearzone`0911`093`091clearcount`093 = dy - (ex_height/2);
- X`009`009 clearzone`0912`093`091clearcount`093 = ex_width;
- X`009`009 clearzone`0913`093`091clearcount`093 = ex_height;
- X`009`009`125
- X`009 clearcount++;
- X`009`009j->p_explode++; `032
- X`009 `125
- X`009`125
- X`009/* Now draw his phaser (if it exists) */
- X`009php = &phasers`091j->p_no`093;
- X`009if (php->ph_status != PHFREE) `123
- X`009 if (php->ph_status == PHMISS) `123
- X`009`009/* Here I will have to compute end coordinate */
- X`009`009tx = j->p_x + PHASEDIST * j->p_ship.s_phaserdamage / 100 * Costab`09
- V1php->ph_dir`093;
- X`009`009ty = j->p_y + PHASEDIST * j->p_ship.s_phaserdamage / 100 * Sintab`09
- V1php->ph_dir`093;
- X`009`009tx = (tx - me->p_x) / SCALE + WINSIDE / 2;
- X`009`009ty = (ty - me->p_y) / SCALE + WINSIDE / 2;
- X`009`009php->ph_fuse = 0;
- X`009 `125 else if (php->ph_status == PHHIT2) `123
- X`009`009tx = (php->ph_x - me->p_x) / SCALE + WINSIDE / 2;
- X`009`009ty = (php->ph_y - me->p_y) / SCALE + WINSIDE / 2;
- X`009 `125 else `123 /* Start point is dx, dy */
- X`009`009tx = (players`091php->ph_target`093.p_x - me->p_x) /
- X`009`009 SCALE + WINSIDE / 2;
- X`009`009ty = (players`091php->ph_target`093.p_y - me->p_y) /
- X`009`009 SCALE + WINSIDE / 2;
- X`009 `125
- X
- X`009 /* Scott: 9/30/90: 5 lines */
- X`009 if ((php->ph_fuse % 2) == 1)
- X`009`009W_MakeLine(w, dx, dy, tx, ty, foreColor);
- X`009 else
- X`009`009W_MakeLine(w, dx, dy, tx, ty, shipCol`091remap`091j->p_team`093`093)
- V;
- X`009 php->ph_fuse++;
- X
- X`009 /* OLD: W_MakeLine(w,dx, dy, tx, ty,phaserColor(php)); */
- X
- X`009 clearline`0910`093`091clearlcount`093 = dx;
- X`009 clearline`0911`093`091clearlcount`093 = dy;
- X`009 clearline`0912`093`091clearlcount`093 = tx;
- X`009 clearline`0913`093`091clearlcount`093 = ty;
- X`009 clearlcount++;
- X`009`125
- X
- X`009/* ATM - visible tractor/pressor beams */
- X`009/* (for the standard client, I am allowing them for self ONLY) */
- X`009/* Since this is NOT a cyborg, I don't show anything if the server */
- X`009/* doesn't allow it. */
- X`009if (vissup >= 0 && j == me && isAlive(j) &&
- X`009`009`009`009`009(j->p_flags & (PFTRACT`124PFPRESS))) `123
- X`009 /* this keeps us from trying to show them on servers which */
- X`009 /* don't support visible tractor beams */
- X`009 if (j->p_tractor < 0) `123
- X`009`009vissup = -1;
- X`009`009goto notsup;
- X`009 `125 else
- X`009`009vissup = 1;
- X
- X`009 if (!showTractor) `123
- X`009`009/* don't use visible beams; use icons instead */
- X`009`009if (j->p_flags & PFPRESS)
- X W_WriteBitmap(dx - (shield_width/2) - 5,
- X dy + (shield_height/2) + 5, pressbits, playerColor(j
- V));
- X else
- X W_WriteBitmap(dx - (shield_width/2) - 5,
- X dy + (shield_height/2) + 5, tractbits, playerColor(j
- V));
- X clearzone`0910`093`091clearcount`093 = dx - (shield_width/2)
- V - 5;
- X clearzone`0911`093`091clearcount`093 = dy + (shield_height/2
- V) + 5;
- X clearzone`0912`093`091clearcount`093 = 5;
- X clearzone`0913`093`091clearcount`093 = 5;
- X clearcount++;
- X
- X`009 `125 else `123
- X`009`009/* use visible beams */
- X`009`009double theta;
- X`009`009unsigned char dir;
- X`009`009int lx`0912`093, ly`0912`093;
- X
- X`009`009tx = (players`091j->p_tractor`093.p_x - me->p_x) / SCALE + WINSIDE/2
- V;
- X`009`009ty = (players`091j->p_tractor`093.p_y - me->p_y) / SCALE + WINSIDE/2
- V;
- X
- X`009`009if (tx == dx && ty == dy)
- X`009`009 continue;`009/* this had better be last in for(..) */
- X
- X#define XPI`0093.1415926
- X`009`009theta = atan2((double) (tx - dx), (double) (dy - ty)) + XPI / 2.0;
- X`009`009dir = (unsigned char) (theta / XPI * 128.0);
- X
- X`009`009lx`0910`093 = tx + (Costab`091dir`093 * (shield_width/2));
- X`009`009ly`0910`093 = ty + (Sintab`091dir`093 * (shield_width/2));
- X`009`009lx`0911`093 = tx - (Costab`091dir`093 * (shield_width/2));
- X`009`009ly`0911`093 = ty - (Sintab`091dir`093 * (shield_width/2));
- X#undef XPI
- X`009`009W_MakeLine(w, dx, dy, lx`0910`093, ly`0910`093, foreColor);
- X`009`009W_MakeLine(w, dx, dy, lx`0911`093, ly`0911`093, foreColor);
- X
- X`009`009clearline`0910`093`091clearlcount`093 = dx;
- X`009`009clearline`0911`093`091clearlcount`093 = dy;
- X`009`009clearline`0912`093`091clearlcount`093 = lx`0910`093;
- X`009`009clearline`0913`093`091clearlcount`093 = ly`0910`093;
- X`009`009clearlcount++;
- X`009`009clearline`0910`093`091clearlcount`093 = dx;
- X`009`009clearline`0911`093`091clearlcount`093 = dy;
- X`009`009clearline`0912`093`091clearlcount`093 = lx`0911`093;
- X`009`009clearline`0913`093`091clearlcount`093 = ly`0911`093;
- X`009`009clearlcount++;
- X`009 `125
- X`009`125
- Xnotsup:`009j = j;`009`009/* lame compiler */
- X `125
- X
- X /* Draw torps */
- X view = SCALE * WINSIDE / 2;
- X for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
- X`009if (!j->p_ntorp)
- X`009 continue;
- X`009for (h = 0, k = &torps`091MAXTORP * i + h`093; h < MAXTORP; h++, k++) `1
- V23
- X`009 if (!k->t_status)
- X`009`009continue;
- X`009 dx = k->t_x - me->p_x;
- X`009 dy = k->t_y - me->p_y;
- X`009 if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -
- Vview) `123
- X`009`009/* Call any torps off screen "free" (if owned by other) */
- X`009`009if (k->t_status==TEXPLODE && j!=me) `123
- X`009`009 k->t_status=TFREE;
- X`009`009 j->p_ntorp--;
- X`009`009`125
- X`009`009continue;
- X`009 `125
- X`009 dx = dx / SCALE + WINSIDE / 2;
- X`009 dy = dy / SCALE + WINSIDE / 2;
- X`009 if (k->t_status == TEXPLODE) `123
- X`009`009k->t_fuse--;
- X`009`009if (k->t_fuse <= 0) `123
- X`009`009 k->t_status=TFREE;
- X`009`009 j->p_ntorp--;
- X`009`009 continue;
- X`009`009`125
- X`009`009if (k->t_fuse>=NUMDETFRAMES) `123
- X`009`009 k->t_fuse=NUMDETFRAMES-1;
- X`009`009`125
- X`009`009W_WriteBitmap(dx - (cloud_width/2), dy - (cloud_height/2),
- X`009`009 cloud`091k->t_fuse`093, torpColor(k));
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (cloud_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (cloud_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = cloud_width;
- X`009`009clearzone`0913`093`091clearcount`093 = cloud_height;
- X`009`009clearcount++;
- X`009 `125
- X`009 else if (k->t_owner != me->p_no && ((k->t_war & me->p_team) `124`124
- X`009`009 (players`091k->t_owner`093.p_team & (me->p_hostile `124 me->p_
- Vswar))))
- X`009 `123
- X`009`009W_WriteBitmap(dx - (etorp_width/2), dy - (etorp_height/2),
- X`009`009 etorp, torpColor(k));
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (etorp_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (etorp_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = etorp_width;
- X`009`009clearzone`0913`093`091clearcount`093 = etorp_height;
- X`009`009clearcount++;
- X`009 `125
- X`009 else `123
- X`009`009W_WriteBitmap(dx - (mtorp_width/2), dy - (mtorp_height/2),
- X`009`009 mtorp, torpColor(k));
- X`009`009clearzone`0910`093`091clearcount`093 = dx - (mtorp_width/2);
- X`009`009clearzone`0911`093`091clearcount`093 = dy - (mtorp_height/2);
- X`009`009clearzone`0912`093`091clearcount`093 = mtorp_width;
- X`009`009clearzone`0913`093`091clearcount`093 = mtorp_height;
- X`009`009clearcount++;
- X`009 `125
- X`009`125
- X `125
- X /* Draw plasma torps */
- X view = SCALE * WINSIDE / 2;
- X for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
- X`009if (!j->p_nplasmatorp)
- X`009 continue;
- +-+-+-+-+-+-+-+- END OF PART 34 +-+-+-+-+-+-+-+-
-