home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / vmsnet / sources / games / 445 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  14.6 KB

  1. 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
  2. Newsgroups: vmsnet.sources.games
  3. Subject: Vmsnetrek 34/47
  4. Message-ID: <1992Nov20.200734.1@acad2.alaska.edu>
  5. From: asdmf@acad2.alaska.edu
  6. Date: Sat, 21 Nov 1992 00:07:34 GMT
  7. Sender: news@raven.alaska.edu (USENET News System)
  8. Organization: University of Alaska
  9. Nntp-Posting-Host: acad2.alaska.edu
  10. Lines: 401
  11.  
  12. -+-+-+-+-+-+-+-+ START OF PART 34 -+-+-+-+-+-+-+-+
  13. X    if (mapmode) map();
  14. X
  15. X    local();`009/* redraw local window */
  16. X
  17. X    stline(0);
  18. X
  19. X    if (W_IsMapped(statwin))
  20. X`009updateStats(statwin);
  21. X`125
  22. X
  23. XW_Icon planetBitmap(p)
  24. Xregister struct planet *p;
  25. X`123
  26. X    int i;
  27. X
  28. X    if (showlocal==2) `123
  29. X`009return(bplanets`0910`093);
  30. X    `125 else if (p->pl_info & me->p_team) `123
  31. X`009if (showlocal==1) `123
  32. X`009    i=0;
  33. X`009    if (p->pl_armies > 4) i+=4;
  34. X`009    if (p->pl_flags & PLREPAIR) i+=2;
  35. X`009    if (p->pl_flags & PLFUEL) i+=1;
  36. X`009    return(bplanets2`091i`093);
  37. X`009`125 else `123
  38. X`009    return(bplanets`091remap`091p->pl_owner`093`093);
  39. X`009`125
  40. X    `125 else `123
  41. X`009return(bplanets`0915`093);
  42. X    `125
  43. X`125
  44. X
  45. X
  46. XW_Icon planetmBitmap(p)
  47. Xregister struct planet *p;
  48. X`123
  49. X    int i;
  50. X
  51. X    if (showgalactic==2) `123
  52. X`009return(mbplanets`0910`093);
  53. X    `125 else if (p->pl_info & me->p_team) `123
  54. X`009if (showgalactic==1) `123
  55. X`009    i=0;
  56. X`009    if (p->pl_armies > 4) i+=4;
  57. X`009    if (p->pl_flags & PLREPAIR) i+=2;
  58. X`009    if (p->pl_flags & PLFUEL) i+=1;
  59. X`009    return(mbplanets2`091i`093);
  60. X`009`125 else `123
  61. X`009    return(mbplanets`091remap`091p->pl_owner`093`093);
  62. X`009`125
  63. X    `125 else `123
  64. X`009return(mbplanets`0915`093);
  65. X    `125
  66. X`125
  67. X
  68. Xlocal()
  69. X`123
  70. X    register int h, i;
  71. X    register struct player *j;
  72. X    register struct torp *k;
  73. X    register struct planet *l;
  74. X    register struct phaser *php;
  75. X    register struct plasmatorp *pt;
  76. X
  77. X    int dx, dy;
  78. X    int view;
  79. X    char idbuf`0912`093;
  80. X    W_Icon (*ship_bits)`091VIEWS`093;
  81. X
  82. X    /* Kludge to try to fix missing ID chars on tactical (short range) displ
  83. Vay. */
  84. X    idbuf`0910`093 = '0';
  85. X    idbuf`0911`093 = '\0';
  86. X    /* Draw Planets */
  87. X    view = SCALE * WINSIDE / 2;
  88. X    for (i = 0, l = &planets`091i`093; i < MAXPLANETS; i++, l++) `123
  89. X`009dx = l->pl_x - me->p_x;
  90. X`009dy = l->pl_y - me->p_y;
  91. X`009if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -view
  92. V)
  93. X`009    continue;
  94. X`009dx = dx / SCALE + WINSIDE / 2;
  95. X`009dy = dy / SCALE + WINSIDE / 2;
  96. X`009W_WriteBitmap(dx - (planet_width/2), dy - (planet_height/2),
  97. X`009    planetBitmap(l), planetColor(l));
  98. X`009if (namemode) `123
  99. X`009    W_MaskText(w, dx - (planet_width/2), dy + (planet_height/2),
  100. X`009`009planetColor(l), l->pl_name, l->pl_namelen,
  101. X`009`009planetFont(l));
  102. X`009    clearzone`0910`093`091clearcount`093 = dx - (planet_width/2);
  103. X`009    clearzone`0911`093`091clearcount`093 = dy + (planet_height/2);
  104. X`009    clearzone`0912`093`091clearcount`093 = W_Textwidth * l->pl_namelen;
  105. X`009    clearzone`0913`093`091clearcount`093 = W_Textheight;
  106. X`009    clearcount++;
  107. X`009`125
  108. X`009clearzone`0910`093`091clearcount`093 = dx - (planet_width/2);
  109. X`009clearzone`0911`093`091clearcount`093 = dy - (planet_height/2);
  110. X`009clearzone`0912`093`091clearcount`093 = planet_width;
  111. X`009clearzone`0913`093`091clearcount`093 = planet_height;
  112. X`009clearcount++;
  113. X    `125
  114. X
  115. X    /* Draw ships */
  116. X    nplayers = 0;
  117. X    view = SCALE * WINSIDE / 2;
  118. X    for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
  119. X        int tx, ty;
  120. X`009if ((j->p_status != PALIVE) && (j->p_status != PEXPLODE))
  121. X`009    continue;
  122. X`009nplayers++;
  123. X`009if (j->p_flags & PFCLOAK) `123
  124. X`009    if (j->p_cloakphase < (CLOAK_PHASES-1)) `123
  125. X`009`009j->p_cloakphase++;
  126. X`009    `125
  127. X`009`125 else `123
  128. X`009    if (j->p_cloakphase) `123
  129. X`009`009j->p_cloakphase--;
  130. X`009    `125
  131. X`009`125
  132. X`009dx = j->p_x - me->p_x;
  133. X`009dy = j->p_y - me->p_y;
  134. X`009if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -view
  135. V)`032
  136. X`009    continue;
  137. X`009dx = dx / SCALE + WINSIDE / 2;
  138. X`009dy = dy / SCALE + WINSIDE / 2;
  139. X`009if (j->p_flags & PFCLOAK && (j->p_cloakphase == (CLOAK_PHASES-1))) `123
  140. X`009    if (myPlayer(j)) `123
  141. X`009`009W_WriteBitmap(dx - (cloak_width/2), dy - (cloak_height/2),
  142. X`009`009    cloakicon, myColor);
  143. X`009`009clearzone`0910`093`091clearcount`093 = dx - (shield_width/2);
  144. X`009`009clearzone`0911`093`091clearcount`093 = dy - (shield_height/2);
  145. X`009`009clearzone`0912`093`091clearcount`093 = shield_width;
  146. X`009`009clearzone`0913`093`091clearcount`093 = shield_height;
  147. X`009`009clearcount++;
  148. X`009    `125
  149. X`009    continue;
  150. X`009`125
  151. X`009if (j->p_status == PALIVE) `123
  152. X`009    switch (j->p_team) `123
  153. X`009`009case IND:
  154. X`009`009    ship_bits = ind_bitmaps;
  155. X`009`009    break;
  156. X`009`009case FED:
  157. X`009`009    ship_bits = fed_bitmaps;
  158. X`009`009    break;
  159. X`009`009case ROM:
  160. X`009`009    ship_bits = rom_bitmaps;
  161. X`009`009    break;
  162. X`009`009case KLI:
  163. X`009`009    ship_bits = kli_bitmaps;
  164. X`009`009    break;
  165. X`009`009case ORI:
  166. X`009`009default:
  167. X`009`009    ship_bits = ori_bitmaps;
  168. X`009`009    break;
  169. X`009    `125
  170. X
  171. X`009    clearzone`0910`093`091clearcount`093 = dx - (shield_width/2);
  172. X`009    clearzone`0911`093`091clearcount`093 = dy - (shield_height/2);
  173. X`009    clearzone`0912`093`091clearcount`093 = shield_width;
  174. X`009    clearzone`0913`093`091clearcount`093 = shield_height;
  175. X`009    clearcount++;
  176. X
  177. X`009    W_WriteBitmap(dx - (j->p_ship.s_width/2),
  178. X`009`009dy - (j->p_ship.s_height/2),
  179. X`009`009ship_bits`091j->p_ship.s_type`093`091rosette(j->p_dir)`093,
  180. X`009`009playerColor(j));
  181. X
  182. X            if (j->p_cloakphase > 0) `123
  183. X`009`009W_WriteBitmap(dx - (cloak_width/2),
  184. X`009`009    dy - (cloak_height/2), cloakicon, playerColor(j));
  185. X`009`009continue;
  186. X`009    `125
  187. X
  188. X`009    if (showShields && (j->p_flags & PFSHIELD)) `123
  189. X`009`009W_WriteBitmap(dx - (shield_width/2),
  190. X`009`009    dy - (shield_height/2), shield, playerColor(j));
  191. X`009    `125
  192. X
  193. X`009    idbuf`0910`093 = *(shipnos+j->p_no);
  194. X
  195. X`009    W_MaskText(w, dx + (j->p_ship.s_width/2),`032
  196. X`009`009dy - (j->p_ship.s_height/2), playerColor(j),
  197. X`009`009idbuf, 1, shipFont(j));
  198. X`009      `032
  199. X`009    clearzone`0910`093`091clearcount`093 = dx + (j->p_ship.s_width/2);
  200. X`009    clearzone`0911`093`091clearcount`093 = dy - (j->p_ship.s_height/2);
  201. X`009    clearzone`0912`093`091clearcount`093 = W_Textwidth;
  202. X`009    clearzone`0913`093`091clearcount`093 = W_Textheight;
  203. X`009    clearcount++;
  204. X`009`125
  205. X`009else if (j->p_status == PEXPLODE) `123
  206. X`009    int i;
  207. X
  208. X`009    i=j->p_explode;
  209. X`009    if (i<EX_FRAMES `124`124 (i<SBEXPVIEWS && j->p_ship.s_type==STARBASE
  210. V)) `123
  211. X
  212. X`009`009if (j->p_ship.s_type == STARBASE) `123
  213. X`009`009    W_WriteBitmap(dx - (sbexp_width/2),`032
  214. X`009`009`009dy - (sbexp_height/2), sbexpview`091i`093,`032
  215. X`009`009`009playerColor(j));
  216. X`009`009    clearzone`0910`093`091clearcount`093 = dx - (sbexp_width/2);
  217. X`009`009    clearzone`0911`093`091clearcount`093 = dy - (sbexp_height/2);
  218. X`009`009    clearzone`0912`093`091clearcount`093 = sbexp_width;
  219. X`009`009    clearzone`0913`093`091clearcount`093 = sbexp_height;
  220. X`009`009`125 else `123
  221. X`009`009    W_WriteBitmap(dx - (ex_width/2), dy - (ex_height/2),
  222. X`009`009`009expview`091i`093, playerColor(j));
  223. X`009`009    clearzone`0910`093`091clearcount`093 = dx - (ex_width/2);
  224. X`009`009    clearzone`0911`093`091clearcount`093 = dy - (ex_height/2);
  225. X`009`009    clearzone`0912`093`091clearcount`093 = ex_width;
  226. X`009`009    clearzone`0913`093`091clearcount`093 = ex_height;
  227. X`009`009`125
  228. X`009        clearcount++;
  229. X`009`009j->p_explode++;   `032
  230. X`009    `125
  231. X`009`125
  232. X`009/* Now draw his phaser (if it exists) */
  233. X`009php = &phasers`091j->p_no`093;
  234. X`009if (php->ph_status != PHFREE) `123
  235. X`009    if (php->ph_status == PHMISS) `123
  236. X`009`009/* Here I will have to compute end coordinate */
  237. X`009`009tx = j->p_x + PHASEDIST * j->p_ship.s_phaserdamage / 100 * Costab`09
  238. V1php->ph_dir`093;
  239. X`009`009ty = j->p_y + PHASEDIST * j->p_ship.s_phaserdamage / 100 * Sintab`09
  240. V1php->ph_dir`093;
  241. X`009`009tx = (tx - me->p_x) / SCALE + WINSIDE / 2;
  242. X`009`009ty = (ty - me->p_y) / SCALE + WINSIDE / 2;
  243. X`009`009php->ph_fuse = 0;
  244. X`009    `125 else if (php->ph_status == PHHIT2) `123
  245. X`009`009tx = (php->ph_x - me->p_x) / SCALE + WINSIDE / 2;
  246. X`009`009ty = (php->ph_y - me->p_y) / SCALE + WINSIDE / 2;
  247. X`009    `125 else `123 /* Start point is dx, dy */
  248. X`009`009tx = (players`091php->ph_target`093.p_x - me->p_x) /
  249. X`009`009    SCALE + WINSIDE / 2;
  250. X`009`009ty = (players`091php->ph_target`093.p_y - me->p_y) /
  251. X`009`009    SCALE + WINSIDE / 2;
  252. X`009    `125
  253. X
  254. X`009    /* Scott: 9/30/90: 5 lines */
  255. X`009    if ((php->ph_fuse % 2) == 1)
  256. X`009`009W_MakeLine(w, dx, dy, tx, ty, foreColor);
  257. X`009    else
  258. X`009`009W_MakeLine(w, dx, dy, tx, ty, shipCol`091remap`091j->p_team`093`093)
  259. V;
  260. X`009    php->ph_fuse++;
  261. X
  262. X`009    /* OLD: W_MakeLine(w,dx, dy, tx, ty,phaserColor(php)); */
  263. X
  264. X`009    clearline`0910`093`091clearlcount`093 = dx;
  265. X`009    clearline`0911`093`091clearlcount`093 = dy;
  266. X`009    clearline`0912`093`091clearlcount`093 = tx;
  267. X`009    clearline`0913`093`091clearlcount`093 = ty;
  268. X`009    clearlcount++;
  269. X`009`125
  270. X
  271. X`009/* ATM - visible tractor/pressor beams */
  272. X`009/* (for the standard client, I am allowing them for self ONLY) */
  273. X`009/* Since this is NOT a cyborg, I don't show anything if the server */
  274. X`009/* doesn't allow it. */
  275. X`009if (vissup >= 0 && j == me && isAlive(j) &&
  276. X`009`009`009`009`009(j->p_flags & (PFTRACT`124PFPRESS))) `123
  277. X`009    /* this keeps us from trying to show them on servers which */
  278. X`009    /* don't support visible tractor beams */
  279. X`009    if (j->p_tractor < 0) `123
  280. X`009`009vissup = -1;
  281. X`009`009goto notsup;
  282. X`009    `125 else
  283. X`009`009vissup = 1;
  284. X
  285. X`009    if (!showTractor) `123
  286. X`009`009/* don't use visible beams; use icons instead */
  287. X`009`009if (j->p_flags & PFPRESS)
  288. X                    W_WriteBitmap(dx - (shield_width/2) - 5,
  289. X                        dy + (shield_height/2) + 5, pressbits, playerColor(j
  290. V));
  291. X                else
  292. X                    W_WriteBitmap(dx - (shield_width/2) - 5,
  293. X                        dy + (shield_height/2) + 5, tractbits, playerColor(j
  294. V));
  295. X                clearzone`0910`093`091clearcount`093 = dx - (shield_width/2)
  296. V - 5;
  297. X                clearzone`0911`093`091clearcount`093 = dy + (shield_height/2
  298. V) + 5;
  299. X                clearzone`0912`093`091clearcount`093 = 5;
  300. X                clearzone`0913`093`091clearcount`093 = 5;
  301. X                clearcount++;
  302. X
  303. X`009    `125 else `123
  304. X`009`009/* use visible beams */
  305. X`009`009double theta;
  306. X`009`009unsigned char dir;
  307. X`009`009int lx`0912`093, ly`0912`093;
  308. X
  309. X`009`009tx = (players`091j->p_tractor`093.p_x - me->p_x) / SCALE + WINSIDE/2
  310. V;
  311. X`009`009ty = (players`091j->p_tractor`093.p_y - me->p_y) / SCALE + WINSIDE/2
  312. V;
  313. X
  314. X`009`009if (tx == dx && ty == dy)
  315. X`009`009    continue;`009/* this had better be last in for(..) */
  316. X
  317. X#define XPI`0093.1415926
  318. X`009`009theta = atan2((double) (tx - dx), (double) (dy - ty)) + XPI / 2.0;
  319. X`009`009dir = (unsigned char) (theta / XPI * 128.0);
  320. X
  321. X`009`009lx`0910`093 = tx + (Costab`091dir`093 * (shield_width/2));
  322. X`009`009ly`0910`093 = ty + (Sintab`091dir`093 * (shield_width/2));
  323. X`009`009lx`0911`093 = tx - (Costab`091dir`093 * (shield_width/2));
  324. X`009`009ly`0911`093 = ty - (Sintab`091dir`093 * (shield_width/2));
  325. X#undef XPI
  326. X`009`009W_MakeLine(w, dx, dy, lx`0910`093, ly`0910`093, foreColor);
  327. X`009`009W_MakeLine(w, dx, dy, lx`0911`093, ly`0911`093, foreColor);
  328. X
  329. X`009`009clearline`0910`093`091clearlcount`093 = dx;
  330. X`009`009clearline`0911`093`091clearlcount`093 = dy;
  331. X`009`009clearline`0912`093`091clearlcount`093 = lx`0910`093;
  332. X`009`009clearline`0913`093`091clearlcount`093 = ly`0910`093;
  333. X`009`009clearlcount++;
  334. X`009`009clearline`0910`093`091clearlcount`093 = dx;
  335. X`009`009clearline`0911`093`091clearlcount`093 = dy;
  336. X`009`009clearline`0912`093`091clearlcount`093 = lx`0911`093;
  337. X`009`009clearline`0913`093`091clearlcount`093 = ly`0911`093;
  338. X`009`009clearlcount++;
  339. X`009    `125
  340. X`009`125
  341. Xnotsup:`009j = j;`009`009/* lame compiler */
  342. X    `125
  343. X
  344. X    /* Draw torps */
  345. X    view = SCALE * WINSIDE / 2;
  346. X    for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
  347. X`009if (!j->p_ntorp)
  348. X`009    continue;
  349. X`009for (h = 0, k = &torps`091MAXTORP * i + h`093; h < MAXTORP; h++, k++) `1
  350. V23
  351. X`009    if (!k->t_status)
  352. X`009`009continue;
  353. X`009    dx = k->t_x - me->p_x;
  354. X`009    dy = k->t_y - me->p_y;
  355. X`009    if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -
  356. Vview) `123
  357. X`009`009/* Call any torps off screen "free" (if owned by other) */
  358. X`009`009if (k->t_status==TEXPLODE && j!=me) `123
  359. X`009`009    k->t_status=TFREE;
  360. X`009`009    j->p_ntorp--;
  361. X`009`009`125
  362. X`009`009continue;
  363. X`009    `125
  364. X`009    dx = dx / SCALE + WINSIDE / 2;
  365. X`009    dy = dy / SCALE + WINSIDE / 2;
  366. X`009    if (k->t_status == TEXPLODE) `123
  367. X`009`009k->t_fuse--;
  368. X`009`009if (k->t_fuse <= 0) `123
  369. X`009`009    k->t_status=TFREE;
  370. X`009`009    j->p_ntorp--;
  371. X`009`009    continue;
  372. X`009`009`125
  373. X`009`009if (k->t_fuse>=NUMDETFRAMES) `123
  374. X`009`009    k->t_fuse=NUMDETFRAMES-1;
  375. X`009`009`125
  376. X`009`009W_WriteBitmap(dx - (cloud_width/2), dy - (cloud_height/2),
  377. X`009`009    cloud`091k->t_fuse`093, torpColor(k));
  378. X`009`009clearzone`0910`093`091clearcount`093 = dx - (cloud_width/2);
  379. X`009`009clearzone`0911`093`091clearcount`093 = dy - (cloud_height/2);
  380. X`009`009clearzone`0912`093`091clearcount`093 = cloud_width;
  381. X`009`009clearzone`0913`093`091clearcount`093 = cloud_height;
  382. X`009`009clearcount++;
  383. X`009    `125
  384. X`009    else if (k->t_owner != me->p_no && ((k->t_war & me->p_team) `124`124
  385. X`009`009      (players`091k->t_owner`093.p_team & (me->p_hostile `124 me->p_
  386. Vswar))))
  387. X`009    `123
  388. X`009`009W_WriteBitmap(dx - (etorp_width/2), dy - (etorp_height/2),
  389. X`009`009    etorp, torpColor(k));
  390. X`009`009clearzone`0910`093`091clearcount`093 = dx - (etorp_width/2);
  391. X`009`009clearzone`0911`093`091clearcount`093 = dy - (etorp_height/2);
  392. X`009`009clearzone`0912`093`091clearcount`093 = etorp_width;
  393. X`009`009clearzone`0913`093`091clearcount`093 = etorp_height;
  394. X`009`009clearcount++;
  395. X`009    `125
  396. X`009    else `123
  397. X`009`009W_WriteBitmap(dx - (mtorp_width/2), dy - (mtorp_height/2),
  398. X`009`009    mtorp, torpColor(k));
  399. X`009`009clearzone`0910`093`091clearcount`093 = dx - (mtorp_width/2);
  400. X`009`009clearzone`0911`093`091clearcount`093 = dy - (mtorp_height/2);
  401. X`009`009clearzone`0912`093`091clearcount`093 = mtorp_width;
  402. X`009`009clearzone`0913`093`091clearcount`093 = mtorp_height;
  403. X`009`009clearcount++;
  404. X`009    `125
  405. X`009`125
  406. X    `125
  407. X    /* Draw plasma torps */
  408. X    view = SCALE * WINSIDE / 2;
  409. X    for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
  410. X`009if (!j->p_nplasmatorp)
  411. X`009    continue;
  412. +-+-+-+-+-+-+-+-  END  OF PART 34 +-+-+-+-+-+-+-+-
  413.