home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / vmsnet / sources / games / 446 < 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 35/47
  4. Message-ID: <1992Nov20.201736.1@acad2.alaska.edu>
  5. From: asdmf@acad2.alaska.edu
  6. Date: Sat, 21 Nov 1992 00:17:36 GMT
  7. Sender: news@raven.alaska.edu (USENET News System)
  8. Organization: University of Alaska
  9. Nntp-Posting-Host: acad2.alaska.edu
  10. Lines: 408
  11.  
  12. -+-+-+-+-+-+-+-+ START OF PART 35 -+-+-+-+-+-+-+-+
  13. X`009for (h=0, pt = &plasmatorps`091MAXPLASMA * i + h`093; h < MAXPLASMA; h++
  14. V, pt++) `123
  15. X`009    if (!pt->pt_status)
  16. X`009`009continue;
  17. X`009    dx = pt->pt_x - me->p_x;
  18. X`009    dy = pt->pt_y - me->p_y;
  19. X`009    if (dx > view `124`124 dx < -view `124`124 dy > view `124`124 dy < -
  20. Vview)
  21. X`009`009continue;
  22. X`009    dx = dx / SCALE + WINSIDE / 2;
  23. X`009    dy = dy / SCALE + WINSIDE / 2;
  24. X`009    if (pt->pt_status == PTEXPLODE) `123
  25. X`009`009pt->pt_fuse--;
  26. X`009`009if (pt->pt_fuse <= 0) `123
  27. X`009`009    pt->pt_status=PTFREE;
  28. X`009`009    j->p_nplasmatorp--;
  29. X`009`009    continue;
  30. X`009`009`125
  31. X`009`009if (pt->pt_fuse>=NUMDETFRAMES) `123
  32. X`009`009    pt->pt_fuse=NUMDETFRAMES-1;
  33. X`009`009`125
  34. X`009`009W_WriteBitmap(dx - (plasmacloud_width/2),
  35. X`009`009     dy - (plasmacloud_height/2),`032
  36. X`009`009     plasmacloud`091pt->pt_fuse`093, plasmatorpColor(pt));
  37. X`009`009clearzone`0910`093`091clearcount`093 = dx - (plasmacloud_width/2);
  38. X`009`009clearzone`0911`093`091clearcount`093 = dy - (plasmacloud_height/2);
  39. X`009`009clearzone`0912`093`091clearcount`093 = plasmacloud_width;
  40. X`009`009clearzone`0913`093`091clearcount`093 = plasmacloud_height;
  41. X`009`009clearcount++;
  42. X`009    `125
  43. X`009    else if (pt->pt_owner != me->p_no && ((pt->pt_war & me->p_team) `124
  44. V`124
  45. X`009`009      (players`091pt->pt_owner`093.p_team & (me->p_hostile `124 me->
  46. Vp_swar))))
  47. X`009    `123
  48. X`009`009W_WriteBitmap(dx - (eplasmatorp_width/2),
  49. X`009`009     dy - (eplasmatorp_height/2),`032
  50. X`009`009     eplasmatorp, plasmatorpColor(pt));
  51. X`009`009clearzone`0910`093`091clearcount`093 = dx - (eplasmatorp_width/2);
  52. X`009`009clearzone`0911`093`091clearcount`093 = dy - (eplasmatorp_height/2);
  53. X`009`009clearzone`0912`093`091clearcount`093 = eplasmatorp_width;
  54. X`009`009clearzone`0913`093`091clearcount`093 = eplasmatorp_height;
  55. X`009`009clearcount++;
  56. X`009    `125
  57. X`009    else `123
  58. X`009`009W_WriteBitmap(dx - (mplasmatorp_width/2),
  59. X`009`009     dy - (mplasmatorp_height/2),`032
  60. X`009`009     mplasmatorp, plasmatorpColor(pt));
  61. X`009`009clearzone`0910`093`091clearcount`093 = dx - (mplasmatorp_width/2);
  62. X`009`009clearzone`0911`093`091clearcount`093 = dy - (mplasmatorp_height/2);
  63. X`009`009clearzone`0912`093`091clearcount`093 = mplasmatorp_width;
  64. X`009`009clearzone`0913`093`091clearcount`093 = mplasmatorp_height;
  65. X`009`009clearcount++;
  66. X`009    `125
  67. X`009`125
  68. X    `125
  69. X    /* Draw Edges */
  70. X    if (me->p_x < (WINSIDE / 2) * SCALE) `123
  71. X`009int`009sy, ey;
  72. X
  73. X`009dx = (WINSIDE / 2) - (me->p_x) / SCALE;
  74. X`009sy = (WINSIDE / 2) + (0 - me->p_y) / SCALE;
  75. X`009ey = (WINSIDE / 2) + (GWIDTH - me->p_y) / SCALE;
  76. X`009if (sy < 0) sy = 0;
  77. X`009if (ey > WINSIDE - 1) ey = WINSIDE - 1;
  78. X`009W_MakeLine(w, dx, sy, dx, ey, warningColor);
  79. X`009clearline`0910`093`091clearlcount`093 = dx;
  80. X`009clearline`0911`093`091clearlcount`093 = sy;
  81. X`009clearline`0912`093`091clearlcount`093 = dx;
  82. X`009clearline`0913`093`091clearlcount`093 = ey;
  83. X`009clearlcount++;
  84. X    `125
  85. X    if ((GWIDTH - me->p_x) < (WINSIDE / 2) * SCALE) `123
  86. X`009int`009sy, ey;
  87. X
  88. X`009dx = (WINSIDE / 2) + (GWIDTH - me->p_x) / SCALE;
  89. X`009sy = (WINSIDE / 2) + (0 - me->p_y) / SCALE;
  90. X`009ey = (WINSIDE / 2) + (GWIDTH - me->p_y) / SCALE;
  91. X`009if (sy < 0) sy = 0;
  92. X`009if (ey > WINSIDE - 1) ey = WINSIDE - 1;
  93. X`009W_MakeLine(w, dx, sy, dx, ey, warningColor);
  94. X`009clearline`0910`093`091clearlcount`093 = dx;
  95. X`009clearline`0911`093`091clearlcount`093 = sy;
  96. X`009clearline`0912`093`091clearlcount`093 = dx;
  97. X`009clearline`0913`093`091clearlcount`093 = ey;
  98. X`009clearlcount++;
  99. X    `125
  100. X    if (me->p_y < (WINSIDE / 2) * SCALE) `123
  101. X`009int`009sx, ex;
  102. X
  103. X`009dy = (WINSIDE / 2) - (me->p_y) / SCALE;
  104. X`009sx = (WINSIDE / 2) + (0 - me->p_x) / SCALE;
  105. X`009ex = (WINSIDE / 2) + (GWIDTH - me->p_x) / SCALE;
  106. X`009if (sx < 0) sx = 0;
  107. X`009if (ex > WINSIDE - 1) ex = WINSIDE - 1;
  108. X`009W_MakeLine(w, sx, dy, ex, dy, warningColor);
  109. X`009clearline`0910`093`091clearlcount`093 = sx;
  110. X`009clearline`0911`093`091clearlcount`093 = dy;
  111. X`009clearline`0912`093`091clearlcount`093 = ex;
  112. X`009clearline`0913`093`091clearlcount`093 = dy;
  113. X`009clearlcount++;
  114. X    `125
  115. X    if ((GWIDTH - me->p_y) < (WINSIDE / 2) * SCALE) `123
  116. X`009int`009sx, ex;
  117. X
  118. X`009dy = (WINSIDE / 2) + (GWIDTH - me->p_y) / SCALE;
  119. X`009sx = (WINSIDE / 2) + (0 - me->p_x) / SCALE;
  120. X`009ex = (WINSIDE / 2) + (GWIDTH - me->p_x) / SCALE;
  121. X`009if (sx < 0) sx = 0;
  122. X`009if (ex > WINSIDE - 1) ex = WINSIDE - 1;
  123. X`009W_MakeLine(w, sx, dy, ex, dy, warningColor);
  124. X`009clearline`0910`093`091clearlcount`093 = sx;
  125. X`009clearline`0911`093`091clearlcount`093 = dy;
  126. X`009clearline`0912`093`091clearlcount`093 = ex;
  127. X`009clearline`0913`093`091clearlcount`093 = dy;
  128. X`009clearlcount++;
  129. X    `125
  130. X
  131. X    /* Change border color to signify alert status */
  132. X
  133. X    if (oldalert != (me->p_flags & (PFGREEN`124PFYELLOW`124PFRED))) `123
  134. X        oldalert = (me->p_flags & (PFGREEN`124PFYELLOW`124PFRED));
  135. X`009switch (oldalert) `123
  136. X`009    case PFGREEN:
  137. X`009`009W_ChangeBorder(baseWin, gColor);
  138. X`009`009W_ChangeBorder(iconWin, gColor);
  139. X`009`009break;
  140. X`009    case PFYELLOW:
  141. X`009`009W_ChangeBorder(baseWin, yColor);
  142. X`009`009W_ChangeBorder(iconWin, yColor);
  143. X`009`009break;
  144. X`009    case PFRED:
  145. X`009`009W_ChangeBorder(baseWin, rColor);
  146. X`009`009W_ChangeBorder(iconWin, rColor);
  147. X`009`009break;
  148. X`009`125
  149. X    `125
  150. X`125
  151. X
  152. Xmap()
  153. X`123
  154. X    register int i;
  155. X    register struct player *j;
  156. X    register struct planet *l;
  157. X    int dx, dy;
  158. X
  159. X    if (redrawall) W_ClearWindow(mapw);
  160. X    /* Erase ships */
  161. X    else for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
  162. X`009lastUpdate`091i`093++;
  163. X`009/* Erase the guy if:
  164. X`009 * redrawPlayer`091i`093 is set and the mapmode setting allows it.
  165. X`009 */
  166. X`009if (!redrawPlayer`091i`093 `124`124 (mapmode==1 && lastUpdate`091i`093<5
  167. V))
  168. X`009    continue;
  169. X`009lastUpdate`091i`093=0;
  170. X`009/* Clear his old image... */
  171. X`009if (mclearzone`0912`093`091i`093) `123
  172. X`009    W_ClearArea(mapw, mclearzone`0910`093`091i`093, mclearzone`0911`093`
  173. V091i`093,
  174. X`009`009mclearzone`0912`093`091i`093, mclearzone`0913`093`091i`093, backColo
  175. Vr);
  176. X`009    /* Redraw the hole just left next update */
  177. X`009    checkRedraw(mclearzone`0914`093`091i`093, mclearzone`0915`093`091i`0
  178. V93);
  179. X`009    mclearzone`0912`093`091i`093=0;
  180. X`009`125
  181. X    `125
  182. X    /* Draw Planets */
  183. X    for (i = 0, l = &planets`091i`093; i < MAXPLANETS; i++, l++) `123
  184. X`009if (!(l->pl_flags & PLREDRAW) && (!redrawall))
  185. X`009    continue;
  186. X`009l->pl_flags &= `126PLREDRAW; `009/* Turn redraw flag off! */
  187. X`009dx = l->pl_x * WINSIDE / GWIDTH;
  188. X`009dy = l->pl_y * WINSIDE / GWIDTH;
  189. X`009W_ClearArea(mapw, dx - (mplanet_width/2), dy - (mplanet_height/2),`032
  190. X`009    mplanet_width, mplanet_height, backColor);
  191. X`009W_WriteBitmap(dx - (mplanet_width/2), dy - (mplanet_height/2),
  192. X`009    planetmBitmap(l), planetColor(l));
  193. X`009W_WriteText(mapw, dx - (mplanet_width/2), dy + (mplanet_height/2),
  194. X`009    planetColor(l), l->pl_name, 3, planetFont(l));
  195. X    `125
  196. X    /* Draw ships */
  197. X    for (i = 0, j = &players`091i`093; i < MAXPLAYER; i++, j++) `123
  198. X`009/* We draw the guy if redrawall, or we just erased him.
  199. X`009 * Also, we redraw if we haven't drawn for 30 frames.
  200. X`009 * (in case he was erased by other ships).
  201. X`009 */
  202. X`009if (lastUpdate`091i`093!=0 && (!redrawall) && lastUpdate`091i`093<30)`03
  203. V2
  204. X`009    continue;
  205. X`009if (j->p_status != PALIVE)`032
  206. X`009    continue;
  207. X`009lastUpdate`091i`093=0;
  208. X`009dx = j->p_x * WINSIDE / GWIDTH;
  209. X`009dy = j->p_y * WINSIDE / GWIDTH;
  210. X`009if (j->p_flags & PFCLOAK) `123
  211. X`009    W_WriteText(mapw, dx - W_Textwidth,
  212. X`009`009dy - W_Textheight/2, unColor, "??", 2, W_RegularFont);
  213. X`009`125 else `123
  214. X`009    W_WriteText(mapw, dx - W_Textwidth,`032
  215. X`009`009dy - W_Textheight/2, playerColor(j), j->p_mapchars, 2,
  216. X`009`009shipFont(j));
  217. X`009`125
  218. X
  219. X`009mclearzone`0910`093`091i`093 = dx - W_Textwidth;
  220. X`009mclearzone`0911`093`091i`093 = dy - W_Textheight/2;
  221. X`009mclearzone`0912`093`091i`093 = W_Textwidth * 2;
  222. X`009mclearzone`0913`093`091i`093 = W_Textheight;
  223. X`009/* Set these so we can checkRedraw() next time */
  224. X`009mclearzone`0914`093`091i`093 = j->p_x;
  225. X`009mclearzone`0915`093`091i`093 = j->p_y;
  226. X`009redrawPlayer`091i`093=0;
  227. X    `125
  228. X    redrawall = 0;
  229. X`125
  230. X
  231. Xstline(flag)
  232. Xint flag;
  233. X`123
  234. X    static char buf1`09180`093;
  235. X    static char buf2`09180`093;
  236. X    static char whichbuf=0;
  237. X    register char *buf, *oldbuf;
  238. X    register char *s;
  239. X    register int i,j;
  240. X    int k;
  241. X
  242. X    /* Instead of one sprintf, we do all this by hand for optimization */
  243. X
  244. X    if (flag) whichbuf=0;`009/* We must completely refresh */
  245. X
  246. X    if (whichbuf!=2) `123
  247. X`009buf=buf1;
  248. X`009oldbuf=buf2;
  249. X    `125 else `123
  250. X`009buf=buf2;
  251. X`009oldbuf=buf1;
  252. X    `125
  253. X    buf`0910`093 = (me->p_flags & PFSHIELD ? 'S': ' ');
  254. X    if (me->p_flags & PFGREEN)
  255. X`009buf`0911`093 = 'G';
  256. X    else if (me->p_flags & PFYELLOW)
  257. X`009buf`0911`093 = 'Y';
  258. X    else if (me->p_flags & PFRED)
  259. X`009buf`0911`093 = 'R';
  260. X    buf`0912`093 = (me->p_flags & (PFPLLOCK `124 PFPLOCK) ? 'L': ' ');
  261. X    buf`0913`093 = (me->p_flags & PFREPAIR ? 'R': ' ');
  262. X    buf`0914`093 = (me->p_flags & PFBOMB ? 'B': ' ');
  263. X    buf`0915`093 = (me->p_flags & PFORBIT ? 'O': ' ');
  264. X    if (me->p_ship.s_type == STARBASE)
  265. X`009buf`0916`093 = (me->p_flags & PFDOCKOK ? 'D' : ' ');
  266. X    else
  267. X`009buf`0916`093 = (me->p_flags & PFDOCK ? 'D' : ' ');
  268. X    buf`0917`093 = (me->p_flags & PFCLOAK ? 'C': ' ');
  269. X    buf`0918`093 = (me->p_flags & PFWEP ? 'W': ' ');
  270. X    buf`0919`093 = (me->p_flags & PFENG ? 'E': ' ');
  271. X    if (me->p_flags & PFPRESS)
  272. X       buf`09110`093 = 'P';
  273. X    else if (me->p_flags & PFTRACT)
  274. X       buf`09110`093 = 'T';
  275. X    else
  276. X       buf`09110`093 = ' ';
  277. X    if (me->p_flags & PFBEAMUP)
  278. X`009buf`09111`093 = 'u';
  279. X    else if (me->p_flags & PFBEAMDOWN)
  280. X`009buf`09111`093 = 'd';
  281. X    else
  282. X`009buf`09111`093 = ' ';
  283. X    buf`09112`093 = (status->tourn) ? 't' : ' ';
  284. X    buf`09113`093 = ' ';
  285. X    buf`09114`093 = '0' + ((me->p_speed % 100) / 10);
  286. X    if (buf`09114`093 == '0')
  287. X`009buf`09114`093 = ' ';
  288. X    buf`09115`093 = '0' + (me->p_speed % 10);`009/* speed */
  289. X    buf`09116`093 = ' ';
  290. X    buf`09117`093 = ' ';
  291. X    buf`09118`093 = '0' + (me->p_damage / 100);
  292. X    if (buf`09118`093 == '0')
  293. X`009buf`09118`093 = ' ';
  294. X    buf`09119`093 = '0' + ((me->p_damage % 100) / 10);
  295. X    if ((buf`09119`093 == '0') && (me->p_damage < 100))
  296. X`009buf`09119`093 = ' ';
  297. X    buf`09120`093 = '0' + (me->p_damage % 10);
  298. X    buf`09121`093 = ' ';
  299. X    buf`09122`093 = '0' + (me->p_shield / 100);
  300. X    if (buf`09122`093 == '0')
  301. X`009buf`09122`093 = ' ';
  302. X    buf`09123`093 = '0' + ((me->p_shield % 100) / 10);
  303. X    if ((buf`09123`093 == '0') && (me->p_shield < 100))
  304. X`009buf`09123`093 = ' ';
  305. X    buf`09124`093 = '0' + (me->p_shield % 10);
  306. X    buf`09125`093 = ' ';
  307. X    buf`09126`093 = ' ';
  308. X    buf`09127`093 = '0' + ((me->p_ntorp % 100) / 10);
  309. X    if (buf`09127`093 == '0')
  310. X`009buf`09127`093 = ' ';
  311. X    buf`09128`093 = '0' + (me->p_ntorp % 10);
  312. X    buf`09129`093 = ' ';
  313. X    buf`09130`093 = ' ';
  314. X    buf`09131`093 = ' ';
  315. X    buf`09132`093 = ' ';
  316. X    buf`09133`093 = '0' + ((int) (me->p_kills / 10));
  317. X    if (buf`09133`093 == '0')
  318. X`009buf`09133`093 = ' ';
  319. X    buf`09134`093 = '0' + (((int) me->p_kills) % 10);
  320. X    buf`09135`093 = '.';
  321. X    buf`09136`093 = '0' + (((int) (me->p_kills * 10)) % 10);
  322. X    buf`09137`093 = '0' + (((int) (me->p_kills * 100)) % 10);
  323. X    buf`09138`093 = ' ';
  324. X    buf`09139`093 = ' ';
  325. X    buf`09140`093 = ' ';
  326. X    buf`09141`093 = '0' + ((me->p_armies % 100) / 10);
  327. X    if (buf`09141`093 == '0')
  328. X`009buf`09141`093 = ' ';
  329. X    buf`09142`093 = '0' + (me->p_armies % 10);
  330. X    buf`09143`093 = ' ';
  331. X    buf`09144`093 = ' ';
  332. X    buf`09145`093 = ' ';
  333. X
  334. X    buf`09146`093 = '0' + (me->p_fuel / 100000);
  335. X    if (buf`09146`093 == '0')
  336. X`009buf`09146`093 = ' ';
  337. X    buf`09147`093 = '0' + ((me->p_fuel % 100000) / 10000);
  338. X    if ((buf`09147`093 == '0') && (me->p_fuel < 100000))
  339. X`009buf`09147`093 = ' ';
  340. X    buf`09148`093 = '0' + ((me->p_fuel % 10000) / 1000);
  341. X    if ((buf`09148`093 == '0') && (me->p_fuel < 10000))
  342. X`009buf`09148`093 = ' ';
  343. X    buf`09149`093 = '0' + ((me->p_fuel % 1000) / 100);
  344. X    if ((buf`09149`093 == '0') && (me->p_fuel < 1000))
  345. X`009buf`09149`093 = ' ';
  346. X    buf`09150`093 = '0' + ((me->p_fuel % 100) / 10);
  347. X    if ((buf`09150`093 == '0') && (me->p_fuel < 100))
  348. X`009buf`09150`093 = ' ';
  349. X    buf`09151`093 = '0' + (me->p_fuel % 10);
  350. X    buf`09152`093 = ' ';
  351. X    buf`09153`093 = ' ';
  352. X    buf`09154`093 = ' ';
  353. X
  354. X    buf`09155`093 = '0' + ((me->p_wtemp / 10) / 100);
  355. X    if (buf`09155`093 == '0')
  356. X`009buf`09155`093 = ' ';
  357. X    buf`09156`093 = '0' + (((me->p_wtemp / 10) % 100) / 10);
  358. X    if ((buf`09156`093 == '0') && (me->p_wtemp < 1000))
  359. X`009buf`09156`093 = ' ';
  360. X    buf`09157`093 = '0' + ((me->p_wtemp / 10) % 10);
  361. X
  362. X    buf`09158`093 = ' ';
  363. X    buf`09159`093 = ' ';
  364. X    buf`09160`093 = ' ';
  365. X
  366. X    buf`09161`093 = '0' + ((me->p_etemp / 10) / 100);
  367. X    if (buf`09161`093 == '0')
  368. X`009buf`09161`093 = ' ';
  369. X    buf`09162`093 = '0' + (((me->p_etemp / 10) % 100) / 10);
  370. X    if ((buf`09162`093 == '0') && (me->p_etemp < 1000))
  371. X`009buf`09162`093 = ' ';
  372. X    buf`09163`093 = '0' + ((me->p_etemp / 10) % 10);
  373. X
  374. X    if (whichbuf==0) `123
  375. X`009/* Draw status line */
  376. X`009W_WriteText(tstatw, 50, 16, textColor, buf, 64, W_RegularFont);
  377. X`009whichbuf=1;
  378. X    `125 else `123`009/* Hacks to make it print only what is necessary */
  379. X`009whichbuf=3-whichbuf;
  380. X`009j= -1;
  381. X`009for (i=0; i<64; i++) `123
  382. X`009    if (*(buf++) != *(oldbuf++)) `123
  383. X`009`009/* Different string */
  384. X`009`009if (j==-1) `123
  385. X`009`009    k=i;
  386. X`009`009    s=buf-1;
  387. X`009`009`125
  388. X`009`009j=0;
  389. X`009    `125 else `123
  390. X`009`009/* Same string */
  391. X`009`009if (j==-1) continue;
  392. X`009`009j++;
  393. X`009`009if (j==20) `123`009/* Random number */
  394. X`009`009    W_WriteText(tstatw, 50+W_Textwidth*k, 16, textColor,
  395. X`009`009`009s, i-k-19, W_RegularFont);
  396. X`009`009    j= -1;
  397. X`009`009`125
  398. X`009    `125
  399. X`009`125
  400. X`009if (j!=-1) `123
  401. X`009    W_WriteText(tstatw, 50+W_Textwidth*k, 16, textColor, s, i-k-j,
  402. X`009`009W_RegularFont);
  403. X`009`125
  404. X    `125
  405. X`125
  406. X
  407. Xnewcourse(x, y)
  408. Xint x, y;
  409. X`123
  410. X    return((unsigned char) (atan2((double) (x - me->p_x),
  411. X`009(double) (me->p_y - y)) / 3.14159 * 128.));
  412. X`125
  413. X
  414. XredrawTstats()
  415. X`123
  416. X    char`009buf`091BUFSIZ`093;
  417. X
  418. X    W_ClearWindow(tstatw);
  419. +-+-+-+-+-+-+-+-  END  OF PART 35 +-+-+-+-+-+-+-+-
  420.