home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume18 / xmpb / part02 < prev    next >
Encoding:
Internet Message Format  |  1993-07-11  |  54.8 KB

  1. Path: uunet!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v18i002:  xmpb - multiplayer space combat for X, Part02/08
  5. Date: 26 Jun 1993 00:32:16 GMT
  6. Organization: Tektronix, Inc, Redmond, OR, USA
  7. Lines: 1845
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <20g5eg$6sl@ying.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1792
  12.  
  13. Submitted-by: ddp@deakin.edu.au (Damien De Paoli)
  14. Posting-number: Volume 18, Issue 2
  15. Archive-name: xmpb/Part02
  16. Environment: X11, Xlib
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 2 (of 8)."
  27. # Contents:  input.c shop_stubs.c xmpb.man
  28. # Wrapped by billr@saab on Fri Jun 25 16:30:14 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'input.c' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'input.c'\"
  32. else
  33. echo shar: Extracting \"'input.c'\" \(7677 characters\)
  34. sed "s/^X//" >'input.c' <<'END_OF_FILE'
  35. X/* input.c - *** Get strings from X-window */
  36. X
  37. Xstatic char sccs_id[] = "@(#)input.c 1.9 93/01/13 XMPB";
  38. X#include "player.h"
  39. X#include "bitmaps/ship.0"
  40. X#include <X11/keysym.h>
  41. X#include <ctype.h>
  42. X#define BORDER_WIDTH 2
  43. X#define RES_NAME "da" 
  44. X#define RES_CLASS "da"
  45. X#include "save.h"
  46. X
  47. Xextern int euid;
  48. Xextern save default_save;
  49. Xextern winptr first_win;
  50. Xextern int no_hosts;
  51. Xextern int numnpcs;
  52. X
  53. Xsave *load_dude();
  54. X
  55. Xint get_string(w, aGC, x, y, out, answer, show)
  56. Xwinptr w;
  57. XGC aGC;
  58. Xint x,y;
  59. Xchar *out, *answer;
  60. Xint show;
  61. X{
  62. X
  63. X            char buf[10];   /* dummy buffer for XLookupString */
  64. X    char *buf2;     /* stores full string */
  65. X    char nl[MAX_NAME_SIZE*2]; /* just blanks for a newline */
  66. X    XEvent xe;      /* the X event received */
  67. X    KeySym keysym;  /* the keysym decoded from the event */
  68. X    int fin=0,i;        /* i = loop counter, y is where to draw text */
  69. X    int dr, far, fdr; /* need these for text bits */
  70. X    XCharStruct or; /* overall return */
  71. X    int tw; /* textwidth */
  72. X
  73. X    XTextExtents(w->xf, out, strlen(out),&dr,&far,&fdr,&or);
  74. X    
  75. X    buf2=answer;                     /* where to put string */ 
  76. X    for(i=0; i< MAX_NAME_SIZE; i++)  /* blank new line */
  77. X    {
  78. X        buf2[i]=0;
  79. X        nl[i]=' ';
  80. X    }
  81. X    for(i=MAX_NAME_SIZE-1; i<2*MAX_NAME_SIZE; i++)
  82. X        nl[i]=' ';
  83. X    nl[i-1]=0;
  84. X    for(i=0; i< 10; i++)
  85. X        buf[i]=0;
  86. X    XDrawImageString(w->theDisplay, w->theWindow, aGC, x, y, out, strlen(out));
  87. X    XSync(w->theDisplay,False);
  88. X    while(XCheckWindowEvent(w->theDisplay,w->theWindow,EVENTMASK,&xe))
  89. X    {
  90. X        switch(xe.type)
  91. X        {
  92. X            case KeyPress:
  93. X                 XLookupString(&(xe.xkey),buf,10,&keysym,NULL);    /* what key pressed */
  94. X                switch(keysym) {
  95. X                    case XK_BackSpace:
  96. X                    case XK_Delete:                    /* del a char, so move \0 back one and draw nl */
  97. X                        XDrawImageString(w->theDisplay, w->theWindow, aGC, x+29, y, nl, strlen(nl));
  98. X                        return 2;
  99. X                        break;
  100. X            
  101. X                    case XK_Linefeed:            /* end of string so return */
  102. X                    case XK_Return:
  103. X                            return 1;
  104. X                        break;
  105. X                    case XK_Shift_L:
  106. X                    case XK_Shift_R:
  107. X                        break;
  108. X
  109. X                    default:
  110. X                        /* if haven't typed too much, put char on */
  111. X                        if(strlen(buf2)!=MAX_NAME_SIZE-1)
  112. X                            strcat(buf2, buf);
  113. X                        break;
  114. X                }
  115. X                if(show)
  116. X                XDrawImageString(w->theDisplay, w->theWindow, aGC, or.width + x, y, buf2, strlen(buf2));
  117. X                XSync(w->theDisplay,False);
  118. X                break;
  119. X        
  120. X            case Expose:
  121. X                if(show)
  122. X                XDrawImageString(w->theDisplay, w->theWindow, aGC, x, y, out, strlen(out));
  123. X                XSync(w->theDisplay,False);
  124. X                break;
  125. X            default:
  126. X                break;
  127. X        }
  128. X    }
  129. X    return 0;
  130. X}
  131. X
  132. Xget_name(w)
  133. Xwinptr w;
  134. X{
  135. Xchar answer[MAX_NAME_SIZE];
  136. Xchar buf[80];
  137. Xint res;
  138. X
  139. X    sprintf(buf, "Enter your name: %s", w->Name);
  140. X    res=get_string(w, w->aGC, 20, 20, buf, answer,1); /* we got name */
  141. X    if(res==1)
  142. X    {
  143. X        return 1;
  144. X    }
  145. X    if(res==2)
  146. X        w->Name[strlen(w->Name)-1]=0;
  147. X    else
  148. X        if(strlen(w->Name) < MAX_NAME_SIZE -1)
  149. X            strcat(w->Name, answer);
  150. X    return 0;
  151. X}
  152. X
  153. Xget_ship(w)
  154. Xwinptr w;
  155. X{
  156. Xchar answer[MAX_NAME_SIZE];
  157. Xchar buf[80];
  158. Xint res;
  159. X
  160. X    sprintf(buf, "Enter the name of your Ship: %s", w->Ship);
  161. X    res=get_string(w, w->aGC, 20, 50, buf, answer,1);
  162. X    if(res==1)
  163. X        return 1;
  164. X    if(res==2)
  165. X        w->Ship[strlen(w->Ship)-1]=0;
  166. X    else
  167. X        if(strlen(w->Ship) < MAX_NAME_SIZE -1)
  168. X            strcat(w->Ship, answer);
  169. X    return 0;
  170. X}
  171. X
  172. Xget_password(w, which)
  173. Xwinptr w;
  174. Xint which;
  175. X{
  176. Xchar answer[MAX_NAME_SIZE];
  177. Xchar buf[80];
  178. Xint res;
  179. X
  180. X    if(!which)
  181. X        sprintf(buf, "Enter your new password:");
  182. X    else
  183. X    if(which==1)
  184. X        sprintf(buf, "Password:");
  185. X    else
  186. X        sprintf(buf, "Retype your new password:");
  187. X    if(which==2)
  188. X        res=get_string(w, w->aGC, 20, 100, buf,answer,0);
  189. X    else
  190. X        res=get_string(w, w->aGC, 20, 80, buf,answer,0);
  191. X    if(res==1)
  192. X    {
  193. X        if(which==2)
  194. X        {
  195. X            if(strlen(w->pass2) < MAX_NAME_SIZE -1)
  196. X            {
  197. X                strcat(w->pass2, answer);
  198. X            }
  199. X        }
  200. X        else
  201. X            if(strlen(w->password) < MAX_NAME_SIZE -1)
  202. X                strcat(w->password, answer);
  203. X        return 1;
  204. X    }
  205. X    if(res==2)
  206. X    {
  207. X        if(which==2)
  208. X            w->pass2[strlen(w->pass2)-1]=0;
  209. X        else
  210. X            w->password[strlen(w->password)-1]=0;
  211. X    }
  212. X    else
  213. X    {
  214. X        if(which==2)        
  215. X        {
  216. X            if(strlen(w->pass2) < MAX_NAME_SIZE -1)
  217. X            {
  218. X                strcat(w->pass2, answer);
  219. X            }
  220. X        }
  221. X        else
  222. X        {
  223. X            if(strlen(w->password) < MAX_NAME_SIZE -1)
  224. X                strcat(w->password, answer);
  225. X        }
  226. X    }
  227. X    return 0;
  228. X}
  229. X
  230. Xset_vars(w)
  231. Xwinptr w;
  232. X{
  233. Xsave *x;
  234. Xint i;
  235. Xchar buf[160];
  236. XFILE *tmp;
  237. X
  238. X
  239. X    x=load_dude(w->Name);
  240. X    if(x!=&default_save)
  241. X        strcpy(w->Ship, x->Ship);
  242. X    if(!w->npc)
  243. X    {
  244. X        strcpy(buf, SAVEDIR);
  245. X        strcat(buf, w->Name);
  246. X        strcat(buf, ".lock");
  247. X
  248. Xseteuid(euid);
  249. X        tmp=fopen(buf, "w");
  250. Xseteuid(getuid());
  251. X        if(!tmp)
  252. X        {
  253. X            printf("Cannot open lock file\n");
  254. X        }
  255. X        fclose(tmp);
  256. X        w->energy_max=x->energy_max;
  257. X        w->ls_max=x->ls_max;
  258. X        w->bs_max=x->bs_max;
  259. X        w->rs_max=x->rs_max;
  260. X        w->credits=x->credits;
  261. X        w->kills = x->kills;
  262. X        for(i=0; i<NUM_ITEMS; i++)
  263. X        {
  264. X            w->quality[i]=x->quality[i];
  265. X            w->state[i]=x->state[i];
  266. X        }
  267. X        for(i=0; i<NO_WEAPONS; i++)
  268. X        {
  269. X            w->does_have_weap[i]=x->does_have_weap[i];
  270. X            w->weap_on_status[i]=x->weap_on_status[i];
  271. X        }
  272. X        w->ship_value=x->ship_value;
  273. X    }
  274. X    /*
  275. X    *     Set initial shield strengths and energy
  276. X    */
  277. X    w->shield_cnt = 3;
  278. X    w->ls_curr=w->ls_max;
  279. X    w->rs_curr=w->rs_max;
  280. X    w->bs_curr=w->bs_max;
  281. X    w->energy_curr=w->energy_max;
  282. X
  283. X    /*
  284. X    *    Set current weapon
  285. X    */
  286. X    {
  287. X        int first;
  288. X        int cw = 0;
  289. X
  290. X        w->curr_weap=WEAP_PULSE;
  291. X        first=1;
  292. X        while(!w->does_have_weap[w->curr_weap])
  293. X        {
  294. X            w->curr_weap++;
  295. X            w->curr_weap %= NO_WEAPONS;
  296. X            if(cw == w->curr_weap && !first)
  297. X            {
  298. X            w->curr_weap++;
  299. X                cw = -1;
  300. X                break;
  301. X            }
  302. X            first=0;
  303. X        }
  304. X        if(cw == -1) w->curr_weap = -1;
  305. X    }
  306. X}
  307. X
  308. Xget_strings()
  309. X{
  310. X    winptr w;
  311. X    int done=0;
  312. X    save *x;
  313. X
  314. X    while(done < no_hosts - numnpcs) 
  315. X    {
  316. X        w=first_win;
  317. X        while(w)
  318. X        {
  319. X            if(w->npc)
  320. X                goto KLUDGE;
  321. X            if(w->quitting>10)
  322. X            {
  323. X                w->quitting--;
  324. X                goto KLUDGE;
  325. X            }
  326. X            if(w->quitting==10)
  327. X            {
  328. X                w->quitting=6;
  329. X                w->Name[0]=0;
  330. X                xfe_clear(w);
  331. X            }
  332. X            if(w->quitting==6) 
  333. X            {
  334. X                if(get_name(w) && strlen(w->Name))
  335. X                {
  336. X                    winptr r;
  337. X
  338. X                    r=first_win;
  339. X                    while(r)
  340. X                    {
  341. X                        if(w!=r && !strcmp(r->Name, w->Name))
  342. X                        {
  343. X                            char buf[30];
  344. X
  345. X                            xfe_clear(w);
  346. X                            sprintf(buf, "Sorry, that name has already been used by a player in this game");
  347. X                            XDrawString(w->theDisplay, w->theWindow, w->aGC, 20, 20, buf, strlen(buf));
  348. X                            XFlush(w->theDisplay);
  349. X                            w->quitting=300;
  350. X                        }
  351. X                        r=r->next;
  352. X                    }
  353. X                    if(w->quitting==6)
  354. X                    {
  355. X                        x=load_dude(w->Name);
  356. X                        if(x == &default_save)
  357. X                            w->quitting=2;
  358. X                        else
  359. X                            w->quitting=5;
  360. X                    }
  361. X                }
  362. X            }
  363. X            else 
  364. X            {    
  365. X                if(w->quitting==2) 
  366. X                    if(get_ship(w) && strlen(w->Ship))
  367. X                        w->quitting=3;
  368. X                if(w->quitting==3) 
  369. X                    if(get_password(w, 0) && strlen(w->password))
  370. X                        w->quitting=4;
  371. X                if(w->quitting==4) 
  372. X                    if(get_password(w, 2) && strlen(w->pass2))
  373. X                    {
  374. X                        if(!strcmp(w->password, w->pass2))
  375. X                        {
  376. X                            set_vars(w);
  377. X                            done++;
  378. X                            XDrawString(w->theDisplay, w->theWindow, w->aGC, 
  379. X                                20, 120, "Welcome!", 8);
  380. X                            XFlush(w->theDisplay);
  381. X                            w->quitting=0;
  382. X                        }
  383. X                        else
  384. X                        {
  385. X                            w->quitting=3;
  386. X                            w->password[0]=0;
  387. X                            w->pass2[0]=0;
  388. X                            usleep(500);
  389. X                            XClearArea(w->theDisplay, w->theWindow, 0, 70, 600, 400, False);
  390. X                        }
  391. X                    }
  392. X                if(w->quitting==5) 
  393. X                {
  394. X                    if(get_password(w, 1) && strlen(w->password))
  395. X                    {
  396. X                        x=load_dude(w->Name);
  397. X                        if(!strcmp(w->password, x->password))
  398. X                        {
  399. X                        char buf[80];
  400. X                            set_vars(w);
  401. X                            done++;
  402. X                            XDrawString(w->theDisplay, w->theWindow, w->aGC, 
  403. X                                20, 100, "Welcome Back!", 13);
  404. X                            XFlush(w->theDisplay);
  405. X                            w->quitting=0;
  406. X                        }
  407. X                        else
  408. X                        {
  409. X                            usleep(500);
  410. X                            xfe_clear(w);
  411. X                            w->Name[0]=0;
  412. X                            w->quitting=6;
  413. X                            w->password[0]=0;
  414. X                        }
  415. X                    }
  416. X                }
  417. X            }
  418. XKLUDGE:
  419. X            w=w->next;
  420. X        }
  421. X    }
  422. X}
  423. END_OF_FILE
  424. if test 7677 -ne `wc -c <'input.c'`; then
  425.     echo shar: \"'input.c'\" unpacked with wrong size!
  426. fi
  427. # end of 'input.c'
  428. fi
  429. if test -f 'shop_stubs.c' -a "${1}" != "-c" ; then 
  430.   echo shar: Will not clobber existing file \"'shop_stubs.c'\"
  431. else
  432. echo shar: Extracting \"'shop_stubs.c'\" \(19508 characters\)
  433. sed "s/^X//" >'shop_stubs.c' <<'END_OF_FILE'
  434. X#include <stdio.h>
  435. X#include <sys/param.h>
  436. X#include <sys/types.h>
  437. X#include <xview/xview.h>
  438. X#include <xview/panel.h>
  439. X#include <xview/textsw.h>
  440. X#include <xview/xv_xrect.h>
  441. X#include <xview/notice.h>
  442. X#include <string.h>
  443. X#include "shop_ui.h"
  444. X#include "player.h"
  445. X#include "save.h"
  446. X#include "weapon.h"
  447. X
  448. X#define ITEMS 0
  449. X#define WEAPONS 1
  450. X#define LS 7
  451. X#define RS 8
  452. X#define BS 9
  453. X#define ENERGY 10
  454. X
  455. X#define NUMLRADS 9
  456. X
  457. XAttr_attribute    INSTANCE;
  458. Xint initd=0, chosen=0, passd=0;
  459. Xsave *dude;
  460. Xint what=-1;
  461. XXFontStruct *xf;
  462. Xint showing=0;
  463. Xstruct menu_p *old_curr;
  464. Xint    old_pos, old_what;
  465. Xextern save default_save;
  466. XpwdWinObjs *pwdWin;
  467. XXFontStruct *xf;
  468. Xint sc;
  469. Xunsigned long white, black;
  470. Xint euid;
  471. X
  472. X
  473. Xint cost_of_item(what,pos)
  474. Xint what,pos;
  475. X{
  476. Xstruct menu_p *curr;
  477. X
  478. X    curr=head;
  479. X    if(what==ENGINE) {
  480. X        return (curr->cost[dude->quality[ENGINE]-1]);
  481. X    }
  482. X    curr=curr->next;
  483. X    if(what==SOLAR) {
  484. X        return (curr->cost[dude->quality[SOLAR]-1]);
  485. X    }
  486. X    curr=curr->next;
  487. X    if(what==SHORTRR || what==LONGRR) {
  488. X        if(what==SHORTRR)
  489. X        {
  490. X            return (curr->cost[dude->quality[SHORTRR]+NUMLRADS-1]);    
  491. X        }
  492. X        else
  493. X        {
  494. X            return (curr->cost[dude->quality[LONGRR]-1]);
  495. X        }
  496. X    }
  497. X    curr=curr->next->next;
  498. X    if(what==REPAIR) {
  499. X        return (curr->cost[dude->quality[REPAIR]-1]);
  500. X    }
  501. X    curr=curr->next;
  502. X    if(what==TC) {
  503. X        return (curr->cost[0]);
  504. X    }
  505. X    if(what==CLOAK) {
  506. X        return (curr->cost[dude->quality[CLOAK]-1]);
  507. X    }
  508. X    curr=curr->next;
  509. X    if((what==RS) || (what==BS) || (what==LS)) {
  510. X            return(curr->cost[what-NUM_ITEMS]);
  511. X    }
  512. X    curr=curr->next;
  513. X    if(what==ENERGY) {
  514. X        return(curr->cost[0]);
  515. X    }
  516. X    else
  517. X    {
  518. X        fprintf(stderr, "No such item!  Panic time.  I'm Bailing\n Problem could be shop.contents does not match shop_stubs.c expectations\n");
  519. X        exit(1);
  520. X    }
  521. X}
  522. X
  523. Xcost_of_weap(what)
  524. Xint what;
  525. X{
  526. Xstruct menu_p *curr;
  527. X
  528. X    curr=head;
  529. X    curr=curr->next->next->next;
  530. X    return(curr->cost[what]);
  531. X}
  532. X
  533. Xrevgc(which)
  534. Xint which;
  535. X{
  536. X    XGCValues gcval;
  537. X
  538. X    if (!which)
  539. X    {
  540. X        gcval.background=black;
  541. X        gcval.foreground=white;
  542. X    }
  543. X    else
  544. X    {
  545. X        gcval.background=white;
  546. X        gcval.foreground=black;
  547. X    }
  548. X    XChangeGC(disp, gc, (unsigned long)GCForeground|GCBackground, &gcval);
  549. X}
  550. X
  551. Xvoid
  552. XDrawBits(canvas, paint_window, display, xid, rects)
  553. X    Canvas        canvas;
  554. X    Xv_window    paint_window;
  555. X    Display        *display;
  556. X    Window        xid;
  557. X    Xv_xrectlist    *rects;
  558. X{
  559. X    char *p, buf[80];
  560. X    int i;
  561. X
  562. X    win=paint_window;
  563. X    XClearWindow(display, xid);
  564. X    if(!passd) {
  565. X        return;
  566. X    }
  567. X
  568. X    /* all our stuff */
  569. X    sprintf(buf, "Credits: $%d", dude->credits);
  570. X    XDrawImageString(display, xid, gc, 360, 20, buf, strlen(buf));
  571. X
  572. Xif(showing==ITEMS) {
  573. X    if(dude->state[SOLAR]!=-1)
  574. X    {
  575. X        sprintf(buf, "Solar Panels of quality:  %d at  (%d)%%", dude->quality[SOLAR], dude->state[SOLAR]);
  576. X        if(what==SOLAR) {
  577. X            revgc(0);
  578. X            XDrawImageString(disp, xid, gc, 360, 60, buf, strlen(buf));
  579. X            revgc(1);
  580. X        }
  581. X        else
  582. X            XDrawImageString(disp, xid, gc, 360, 60, buf, strlen(buf));
  583. X    }
  584. X
  585. X    if(dude->state[SHORTRR]!=-1)
  586. X    {
  587. X        sprintf(buf, "Short Range Radar of quality: %d at  (%d)%%", dude->quality[SHORTRR], dude->state[SHORTRR]);
  588. X        if(what==SHORTRR)
  589. X        {
  590. X            revgc(0);
  591. X            XDrawImageString(disp, xid, gc, 360, 85, buf, strlen(buf));
  592. X            revgc(1);
  593. X        }
  594. X        else
  595. X            XDrawImageString(disp, xid, gc, 360, 85, buf, strlen(buf));
  596. X    }
  597. X
  598. X    if(dude->state[ENGINE]!=-1)
  599. X    {
  600. X        sprintf(buf, "Engine of quality:  %d at  (%d)%%", dude->quality[ENGINE], dude->state[ENGINE]);
  601. X        if(what==ENGINE)
  602. X        {
  603. X            revgc(0);
  604. X            XDrawImageString(disp, xid, gc, 360, 110, buf, strlen(buf));
  605. X            revgc(1);
  606. X        }
  607. X        else
  608. X            XDrawImageString(disp, xid, gc, 360, 110, buf, strlen(buf));
  609. X    }
  610. X
  611. X    if(dude->state[REPAIR]!=-1)
  612. X    {
  613. X        sprintf(buf, "Repair System of quality: %d at  (%d)%%", dude->quality[REPAIR],  dude->state[REPAIR]);
  614. X        if(what==REPAIR)
  615. X        {
  616. X            revgc(0);
  617. X            XDrawImageString(disp, xid, gc, 360, 135, buf, strlen(buf));
  618. X            revgc(1);
  619. X        }
  620. X        else
  621. X            XDrawImageString(disp, xid, gc, 360, 135, buf, strlen(buf));
  622. X    }
  623. X
  624. X    if(dude->state[LONGRR]!=-1)
  625. X    {
  626. X        sprintf(buf, "Long Range Radar of quality: %d at  (%d)%%", dude->quality[LONGRR], dude->state[LONGRR]);
  627. X        if(what==LONGRR)    
  628. X        {
  629. X            revgc(0);
  630. X            XDrawImageString(disp, xid, gc, 360, 160, buf, strlen(buf));
  631. X            revgc(1);
  632. X        }
  633. X        else
  634. X            XDrawImageString(disp, xid, gc, 360, 160, buf, strlen(buf));
  635. X    }
  636. X
  637. X    if(dude->state[CLOAK]!=-1)
  638. X    {
  639. X        sprintf(buf, "Jammer of quality: %d at  (%d)%%", dude->quality[CLOAK], dude->state[CLOAK]);
  640. X        if(what==CLOAK)
  641. X        {
  642. X            revgc(0);
  643. X            XDrawImageString(disp, xid, gc, 360, 185, buf, strlen(buf));
  644. X            revgc(1);
  645. X        }
  646. X        else
  647. X            XDrawImageString(disp, xid, gc, 360, 185, buf, strlen(buf));
  648. X    }
  649. X
  650. X    if(dude->state[TC]!=-1)
  651. X    {
  652. X        sprintf(buf, "Targeting Computer of quality:  %d at  (%d)%%", dude->quality[TC], dude->state[TC]);
  653. X        if(what==TC)
  654. X        {
  655. X            revgc(0);
  656. X            XDrawImageString(disp, xid, gc, 360, 210, buf, strlen(buf));
  657. X            revgc(1);
  658. X        }
  659. X        else
  660. X            XDrawImageString(disp, xid, gc, 360, 210, buf, strlen(buf));
  661. X    }
  662. X
  663. X    sprintf(buf, "Left Shield (%d)", dude->ls_max);
  664. X    if(what==LS) {
  665. X        revgc(0);
  666. X        XDrawImageString(disp, xid, gc, 360, 235, buf, strlen(buf));
  667. X        revgc(1);
  668. X    }
  669. X    else
  670. X        XDrawImageString(disp, xid, gc, 360, 235, buf, strlen(buf));
  671. X
  672. X    sprintf(buf, "Right Shield (%d)", dude->rs_max);
  673. X    if(what==RS) {
  674. X        revgc(0);
  675. X        XDrawImageString(disp, xid, gc, 360, 260, buf, strlen(buf));
  676. X        revgc(1);
  677. X    }
  678. X    else
  679. X        XDrawImageString(disp, xid, gc, 360, 260, buf, strlen(buf));
  680. X
  681. X    sprintf(buf, "Bottom Shield (%d)", dude->bs_max);
  682. X    if(what==BS) {
  683. X        revgc(0);
  684. X        XDrawImageString(disp, xid, gc, 360, 285, buf, strlen(buf));
  685. X        revgc(1);
  686. X    }
  687. X    else
  688. X        XDrawImageString(disp, xid, gc, 360, 285, buf, strlen(buf));
  689. X
  690. X    sprintf(buf, "Energy (%d)", dude->energy_max);
  691. X    if(what==ENERGY) {
  692. X        revgc(0);
  693. X        XDrawImageString(disp, xid, gc, 360, 310, buf, strlen(buf));
  694. X        revgc(1);
  695. X    }
  696. X    else
  697. X        XDrawImageString(disp, xid, gc, 360, 310, buf, strlen(buf));
  698. X}
  699. X
  700. X    XDrawLine(disp, xid, gc, 349, 0, 349, 600);
  701. X    XDrawLine(disp, xid, gc, 351, 0, 351, 600);
  702. X    if(what>=0 && ((showing==WEAPONS && what < NO_WEAPONS && dude->does_have_weap[what]>0)
  703. X     || (showing==ITEMS && what < NUM_ITEMS && dude->state[what]>0) || (showing==ITEMS && what >= NUM_ITEMS && what < NUM_ITEMS+4)))
  704. X    {
  705. X        if(showing==ITEMS)
  706. X        {
  707. X            if(what < NUM_ITEMS) 
  708. X                sprintf(buf, "Retail Value: $%d", cost_of_item(what,pos)*dude->state[what]/200);
  709. X            else
  710. X                sprintf(buf, "Retail Value: $%d for 100 units", cost_of_item(what,pos)/2);
  711. X        }
  712. X        else
  713. X            sprintf(buf, "Retail Value: $%d", cost_of_weap(what)/2);
  714. X        if(showing==WEAPONS) XDrawImageString(disp, xid, gc, 500, 410, buf, strlen(buf));
  715. X        if(showing==ITEMS) XDrawImageString(disp, xid, gc, 360, 350, buf, strlen(buf));
  716. X        if(showing==ITEMS && dude->state[what]<100 && what < NUM_ITEMS)
  717. X        {
  718. X            sprintf(buf, "Cost to repair: $%d", ((((100-dude->state[what])+5)*cost_of_item(what,pos))/100));
  719. X            XDrawImageString(disp, xid, gc, 360, 410, buf, strlen(buf));
  720. X        }
  721. X    }
  722. X
  723. X    if(showing==WEAPONS)
  724. X    {
  725. X        int y=0;
  726. X
  727. X        for(y=0; y < NO_WEAPONS; y++)
  728. X            if(dude->does_have_weap[y]) 
  729. X            {
  730. X                if(what==y) 
  731. X                {
  732. X                    revgc(0);
  733. X                    XDrawImageString(disp, xid, gc, 360, 60+y*25, weap_names[y], strlen(weap_names[y]));
  734. X                    revgc(1);
  735. X                }
  736. X                else
  737. X                    XDrawImageString(disp, xid, gc, 360, 60+y*25, weap_names[y], strlen(weap_names[y]));
  738. X            }
  739. X    }
  740. X    if(!initd && !chosen)
  741. X    {
  742. X        xv_set(MainWin->BuyButton, PANEL_INACTIVE, TRUE, NULL);
  743. X        xv_set(MainWin->SellButton, PANEL_INACTIVE, TRUE, NULL);
  744. X        xv_set(MainWin->RepairButton, PANEL_INACTIVE, TRUE, NULL);
  745. X        return;
  746. X    }    
  747. X    if((initd && dude->credits >= curr->cost[pos]) && !(!strcmp("Weapons", curr->menu_name) && dude->does_have_weap[pos])) 
  748. X        xv_set(MainWin->BuyButton, PANEL_INACTIVE, FALSE, NULL);
  749. X    else
  750. X        xv_set(MainWin->BuyButton, PANEL_INACTIVE, TRUE, NULL);
  751. X    
  752. X    if((what>=0) && ((showing==WEAPONS && what < NO_WEAPONS && dude->does_have_weap[what]>0) || (showing==ITEMS && what < NUM_ITEMS && dude->state[what]>0) || (showing==ITEMS && (what==LS && dude->ls_max>100) || (what==RS && dude->rs_max>100) || (what==BS && dude->bs_max>100) || (what==ENERGY && dude->energy_max>100))))
  753. X        xv_set(MainWin->SellButton, PANEL_INACTIVE, FALSE, NULL);
  754. X    else
  755. X        xv_set(MainWin->SellButton, PANEL_INACTIVE, TRUE, NULL);
  756. X    
  757. X    if((what>=0 && what<=NUM_ITEMS-1) && showing==ITEMS && (dude->state[what]<100) && (dude->state[what]>0) && (((((100-dude->state[what])+5)*cost_of_item(what,pos))/100)<=dude->credits)) 
  758. X    {
  759. X        xv_set(MainWin->RepairButton, PANEL_INACTIVE, FALSE, NULL);
  760. X    }
  761. X    else
  762. X        xv_set(MainWin->RepairButton, PANEL_INACTIVE, TRUE, NULL);
  763. X
  764. X    if(!initd) return;    
  765. X    XDrawImageString(disp, xid, gc, 10, 20, curr->menu_item[pos], strlen(curr->menu_item[pos]));
  766. X    XDrawImageString(disp, xid, gc, 10, 40, "Details:", strlen("Details:"));
  767. X    
  768. X    sprintf(buf, "Cost: $%d", curr->cost[pos]);
  769. X    XDrawImageString(disp, xid, gc, 10, 380, buf, strlen(buf));
  770. X    p=curr->descr[pos];
  771. X    i=0;
  772. X    while(*p) {
  773. X        sscanf(p, "%[^\n]", buf);
  774. X        p+=strlen(buf);
  775. X        XDrawImageString(disp, xid, gc, 10, 60+i*15, buf, strlen(buf));
  776. X        while((*p)=='\n') {
  777. X            p++;
  778. X            i++;
  779. X        }
  780. X    }
  781. X}
  782. X
  783. X
  784. XMenuNotify(menu, item)
  785. XMenu        menu;
  786. XMenu_item   item;
  787. X{
  788. X
  789. X    /*
  790. X    ** set curr to correct menu_item
  791. X    */
  792. X    initd=1;
  793. X    curr=head;
  794. X    while(curr)
  795. X    {
  796. X        for(pos=0; pos<40; pos++) {
  797. X            if(!strcmp(curr->menu_item[pos], (char *)xv_get(item, MENU_STRING, NULL)))
  798. X                goto KLUDGE;
  799. X        }
  800. X        curr=curr->next;
  801. X    }
  802. X
  803. XKLUDGE:
  804. X    old_curr=curr;
  805. X    old_pos=pos;
  806. X    DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  807. X}
  808. X
  809. X
  810. Xvoid
  811. Xmain(argc, argv)
  812. X    int        argc;
  813. X    char        **argv;
  814. X{
  815. X
  816. X    FILE *fp, *fc;
  817. X    int i, menu_done, retn;
  818. X    char fname[160];
  819. X
  820. X    euid = geteuid();
  821. X    seteuid(getuid());
  822. X    if(argc!=2) {
  823. X        fprintf(stderr,"Usage: %s Name\n", argv[0]);
  824. X        exit(1);
  825. X    }
  826. X    dude=load_dude(argv[1]);    
  827. X    if(dude==&default_save) {
  828. X        perror("No such player");
  829. X        fprintf(stderr, "Exiting...\n");
  830. X        exit(1);
  831. X    }
  832. X    fname[0]=0;
  833. X    strcpy(fname, SAVEDIR);
  834. X    strcat(fname, argv[1]);
  835. X    strcat(fname, ".lock");
  836. Xseteuid(euid);
  837. X    fc=fopen(fname, "r");
  838. Xseteuid(getuid());
  839. X    if(fc)
  840. X    {
  841. X        fprintf(stderr,"You cannot execute the shop when you have an active xmpb window.\n");
  842. X        fprintf(stderr,"Quit your xmpb window and then run the shop\n");
  843. X        exit(1);
  844. X    }
  845. X    fclose(fc);
  846. X
  847. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);
  848. X    INSTANCE = xv_unique_key();
  849. X    
  850. X    MainWin = MainWinObjsInit(NULL, NULL); 
  851. X    pwdWin = pwdWinObjsInit(NULL, NULL);
  852. X
  853. X    lastButtonPos=10;
  854. X    ypos=5;
  855. X    parse_shop_contents();
  856. X    QuitButton_create(MainWin, MainWin->controls1,lastButtonPos, ypos);
  857. X    xv_set(base, FRAME_BUSY, TRUE, NULL);
  858. X    xv_set(base, FRAME_CLOSED, TRUE, NULL);
  859. X
  860. X    xv_main_loop(MainWin->Shop);
  861. X    exit(0);
  862. X}
  863. X
  864. X
  865. Xvoid
  866. XQuitPressed(item, event)
  867. X    Panel_item  item;
  868. X    Event       *event;
  869. X{
  870. X    dude->ship_value=value_of_craft(dude);
  871. X    save_dude(dude);
  872. X    exit(0);
  873. X}
  874. X
  875. Xvoid
  876. XRepairPressed(item, event)
  877. X    Panel_item    item;
  878. X    Event        *event;
  879. X{
  880. X    int rep;
  881. X    
  882. X    rep=cost_of_item(what,pos);
  883. X    rep=((((100-dude->state[what])+5)*rep)/100);
  884. X    dude->state[what]=100;
  885. X    dude->credits-=rep;
  886. X    DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  887. X    dude->ship_value=value_of_craft(dude);
  888. X    save_dude(dude);
  889. X    what=-1;
  890. X}
  891. X
  892. Xint do_notice(panel, x, y)
  893. XPanel panel;
  894. X{
  895. X    int result;
  896. X
  897. X    result= notice_prompt(panel, NULL,
  898. X        NOTICE_FOCUS_XY, x, y, 
  899. X        NOTICE_MESSAGE_STRINGS, "You already have one of these items", "Click OK to sell the existing item", "or CANCEL to cancel the buy operation", NULL,
  900. X        NOTICE_BUTTON, "OK", 1,
  901. X        NOTICE_BUTTON, "CANCEL", 0,
  902. X        NULL);
  903. X    return result;
  904. X}
  905. X
  906. Xvoid
  907. XBuyPressed(item, event)
  908. X    Panel_item    item;
  909. X    Event        *event;
  910. X{
  911. X    MainWinObjs    *ip = (MainWinObjs *) xv_get(item, XV_KEY_DATA, INSTANCE);
  912. X
  913. X    if(!strcmp(curr->menu_name,"Engines")) 
  914. X    {
  915. X        if(dude->state[ENGINE]>0) { 
  916. X            if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  917. X            old_what=what; what=ENGINE; 
  918. X            dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  919. X        }
  920. X        dude->quality[ENGINE]=pos+1;
  921. X        dude->state[ENGINE]=100;
  922. X    }
  923. X    else 
  924. X    if(!strcmp(curr->menu_name,"Solar Panels")) 
  925. X    {
  926. X        if(dude->state[SOLAR]>0) {
  927. X             if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  928. X            old_what=what; what=SOLAR;
  929. X            dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  930. X        }
  931. X        dude->quality[SOLAR]=pos+1;
  932. X        dude->state[SOLAR]=100;
  933. X    }
  934. X    else
  935. X    if(!strcmp(curr->menu_name,"Radar")) 
  936. X    {
  937. X        if(pos>=NUMLRADS)     
  938. X        {    
  939. X            if(dude->state[SHORTRR]>0) {
  940. X                 if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  941. X                old_what=what; what=SHORTRR;
  942. X                dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  943. X            }
  944. X            dude->quality[SHORTRR]=pos-NUMLRADS+1;
  945. X            dude->state[SHORTRR]=100;
  946. X        }
  947. X        else
  948. X        {
  949. X            if(dude->state[LONGRR]>0) {
  950. X            if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  951. X                old_what=what; what=LONGRR;
  952. X                dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  953. X            }
  954. X            dude->quality[LONGRR]=pos+1;
  955. X            dude->state[LONGRR]=100;
  956. X        }
  957. X    }
  958. X    else
  959. X    if(!strcmp(curr->menu_name,"Weapons")) 
  960. X    {
  961. X        dude->does_have_weap[pos]=1;
  962. X    }
  963. X    else
  964. X    if(!strcmp(curr->menu_name,"Repair Systems")) 
  965. X    {
  966. X        if(dude->state[REPAIR]>0) {
  967. X        if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  968. X            old_what=what; what=REPAIR;
  969. X            dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  970. X        }
  971. X        dude->quality[REPAIR]=pos+1;
  972. X        dude->state[REPAIR]=100;
  973. X    }
  974. X    else
  975. X    if(!strcmp(curr->menu_name,"Miscellaneous")) 
  976. X    {
  977. X        if(pos==0)
  978. X        {
  979. X            if(dude->state[TC]>0) {
  980. X                if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  981. X                    old_what=what; what=TC;
  982. X                    dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  983. X                }
  984. X            dude->quality[TC]=0;
  985. X            dude->state[TC]=100;
  986. X        }
  987. X        if(pos>0)
  988. X        {
  989. X            if(dude->state[CLOAK]>0) {
  990. X                 if(!do_notice(ip->controls2, event_x(event), event_y(event))) return;
  991. X                    old_what=what; what=CLOAK;
  992. X                    dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  993. X            }
  994. X            dude->quality[CLOAK]=pos+1;
  995. X            dude->state[CLOAK]=100;
  996. X        }
  997. X    }
  998. X    else
  999. X    if(!strcmp(curr->menu_name,"Shields"))
  1000. X    {
  1001. X        switch(pos) {
  1002. X            case 0: dude->ls_max+=100;
  1003. X            break;
  1004. X            case 1: dude->rs_max+=100;
  1005. X            break;
  1006. X            case 2: dude->bs_max+=100;
  1007. X            break;
  1008. X        }
  1009. X    }
  1010. X    else
  1011. X    if(!strcmp(curr->menu_name,"Energy"))
  1012. X    {
  1013. X        dude->energy_max+=100;
  1014. X    }
  1015. X    
  1016. X    dude->credits-=curr->cost[pos];
  1017. X    DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  1018. X    dude->ship_value=value_of_craft(dude);
  1019. X    save_dude(dude);
  1020. X}
  1021. X
  1022. Xvoid
  1023. XTogglePressed(item, event)
  1024. X    Panel_item    item;
  1025. X    Event        *event;
  1026. X{
  1027. X    MainWinObjs    *ip = (MainWinObjs *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1028. X    
  1029. X    showing=!showing;
  1030. X    what=-1;
  1031. X    if(showing==WEAPONS)
  1032. X        xv_set(ip->ShowButton, PANEL_LABEL_STRING, "Show Items", NULL);
  1033. X    else
  1034. X        xv_set(ip->ShowButton, PANEL_LABEL_STRING, "Show Weapons", NULL);
  1035. X    DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  1036. X}
  1037. X
  1038. Xvoid
  1039. XSellPressed(item, event)
  1040. X    Panel_item    item;
  1041. X    Event        *event;
  1042. X{
  1043. X
  1044. X    if(showing==WEAPONS)
  1045. X    {
  1046. X        dude->credits+=cost_of_weap(what)/2;
  1047. X        dude->does_have_weap[what]=0;    
  1048. X    }
  1049. X    else
  1050. X    {
  1051. X        if(what< NUM_ITEMS) {
  1052. X            dude->credits+=cost_of_item(what,pos)*dude->state[what]/200;
  1053. X            dude->state[what]=-1;
  1054. X        }
  1055. X        else {
  1056. X            dude->credits+=cost_of_item(what,pos)/2;
  1057. X            switch(what) {
  1058. X            case LS: dude->ls_max-=100;
  1059. X                break;
  1060. X            case RS: dude->rs_max-=100;
  1061. X                break;
  1062. X            case BS: dude->bs_max-=100;
  1063. X                break;
  1064. X            case ENERGY: dude->energy_max-=100;
  1065. X                break;
  1066. X            }
  1067. X        }
  1068. X    }
  1069. X    if (what < NUM_ITEMS) what=-1;
  1070. X    DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  1071. X    dude->ship_value=value_of_craft(dude);
  1072. X    save_dude(dude);
  1073. X}
  1074. X
  1075. XNotify_value
  1076. XChoose(win, event, arg, type)
  1077. X    Xv_window   win;
  1078. X    Event       *event;
  1079. X    Notify_arg  arg;
  1080. X    Notify_event_type type;
  1081. X{
  1082. X    int i, oldwhat;
  1083. X
  1084. X
  1085. X    oldwhat=what;    
  1086. X    if (event_action(event) == ACTION_SELECT && event_is_down(event)) {
  1087. X        if(event->ie_locx < 350)
  1088. X            return notify_next_event_func(win, (Notify_event) event, arg, type);
  1089. X
  1090. X    /* 20 is a KLUDGE, but it should take us out the window anyway...*/
  1091. X        for(i=0; i<20; i++) 
  1092. X            if((event->ie_locy >= 60+i*25-xf->ascent) && (event->ie_locy <= 60+i*25+xf->descent)) 
  1093. X        {
  1094. X                if(((i >= NO_WEAPONS) && (showing==WEAPONS)) || 
  1095. X                    ((i >= NUM_ITEMS+4) && (showing==ITEMS)))
  1096. X                {
  1097. X                    what=oldwhat;
  1098. X                }
  1099. X                else 
  1100. X                {
  1101. X                    what=i;
  1102. X                    chosen=1;
  1103. X                }
  1104. X                break;
  1105. X        }
  1106. X        else 
  1107. X        {
  1108. X            what=oldwhat;
  1109. X        }
  1110. X        if(what!=oldwhat)
  1111. X            DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  1112. X    }
  1113. X    return notify_next_event_func(win, (Notify_event) event, arg, type);
  1114. X}
  1115. X
  1116. X    
  1117. XPanel_setting
  1118. Xpwdnotify(item, event)
  1119. X    Panel_item    item;
  1120. X    Event        *event;
  1121. X{
  1122. X    char *    value = (char *) xv_get(item, PANEL_VALUE);
  1123. X    
  1124. X    if(strcmp(value, dude->password)) {
  1125. X        xv_set(base, FRAME_BUSY, TRUE, NULL);
  1126. X    }
  1127. X    else { 
  1128. X        xv_set(base, FRAME_BUSY, FALSE, NULL);
  1129. X        xv_set(base, FRAME_CLOSED, FALSE, NULL);
  1130. X        xv_destroy_safe(pwd);
  1131. X        passd=1;
  1132. X        DrawBits((Canvas)NULL,win,disp,xv_get(win,XV_XID),(Xv_xrectlist *)NULL);
  1133. X    }
  1134. X    value[0]=0;
  1135. X    return panel_text_notify(item, event);
  1136. X}
  1137. X
  1138. X#define SHOP
  1139. X
  1140. Xparse_shop_contents()
  1141. X{
  1142. X    FILE *fp;
  1143. X    char fname[160];
  1144. X    Menu_item tempMenuItem;
  1145. X    XID fid;
  1146. X    int retn, i, menu_done;
  1147. X    
  1148. X    fname[0]=0;
  1149. X    strcpy(fname, BITMAPDIR);
  1150. X    strcat(fname, "shop.contents");
  1151. Xseteuid(euid);
  1152. X    fp=fopen(fname,"r");    
  1153. Xseteuid(getuid());
  1154. X    if(fp==NULL) {
  1155. X        fprintf(stderr, "Warning: Cannot find shop.contents in BITMAPDIR, looking in '.' instead\n");
  1156. X        strcpy(fname, "./shop.contents");
  1157. Xseteuid(euid);
  1158. X        fp=fopen(fname,"r");
  1159. Xseteuid(getuid());
  1160. X        if(fp==NULL)
  1161. X        {
  1162. X            fprintf(stderr,"No data file: %s\n", fname);
  1163. X            exit(0);
  1164. X        }
  1165. X    }
  1166. X
  1167. X    curr= (struct menu_p *) malloc(sizeof(struct menu_p));
  1168. X    head=curr;
  1169. X
  1170. X    retn=1;
  1171. X    while(retn) {
  1172. X        fgets(curr->menu_name, 40, fp);
  1173. X        curr->menu_name[strlen(curr->menu_name)-1]=0;
  1174. X
  1175. X#ifdef SHOP
  1176. X       MainWin->MenuButton = Button_create(MainWin, MainWin->controls1);
  1177. X#endif
  1178. X        menu_done=0;
  1179. X        i=0;
  1180. X        while(!menu_done && retn) {
  1181. X            retn=(int)fgets(curr->menu_item[i], 40, fp);
  1182. X            if(retn) {
  1183. X                curr->menu_item[i][strlen(curr->menu_item[i])-1]=0;
  1184. X                if(!strncmp("###",curr->menu_item[i],3)) {
  1185. X                    menu_done=1;
  1186. X                }
  1187. X                else {
  1188. X                    fscanf(fp, "%[^$]%*c%d%*c", curr->descr[i], &(curr->cost[i]));
  1189. X#ifdef SHOP
  1190. X                    tempMenuItem=(Menu_item)xv_create(NULL,MENUITEM,MENU_STRING,
  1191. X                        curr->menu_item[i],
  1192. X                        MENU_NOTIFY_PROC, MenuNotify,
  1193. X                        MENU_RELEASE,
  1194. X                        NULL);
  1195. X                    xv_set(curr->MenuPointer, MENU_APPEND_ITEM, tempMenuItem, NULL);
  1196. X#endif
  1197. X                }
  1198. X                i++;
  1199. X            }
  1200. X        }
  1201. X        curr->next=(struct menu_p *)malloc(sizeof(struct menu_p));
  1202. X        curr=curr->next;
  1203. X    }    
  1204. X    curr->next=NULL;
  1205. X#ifdef SHOP
  1206. X    fid=(XID) XGContextFromGC(gc);
  1207. X    xf=XQueryFont(disp, fid);
  1208. X    sc=DefaultScreen(disp);
  1209. X    white=WhitePixel(disp, sc);
  1210. X    black=BlackPixel(disp, sc);    
  1211. X#endif
  1212. X    curr=head;
  1213. X
  1214. X}
  1215. X
  1216. Xlong value_of_craft(dude)
  1217. Xsave *dude;
  1218. X{
  1219. X    int i;
  1220. X    int what, pos;
  1221. X
  1222. X    dude->ship_value=1;
  1223. X    for (i=0; i < NUM_ITEMS; i++)
  1224. X    {
  1225. X        if(dude->state[i]>0)
  1226. X        {
  1227. X            what=i;
  1228. X            pos=dude->quality[i];
  1229. X            dude->ship_value += cost_of_item(what,pos);
  1230. X        }
  1231. X    }
  1232. X    for (i=0; i < NO_WEAPONS; i++)
  1233. X    {
  1234. X        if(dude->does_have_weap[i])
  1235. X        {
  1236. X            what=i;
  1237. X            dude->ship_value += cost_of_weap(what);
  1238. X        }
  1239. X    }
  1240. X    what=LS;
  1241. X    dude->ship_value += (dude->ls_max-100)/100*cost_of_item(what,pos);
  1242. X    what=RS;
  1243. X    dude->ship_value += (dude->rs_max-100)/100*cost_of_item(what,pos);
  1244. X    what=BS;
  1245. X    dude->ship_value += (dude->bs_max-100)/100*cost_of_item(what,pos);
  1246. X    what=ENERGY;
  1247. X    dude->ship_value += (dude->energy_max-100)/100*cost_of_item(what,pos);
  1248. X    return dude->ship_value;
  1249. X}
  1250. END_OF_FILE
  1251. if test 19508 -ne `wc -c <'shop_stubs.c'`; then
  1252.     echo shar: \"'shop_stubs.c'\" unpacked with wrong size!
  1253. fi
  1254. # end of 'shop_stubs.c'
  1255. fi
  1256. if test -f 'xmpb.man' -a "${1}" != "-c" ; then 
  1257.   echo shar: Will not clobber existing file \"'xmpb.man'\"
  1258. else
  1259. echo shar: Extracting \"'xmpb.man'\" \(24649 characters\)
  1260. sed "s/^X//" >'xmpb.man' <<'END_OF_FILE'
  1261. X.TH Xmpb 6
  1262. X.SH NAME
  1263. Xxmpb \- X Multi Player Blast
  1264. X.SH SYPNOSIS
  1265. X.in +.5i
  1266. X\fIxmpb\fR [-s] [displayname | \-npc name [ \-npcwin displayname]] ...
  1267. X.in -.5i
  1268. X
  1269. X.SH COPYRIGHT NOTICE
  1270. X.sp
  1271. XXMPB is Copyright (C) 1992-3 by Shane Hyde & Damien De Paoli.  
  1272. X.sp
  1273. XPermission is given to
  1274. Xfreely distribute in a non-modified form.  Any modifications to the source
  1275. Xcode may not be distributed without the written consent of the authors.
  1276. XOr else we'll get you with the Rail Gun!
  1277. X
  1278. X
  1279. X.SH What is XMPB?
  1280. X
  1281. XXMPB (X-Multi Player Blast) is a multi-player space combat arcade style
  1282. Xgame for X-terms and workstations.  It was written for Sparcstations
  1283. Xrunning SunOS 4.1 and using X11R5.  But it has been ported to other
  1284. Xsystems including-
  1285. X
  1286. X    - SCO SYS5 UNIX on Intel based machines
  1287. X    - VAX/VMS using DECWindows.
  1288. X
  1289. X
  1290. X.SH About the Authors.
  1291. X
  1292. XWe are two Computer Science students at Deakin University, Geelong, Australia.
  1293. XWe started XMPB while completing our Honours Degree in Computer Science.
  1294. X
  1295. XBeing bored with all the games already for X-terms, we decided to write our
  1296. Xown.  Everyone else out there, do it too!
  1297. X
  1298. X
  1299. X.SH Version 1.0 Changes.
  1300. X
  1301. X    - Save files.
  1302. X    - Hall of fame
  1303. X    - Shop.
  1304. X    - NPC's and compiler.
  1305. X    - better Imakefile.
  1306. X    - more weapons.
  1307. X    - more consistent qualities of items.
  1308. X    - Speed increase.
  1309. X    - Clean quitting.
  1310. X    - CTRL-C trapping.
  1311. X    - Fixed collision routines.
  1312. X    - Keys may be configured by resources.
  1313. X    - Keys may be used instead of the mouse buttons.
  1314. X
  1315. X
  1316. X.SH Installing XMPB.
  1317. X
  1318. XThe Imakefile that comes with the source distibution allows for much
  1319. Xlocal system dependant setup.
  1320. X
  1321. XCC should be set to your favourite C-compiler.  Any compiler should work
  1322. Xexcept maybe some versions of acc which seems to not like compiling
  1323. Xbitmaps.
  1324. X
  1325. XCFLAGS should be set to whatever flags you like.  We strongly recommend
  1326. Xthe best optimisation flags to be set for the compiler, to make the game
  1327. Xgo faster.
  1328. X
  1329. XBINDIR describe the path where the executables will be stored.
  1330. X
  1331. XMANDIR describes the path where the man page will be installed.
  1332. X
  1333. XMANSUFFIX sets which part of the manual the man page should be put in
  1334. X(6 for games).
  1335. X
  1336. XBITMAPSDIR contains the directory where the bitmaps are to be installed
  1337. Xand loaded by the game.
  1338. X
  1339. XSAVEDIR contains the directory where all the players' save files are
  1340. Xstored.
  1341. X
  1342. XINSTALLMODS is set to the permissions for the installed executables.  If
  1343. Xyou are a system administrator, it is probably best to set these to
  1344. Xsetuid.  I know this sounds like a brute force method, but it will allow
  1345. Xplayers to be able to load their saved games, regardless of who invoked
  1346. Xthe game.  Running without setuid, means that files are owned by the
  1347. Xperson running the game, and the default permissions on the save game is
  1348. Xread and write for owner only.  This is to prevent peeking at others
  1349. Xpasswords.  If you are a user who will be installing the game into your
  1350. Xhome directory, and letting your friends have access to it, then you
  1351. Xshould also probably leave the permissions the way they are and the
  1352. Xfiles will be saved as if you ran the game every time.
  1353. X
  1354. XOnce you have set all of the variables to the correct settings for your
  1355. Xsystem, it is now easy to install Xmpb.
  1356. X
  1357. X    xmkmf
  1358. X    make depend
  1359. X    make install
  1360. X
  1361. X
  1362. X.SH The Scenario.
  1363. X
  1364. XIn the far future, the most popular televised sport is "Blast" a game
  1365. Xwhere contestants battle each other in space craft inside an arena in
  1366. Xdeep space.
  1367. X
  1368. XOf course, there are heroes and there are losers.  Your job is to become
  1369. Xone of the heroes.
  1370. X
  1371. X
  1372. X.SH The Arena.
  1373. X
  1374. XThe battles are fought inside an arena, whose walls are provided by strong
  1375. Xelectro-magnetic fields.  Touching the "walls" with your ship can cause
  1376. Xdamage.  The walls also act as solid objects, "bouncing" yor ship off them.
  1377. X
  1378. XAlso, the faster you are travelling when you hit a wall, the more damage
  1379. Xis incurred.
  1380. X
  1381. XAlso provided, for added fun, are many rocks of different sizes just
  1382. Xright for crashing into.
  1383. X
  1384. X
  1385. X.SH Starting XMPB.
  1386. X
  1387. XIf you are using X-terms rather than workstations, then you may suffer a
  1388. Xlarge performance loss.  This is because this program is very server oriented,
  1389. Xmuch of execution time is spent in the server.  Unfortunatley it also seems to
  1390. Xrun slower on colour machines :^(
  1391. X
  1392. XTo get the best performance from the game, the following setup is recommended-
  1393. X- The people who want to play all login to seperate workstations.
  1394. X- Another machine is chosen to run the game. (e.g. pleb1)
  1395. X- Everyone types "xhost pleb1" (some setups may not require this)
  1396. X- The person running the game (from pleb1) starts it up by
  1397. X
  1398. X.nf
  1399. X     xmpb gleeb:0.0 nurk:0.0 frob:0.0 foo:0.0 bar:0.0 ...
  1400. X.fi
  1401. X
  1402. XN.B. You might have to use different values instead of 0.0  It all
  1403. Xdepends on your setup.
  1404. X
  1405. XN.Really.B. You should definitely use different names for the displays
  1406. Xthan the example ones (unless, of course, you have a machine called
  1407. X"gleeb"?)
  1408. X
  1409. X- It's probably best, if you used xhost before running the game to remove the host from the list of trusted hosts by typing "xhost -pleb1", or else you are subject to roaches, antfarms etc.  :-)
  1410. X
  1411. X
  1412. XAfter starting the game up on different X-terms, each is presented by a
  1413. Xprompt in turn-
  1414. X
  1415. XWhat is your name?
  1416. X
  1417. XIf you are a new player, type the name of your new character.  You will 
  1418. Xthen be asked to give a name to your ship.  After this, you will be asked
  1419. Xfor a password, and then asked to retype the password.
  1420. X
  1421. XIf you already have a character, just type your character's name and your
  1422. Xpassword, and you will be welcomed back.
  1423. X
  1424. XYou will then be presented with 3 windows as described below.
  1425. X
  1426. X.SH The Main Window.
  1427. X
  1428. X    The Main Window shows the playfield just around your ship.  You are permenantly in the middle, and will see the world slip by behind you.  There are two planes of stars to give you a good feel of how fast and in what direction you are moving.  The walls appear as lines, these bound your ship into the playing arena.  Oppostion ships, bullets, explosions, debris and clouds of smoke all show up on this window
  1429. X
  1430. X.SH The Radar Window.
  1431. X
  1432. X    The Radar Window has two modes.  It'd default is Long Range (which displays a 1x in the bottom left corner).  The Long Range Radar mode requires that you have a working Long Range Radar.  If you do, then you will see your ship as a cross.  The opposition ships, are dots.  The edge of your radar window is where the walls are.  If your Long Range Radar is not 100%, then it will flicker.  The more damaged, then the less you will see the radar.  If you have a targeting computer, and target an opponent, then the targeted ship will be a large cross in the radar window.
  1433. X    The second mode of the window is Short Range (which displays a 1x in the bottom left corner).  The Short Range Radar shows the world just around your ship, this shows you always in the middle of the screen.  It makes it easier to target the opposition.   Watch out though as the cheaper radars never show the walls.  Again flickering occurs if you have a dmaged Short Range Radar, and nothing will appear if it is destroyed or you don;t own one.  A targeted ship shows up as a large cross.  The opposition show up as little hollow squares, you show up as a cross (same as in Long Range Radar).  With more expensive Short Range Radars: rocks, clouds, debris, bullets all show up as dots, and walls as lines.  Lasers never show up. 
  1434. X
  1435. X.SH The Stats Window.
  1436. X
  1437. X    The Stats Window shows how your ship is going, and is split into four parts.  The top left section shows your shields and energy banks.  These are a simple bar graph, full white is full shields/Energy.  Remember if your shields get to 0, then you take internal damage.  And if your energy is 0, then you can't thrust, shoot, repair e.t.c.
  1438. X    The top right gives some stats about your character, its Name, Ship, Credits, how many credits you have earned this game and finally the value of your ship at the start of the game.  (This is used to even out the credits earned, so that if a cheap ship hits an expensive ship, then the cheap ship gets more credits and vice versa). 
  1439. X    The Bottom Left shows some details about the items that can be be toggled.  Firstly the current weapon is displayed (by default a Pulse Rifle if you have one), below this is the Status of your weapon.  The status can have three values, Ready - you can shoot your weapon, Loading - you will have to wait until the weapon is ready to fire, and Destroyed, which means that the weapon is destroyed and you had better use another weapon.  If You have no weapons, then the Weapon will be None, and no status will be displayed.
  1440. X    Below this is Repair, which shows which item you are repairing currently, including Idle, which means no item is currently being repaired.  If you don't have a repair system, then this line will not appear (BTW - It is foolish to go out without a Repair system).  Below this is targeting  (if you have a TC), this shows the Name of who you are targeting, or Off if no-one is currently being targeted.  Next is Shields Regenerating, this shows whether your shields are regenerating or not (when you need some energy and have high shields, it can be handy to turn shield regenerating off).  Below this (if you have a Jammer), is Jamming: with Off/On beside it, indicating your whether or not you are Jamming.
  1441. X    Finally the bottom right shows all your items, that your ship has, and beside it whether they are Okay (at 100%), between 99% and 1% or Destroyed.
  1442. X
  1443. X.SH Playing the game.
  1444. X
  1445. XAfter all the players have identified themselves, the game begins.
  1446. X
  1447. X
  1448. X.SH Your ship.
  1449. X
  1450. XYour ship is a triangular design.  It has 3 electro-magnetic shields, one on the right side, one on the left, and one on the back.  These shields take a long time to charge, but once charged, energy may be move freely between shields or quickly removed from the shields.  Fitted into the nose of your craft are weapons (useful for killing the other players).
  1451. X
  1452. XYour ship may or may not be fitted with additional items-
  1453. X
  1454. X- Solar Panels, to recharge energy banks.
  1455. X- Long Range radar, to find the enemies that are hiding.
  1456. X- Short range radar, a more detailed view.
  1457. X- Repair System, obviously only useful if you get hit
  1458. X- Engine, for moving the ship around.
  1459. X- Targeting computer, to lock seeking weapons onto enemies.
  1460. X- Jamming device, to confuse other's radars.
  1461. X
  1462. XEnergy is the basis for the ships functioning.  If you have no energy, none of the systems will function.
  1463. X
  1464. X
  1465. X.SH Controlling your craft.
  1466. X
  1467. XAll of the keys used for controlling the ship are configurable using
  1468. Xresources. See Configuring Keys below.
  1469. X
  1470. XThe default keys are as follows-
  1471. X
  1472. X.nf
  1473. Xz - rotate ship anti-clockwise.
  1474. Xx - rotate ship clockwise.
  1475. Xc - change radar scale (i.e. short range/long range)
  1476. Xb - balance the shields. (i.e. balance the shield energy 
  1477. X    evenly over the three shields)
  1478. Xs - Toggle shield regeneration on/off.  This is useful if 
  1479. X    you have poor solar capability and you wish to fire 
  1480. X    more quickly.
  1481. Xw - toggle the current weapon on/off.  This is useful when 
  1482. X    using both firing and change weapon at the same time, 
  1483. X    only "on" weapons are used.
  1484. Xr - Change item being repaired.  Of course, you must have 
  1485. X    a working repair
  1486. X    system.
  1487. Xt - Change current target.  You must have a functioning 
  1488. X    targeting computer.
  1489. Xi - Toggle Jamming Device on/off.  The jamming device 
  1490. X    prevents other ships from seeing you on their radar.
  1491. Xq - Quit.  This effectively acts as a "yield" function.  
  1492. X    Note, that there is a penalty for "yielding" in the face 
  1493. X    of danger (of 1/3 of your credits that you have EARNED 
  1494. X    this game.  You will be removed from the current game 
  1495. X    and all of the windows will be closed.  When the last 
  1496. X    person leaves the game, the program will exit.
  1497. X.fi
  1498. X
  1499. X.SH Configuring Keys.
  1500. X
  1501. X    To configure any of the keys used by the program, you need to place the appropriate line in either your .xrdb or .Xdefaults file.  If you don't have one of these files, then make a new one in your home directory.
  1502. X
  1503. X    e.g. If for instanve you wish to change the key that turns your ship to the left (or anti-clockwise) from an 'x' to an 'l', then put the following line in:
  1504. X
  1505. X.nf
  1506. X    xmpb.turnLeft:    l
  1507. X.fi
  1508. X
  1509. XEach of the resources follows, with a brief description of what the key does.
  1510. X
  1511. X.nf
  1512. X  xmpb.turnRight:           Turn ship right (or Clock-wise)
  1513. X  xmpb.toggleRadar:        Toggles radar between short and 
  1514. X                           long range modes
  1515. X  xmpb.toggleShieldsRegen: Toggles whether shields 
  1516. X                           regenerate or not
  1517. X  xmpb.toggleWeaponStatus: Allows a weapon to be turned 
  1518. X                           off (or on again)
  1519. X  xmpb.changeRepair:       The key to use the repair 
  1520. X                           system
  1521. X  xmpb.changeTarget:       The key to target another 
  1522. X                           combatant
  1523. X  xmpb.invisibility:       The key to turn on jamming 
  1524. X                           (makes you invisible)    
  1525. X  xmpb.quit:               The key quit the game
  1526. X  xmpb.grabEnergy:         The key to grab energy from 
  1527. X                           your shields and place it 
  1528. X                           into your energy banks 
  1529. X  xmpb.balanceShields:     The key to balnce shield 
  1530. X                           strength
  1531. X  xmpb.changeView:         When one dies, this key lets
  1532. X                           you see the other combatants.    
  1533. X  xmpb.fire:               The key to fire a weapon
  1534. X  xmpb.changeWeapon:       The key to change to a new weapon
  1535. X  xmpb.thrust:             The key to engage the engines
  1536. X.fi
  1537. X
  1538. XIMPORTANT!!!  If you wish these changes to occur, then you must make your xrdb realise you have made changes.  Type "xrdb .xrdb" or "xrdb .Xdefaults" Whichever is appropriate to your system.  This needs only to be done if you change the .xrdb (or .Xdefaults) file after you have logged in.  So once you have your keys set up, each time you log in and run xmpb, the keys will be configured the way that makes you happy.
  1539. X
  1540. XN.B.  Special keys such as shift, control e.t.c. are not supported :^(
  1541. X
  1542. X
  1543. XIf you run xmpb with a -s option:
  1544. X
  1545. X        xmpb -s
  1546. X
  1547. X    Then a list of all those characters who have been retired is given, in order of most kills, and then most expensive ship.  Followed by a list of the best NPC's in a similar order
  1548. X
  1549. X
  1550. X.SH The Shop.
  1551. X
  1552. XOk, so you destroyed all of the other players and earned lots of credits.  What do you do with them?  Spend them at the shop and make your ship indestructible.  Or maybe you lost and want to buy a new ship?
  1553. X
  1554. XEach item has an associated quality rating which describes how good the item generally is.  By spending money, it is possible to improve the quality rating of your ships accesories and to buy new and better weapons.
  1555. X
  1556. X    Once an item is chosen from the menus, it will be displayed in the left side of the window.  The right hand side shows what items you have.  Pressing the "Show Weapons" button, shows your weapons.  Press again and your items will be redisplayed.
  1557. X    The buy button purchases (if you have enough $'s) what is shown in the left window.  
  1558. X    To sell or repair one of your items/weapons, select it by clicking on it with the left mouse button.  This will highlight it and give you some details about it.  Then press the sell or repair button. 
  1559. X
  1560. X
  1561. XEngines.
  1562. X
  1563. XEngine qualities range from 1-9 with the default ship having an engine of quality 3.  The quality of engine describes the acceleration provided by the rockets.  All engines use the same amount of energy.
  1564. X
  1565. X
  1566. XSolar Panels.
  1567. X
  1568. XSolar panels' qualities range from 1-9.  The default is 2.  The quality describe how quickly solar energy in space is converted and stored in your ships energy banks.
  1569. X
  1570. X
  1571. XRadars.
  1572. X
  1573. XLong range radars range from 1-9. The quality effects how easily your radar will show up ships that are jamming.
  1574. X
  1575. XShort range radars range from 1-7.  With 1 showing only ships up to 8 which shows everything down to puffs of dust clouds, even bullets.
  1576. X
  1577. XAll radars take no energy to run.
  1578. X
  1579. X
  1580. XRepair Systems.
  1581. X
  1582. XRepair systems range in quality from 1-9.  The quality describe the amount of energy used as well as how quickly repairs are provided by the system.
  1583. X
  1584. X
  1585. XTargeting Computer.
  1586. X
  1587. XThis accessory allows any targetted weapons to be used.  There is no associated quality.  It takes no energy to run.
  1588. X
  1589. X
  1590. XJamming Device.
  1591. X
  1592. XThis accesory allows your ship to jam enemies' radars and targeting computers.  If your ship is having seeking weapons fired upon it, using the jamming device will hide you from an enemy's seekers.  The quality of these items range from 2-9. The higher the quality, the 
  1593. Xmore confused the opppositions radar will be.  And in close (in your Main Window view) you will see less and less of the ship, throught to camouflage and finally being completely invisible. 
  1594. X
  1595. X.SH
  1596. XWeapons.
  1597. X
  1598. XThe weapons currently available are -
  1599. X
  1600. X\fIPulse rifle\fR Default weapon.  Fast firing, small damage, but still
  1601. Xnot a weapon to be sneezed at, due to its small energy use.
  1602. X
  1603. X\fIEnergy Bomb\fR Short Range. Fires fairly quickly. Causes large damage. 
  1604. X
  1605. X\fISeeker Bomb\fR Long Range. These weapons (with the aid of a targeting 
  1606. Xcomputer) will actually seek out and chase an enemy down. High Damage,
  1607. Xbut slow firing rate.
  1608. X
  1609. X\fILight Laser\fR Infinite Range. This weapon will shoot out a beam of light
  1610. Xthe whole way across the playing field, instantaneously. The firing rate
  1611. Xis reasonably quick, and damage is slightly less than that of an energy 
  1612. Xbomb.
  1613. X
  1614. X\fIRail Gun\fR A fast firing weapon that shoots a very small (and hard to see)
  1615. Xprojectile. This weapon has a long range and causes large damage. 
  1616. X
  1617. X\fIMass Driver\fR A fast firing weapon. This weapon can cause a lot of damage
  1618. Xat close range, but at long range is useless. Hence its cheap price.
  1619. X
  1620. X\fIMine\fR A slow firing rate. This weapon drops a mine from the back of your
  1621. Xship. These mines last for a long time and detonate on any who run over
  1622. Xthem.  Damage is very, very large.
  1623. X
  1624. X\fIHeavy Laser\fR Similar to light laser, only more damage, and three beams 
  1625. Xinstead on one.
  1626. X
  1627. X\fIAtomic Spray\fR Short Range. Very fast fire rate. Good in close.
  1628. X
  1629. X\fIHeavy Pulse Rifle\fR Just like a pulse rifle only nastier.
  1630. X
  1631. X\fIMagneto Disk(T)\fR A long range seeking weapon. This one has a superior
  1632. Xtracking algorithm. And won't miss unless you run away really fast.
  1633. XLots of damage.
  1634. X
  1635. X\fIBlack Death\fR A very short lived, short range weapon. But it does heaps
  1636. Xof damage. 
  1637. X
  1638. X    
  1639. X.SH NPC's (Non Playing Characters)
  1640. X
  1641. XIf you don't have any friends, or they're all home studying, then play
  1642. Xagainst one or more of the NPC's provided.
  1643. X
  1644. X    To set up the game with npcs in it:
  1645. X
  1646. X        xmpb gleeb:0.0 nurk:0.0 -npc basic  
  1647. X
  1648. X    This will let two windows appear and one npc (called basic) which
  1649. X    will happily attempt to kill you.
  1650. X
  1651. X        xmpb -npc basic -npcwin gleeb:0.0 -npc nasty -npc killer -npc nurk:0.0
  1652. X
  1653. X    This configuration will allow the npc basic to be seen on gleeb's display.  The full set of main, radar and stats windows show exactly what basic is doing.  (This is useful when programming npc's just to see what they are doing.  And of course if you just want to write a better npc than your mates.) Along with basic, will be nasty and killer.  And again, killer will be shown of nurk's display.
  1654. X
  1655. X    Any mix of these parameters is possible.
  1656. X
  1657. X    xmpb -npc basic gleeb:0.0 -npc nasty -npcwin frob:0.0 nurk:0.0 -npc killer
  1658. X
  1659. X    Would allow to people to play with their ships (on displays gleeb and nurk).  Along with three npcs: basic, nasty and killer.  Also nasty will be seen on frob's display.
  1660. X
  1661. X.nf
  1662. X    The current NPCs are:
  1663. X
  1664. X        basic:   Has the same ship as a player just starting
  1665. X        average: A ship for those who have won 4 or 5 games. 
  1666. X        nasty:   A real nasty NPC.  A good ship and lots 
  1667. X                 of firepower.
  1668. X        ml:      A stupid mine layer
  1669. X        ml2:     An old (and bad) attempt to ram people. A 
  1670. X                 good ship tho' 
  1671. X        john:    A tough ship.  Don't take it out unless 
  1672. X                 you have a real good ship.
  1673. X        harry:   simliar to basic.
  1674. X        beam:    see john.
  1675. X        rad1:    similar to basic
  1676. X        rad2:    Better ship, but still only a pulse rifle
  1677. X        rad3:    In the league of nasty
  1678. X        
  1679. X
  1680. X.SH Playing Tips (From the masters :-)
  1681. X
  1682. X- Don't spend all of your money as soon as you get it.  Or else, when you get nailed, you'll be out.  It's better to have some money as backup in case you get beaten, and have to buy a new ship.
  1683. X
  1684. X
  1685. X.SH SEE ALSO
  1686. Xshop(6),describe(6),retire(6),npcc(6)
  1687. X.SH BUGS
  1688. X
  1689. XBugs, what's a bug? :-)
  1690. X
  1691. XSome versions of X-servers don't like the way we put bitmaps on the
  1692. Xhidden buffer.  This results in the stars, rocks etc. being shown as
  1693. Xinverted (black pic inside a white sqaure).  if this happens to you,
  1694. Xthen change GXxor in line ??? in add_host.c to GXand and recompile.
  1695. XThis will fix this problem.  We can't code it like this, though, because
  1696. Xusing this reverses them on our displays.  Oh well, some incompatibilty
  1697. Xmaybe?  It seems to be on HP machines.
  1698. X
  1699. XSome servers do not clip lines outside the window, instead showing no
  1700. Xpart of the line at all.  This means that lasers and and walls of the
  1701. Xarena will not be displayed.  Again this is a deficiency of the servers,
  1702. Xwhich we haven't figured out which vendor yet.
  1703. X
  1704. X
  1705. X.SH Acknowledgements.
  1706. X
  1707. XThanks to everyone who responded to the posting of version 0.85.  The
  1708. Xresponse was fantastic.  There was obviously enough positive response
  1709. Xto warrant finishing this game off.
  1710. X
  1711. XSpecial thanks to the following people who provided code fragments and
  1712. Xfixes -
  1713. X
  1714. X.nf
  1715. XG Ferguson  Imakefile, original man page
  1716. X            Patches for bitmap directory.
  1717. X            Patches for color displays.
  1718. Xmuzzle      Finding out the inverted bm fix.
  1719. X.fi
  1720. X
  1721. XAnd lastly, to all the people who playtested the game and gave us their
  1722. Xsuggestions and some extra NPC's
  1723. X
  1724. X.nf
  1725. XEspecially:
  1726. X    Robert Dew
  1727. X    Michael Hobbs
  1728. X    Stephen Larcombe
  1729. X    Greg Whickham
  1730. X.fi
  1731. X
  1732. X.SH AUTHORS
  1733. XShane Hyde
  1734. XDamien De Paoli
  1735. X.SH SEE ALSO
  1736. Xshop(6),describe(6),retire(6),npcc(6)
  1737. X.SH BUGS
  1738. X
  1739. XBugs, what's a bug? :-)
  1740. X
  1741. XSome versions of X-servers don't like the way we put bitmaps on the
  1742. Xhidden buffer.  This results in the stars, rocks etc. being shown as
  1743. Xinverted (black pic inside a white sqaure).  if this happens to you,
  1744. Xthen change GXxor in line ??? in add_host.c to GXand and recompile.
  1745. XThis will fix this problem.  We can't code it like this, though, because
  1746. Xusing this reverses them on our displays.  Oh well, some incompatibilty
  1747. Xmaybe?  It seems to be on HP machines.
  1748. X
  1749. XSome servers do not clip lines outside the window, instead showing no
  1750. Xpart of the line at all.  This means that lasers and and walls of the
  1751. Xarena will not be displayed.  Again this is a deficiency of the servers,
  1752. Xwhich we haven't figured out which vendor yet.
  1753. X
  1754. X
  1755. X.SH Acknowledgements.
  1756. X
  1757. XThanks to everyone who responded to the posting of version 0.85.  The
  1758. Xresponse was fantastic.  There was obviously enough positive response
  1759. Xto warrant finishing this game off.
  1760. X
  1761. XSpecial thanks to the following people who provided code fragments and
  1762. Xfixes -
  1763. X
  1764. X.nf
  1765. XG Ferguson  Imakefile, original man page
  1766. X            Patches for bitmap directory.
  1767. X            Patches for color displays.
  1768. Xmuzzle      Finding out the inverted bm fix.
  1769. X.fi
  1770. X
  1771. XAnd lastly, to all the people who playtested the game and gave us their
  1772. Xsuggestions and some extra NPC's
  1773. X
  1774. X.nf
  1775. XEspecially:
  1776. X    Robert Dew
  1777. X    Michael Hobbs
  1778. X    Stephen Larcombe
  1779. X    Greg Whickham
  1780. X.fi
  1781. X
  1782. X.SH AUTHORS
  1783. XShane Hyde
  1784. XDamien De Paoli
  1785. X.SH SEE ALSO
  1786. Xshop(6),describe(6),retire(6),npcc(6)
  1787. X.SH BUGS
  1788. X
  1789. XBugs, what's a bug? :-)
  1790. X
  1791. XSome versions of X-servers don't like the way we put bitmaps on the
  1792. Xhidden buffer.  This results in the stars, rocks etc. being shown as
  1793. Xinverted (black pic inside a white sqaure).  if this happens to you,
  1794. Xthen change GXxor in line ??? in add_host.c to GXand and recompile.
  1795. XThis will fix this problem.  We can't code it like this, though, because
  1796. Xusing this reverses them on our displays.  Oh well, some incompatibilty
  1797. Xmaybe?  It seems to be on HP machines.
  1798. X
  1799. XSome servers do not clip lines outside the window, instead showing no
  1800. Xpart of the line at all.  This means that lasers and and walls of the
  1801. Xarena will not be displayed.  Again this is a deficiency of the servers,
  1802. Xwhich we haven't figured out which vendor yet.
  1803. X
  1804. X
  1805. X.SH Acknowledgements.
  1806. X
  1807. XThanks to everyone who responded to the posting of version 0.85.  The
  1808. Xresponse was fantastic.  There was obviously enough positive response
  1809. Xto warrant finishing this game off.
  1810. X
  1811. XSpecial thanks to the following people who provided code fragments and
  1812. Xfixes -
  1813. X
  1814. X.nf
  1815. XG Ferguson  Imakefile, original man page
  1816. X            Patches for bitmap directory.
  1817. X            Patches for color displays.
  1818. Xmuzzle      Finding out the inverted bm fix.
  1819. X.fi
  1820. X
  1821. XAnd lastly, to all the people who playtested the game and gave us their
  1822. Xsuggestions and some extra NPC's
  1823. X
  1824. X.nf
  1825. XEspecially:
  1826. X    Robert Dew
  1827. X    Michael Hobbs
  1828. X    Stephen Larcombe
  1829. X    Greg Whickham
  1830. X.fi
  1831. X
  1832. X.SH AUTHORS
  1833. XShane Hyde
  1834. XDamien De Paoli
  1835. END_OF_FILE
  1836. if test 24649 -ne `wc -c <'xmpb.man'`; then
  1837.     echo shar: \"'xmpb.man'\" unpacked with wrong size!
  1838. fi
  1839. # end of 'xmpb.man'
  1840. fi
  1841. echo shar: End of archive 2 \(of 8\).
  1842. cp /dev/null ark2isdone
  1843. MISSING=""
  1844. for I in 1 2 3 4 5 6 7 8 ; do
  1845.     if test ! -f ark${I}isdone ; then
  1846.     MISSING="${MISSING} ${I}"
  1847.     fi
  1848. done
  1849. if test "${MISSING}" = "" ; then
  1850.     echo You have unpacked all 8 archives.
  1851.     rm -f ark[1-9]isdone
  1852. else
  1853.     echo You still need to unpack the following archives:
  1854.     echo "        " ${MISSING}
  1855. fi
  1856. ##  End of shell archive.
  1857. exit 0
  1858.