home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / xtrek.zip / XTREK6.6 < prev   
Text File  |  1987-07-05  |  5KB  |  157 lines

  1. Article 52 of comp.sources.games:
  2. Path: ncrcce!rd1632!ncrlnk!ncrcae!ece-csc!mcnc!seismo!rochester!cornell!uw-beaver!tektronix!tekgen!tekred!games-request
  3. From: games-request@tekred.TEK.COM
  4. Newsgroups: comp.sources.games
  5. Subject: v01i078:  xtrek - multiplayer space war for X-windows, Part06/06
  6. Message-ID: <1371@tekred.TEK.COM>
  7. Date: 2 Jul 87 20:56:33 GMT
  8. Sender: billr@tekred.TEK.COM
  9. Lines: 143
  10. Approved: billr@tekred.TEK.COM
  11.  
  12. Submitted by: Chris Guthrie <chris%ic.Berkeley.EDU@ucbvax.berkeley.edu>
  13. Comp.sources.games: Volume 1, Issue 78
  14. Archive-name: xtrek/Part06
  15.  
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 6 (of 6)."
  24. # Contents:  getship.c warning.c
  25. # Wrapped by billr@tekred on Thu Jul  2 10:26:36 1987
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f getship.c -a "${1}" != "-c" ; then 
  28.   echo shar: Will not over-write existing file \"getship.c\"
  29. else
  30. echo shar: Extracting \"getship.c\" \(1253 characters\)
  31. sed "s/^X//" >getship.c <<'END_OF_getship.c'
  32. X
  33. X/*
  34. X
  35. X    Copyright (c) 1986     Chris Guthrie
  36. X
  37. XPermission to use, copy, modify, and distribute this
  38. Xsoftware and its documentation for any purpose and without
  39. Xfee is hereby granted, provided that the above copyright
  40. Xnotice appear in all copies and that both that copyright
  41. Xnotice and this permission notice appear in supporting
  42. Xdocumentation.  No representations are made about the
  43. Xsuitability of this software for any purpose.  It is
  44. Xprovided "as is" without express or implied warranty.
  45. X
  46. X*/
  47. X
  48. X#include <X/Xlib.h>
  49. X#include <stdio.h>
  50. X#include <sys/types.h>
  51. X#include <sys/ipc.h>
  52. X#include <sys/shm.h>
  53. X#include "defs.h"
  54. X#include "struct.h"
  55. X#include "data.h"
  56. X
  57. X/* fill in ship characteristics */
  58. X
  59. Xgetship(shipp)
  60. Xstruct ship *shipp;
  61. X{
  62. X    shipp->s_turns = 128000;
  63. X    shipp->s_accint = 100;
  64. X    shipp->s_decint = 200;
  65. X    shipp->s_accs = 100;
  66. X    shipp->s_torpdamage = 30;
  67. X    shipp->s_phaserdamage = 100;
  68. X    shipp->s_torpspeed = 12;
  69. X    shipp->s_maxspeed = 9;
  70. X    shipp->s_repair = 100;
  71. X    shipp->s_maxfuel = 10000;
  72. X    shipp->s_detcost = 100;
  73. X    shipp->s_torpcost = 10 * shipp->s_torpdamage;
  74. X    shipp->s_phasercost = 10 * shipp->s_phaserdamage;
  75. X    shipp->s_warpcost = 4;
  76. X    shipp->s_cloakcost = 30;
  77. X    shipp->s_recharge = 10;
  78. X    shipp->s_maxarmies = 10;
  79. X}
  80. END_OF_getship.c
  81. if test 1253 -ne `wc -c <getship.c`; then
  82.     echo shar: \"getship.c\" unpacked with wrong size!
  83. fi
  84. # end of overwriting check
  85. fi
  86. if test -f warning.c -a "${1}" != "-c" ; then 
  87.   echo shar: Will not over-write existing file \"warning.c\"
  88. else
  89. echo shar: Extracting \"warning.c\" \(1122 characters\)
  90. sed "s/^X//" >warning.c <<'END_OF_warning.c'
  91. X
  92. X/*
  93. X
  94. X    Copyright (c) 1986     Chris Guthrie
  95. X
  96. XPermission to use, copy, modify, and distribute this
  97. Xsoftware and its documentation for any purpose and without
  98. Xfee is hereby granted, provided that the above copyright
  99. Xnotice appear in all copies and that both that copyright
  100. Xnotice and this permission notice appear in supporting
  101. Xdocumentation.  No representations are made about the
  102. Xsuitability of this software for any purpose.  It is
  103. Xprovided "as is" without express or implied warranty.
  104. X
  105. X*/
  106. X
  107. X
  108. X#include <X/Xlib.h>
  109. X#include <stdio.h>
  110. X#include <math.h>
  111. X#include <signal.h>
  112. X#include "defs.h"
  113. X#include "struct.h"
  114. X#include "data.h"
  115. X
  116. X/*
  117. X** The warning in text will be printed in the warning window.
  118. X** The message will last WARNTIME/10 seconds unless another message
  119. X** comes through and overwrites it.
  120. X*/
  121. Xwarning(text)
  122. Xchar *text;
  123. X{
  124. X    warntimer = udcounter + WARNTIME;  /* set the line to be cleared */
  125. X    if (warncount > 0)
  126. X    XPixSet(warnw, 5, 5, dfontinfo->width * warncount, dfontinfo->height,
  127. X        backColor);
  128. X    warncount = strlen(text);
  129. X    XText(warnw, 5, 5, text, warncount, dfont, textColor, backColor);
  130. X    XFlush();
  131. X}
  132. END_OF_warning.c
  133. if test 1122 -ne `wc -c <warning.c`; then
  134.     echo shar: \"warning.c\" unpacked with wrong size!
  135. fi
  136. # end of overwriting check
  137. fi
  138. echo shar: End of archive 6 \(of 6\).
  139. cp /dev/null ark6isdone
  140. MISSING=""
  141. for I in 1 2 3 4 5 6 ; do
  142.     if test ! -f ark${I}isdone ; then
  143.     MISSING="${MISSING} ${I}"
  144.     fi
  145. done
  146. if test "${MISSING}" = "" ; then
  147.     echo You have unpacked all 6 archives.
  148.     rm -f ark[1-9]isdone
  149. else
  150.     echo You still need to unpack the following archives:
  151.     echo "        " ${MISSING}
  152. fi
  153. ##  End of shell archive.
  154. exit 0
  155.  
  156.  
  157.