home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch3a < prev    next >
Encoding:
Internet Message Format  |  1989-07-20  |  61.3 KB

  1. Path: uunet!zephyr!tektronix!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v07i052:  conquer4 - middle earth multi-player game (V4), Patch3a
  5. Message-ID: <4291@tekred.CNA.TEK.COM>
  6. Date: 19 Jul 89 17:53:51 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2101
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@bu-cs.bu.edu>
  12. Posting-number: Volume 7, Issue 52
  13. Archive-name: conquer4/Patch3a
  14. Patch-To: conquer4: Volume 6, Issue 83-97
  15.  
  16.     [This patch is split into four parts Patch3[a-d]. You can
  17.      not feed this directly to patch. You must unshar this and
  18.      the following 3 articles then feed the file "patchV4.03"
  19.      to 'patch'.    -br]
  20.  
  21. [[Due to diffs being larger than the actual files,
  22. I have put the following files in:
  23.  
  24.        README     - the installation and a general notes file.
  25.        Makefile   - hopefully this is more portable now.
  26.        newlogin.c - entire file rewritten.
  27.                     [Try "conqrun -a" now!!!]
  28.        oMakefile  - original 4.0 Makefile.
  29.                     [supporting two Makefiles, ack!]
  30.        patchV4.03 - a patch for the rest!
  31.  
  32. This time, they can safely replace all of the above.
  33. Don't remove any other files though :-)... maybe try
  34. the unshar in another directory, then move them over.
  35.  
  36. A short list of what I have done:
  37.  
  38.  -- added the environment variable CONQ_OPTS to enable default
  39.      user values to be sent to conquer.
  40.  -- added the ability to allow another person to administrate
  41.      a world.  [Method:  One "conquer" administrator for all
  42.      worlds of conquer and each world can also have a separate
  43.      administrator.]
  44.  -- fixed up the help files.
  45.  -- added a nice highlight of nation name in news.  [This was
  46.      contributed by T. Kivinen]
  47.  -- REWROTE NEWLOGIN ROUTINE!!!  Added a curses interface to
  48.      the newlogin routine.  This makes building a country a
  49.      much more pleasant experience.
  50.  -- one note:  Orcs repro limit is still 14% but may only purchase
  51.      up to 12% at the start of the game.  [Making the limit like
  52.      the +2% allowed with other nations and extra magic]
  53.  -- and many more....
  54.  
  55. As before, a mostly complete list of changes will be found
  56. in the files 'notes.v4' after patching.
  57.  
  58. Well... here it is, comments and questions appreciated.
  59.  
  60. conquer mailing list:  conquer-news@bu-cs.bu.edu
  61.  
  62. adam bryant
  63. adb@bu-cs.bu.edu
  64. conquer@bu-cs.bu.edu
  65. ]]
  66.  
  67. #!/bin/sh
  68. # shar:    Shell Archiver  (v1.22)
  69. #
  70. # This is part 1 of a multipart archive                                    
  71. # do not concatenate these parts, unpack them in order with /bin/sh        
  72. #
  73. #    Run the following text with /bin/sh to create:
  74. #      Makefile
  75. #      README
  76. #      newlogin.c
  77. #      oMakefile
  78. #      patchV4.03
  79. #
  80. if test -r s2_seq_.tmp
  81. then echo "Must unpack archives in sequence!"
  82.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  83.      exit 1; fi
  84. sed 's/^X//' << 'SHAR_EOF' > Makefile &&
  85. X#    conquer: Copyright (c) 1989 by Edward M Barlow
  86. X#
  87. X#    BY CHANGING THIS FILE, YOU AGREE TO ABIDE BY THE LIMITATIONS STATED IN
  88. X#    THE LIMITED USE CONTRACT CONTAINED IN THE FILE "header.h"
  89. X#
  90. X#       This makefile has been modified to allow compilation using
  91. X#       a parallelized make program.  It has been used successfully
  92. X#       on an Encore Multimax parallel computer with both 4 and
  93. X#       6 cpus.
  94. X#
  95. X#       It should pose no problems for non parallel makes.
  96. X#
  97. X#       Please report any problems to adb@bucsf.bu.edu
  98. X#                   or adb@bu-cs.bu.edu
  99. X#
  100. XMAKE    = /bin/make
  101. XCC    = /bin/cc
  102. XRM      = /bin/rm -f
  103. X
  104. X#    LN must be "ln -s" if source and default directories span disks
  105. XLN    = ln
  106. XCP    = cp
  107. XNULL    = 2>/dev/null
  108. X
  109. X#    Flags to lint
  110. XLTFLG   = -h -lcurses
  111. X
  112. X#    Options for shar program, SHARLIM is limit of each shar
  113. X#    file created in kilobytes and SHARNAM is the prefix for
  114. X#    SHARFILE name.
  115. X#    [This is for a public domain shar from USENET, I can send
  116. X#    copies if you wish - adb@bu-cs.bu.edu]
  117. XSHAR    = xshar
  118. XSHARLIM    = 50
  119. XSHARNAM    = shar.
  120. XSHARFLG = -D -c -l$(SHARLIM) -o$(SHARNAM)
  121. X
  122. X#    This should be installed by whomever you want to own the game.
  123. X#    I recommend "games" or "root".
  124. X
  125. X#    uncomment the next line if you dont have getopt in your library
  126. X#    (eg you are on a pc, or a non unix system).  getopt.c is a
  127. X#    public domain software, and has not been tested by the authors
  128. X#    of conquer.  [not distributed with conquer V4]
  129. X#GETOPT    = getopt.o
  130. X
  131. X#if the final link does not compile change to the line below
  132. XLIBRARIES = -lcurses -ltermcap
  133. X#LIBRARIES = -lcurses
  134. X
  135. X#    DEFAULT is the directory where default nations & help files will be 
  136. X#    stored.     It is also the default directory = where players will play 
  137. X#    if they do not use the -d option.
  138. XDEFAULT = /usr4/acm/stud/adb/games/conqlib
  139. X
  140. X#    This directory is where the executables will be stored
  141. XEXEDIR = /usr4/acm/stud/adb/games
  142. X
  143. X#    Definitions used for compiling conquer
  144. XCDEFS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DEXEDIR=\"$(EXEDIR)\"
  145. X
  146. X#    Options flag used for non-debugging purposes
  147. XOPTFLG  = -O
  148. X
  149. X#    Options flag used for debugging purposes
  150. X#    [make sure to comment out 'strip' commands in install section]
  151. X#OPTFLG  = -DDEBUG -g
  152. X
  153. X#    this is the name of the user executable
  154. X#       the user executable contains commands for the games players
  155. XGAME  = conquer
  156. X#    this is the name of the administrative executable
  157. X#       the administrative executable contains commands for the game super user
  158. XADMIN = conqrun
  159. X#    this is the name of the sorting program which conquer uses
  160. XSORT  = conqsort
  161. X
  162. X#       GAME IDENTIFICATION
  163. X#
  164. X#    Set this to some unique identifier for each game you wish
  165. X#    to create via 'make new_game'.  It will make a subdirectory
  166. X#    $(GAMEID) to the DEFAULT data directory where it will store
  167. X#    data for the new game.  [Leave it blank to create the default
  168. X#    game]
  169. XGAMEID = 
  170. X
  171. X# AFILS are files needed for game updating...
  172. XAFILS = combat.c cexecute.c io.c admin.c makeworl.c navy.c spew.c \
  173. Xnewlogin.c update.c magic.c npc.c misc.c randeven.c data.c trade.c check.c
  174. XAOBJS = combat.o cexecuteA.o ioA.o admin.o makeworl.o navyA.o spew.o \
  175. Xnewlogin.o update.o magicA.o npc.o miscA.o randeven.o dataA.o \
  176. XtradeA.o $(GETOPT) check.o
  177. X
  178. X# GFILS are files needed to run a normal interactive game
  179. XGFILS = commands.c cexecute.c forms.c io.c main.c move.c navy.c \
  180. Xmagic.c misc.c reports.c data.c display.c extcmds.c trade.c check.c
  181. XGOBJS = commands.o cexecuteG.o forms.o ioG.o main.o move.o navyG.o \
  182. XmagicG.o miscG.o reports.o dataG.o display.o extcmds.o tradeG.o \
  183. X$(GETOPT) check.o
  184. X
  185. X# List of temporary C files
  186. XDAFILS = cexecuteA.c ioA.c miscA.c navyA.c magicA.c dataA.c tradeA.c
  187. XDGFILS = cexecuteG.c ioG.c miscG.c navyG.c magicG.c dataG.c tradeG.c
  188. X
  189. X#txt[0-4] are input help files.  help[0-4] are output. HELPSCR is sed script.
  190. XHELP=txt
  191. XHELPOUT=help
  192. XHELPSCR=sed
  193. X
  194. XHEADERS=header.h data.h newlogin.h patchlevel.h
  195. XSUPT1=nations Makefile $(HELP)[0-5] README run man.pag rules
  196. XSUPT2=execute messages news commerce
  197. XALLFILS=$(SUPT1) $(HEADERS) $(AFILS) commands.c forms.c main.c move.c \
  198. Xreports.c display.c extcmds.c newhelp.c sort.c getopt.c
  199. X
  200. Xall:    $(ADMIN) $(GAME) $(SORT) helpfile
  201. X    @echo YAY! make new_game to set up permissions, zero appropriate
  202. X    @echo initial files, move $(GAME) and $(ADMIN) to 
  203. X    @echo $(EXEDIR), and set up the world.
  204. X    @echo If a game is in progress, make install will just move $(GAME) 
  205. X    @echo and $(ADMIN) to $(EXEDIR).
  206. X    @echo
  207. X
  208. X$(ADMIN):    $(AOBJS)
  209. X    @echo phew...
  210. X    -$(RM) $(DAFILS) $(NULL)
  211. X    @echo if the next command does not work you might also need -ltermcap
  212. X    @echo === compiling administrative functions
  213. X    $(CC) $(OPTFLG) -o $(ADMIN) $(AOBJS) $(LIBRARIES)
  214. X#    comment out the next line during debugging    
  215. X    strip $(ADMIN)
  216. X
  217. X$(GAME):    $(GOBJS)
  218. X    @echo phew... 
  219. X    -$(RM) $(DGFILS) $(NULL)
  220. X    @echo if the next command does not work you might also need -ltermcap
  221. X    @echo === compiling user interface
  222. X    $(CC) $(OPTFLG) -o $(GAME) $(GOBJS) $(LIBRARIES)
  223. X#    comment out the next line during debugging
  224. X    strip $(GAME)
  225. X
  226. X$(SORT):    sort.c
  227. X    $(CC) $(OPTFLG) -o $(SORT) sort.c
  228. X#    comment out the next line if debugging
  229. X    strip $(SORT)
  230. X
  231. Xclobber:
  232. X    $(RM) *.o $(HELPOUT)[0-5] $(SORT) newhelp in$(GAME) in$(SORT) in$(ADMIN) $(HELPSCR).[12] lint[aghs] conquer.doc $(GAME) $(ADMIN) $(NULL)
  233. X
  234. Xclean:
  235. X    $(RM) *.o lint[aghs] conquer.doc $(NULL)
  236. X
  237. Xin$(GAME):    $(GAME)
  238. X    -$(RM) $(EXEDIR)/$(GAME)
  239. X    $(CP) $(GAME) $(EXEDIR)
  240. X    chmod 4751 $(EXEDIR)/$(GAME)
  241. X    touch in$(GAME)
  242. X
  243. Xin$(ADMIN):    $(ADMIN)
  244. X    -$(RM) $(EXEDIR)/$(ADMIN)
  245. X    $(CP) $(ADMIN) $(EXEDIR)
  246. X    chmod 4751 $(EXEDIR)/$(ADMIN)
  247. X    touch in$(ADMIN)
  248. X
  249. Xin$(SORT):    $(SORT)
  250. X    -$(RM) $(EXEDIR)/$(SORT)
  251. X    $(CP) $(SORT) $(EXEDIR)
  252. X    chmod 751 $(EXEDIR)/$(SORT)
  253. X    touch in$(SORT)
  254. X
  255. Xinstall:    in$(GAME) in$(ADMIN) in$(SORT) insthelp
  256. X    @echo ""
  257. X    @echo "Installation complete"
  258. X
  259. Xnew_game:    all insthelp
  260. X    @echo Installing new game
  261. X    -mkdir $(EXEDIR) $(NULL)
  262. X    -mkdir $(DEFAULT)  $(NULL)
  263. X    -mkdir $(DEFAULT)/$(GAMEID) $(NULL)
  264. X    chmod 755 $(EXEDIR)
  265. X    chmod 750 $(DEFAULT)/$(GAMEID) $(DEFAULT)
  266. X    $(CP) $(GAME) $(ADMIN) $(SORT) $(EXEDIR)
  267. X    chmod 4755 $(EXEDIR)/$(GAME) $(EXEDIR)/$(ADMIN)
  268. X    chmod 0755 $(EXEDIR)/$(SORT)
  269. X    chmod 0600 nations
  270. X    chmod 0700 run
  271. X    $(CP) nations rules $(DEFAULT)/$(GAMEID)
  272. X    $(CP) nations rules $(DEFAULT)
  273. X    @echo now making the world
  274. X    $(EXEDIR)/$(ADMIN) -d "$(GAMEID)" -m
  275. X    $(EXEDIR)/$(ADMIN) -d "$(GAMEID)" -a
  276. X
  277. Xinsthelp:    helpfile
  278. X    @echo Installing helpfiles
  279. X    -$(RM) $(DEFAULT)/$(HELPOUT)0
  280. X    -$(LN) $(HELPOUT)0 $(DEFAULT)/$(HELPOUT)0
  281. X    -$(RM) $(DEFAULT)/$(HELPOUT)1
  282. X    -$(LN) $(HELPOUT)1 $(DEFAULT)/$(HELPOUT)1
  283. X    -$(RM) $(DEFAULT)/$(HELPOUT)2
  284. X    -$(LN) $(HELPOUT)2 $(DEFAULT)/$(HELPOUT)2
  285. X    -$(RM) $(DEFAULT)/$(HELPOUT)3
  286. X    -$(LN) $(HELPOUT)3 $(DEFAULT)/$(HELPOUT)3
  287. X    -$(RM) $(DEFAULT)/$(HELPOUT)4
  288. X    -$(LN) $(HELPOUT)4 $(DEFAULT)/$(HELPOUT)4
  289. X    -$(RM) $(DEFAULT)/$(HELPOUT)5
  290. X    -$(LN) $(HELPOUT)5 $(DEFAULT)/$(HELPOUT)5
  291. X    touch insthelp
  292. X
  293. Xhelpfile:    $(HELPOUT)0 $(HELPOUT)1 $(HELPOUT)2 $(HELPOUT)3 $(HELPOUT)4 $(HELPOUT)5
  294. X    @echo Helpfiles built
  295. X    touch helpfile
  296. X
  297. X$(HELPOUT)0:    $(HELP)0 $(HELPSCR).1 $(HELPSCR).2
  298. X    @echo building $(HELPOUT)0
  299. X    cat $(HELP)0 | sed -f $(HELPSCR).1 | sed -f $(HELPSCR).2 > $(HELPOUT)0
  300. X
  301. X$(HELPOUT)1:    $(HELP)1 $(HELPSCR).1 $(HELPSCR).2
  302. X    @echo building $(HELPOUT)1
  303. X    cat $(HELP)1 | sed -f $(HELPSCR).1 | sed -f $(HELPSCR).2 > $(HELPOUT)1
  304. X
  305. X$(HELPOUT)2:    $(HELP)2 $(HELPSCR).1 $(HELPSCR).2
  306. X    @echo building $(HELPOUT)2
  307. X    cat $(HELP)2 | sed -f $(HELPSCR).1 | sed -f $(HELPSCR).2 > $(HELPOUT)2
  308. X
  309. X$(HELPOUT)3:    $(HELP)3 $(HELPSCR).1 $(HELPSCR).2
  310. X    @echo building $(HELPOUT)3
  311. X    cat $(HELP)3 | sed -f $(HELPSCR).1 | sed -f $(HELPSCR).2 > $(HELPOUT)3
  312. X
  313. X$(HELPOUT)4:    $(HELP)4 $(HELPSCR).1 $(HELPSCR).2
  314. X    @echo building $(HELPOUT)4
  315. X    cat $(HELP)4 | sed -f $(HELPSCR).1 | sed -f $(HELPSCR).2 > $(HELPOUT)4
  316. X
  317. X$(HELPOUT)5:    $(HELP)5 $(HELPSCR).1 $(HELPSCR).2
  318. X    @echo building $(HELPOUT)5
  319. X    cat $(HELP)5 | sed -f $(HELPSCR).1 | sed -f $(HELPSCR).2 > $(HELPOUT)5
  320. X
  321. X$(HELPSCR).1:    newhelp
  322. X    newhelp
  323. X
  324. X$(HELPSCR).2:    newhelp
  325. X    newhelp
  326. X
  327. Xnewhelp:    dataG.o    newhelp.o
  328. X    $(CC) dataG.o newhelp.o -o newhelp
  329. X
  330. Xlint:
  331. X    lint $(LTFLG) $(CDEFS) -DCONQUER $(GFILS) > lintg
  332. X    lint $(LTFLG) $(CDEFS) -DADMIN $(AFILS) > linta
  333. X
  334. Xdocs:    conquer.doc
  335. X
  336. Xconquer.doc:    $(HELPOUT)0 $(HELPOUT)1 $(HELPOUT)2 $(HELPOUT)3 $(HELPOUT)4 $(HELPOUT)5
  337. X    cat $(HELPOUT)? |sed -e "s/^DONE/ /g"|sed -e "s/^END//g" >conquer.doc
  338. X
  339. Xcpio:
  340. X    -$(RM) core
  341. X    find . -name '*[CrpsEech]' -print | cpio -ocBv > cpiosv
  342. X
  343. Xshar:    
  344. X    echo " lines   words chars   FILENAME" > MANIFEST
  345. X    wc $(ALLFILS) >> MANIFEST
  346. X    $(SHAR) $(SHARFLG) $(ALLFILS) MANIFEST
  347. X
  348. X.cA.o:    $<
  349. X    ( trap "" 0 1 2 3 4 ; $(LN) $*.c $*A.c ;\
  350. X    $(CC) $(OPTFLG) $(CDEFS) -DADMIN -c $*A.c ;\
  351. X    $(RM) $*A.c )
  352. X
  353. X.cG.o:    $<
  354. X    ( trap "" 0 1 2 3 4 ; $(LN) $*.c $*G.c ;\
  355. X    $(CC) $(OPTFLG) $(CDEFS) -DCONQUER -c $*G.c ;\
  356. X    $(RM) $*G.c )
  357. X
  358. X.c.o:    $<
  359. X#    compiles using both defines since they
  360. X#    are needed for the data.h definitions for
  361. X#    each file... but should not be needed for
  362. X#    the actual C source file being compiled
  363. X    $(CC) $(OPTFLG) $(CDEFS) -DADMIN -DCONQUER -c $*.c
  364. X
  365. X$(GOBJS):    data.h header.h
  366. X
  367. X$(AOBJS):    data.h header.h
  368. X
  369. XioG.o:    data.h header.h patchlevel.h
  370. X
  371. XioA.o:    data.h header.h patchlevel.h
  372. X
  373. Xnewlogin.o:    data.h header.h newlogin.h patchlevel.h
  374. X
  375. Xmain.o:    data.h header.h patchlevel.h
  376. X
  377. Xnewhelp.c:    data.h header.h patchlevel.h
  378. X
  379. X#    Clear suffixes
  380. X.SUFFIXES:    
  381. X
  382. X#    Suffixes for conquer files.
  383. X.SUFFIXES:    A.o G.o .c .h .o
  384. SHAR_EOF
  385. chmod 0640 Makefile || echo "restore of Makefile fails"
  386. sed 's/^X//' << 'SHAR_EOF' > README &&
  387. X    *********************************************************
  388. X    *    README FILE FOR THE INSTALLER OF CONQUER    *
  389. X    *********************************************************
  390. X
  391. XWhat you have here is a copyrighted release 4 version version of CONQUER.  
  392. XI make no guaranties to the sanity or style of this code, but do believe
  393. Xthat it should work as documented.  I have included numerous bugfixes
  394. Xfrom previous releases posting, and have added numerous enhancements. 
  395. XThe file notes.v4 details changes between v3.5 and v4, bugs and other things.  
  396. X
  397. XI have no current email address... Too bad.  I will post a patch to THIS FILE
  398. Xwhen i get a new email address. The hazards of switching jobs.  Adam Bryant
  399. Xhas volunteered to take mail for the summer of 1989 at "arpa!bu-cs.bu.edu!adb"
  400. Xor "adb@bu-cs.bu.edu".  He is the co-author of the game... so send comments to
  401. Xhim.  We like feedback on the game.  Comments and feature requests are very
  402. Xuseful to me as they are my primary method of deciding what to next add to the
  403. Xcode.  Your interest is appreciated.
  404. X
  405. XIncluded in this file are the following:
  406. X    1) A Brief Description of Conquer
  407. X    2) Installation (unpacking) Instructions
  408. X    3) Configuration Instructions
  409. X    4) Compilation Instructions
  410. X    5) Administration instructions
  411. X    6) Changes in this version
  412. X
  413. XThis version should not be redistributed without the permission of Edward
  414. XBarlow or Adam Bryant ( please read the copyright note in header.h ).
  415. X
  416. XAgain, any comments or bug reports would be greatly appreciated.
  417. X
  418. X-----------------------------------------------------------
  419. XI   A Brief Description of Conquer
  420. X-----------------------------------------------------------
  421. XA complete description of Conquer v4 is contained in "man.page" and
  422. X"conquer.docs".  "conquer.docs" is created from the files txt[0-5] which are
  423. Xcustomized from data in the header files.  These txt[] files are then
  424. Xconverted int help[0-5] files, which contain configuration data.  "make docs"
  425. Xwill create this file from current data.  Note conquer.doc IS NOT created
  426. Xprogram is compiled.  I have tried to make the documentation as good as
  427. Xpossible, but I guarantee that I have missed a lot.  Consider this a feature
  428. Xand enjoy any (hopefully pleasant) suprises you get.
  429. X-----------------------------------------------------------
  430. XII  Installation (unpacking) Instructions
  431. X-----------------------------------------------------------
  432. XThis program came in several shell archive scripts. They can can be unpacked
  433. Xby using "sh filename".  If you are reading this, you know this.
  434. X
  435. XIf you suspect missing files, please check the MANIFEST.
  436. X-----------------------------------------------------------
  437. XIII Configuration
  438. X-----------------------------------------------------------
  439. XTHE FOLLOWING FILES SHOULD BE MODIFIED TO REFLECT YOUR ENVIRONMENT
  440. XAND THE TYPE OF GAME YOU WISH TO PLAY.  THE GAME WILL NOT RUN UNLESS
  441. XYOU MODIFY THESE FILES APPROPRIATELY.
  442. X
  443. Xheader.h    modify as per instructions
  444. XMakefile    modify as per instructions
  445. X
  446. XI have tried to comment this stuff appropriately.
  447. X
  448. XThe options specified in these files will be reflected
  449. Xin the conquer.docs and help files when the program is compiled.
  450. X
  451. XYou will probably also want to take a look at the "rules*" file. This
  452. Xcontains the grammar rules for the random mail messages generated by
  453. XNPC's. You may wish to insert some local people's names, or think of
  454. Xsome really juicy insults. The format of the file should be obvious;
  455. Xbasically %FOO declares a class FOO and one of the things inside that
  456. Xclass will be selected randomly. Obviously, %MAIN is the top level which
  457. Xthen calls on the subclasses to construct sentences.
  458. X
  459. X-----------------------------------------------------------
  460. XIV  Compilation Instructions
  461. X-----------------------------------------------------------
  462. XThis program should be easy to compile.  After header.h and Makefile have
  463. Xbeen edited properly, you may type 'make' to compile conquer, and
  464. X'make new_game' to build and install a new game.
  465. X
  466. XNote: Sometimes curses does not include termcap or termlib.  If all the
  467. X    '.c' files get compiled, but do not link together,  and 
  468. X    unreferenced symbol errors occur,  try adding "-ltermcap" after
  469. X    the "-lcurses" line in the makefile.
  470. X
  471. X-----------------------------------------------------------
  472. XV   administration instructions
  473. X-----------------------------------------------------------
  474. XNow that you have compiled it, this is how you administer/set up/run the game.
  475. XI recommend following these instructions once yourself in a mock game 
  476. X(ie. no other players) for a few turns to get things straight.  Then you 
  477. Xcan add other players.
  478. X
  479. XThe command line format for the administration commands is 
  480. X
  481. X    conqrun [-maxp -dDIR -rSCENARIO]\n",argv[0]);
  482. X        -m          make a world
  483. X        -a          add new player
  484. X        -x          execute program
  485. X        -d DIR      to use play different game
  486. X        -p          print a map
  487. X        -r SCENARIO read map while making a new world
  488. X                uses SCENARIO.ele, SCENARIO.veg, &  SCENARIO.nat
  489. X
  490. XAlso, some useful god functions are provided through the conquer program
  491. Xthrough logging in as 'god' with 'conquer -n god'.
  492. X
  493. XConquer now supports two layers of game administration:  the god of
  494. Xconquer, as defined by the LOGIN define in header.h, may allow each
  495. Xworld to have an administrator or demi-god.  This demi-god will be able
  496. Xto perform updates and other god functions for this world only.  This
  497. Xfeature allows for multiple worlds, each governed by a different god.
  498. XDuring the creation of a world, god will be prompted for the name of the
  499. Xdemi-god for the new world.  Just hitting return will mean that god will
  500. Xhimself act as the demi-god for this world.
  501. X
  502. XUnlike godship, the demi-god for a world may be changed during the
  503. Xrunning of a game, without recompilation of conquer.  This is done using
  504. Xthe 'c'hange menu when logged in as god.
  505. X
  506. XIn addition the the conqrun command, the makefile helps you as follows:
  507. X
  508. Xmake:        Compiles the code.
  509. Xmake clobber:   Clobber everything but the source (destroys executables)
  510. Xmake clean:     Clean up objects (does not destroy executables)
  511. Xmake new_game:    Create a new game, make world, add players...
  512. Xmake install:    Install game in appropriate directory
  513. Xmake docs:    Creates documentation from help file
  514. X
  515. XFinally, I have included an 'at' script that permits automatic updating.
  516. Xrun:        read this shell script, it permits you to run the update
  517. X        automatically.  It needs to be modified for time to update.
  518. X
  519. XThe command line for the conquer executable can be found by reading
  520. Xthe help files.  
  521. X
  522. XAgain, prior to the compile, you should have followed the instructions
  523. Xin the Makefile and in header.h.  
  524. X
  525. XYou can administrate world either via "make new_game" or via:
  526. X    <conqrun -m>    this will make your world.  
  527. X            This also sets up npc nations as per the nations file
  528. X            npc stats can be adjusted by editing nations
  529. X            prior to making the world.  Non player nations have
  530. X            the same password as god.
  531. Xor    <conqrun -rSCENARIO>    this will make your world by using scenarios.
  532. X            Basically, the scenarios include a nation file and
  533. X            three map files (elevation, vegetation, and nation
  534. X            setup). Look at the rome scenario included in the game.
  535. X            [ this scenario is not finished yet ]
  536. X
  537. XYou can add ( 0 or more ) players via
  538. X    <conqrun -a>    which should be self explanatory.  This wont work if
  539. X            the world is filled, as it would be if a scenario was
  540. X            read in and the SCENARIO.ntn file filled the world.
  541. X            This is because the program wont find spots to place
  542. X            your players.  Adjust the nations file for your
  543. X            scenario to set up players.  When they log in, they
  544. X            will be asked for a new password.
  545. X
  546. X
  547. XOnce you log in as a player or as god, you can get help by
  548. Xtyping '?'.  Play around with the commands and get your syntax right.
  549. X
  550. XTry logging in as either a player or non player nation (they use the super
  551. Xuser password) and noticing any differences.
  552. X
  553. XIMPORTANT NOTE ON PLAY BALANCE: 
  554. XThe world is not created equal.  Some players may start in very bad
  555. Xpositions.  You can either start them over (destroy that nation in the
  556. Xchange nation command and create a new one), or modify the surrounding
  557. Xterain appropriately (god can use the redesignate command to change
  558. Xelevation and vegetation).
  559. X
  560. XNow move around on the map and learn where the players are positioned.
  561. XIf there is a problem (they are surrounded by water...), use the
  562. Xredesignate command to change elevation or vegetation.  In the worst
  563. Xcase, god can destroy a nation with 'c', the change nation command.
  564. XOnce you think the game will be fair, it is time to allow players to
  565. Xproceed.
  566. X
  567. XNow you are all set -- play via 
  568. X    <conquer>
  569. X
  570. Xand update with <conqrun -x> via an script similar to "run"
  571. SHAR_EOF
  572. chmod 0640 README || echo "restore of README fails"
  573. sed 's/^X//' << 'SHAR_EOF' > newlogin.c &&
  574. X/*conquer : Copyright (c) 1988 by Ed Barlow.
  575. X *  I spent a long time writing this code & I hope that you respect this.
  576. X *  I give permission to alter the code, but not to copy or redistribute
  577. X *  it without my explicit permission.  If you alter the code,
  578. X *  please document changes and send me a copy, so all can have it.
  579. X *  This code, to the best of my knowledge works well,  but it is my first
  580. X *  'C' program and should be treated as such.  I disclaim any
  581. X *  responsibility for the codes actions (use at your own risk).  I guess
  582. X *  I am saying "Happy gaming", and am trying not to get sued in the process.
  583. X *                                                Ed
  584. X */
  585. X
  586. X/*create a new login for a new player*/
  587. X#include <ctype.h>
  588. X#include "patchlevel.h"
  589. X#include "header.h"
  590. X#include "data.h"
  591. X#include "newlogin.h"
  592. X
  593. X/* information about national classes */
  594. Xchar *Classwho[]= { "DEHO", "DEH", "DEH", "EH", "H", "DHO", "HE", "DHO",
  595. X    "O", "O", "O" };
  596. Xchar *CPowlist[]= { "None", "None", "None", "SUMMON", "RELIGION", "SAILOR",
  597. X    "URBAN", "WARLORD", "DESTROYER", "MA_MONST", "THE_VOID"};
  598. Xint  Classcost[]= { 0, 0, 0, 4, 2, 2, 2, 6, 4, 4, 2 };
  599. Xlong Classpow[]= { 0x0L, 0x0L, 0x0L, SUMMON, RELIGION, SAILOR,
  600. X    URBAN, 0x000000007L, DESTROYER, 0x00000700L, THE_VOID };
  601. X
  602. Xchar *Mprompt[]= { "<<--", "-->>" };
  603. Xchar *LType[]={ "Random", "Fair", "Great" };
  604. X
  605. Xchar *Mlabels[]= { "Population", "Treasury", "Location",
  606. X    "Military", "Attack Bonus", "Defense Bonus", "Reproduction",
  607. X    "Movement", "Magic Powers", "Leaders", "Raw Materials" };
  608. X
  609. Xchar *Mitems[]= { "people", "gold talons", "location", "soldiers",
  610. X    "percent", "percent", "percent", "move points", "powers",
  611. X    "nation leaders", "units of food" };
  612. X
  613. Xchar *Mhelp[]= { "Population: Amount of citizens in your nation",
  614. X    "Treasury: Amount of monetary wealth in your nation",
  615. X    "Location: Relative value of nation placement in world",
  616. X    "Soldiers: Number of men in the national army, not counting leaders",
  617. X    "Attack Bonus: Skill level of your troops when attacking",
  618. X    "Defense Bonus: Skill level of your troops when defending",
  619. X    "Reproduction: Yearly rate of civilian population increase",
  620. X    "Movement: Number of movement points per normal army unit",
  621. X    "Magic Powers: Randomly obtain a new magical power",
  622. X    "Leaders: Number of leader units, including national ruler",
  623. X    "Raw Materials: Starting values for jewels, metal, and food" };
  624. X
  625. Xextern int pwater;        /* percent water in world (0-100) */
  626. Xextern FILE *fexe, *fopen();
  627. Xextern short country;
  628. Xint    numleaders;
  629. Xint spent[CH_NUMBER];
  630. X
  631. X/* Teraform the area around somebodies capitol */
  632. X/* this gives everybody some chance of success */
  633. Xvoid
  634. Xteraform( x,y,range, chance )
  635. Xint x,y;
  636. Xint range,chance;
  637. X{
  638. X    int i,j;
  639. X    switch(curntn->race) {
  640. X    case DWARF:
  641. X        sct[x][y].altitude=MOUNTAIN;
  642. X        for(i=x-range;i<=x+range;i++)
  643. X        for(j=y-range;j<=y+range;j++)
  644. X        if((i!=x)&&(j!=y)&&(ONMAP(i,j))
  645. X        &&(sct[i][j].altitude!=WATER)){
  646. X            if (rand()%3==0)
  647. X                sct[i][j].altitude=MOUNTAIN;
  648. X            else    sct[i][j].altitude=HILL;
  649. X
  650. X            if( rand()%100 < chance ) getmetal( &sct[i][j] );
  651. X        }
  652. X        return;
  653. X    case ELF:
  654. X        sct[x][y].vegetation = FOREST;
  655. X        for(i=x-range;i<=x+range;i++)
  656. X        for(j=y-range;j<=y+range;j++)
  657. X        if((i!=x)&&(j!=y)&&(ONMAP(i,j))
  658. X        &&(sct[i][j].altitude!=WATER)) {
  659. X            if (rand()%3==0)
  660. X                sct[i][j].vegetation=FOREST;
  661. X            else    sct[i][j].vegetation=WOOD;
  662. X            if( rand()%100 < chance ) getjewel( &sct[i][j] );
  663. X        }
  664. X        return;
  665. X    case ORC:
  666. X        sct[x][y].altitude=MOUNTAIN;
  667. X        for(i=x-range;i<=x+range;i++)
  668. X        for(j=y-range;j<=y+range;j++)
  669. X        if((i!=x)&&(j!=y)&&(ONMAP(i,j))
  670. X        &&(sct[i][j].altitude!=WATER)) {
  671. X            if (rand()%3==0)
  672. X                sct[i][j].altitude=MOUNTAIN;
  673. X            else    sct[i][j].altitude=HILL;
  674. X
  675. X            if( rand()%100 < chance ) {
  676. X                if(rand()%2==0)
  677. X                    getmetal( &sct[i][j] );
  678. X                else    getjewel( &sct[i][j] );
  679. X            }
  680. X        }
  681. X        return;
  682. X    case HUMAN:
  683. X        sct[x][y].altitude = CLEAR;
  684. X        for(i=x-range;i<=x+range;i++)
  685. X        for(j=y-range;j<=y+range;j++)
  686. X        if((i!=x)&&(j!=y)&&(ONMAP(i,j))
  687. X        &&(sct[i][j].altitude!=WATER)) {
  688. X            if (rand()%2==0)
  689. X            sct[x][y].altitude = CLEAR;
  690. X
  691. X            if (rand()%2==0)
  692. X                sct[i][j].vegetation=WOOD;
  693. X            else    sct[i][j].vegetation=GOOD;
  694. X
  695. X            if( rand()%100 < chance ) {
  696. X                if (rand()%2==0)
  697. X                    getmetal( &sct[i][j] );
  698. X                else    getjewel( &sct[i][j] );
  699. X            }
  700. X        }
  701. X        return;
  702. X    }
  703. X}
  704. X
  705. Xvoid
  706. Xmailtopc(string)
  707. Xchar    *string;
  708. X{
  709. X    int    ctry;
  710. X    for( ctry=0; ctry<NTOTAL; ctry++){
  711. X        if((ctry==0)||(ispc(ntn[ctry].active))){
  712. X            mailopen(ctry);
  713. X            fprintf(fm,"%s",string);
  714. X            mailclose();
  715. X        }
  716. X    }
  717. X}
  718. X
  719. X/* function  to initialize the curses display */
  720. Xvoid
  721. Xnewinit()
  722. X{
  723. X    initscr();
  724. X    /* check terminal size */
  725. X    if (COLS<80 || LINES<24) {
  726. X        mvaddstr(LINES-2,0,"conqrun: terminal should be at least 80x24");
  727. X        mvaddstr(LINES-1,0,"Please try again with a different setup");
  728. X        beep();
  729. X        getch();
  730. X        newbye(SUCCESS);
  731. X    }
  732. X    crmode();
  733. X    noecho();
  734. X}
  735. X
  736. X/* function to end the curses display */
  737. Xvoid
  738. Xnewreset()
  739. X{
  740. X    clear();
  741. X    refresh();
  742. X    nocrmode();
  743. X    endwin();
  744. X}
  745. X
  746. X/* function to leave the program completely */
  747. Xvoid
  748. Xnewbye(status)
  749. X    int status;
  750. X{
  751. X    newreset();
  752. X    exit(status);
  753. X}
  754. X
  755. X/* message without wait for keystroke */
  756. Xvoid
  757. Xnewmsg(str)
  758. X    char *str;
  759. X{
  760. X    mvaddstr(LINES-1,0,str);
  761. X    clrtoeol();
  762. X    refresh();
  763. X}
  764. X
  765. X/* message with wait for keystroke */
  766. Xvoid
  767. Xnewerror(str)
  768. X    char *str;
  769. X{
  770. X    mvaddstr(LINES-1,0,str);
  771. X    clrtoeol();
  772. X    mvaddstr(LINES-1,COLS-13,"Hit Any Key");
  773. X    beep();
  774. X    refresh();
  775. X    getch();
  776. X    move(LINES-1,0);
  777. X    clrtoeol();
  778. X    refresh();
  779. X}
  780. X
  781. X/* function to check if a character is in a character array */
  782. Xint
  783. Xin_str(ch,str)
  784. X    char ch, *str;
  785. X{
  786. X    int i,l=strlen(str);
  787. X
  788. X    for(i=0;i<l;i++)
  789. X        if (ch == str[i]) return(TRUE);
  790. X    return(FALSE);
  791. X}
  792. X
  793. X/* function to display the comment and error window */
  794. Xvoid
  795. Xerrorbar(str1,str2)
  796. X    char *str1,*str2;
  797. X{
  798. X    int i;
  799. X    move(LINES-4,0);
  800. X    standout();
  801. X    for(i=0;i<COLS-1;i++)
  802. X        addch(' ');
  803. X    standend();
  804. X    mvprintw(LINES-3,0," Conquer %s.%d: %s",VERSION,PATCHLEVEL,str1);
  805. X    mvaddstr(LINES-3,COLS-strlen(str2)-2,str2);
  806. X    move(LINES-2,0);
  807. X    for(i=0;i<COLS-1;i++)
  808. X        addch('-');
  809. X}
  810. X
  811. X/* display amount string at current location */
  812. Xvoid
  813. Xdispitem(item, amount)
  814. X    int item;
  815. X    long amount;
  816. X{
  817. X    if (item == CH_LOCATE) {
  818. X        printw("%s %s", LType[amount], Mitems[item]);
  819. X    } else {
  820. X        printw("%ld %s", amount, Mitems[item]);
  821. X    }
  822. X
  823. X    if (item != CH_RAWGOODS) {
  824. X        addch('.');
  825. X        return;
  826. X    }
  827. X
  828. X    /* now show the extras for the Raw Materials */
  829. X    printw(", %ld jewels", amount*NLJEWELS/Mvalues[CH_RAWGOODS]);
  830. X    printw(", and %ld metal.", amount*NLMETAL/Mvalues[CH_RAWGOODS]);
  831. X}
  832. X
  833. X/* show the current amount for country item */
  834. Xvoid
  835. Xshowitem(line,item)
  836. X    int line, item;
  837. X{
  838. X    char tempc[LINELTH];
  839. X    
  840. X    move(line,15);
  841. X    if (item == CH_LOCATE) {
  842. X        sprintf(tempc,"%s %s", LType[spent[item]], Mitems[item]);
  843. X        printw("%23s",tempc);
  844. X    } else {
  845. X        sprintf(tempc,"%ld %s", spent[item]*Mvalues[item], Mitems[item]);
  846. X        printw("%23s",tempc);
  847. X    }
  848. X    
  849. X    if (item != CH_RAWGOODS) return;
  850. X    line++;
  851. X
  852. X    /* now show the extras for the Raw Materials */
  853. X    if (NLJEWELS==NLMETAL) {
  854. X        sprintf(tempc,"%ld jewels & metal",
  855. X               spent[CH_RAWGOODS]*NLJEWELS);
  856. X        mvprintw(line,0,"%38s",tempc);
  857. X        mvprintw(line,COLS/2+10,"%ld jewels & metal",NLJEWELS);
  858. X    } else {
  859. X        sprintf(tempc,"%ld jewels",
  860. X               spent[CH_RAWGOODS]*NLJEWELS);
  861. X        mvprintw(line,0,"%38s",tempc);
  862. X        mvprintw(line++,COLS/2+10,"%ld jewels",NLJEWELS);
  863. X        sprintf(tempc,"%ld metal",
  864. X               spent[CH_RAWGOODS]*NLMETAL);
  865. X        mvprintw(line,0,"%38s",tempc);
  866. X        mvprintw(line,COLS/2+10,"%ld metals",NLMETAL);
  867. X    }
  868. X}
  869. X
  870. X/* convert the stored information into the nation statistics */
  871. Xvoid
  872. Xconvert()
  873. X{
  874. X    int i,loop;
  875. X    long x;
  876. X
  877. X    curntn->tciv = Mvalues[CH_PEOPLE] * spent[CH_PEOPLE];
  878. X    curntn->tgold = Mvalues[CH_TREASURY] * spent[CH_TREASURY];
  879. X    switch(spent[CH_LOCATE]) {
  880. X    case 2:
  881. X        curntn->location = GREAT;
  882. X        break;
  883. X    case 1:
  884. X        curntn->location = FAIR;
  885. X        break;
  886. X    case 0:
  887. X    default:
  888. X        curntn->location = RANDOM;
  889. X        break;
  890. X    }
  891. X    curntn->tmil = Mvalues[CH_SOLDIERS] * spent[CH_SOLDIERS];
  892. X    curntn->aplus = (short) Mvalues[CH_ATTACK] * spent[CH_ATTACK];
  893. X    curntn->dplus = (short) Mvalues[CH_DEFEND] * spent[CH_DEFEND];
  894. X    curntn->repro = (char) Mvalues[CH_REPRO] * spent[CH_REPRO];
  895. X    curntn->maxmove = (unsigned char) Mvalues[CH_MOVEMENT]
  896. X        * spent[CH_MOVEMENT];
  897. X    for(i = 0; i < spent[CH_MAGIC]; i++) {
  898. X        /* purchase magic */
  899. X        loop = TRUE;
  900. X        while (loop == TRUE) {
  901. X            if((x=getmagic((rand()%M_MGK+M_MIL)))!=0L){
  902. X                CHGMGK;
  903. X                loop = FALSE;
  904. X            }
  905. X        }
  906. X    }
  907. X    numleaders = (int) Mvalues[CH_LEADERS] * spent[CH_LEADERS];
  908. X    curntn->tfood = Mvalues[CH_RAWGOODS] * spent[CH_RAWGOODS];
  909. X    curntn->jewels = NLJEWELS * spent[CH_RAWGOODS];
  910. X    curntn->metals = NLMETAL * spent[CH_RAWGOODS];
  911. X}
  912. X
  913. Xvoid
  914. Xnewlogin()
  915. X{
  916. X    /* use points to create empire, add if late starter*/
  917. X    int points, clr;
  918. X    int choice, direct;
  919. X    int valid=TRUE;  /*valid==FALSE means continue loop*/
  920. X    int temp,ypos,xpos;
  921. X    int more=TRUE;    /*0 if add another player*/
  922. X    long x;
  923. X    char tempc[LINELTH],strin[LINELTH+1];
  924. X    char passwd[PASSLTH+1];
  925. X    register i;
  926. X
  927. X    /* setup curses display */
  928. X    newinit();
  929. X
  930. X    /*find valid nation number type*/
  931. X    country=0;
  932. X    for(i=1;i<NTOTAL;i++) if(ntn[i].active==INACTIVE) {
  933. X        country=i;
  934. X        curntn = &ntn[country];
  935. X        break;
  936. X    }
  937. X
  938. X    while(more==TRUE) {
  939. X        clear();
  940. X
  941. X        sprintf(tempc,"Country #%d", country);
  942. X        errorbar("Nation Builder",tempc);
  943. X        if(country==0) {
  944. X            newerror("No more nations available");
  945. X            newreset();
  946. X            return;
  947. X        }
  948. X
  949. X        /* open output for future printing*/
  950. X        mvprintw(0,0,"Building Country Number %d",country);
  951. X        sprintf(tempc,"%s%d",exefile,i);
  952. X        if ((fexe=fopen(tempc,"w"))==NULL) {
  953. X            sprintf(tempc,"Error opening <%s>",tempc);
  954. X            newerror(tempc);
  955. X            newbye(FAIL);
  956. X        }
  957. X
  958. X        /* begin purchasing */
  959. X        points=MAXPTS;
  960. X        for (i=0; i<CH_NUMBER; i++) {
  961. X            spent[i] = 0;
  962. X        }
  963. X
  964. X        valid=FALSE;
  965. X        /*get name*/
  966. X        while(valid==FALSE) {
  967. X            valid=TRUE;
  968. X            mvprintw(1,0,"Enter a Name for your Country: ");
  969. X            clrtoeol();
  970. X            refresh();
  971. X            get_nname(tempc);
  972. X
  973. X            if((strlen(tempc)<=1)
  974. X             ||(strlen(tempc)>NAMELTH)){
  975. X                newerror("Invalid Name Length");
  976. X                valid=FALSE;
  977. X            }
  978. X
  979. X            /*check if already used*/
  980. X            if((strcmp(tempc,"god")==0)
  981. X            ||(strcmp(tempc,"unowned")==0)){
  982. X                newerror("Name already used");
  983. X                valid=FALSE;
  984. X            }
  985. X
  986. X            for(i=1;i<NTOTAL;i++)
  987. X            if((i!=country)&&(strcmp(ntn[i].name,tempc)==0)&&(isntn(ntn[i].active))) {
  988. X                newerror("Name already used");
  989. X                valid=FALSE;
  990. X            }
  991. X        }
  992. X        strcpy(curntn->name,tempc);
  993. X        move(0,0);
  994. X        clrtoeol();
  995. X        move(1,0);
  996. X        clrtoeol();
  997. X        standout();
  998. X        mvprintw(0,COLS/2-15-strlen(curntn->name)/2,
  999. X            "< Building Country %s >",curntn->name,country);
  1000. X        standend();
  1001. X        clrtoeol();
  1002. X
  1003. X        valid=FALSE;
  1004. X        while(valid==FALSE) {            /* password routine */
  1005. X            mvprintw(2,0,"Enter National Password: ");
  1006. X            clrtoeol();
  1007. X            refresh();
  1008. X            gets(tempc);
  1009. X            if((strlen(tempc)<2)||(strlen(tempc)>PASSLTH)) {
  1010. X                newerror("Invalid Password Length");
  1011. X                continue;
  1012. X            }
  1013. X            mvprintw(2,0,"Reenter National Password: ");
  1014. X            clrtoeol();
  1015. X            refresh();
  1016. X            gets(passwd);
  1017. X
  1018. X            if((strlen(tempc)<2)||(strlen(tempc)>PASSLTH)
  1019. X               ||(strncmp(passwd,tempc,PASSLTH)!=0)){
  1020. X                newerror("Invalid Password Match");
  1021. X            } else valid=TRUE;
  1022. X        }
  1023. X        strncpy(curntn->passwd,crypt(tempc,SALT),PASSLTH);
  1024. X
  1025. X        /*get your name*/
  1026. X        valid=FALSE;
  1027. X        while(valid==FALSE) {
  1028. X            valid=TRUE;
  1029. X            mvprintw(2,0,"Enter the name of your country's leader (Ex. The_Ed, Gandalf, Conan)");
  1030. X            clrtoeol();
  1031. X            mvprintw(3,0,"    [maximum %d characters]: ",LEADERLTH);
  1032. X            refresh();
  1033. X            get_nname(tempc);
  1034. X            if((strlen(tempc)>LEADERLTH)||(strlen(tempc)<2)) {
  1035. X                newerror("Invalid Name Length");
  1036. X                valid=FALSE;
  1037. X            }
  1038. X            else strcpy(curntn->leader,tempc);
  1039. X        }
  1040. X
  1041. X        mvprintw(2,0,"Leader Name: %s", curntn->leader);
  1042. X        clrtoeol();
  1043. X        mvprintw(3,0,"Enter your Race [ (D)warf (E)lf (H)uman (O)rc ]:");
  1044. X        clrtoeol();
  1045. X        refresh();
  1046. X        valid=FALSE;
  1047. X        while(valid==FALSE) {
  1048. X            valid=TRUE;
  1049. X            switch(getch()) {
  1050. X            case 'D':
  1051. X            case 'd':
  1052. X                /*MINER POWER INATE TO DWARVES*/
  1053. X                newerror("Dwarves have MINING skills");
  1054. X                mvprintw(3,0,"National Race: Dwarf");
  1055. X                clrtoeol();
  1056. X                curntn->powers=MINER;
  1057. X                x=MINER;
  1058. X                CHGMGK;
  1059. X                points -= getclass(DWARF);
  1060. X                curntn->race=DWARF;
  1061. X                spent[CH_TREASURY]=NLDGOLD;
  1062. X                spent[CH_RAWGOODS]=NLDRAW;
  1063. X                spent[CH_PEOPLE]= NLDCIVIL;
  1064. X                spent[CH_SOLDIERS]= NLDMILIT;
  1065. X                spent[CH_REPRO]= NLDREPRO;
  1066. X                spent[CH_MOVEMENT]= NLDMMOVE;
  1067. X                spent[CH_ATTACK]= NLDAPLUS;
  1068. X                spent[CH_DEFEND]= NLDDPLUS;
  1069. X                spent[CH_LOCATE]= NLRANDOM;
  1070. X                points-=nstartcst();
  1071. X                break;
  1072. X            case 'E':
  1073. X            case 'e':
  1074. X                newerror("Elves are magically cloaked (VOID power)");
  1075. X                mvprintw(3,0,"National Race: Elf");
  1076. X                clrtoeol();
  1077. X                curntn->powers=THE_VOID;
  1078. X                x=THE_VOID;
  1079. X                CHGMGK;
  1080. X                points -= getclass(ELF);
  1081. X                curntn->race=ELF;
  1082. X                spent[CH_TREASURY]=NLEGOLD;
  1083. X                spent[CH_RAWGOODS]=NLERAW;
  1084. X                spent[CH_PEOPLE]= NLECIVIL;
  1085. X                spent[CH_SOLDIERS]= NLEMILIT;
  1086. X                spent[CH_REPRO]= NLEREPRO;
  1087. X                spent[CH_MOVEMENT]= NLEMMOVE;
  1088. X                spent[CH_ATTACK]= NLEAPLUS;
  1089. X                spent[CH_DEFEND]= NLEDPLUS;
  1090. X                spent[CH_LOCATE]= NLFAIR;
  1091. X                points-=nstartcst();
  1092. X                break;
  1093. X            case 'O':
  1094. X            case 'o':
  1095. X                /*MINOR MONSTER POWER INATE TO ORCS*/
  1096. X                newerror("Your leader is a Monster!");
  1097. X                mvprintw(3,0,"National Race: Orc");
  1098. X                clrtoeol();
  1099. X                curntn->powers=MI_MONST;
  1100. X                x=MI_MONST;
  1101. X                CHGMGK;
  1102. X                points -= getclass(ORC);
  1103. X                curntn->race=ORC;
  1104. X                spent[CH_TREASURY]=NLOGOLD;
  1105. X                spent[CH_RAWGOODS]=NLORAW;
  1106. X                spent[CH_PEOPLE]= NLOCIVIL;
  1107. X                spent[CH_SOLDIERS]= NLOMILIT;
  1108. X                spent[CH_REPRO]= NLOREPRO;
  1109. X                spent[CH_MOVEMENT]= NLOMMOVE;
  1110. X                spent[CH_ATTACK]= NLOAPLUS;
  1111. X                spent[CH_DEFEND]= NLODPLUS;
  1112. X                spent[CH_LOCATE]= NLRANDOM;
  1113. X                points-=nstartcst();
  1114. X                break;
  1115. X            case 'H':
  1116. X            case 'h':
  1117. X                curntn->race=HUMAN;
  1118. X                newerror("Humans have the combat skill of a WARRIOR");
  1119. X                mvprintw(3,0,"National Race: Human");
  1120. X                clrtoeol();
  1121. X                curntn->powers = WARRIOR;
  1122. X                x=WARRIOR;
  1123. X                CHGMGK;
  1124. X                points -= getclass(HUMAN);
  1125. X                spent[CH_TREASURY]=NLHGOLD;
  1126. X                spent[CH_RAWGOODS]=NLHRAW;
  1127. X                spent[CH_PEOPLE]= NLHCIVIL;
  1128. X                spent[CH_SOLDIERS]= NLHMILIT;
  1129. X                spent[CH_REPRO]= NLHREPRO;
  1130. X                spent[CH_MOVEMENT]= NLHMMOVE;
  1131. X                spent[CH_ATTACK]= NLHAPLUS;
  1132. X                spent[CH_DEFEND]= NLHDPLUS;
  1133. X                spent[CH_LOCATE]= NLRANDOM;
  1134. X                points-=nstartcst();
  1135. X                break;
  1136. X            default:
  1137. X                valid=FALSE;
  1138. X            }
  1139. X        }
  1140. X        mvprintw(4,0,"Nation Class: %s",Class[curntn->class]);
  1141. X        clrtoeol();
  1142. X
  1143. X        valid=FALSE;
  1144. X        if( curntn->race == ORC ) {    /* orcs are always evil */
  1145. X            valid=TRUE;
  1146. X            curntn->active=PC_EVIL;
  1147. X        } else {
  1148. X            mvprintw(5,0,"Please Enter Alignment [ (G)ood, (N)eutral, (E)vil ]");
  1149. X            refresh();
  1150. X        }
  1151. X        while (valid==FALSE) {
  1152. X            valid=TRUE;
  1153. X            switch(getch()) {
  1154. X            case 'G':
  1155. X            case 'g':
  1156. X                curntn->active=PC_GOOD;
  1157. X                break;
  1158. X            case 'N':
  1159. X            case 'n':
  1160. X                curntn->active=PC_NEUTRAL;
  1161. X                break;
  1162. X            case 'E':
  1163. X            case 'e':
  1164. X                curntn->active=PC_EVIL;
  1165. X                break;
  1166. X            default:
  1167. X                valid=FALSE;
  1168. X                break;
  1169. X            }
  1170. X        }
  1171. X        mvprintw(2,COLS/2,"Alignment: %s", allignment[curntn->active]);
  1172. X        clrtoeol();
  1173. X
  1174. X
  1175. X        /* get new nation mark */
  1176. X        curntn->mark = ' ';
  1177. X        while(TRUE) {
  1178. X            temp = 30;
  1179. X            mvprintw(6,0,"This can be any of the following:");
  1180. X            for (tempc[0]='!';tempc[0]<='~';tempc[0]++) {
  1181. X                if( markok( tempc[0], FALSE ) ) {
  1182. X                    temp += 2;
  1183. X                    if (temp>COLS-20) {
  1184. X                        printw("\n    ");
  1185. X                        temp = 8;
  1186. X                    }
  1187. X                    printw(" %c",tempc[0]);
  1188. X                }
  1189. X            }
  1190. X            mvprintw(5,0,"Enter National Mark (for maps): ");
  1191. X            clrtoeol();
  1192. X            refresh();
  1193. X            tempc[0] = getch();
  1194. X            if( markok( tempc[0], TRUE ) ){
  1195. X                curntn->mark=(*tempc);
  1196. X                break;
  1197. X            }
  1198. X        }
  1199. X
  1200. X        mvprintw(3,COLS/2,"National Mark [%c]",curntn->mark);
  1201. X        clrtoeol();
  1202. X        move(5,0);
  1203. X        clrtoeol();
  1204. X        move(6,0);
  1205. X        clrtoeol();
  1206. X        move(7,0);
  1207. X        clrtoeol();
  1208. X        refresh();
  1209. X
  1210. X        ypos = 6;
  1211. X        mvprintw(ypos,0,"  %-13s       %s", "ITEM", "CURRENTLY HAVE" );
  1212. X        mvprintw(ypos++,COLS/2+5,"%4s %s", "COST", "AMOUNT" );
  1213. X        for(i=0; i<CH_NUMBER; i++) {
  1214. X            mvprintw(ypos,0,"%-15s", Mlabels[i]);
  1215. X            showitem(ypos,i);
  1216. X            if (i==CH_LOCATE) {
  1217. X                mvprintw(ypos,COLS/2+5,"%3d  %s", Mcost[i],
  1218. X                        "Better Location");
  1219. X            } else {
  1220. X                if (curntn->race==ORC) {            
  1221. X                    switch(i) {
  1222. X                    case CH_MOVEMENT:
  1223. X                        mvprintw(ypos++,COLS/2+5,"  -  --------");
  1224. X                        continue;
  1225. X                    case CH_REPRO:
  1226. X                        x = 2*Munits[i]*Mvalues[i];
  1227. X                        break;
  1228. X                    case CH_ATTACK:
  1229. X                    case CH_DEFEND:
  1230. X                        x = Munits[i]*Mvalues[i]/2;
  1231. X                        break;
  1232. X                    default:
  1233. X                        x = Munits[i]*Mvalues[i];
  1234. X                        break;
  1235. X                    }
  1236. X                    mvprintw(ypos,COLS/2+5,"%3d ", Mcost[i]);
  1237. X                    printw(" %ld %s", x, Mitems[i]);
  1238. X                } else {
  1239. X                    mvprintw(ypos,COLS/2+5,"%3d ", Mcost[i]);
  1240. X                    printw(" %ld %s", Munits[i]*Mvalues[i], Mitems[i]);
  1241. X                }
  1242. X            }
  1243. X            ypos++;
  1244. X        }
  1245. X
  1246. X        /* show everything before menu */
  1247. X        direct = ADDITION;
  1248. X        choice = CH_PEOPLE;
  1249. X        xpos = COLS/2;
  1250. X        ypos = 7;
  1251. X        valid = FALSE;
  1252. X        clr = 1;
  1253. X        standout();
  1254. X        mvaddstr(LINES-4,0,"  ESC: Exit  ?: Info  <,+,h: left  >,+,l: right  k: up  j: down  ' ': ADD/SUB");
  1255. X        standend();
  1256. X
  1257. X        while(valid==FALSE) {
  1258. X            if (clr==1) {
  1259. X                standout();
  1260. X                mvprintw(4,COLS/2,"Points Left: %d", points);
  1261. X                standend();
  1262. X                clrtoeol();
  1263. X                clr++;
  1264. X            } else if (clr==2) {
  1265. X                newmsg("");
  1266. X                clr = 0;
  1267. X            }
  1268. X            standout();
  1269. X            mvaddstr(ypos+choice,xpos,Mprompt[direct]);
  1270. X            standend();
  1271. X            refresh();
  1272. X            switch(getch()) {
  1273. X            case ' ':
  1274. X                /* redraw */
  1275. X                wrefresh(stdscr);
  1276. X                break;
  1277. X            case '?':
  1278. X                /* help on topic */
  1279. X                newerror(Mhelp[choice]);
  1280. X                break;
  1281. X            case '\033':
  1282. X                /* exit option */
  1283. X                if (points > 0) {
  1284. X                    newmsg("Use remaining points for population? [ny]");
  1285. X                    if (getch()!='y') {
  1286. X                        newerror("All points must be spent prior to exiting");
  1287. X                        break;
  1288. X                    }
  1289. X                    temp = points * Munits[CH_PEOPLE] / Mcost[CH_PEOPLE];
  1290. X                    x = temp * Mvalues[CH_PEOPLE];
  1291. X                    spent[CH_PEOPLE] += temp;
  1292. X                    showitem(ypos+CH_PEOPLE,CH_PEOPLE);
  1293. X                    points = 0;
  1294. X                    sprintf(tempc,"Buying %ld more civilians", x);
  1295. X                    newerror(tempc);
  1296. X                }
  1297. X                newmsg("Is the modification complete? (y or n)");
  1298. X                while (((temp=getch())!='y')&&(temp!='n')) ;
  1299. X                if (temp == 'y') {
  1300. X                    valid = TRUE;
  1301. X                }
  1302. X                clr = 1;
  1303. X                break;
  1304. X            case '-':
  1305. X            case '>':
  1306. X            case 'l':
  1307. X            case 'L':
  1308. X                /* subtraction */
  1309. X                direct = SUBTRACTION;
  1310. X                break;
  1311. X            case '+':
  1312. X            case '<':
  1313. X            case 'h':
  1314. X            case 'H':
  1315. X                /* addition */
  1316. X                direct = ADDITION;
  1317. X                break;
  1318. X            case '\b':
  1319. X            case '\177':
  1320. X                /* decrease choice -- with wrap */
  1321. X                mvaddstr(ypos+choice,xpos,"    ");
  1322. X                if (choice==CH_PEOPLE) {
  1323. X                    choice = CH_RAWGOODS;
  1324. X                } else {
  1325. X                    choice--;
  1326. X                    if (choice==CH_MOVEMENT && curntn->race==ORC) {
  1327. X                        choice--;
  1328. X                    }
  1329. X                }
  1330. X                break;
  1331. X            case 'k':
  1332. X            case 'K':
  1333. X                /* move choice up one */
  1334. X                if (choice > CH_PEOPLE) {
  1335. X                    mvaddstr(ypos+choice,xpos,"    ");
  1336. X                    choice--;
  1337. X                    if (choice==CH_MOVEMENT && curntn->race==ORC) {
  1338. X                        choice--;
  1339. X                    }
  1340. X                }
  1341. X                break;
  1342. X            case '\r':
  1343. X            case '\n':
  1344. X                /* increase choice -- with wrap */
  1345. X                mvaddstr(ypos+choice,xpos,"    ");
  1346. X                if (choice==CH_RAWGOODS) {
  1347. X                    choice = CH_PEOPLE;
  1348. X                } else {
  1349. X                    choice++;
  1350. X                    if (choice==CH_MOVEMENT && curntn->race==ORC) {
  1351. X                        choice++;
  1352. X                    }
  1353. X                }
  1354. X                break;
  1355. X            case 'j':
  1356. X            case 'J':
  1357. X                /* move choice down one */
  1358. X                if (choice < CH_RAWGOODS) {
  1359. X                    mvaddstr(ypos+choice,xpos,"    ");
  1360. X                    choice++;
  1361. X                    if (choice==CH_MOVEMENT && curntn->race==ORC) {
  1362. X                        choice++;
  1363. X                    }
  1364. X                }
  1365. X                break;
  1366. X            case ' ':
  1367. X            case '.':
  1368. X                /* make the selection */
  1369. X                if (curntn->race == ORC) {
  1370. X                    switch(choice) {
  1371. X                    case CH_REPRO:
  1372. X                        temp = 2*Munits[choice];
  1373. X                        break;
  1374. X                    case CH_ATTACK:
  1375. X                    case CH_DEFEND:
  1376. X                        temp = Munits[choice]/2;
  1377. X                        break;
  1378. X                    default:
  1379. X                        temp = Munits[choice];
  1380. X                        break;
  1381. X                    }
  1382. X                } else temp = Munits[choice];
  1383. X                if (direct == ADDITION) {
  1384. X                    if (Mcost[choice] > points) {
  1385. X                        sprintf(tempc, "You do not have %d points to spend",
  1386. X                            Mcost[choice]);
  1387. X                        newerror(tempc);
  1388. X                    } else if ((choice == CH_REPRO)&&(curntn->race==ORC)
  1389. X                        &&(spent[choice] + temp > 12)) {
  1390. X                        newerror("You may not purchase any more of that item");
  1391. X                    } else if ((spent[choice] + temp > Maxvalues[choice])
  1392. X                        &&((curntn->race!=ORC)||(choice!=CH_REPRO))) {
  1393. X                        newerror("You may not purchase any more of that item");
  1394. X                    } else {
  1395. X                        spent[choice] += temp;
  1396. X                        newmsg("You now have ");
  1397. X                        dispitem(choice,spent[choice]*Mvalues[choice]);
  1398. X                        showitem(ypos+choice,choice);
  1399. X                        points -= Mcost[choice];
  1400. X                        clr = 1;
  1401. X                    }
  1402. X                } else if (direct == SUBTRACTION) {
  1403. X                    if (spent[choice] - temp < Minvalues[choice]) {
  1404. X                        newerror("You may not sell back any more of that item");
  1405. X                    } else {
  1406. X                        spent[choice] -= temp;
  1407. X                        newmsg("You now have ");
  1408. X                        dispitem(choice,spent[choice]*Mvalues[choice]);
  1409. X                        showitem(ypos+choice,choice);
  1410. X                        points += Mcost[choice];
  1411. X                        clr = 1;
  1412. X                    }
  1413. X                }
  1414. X                break;
  1415. X            default:
  1416. X                break;
  1417. X            }
  1418. X        }
  1419. X        check();
  1420. X
  1421. X        /* check for save */
  1422. X        newmsg("Save this nation? [ny]");
  1423. X        if(getch()!='y'){
  1424. X            curntn->active=INACTIVE;
  1425. X            curntn->powers=0;
  1426. X            newerror("Ok, Nation Deleted");
  1427. X            fclose(fexe);
  1428. X        } else {
  1429. X            convert();
  1430. X            place(-1,-1);
  1431. X            newerror("Ok, Your Nation has been Added to the World");
  1432. X            att_setup(country);    /* setup values ntn attributes */
  1433. X            fclose(fexe);
  1434. X            sprintf(tempc,"NOTICE: Nation %s added to world on turn %d\n",curntn->name,TURN);
  1435. X            mailtopc(tempc);
  1436. X            /* cannot clear until after placement and initializing */
  1437. X            curntn->powers=0;
  1438. X        }
  1439. X        country=0;
  1440. X        for(i=1;i<NTOTAL;i++) if (ntn[i].active==INACTIVE) {
  1441. X            country = i;
  1442. X            curntn = &ntn[country];
  1443. X            break;
  1444. X        }
  1445. X        if (country!=0) {
  1446. X            newmsg("Do you wish to Add another Nation? [ny]");
  1447. X            if (getch()!='y') more = FALSE;
  1448. X            else more = TRUE;
  1449. X        } else {
  1450. X            more = FALSE;
  1451. X            newerror("No More Available Nations");
  1452. X        }
  1453. X    }
  1454. X    newreset();
  1455. X    att_base();    /* calculate base nation attributes */
  1456. X    writedata();
  1457. X}
  1458. X
  1459. X/*****************************************************************/
  1460. X/* PLACE(): put nation on the map.  Fill out army structures too */
  1461. X/*****************************************************************/
  1462. Xvoid
  1463. Xplace(xloc,yloc)
  1464. Xint    xloc,yloc;    /* if not -1,-1 should place in this spot */
  1465. X{
  1466. X    int    placed=0,armysize=100;
  1467. X    short    armynum=0;
  1468. X    long    people;
  1469. X    char tempo[LINELTH+1];
  1470. X    int    x,y,i,j,temp,t;
  1471. X    int    n=0, leadtype;
  1472. X    long    soldsleft;    /* soldiers left to place */
  1473. X
  1474. X    if( xloc != -1 && yloc != -1 && is_habitable(xloc,yloc)) {
  1475. X        placed=1;
  1476. X        x = xloc;
  1477. X        y = yloc;
  1478. X    }
  1479. X
  1480. X    switch(curntn->location) {
  1481. X    case OOPS:
  1482. X        while((placed == 0)&&(n++<2000)){
  1483. X            if(ispc(curntn->active)){
  1484. X                x = (rand()%(MAPX-8))+4;
  1485. X                y = (rand()%(MAPY-8))+4;
  1486. X            } else {
  1487. X                x = (rand()%(MAPX-2))+1;
  1488. X                y = (rand()%(MAPY-2))+1;
  1489. X            }
  1490. X            if(is_habitable(x,y)) placed=1;
  1491. X
  1492. X            for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1493. X                if(sct[i][j].owner!=0) placed=0;
  1494. X            temp=0;
  1495. X            for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1496. X                if(sct[i][j].altitude==WATER) temp++;
  1497. X            if(temp>=7) placed=0;
  1498. X        }
  1499. X        teraform( x,y,1,25 );
  1500. X        break;
  1501. X    case RANDOM:
  1502. X        while ((placed == 0)&&(n++<2000)){
  1503. X            if(ispc(curntn->active)){
  1504. X                if(MAPX>12){
  1505. X                    x = rand()%(MAPX-12)+6;
  1506. X                    y = rand()%(MAPY-12)+6;
  1507. X                } else {
  1508. X                    x = rand()%(MAPX-8)+4;
  1509. X                    y = rand()%(MAPY-8)+4;
  1510. X                }
  1511. X                if(is_habitable(x,y)) placed=1;
  1512. X                /*important that no countries near*/
  1513. X                for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
  1514. X                    if((isntn(ntn[sct[i][j].owner].active))
  1515. X                    &&(sct[i][j].owner!=0)) placed=0;
  1516. X            } else {
  1517. X                x = (rand()%(MAPX-6))+3;
  1518. X                y = (rand()%(MAPY-6))+3;
  1519. X                if(is_habitable(x,y)) placed=1;
  1520. X                /*important that no countries near*/
  1521. X                for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
  1522. X                    if((isntn(ntn[sct[i][j].owner].active))
  1523. X                    &&(sct[i][j].owner!=0)) placed=0;
  1524. X            }
  1525. X            temp=0;
  1526. X            for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1527. X                if(sct[i][j].altitude==WATER) temp++;
  1528. X            if(temp>=7) placed=0;
  1529. X            for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1530. X                if(sct[i][j].owner!=0) placed=0;
  1531. X        }
  1532. X        teraform( x,y,1,40 );
  1533. X        break;
  1534. X    case FAIR:
  1535. X        while ((placed == 0)&&(n++<2000)) {
  1536. X            if(ispc(curntn->active)){
  1537. X                if(MAPX>24) {
  1538. X                    x = rand()%(MAPX-24)+12;
  1539. X                } else {
  1540. X                    x = rand()%(MAPX-14)+7;
  1541. X                }
  1542. X                if(MAPY>24) {
  1543. X                    y = rand()%(MAPY-24)+12;
  1544. X                } else {
  1545. X                    y = rand()%(MAPY-14)+7;
  1546. X                }
  1547. X            } else {
  1548. X                x = rand()%(MAPX-10)+5;
  1549. X                y = rand()%(MAPY-10)+5;
  1550. X            }
  1551. X
  1552. X            if(!is_habitable(x,y)) continue;
  1553. X            if(tofood( &sct[x][y],country)<DESFOOD) continue;
  1554. X
  1555. X            placed=1;
  1556. X            for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1557. X                if(sct[i][j].owner!=0) placed=0;
  1558. X
  1559. X            if(pwater>50) {
  1560. X                temp=0;
  1561. X                for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1562. X                if(sct[i][j].altitude==WATER) temp++;
  1563. X                if(temp>=7) placed=0;
  1564. X
  1565. X                /*important that no countries near*/
  1566. X                for(i=x-3;i<=x+3;i++) for(j=y-3;j<=y+3;j++){
  1567. X                if((isntn(ntn[sct[i][j].owner].active))
  1568. X                    &&(sct[i][j].owner!=0)) placed=0;
  1569. X                }
  1570. X            } else {
  1571. X                temp=0;
  1572. X                for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1573. X                    if(sct[i][j].altitude==WATER) temp++;
  1574. X                if(temp>=5) placed=0;
  1575. X
  1576. X                /*important that no countries near*/
  1577. X                for(i=x-3;i<=x+3;i++) for(j=y-3;j<=y+3;j++){
  1578. X                if((isntn(ntn[sct[i][j].owner].active))
  1579. X                &&(sct[i][j].owner!=0)) placed=0;
  1580. X                }
  1581. X            }
  1582. X        }
  1583. X
  1584. X        teraform( x,y,1,65 );
  1585. X        break;
  1586. X    case GREAT:
  1587. X        placed = 0;
  1588. X        while ((placed == 0) && (n++<2000)){
  1589. X            if(ispc(curntn->active)){
  1590. X                if (MAPX>40){
  1591. X                    x = rand()%(MAPX-40)+20;
  1592. X                }else{
  1593. X                    x = rand()%(MAPX-18)+9;
  1594. X                }
  1595. X                if (MAPY>40){
  1596. X                    y = rand()%(MAPY-40)+20;
  1597. X                }else{
  1598. X                    y = rand()%(MAPY-18)+9;
  1599. X                }
  1600. X
  1601. X                if(is_habitable(x,y)) placed=1;
  1602. X                /*important that no countries near*/
  1603. X                for(i=x-4;i<=x+4;i++) for(j=y-4;j<=y+4;j++){
  1604. X                if((isntn(ntn[sct[i][j].owner].active))
  1605. X                &&( sct[i][j].owner!=0)) placed=0;
  1606. X                }
  1607. X            } else {
  1608. X                if(MAPX>24){
  1609. X                    x = rand()%(MAPX-24)+12;
  1610. X                }else {
  1611. X                    x = rand()%(MAPX-12)+6;
  1612. X                }
  1613. X                if(MAPY>24){
  1614. X                    y = rand()%(MAPY-24)+12;
  1615. X                }else {
  1616. X                    y = rand()%(MAPY-12)+6;
  1617. X                }
  1618. X                if(is_habitable(x,y)) placed=1;
  1619. X                /*important that no countries near*/
  1620. X                for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++){
  1621. X                if((isntn(ntn[sct[i][j].owner].active))
  1622. X                    &&(sct[i][j].owner!=0)) placed=0;
  1623. X                }
  1624. X            }
  1625. X
  1626. X            for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  1627. X                if(sct[i][j].owner!=0) placed=0;
  1628. X
  1629. X            temp=0;
  1630. X            /*if any water within 2 sectors placed = 0*/
  1631. X            for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
  1632. X                if(tofood( &sct[x][y],country)<=0)
  1633. X                    temp++;
  1634. X
  1635. X            if( pwater>50 ) {
  1636. X                if(temp>=18) placed=0;
  1637. X            } else {
  1638. X                if(temp>=15) placed=0;
  1639. X            }
  1640. X        }
  1641. X        teraform( x,y,1,100 );
  1642. X    }
  1643. X
  1644. X    /*done with one try*/
  1645. X    if(placed==1) {
  1646. X        curntn->capx = x;
  1647. X        curntn->capy = y;
  1648. X        sct[x][y].designation=DCAPITOL;
  1649. X        sct[x][y].tradegood=rand()%(END_KNOWLEDGE-END_SPOILRATE)+END_SPOILRATE+1;
  1650. X        sct[x][y].jewels=0;
  1651. X        sct[x][y].metal=0;
  1652. X        sct[x][y].owner=country;
  1653. X        sct[x][y].people=curntn->tciv;
  1654. X        sct[x][y].fortress=5;
  1655. X
  1656. X        /* put all military into armies of armysize */
  1657. X        armysize = (TAKESECTOR*12)/10;
  1658. X        if(armysize<100) armysize=100;
  1659. X        /* cant have more than 50% leaders */
  1660. X        if( MAXARM < numleaders * 2 ) numleaders = MAXARM / 2;
  1661. X        armynum=0;
  1662. X        soldsleft = curntn->tmil;
  1663. X        P_ASOLD = curntn->tmil/MILINCAP;
  1664. X        soldsleft-=P_ASOLD;
  1665. X        P_ATYPE=defaultunit(country);
  1666. X        P_ASTAT=GARRISON;
  1667. X        P_AMOVE=0;
  1668. X        P_AXLOC=curntn->capx;
  1669. X        P_AYLOC=curntn->capy;
  1670. X        armynum++;
  1671. X
  1672. X        armysize = max( armysize, soldsleft  / (MAXARM-numleaders-1));
  1673. X
  1674. X        /* give you your leaders */
  1675. X        leadtype = getleader(curntn->class);
  1676. X        P_ATYPE = leadtype-1;    /* This is the national leader */
  1677. X        P_ASOLD = *(unitminsth+((leadtype-1)%UTYPE));
  1678. X        P_AXLOC = curntn->capx;
  1679. X        P_AYLOC = curntn->capy;
  1680. X        P_ASTAT = DEFEND;
  1681. X        P_AMOVE = 2*curntn->maxmove;
  1682. X        armynum++;
  1683. X        numleaders--;
  1684. X        while ((armynum < MAXARM)&&(numleaders>0)) {
  1685. X            P_ATYPE=leadtype;
  1686. X            P_ASOLD= *(unitminsth+(leadtype%UTYPE));
  1687. X            P_AXLOC=curntn->capx;
  1688. X            P_AYLOC=curntn->capy;
  1689. X            P_ASTAT=DEFEND;
  1690. X            P_AMOVE=2*curntn->maxmove;
  1691. X            armynum++;
  1692. X            numleaders--;
  1693. X        }
  1694. X
  1695. X        /* give you the rest of your armies */
  1696. X        while((armynum < MAXARM)&&(soldsleft >0)) {
  1697. X            P_ATYPE=defaultunit(country);
  1698. X            if(soldsleft >= armysize){
  1699. X                P_ASOLD=armysize;
  1700. X                soldsleft -=armysize;
  1701. X            } else {
  1702. X                P_ASOLD=soldsleft ;
  1703. X                soldsleft=0;
  1704. X            }
  1705. X            P_AXLOC=curntn->capx;
  1706. X            P_AYLOC=curntn->capy;
  1707. X            P_ASTAT=DEFEND;
  1708. X            P_AMOVE=curntn->maxmove;
  1709. X            armynum++;
  1710. X        }
  1711. X
  1712. X        if(soldsleft >0) {
  1713. X            curntn->arm[0].sold += soldsleft;
  1714. X            curntn->arm[0].unittyp = A_INFANTRY;
  1715. X        }
  1716. X
  1717. X        /* give you some terain to start with: pc nations get more*/
  1718. X        if (isnotpc(curntn->active)) t=1;
  1719. X        else if (curntn->location==OOPS) t=0;
  1720. X        else if (curntn->location==RANDOM) t=0;
  1721. X        else if (curntn->location==FAIR) t=1;
  1722. X        else if (curntn->location==GREAT) t=2;
  1723. X        else {
  1724. X            newerror("Error in finding placement");
  1725. X            t=0;
  1726. X        }
  1727. X        if( t==1 )
  1728. X            people = sct[x][y].people / 12;
  1729. X        else if( t==2 )
  1730. X            people = sct[x][y].people / 30;
  1731. X
  1732. X        curntn->tsctrs=1;
  1733. X        for(i=x-t;i<=x+t;i++) for(j=y-t;j<=y+t;j++)
  1734. X            if((tofood( &sct[i][j],country)>=DESFOOD)
  1735. X            &&(sct[i][j].owner==0)
  1736. X            &&(is_habitable(i,j)==TRUE)
  1737. X            &&(sct[i][j].people==0)) {
  1738. X                curntn->tsctrs++;
  1739. X                sct[i][j].owner=country;
  1740. X                sct[i][j].designation=DFARM;
  1741. X                sct[i][j].people=people;
  1742. X                sct[x][y].people-=people;
  1743. X            }
  1744. X    }
  1745. X    else {
  1746. X        if(curntn->location==OOPS) newerror("MAJOR ERROR IN PLACEMENT");
  1747. X        else if(curntn->location==RANDOM) {
  1748. X            newerror("Random Place Failed, trying to place again");
  1749. X            curntn->location=OOPS;
  1750. X            place(-1,-1);
  1751. X        } else if(curntn->location==FAIR) {
  1752. X            sprintf(tempo,"Fair Place Failed, trying again - Adding %ld people to nation",Munits[CH_PEOPLE]*Mvalues[CH_PEOPLE]/Mcost[CH_PEOPLE]);
  1753. X            newerror(tempo);
  1754. X            /*give back one point -> NLPOP people*/
  1755. X            curntn->tciv += Munits[CH_PEOPLE] * Mvalues[CH_PEOPLE]
  1756. X                / Mcost[CH_PEOPLE];
  1757. X            curntn->location=RANDOM;
  1758. X            place(-1,-1);
  1759. X        } else if(curntn->location==GREAT) {
  1760. X            sprintf(tempo,"Great Place Failed, trying again - Adding %ld people to nation",Munits[CH_PEOPLE]*Mvalues[CH_PEOPLE]/Mcost[CH_PEOPLE]);
  1761. X            newerror(tempo);
  1762. X            /*give back one point -> NLPOP people*/
  1763. X            curntn->tciv+= Munits[CH_PEOPLE] * Mvalues[CH_PEOPLE]
  1764. X                / Mcost[CH_PEOPLE];
  1765. X            curntn->location=FAIR;
  1766. X            place(-1,-1);
  1767. X        }
  1768. X    }
  1769. X}
  1770. X
  1771. X/*get class routine*/
  1772. X/* return the number of points needed */
  1773. Xint
  1774. Xgetclass(race)
  1775. X    int race;
  1776. X{
  1777. X    short chk=FALSE;
  1778. X    short tmp;
  1779. X    short ypos=4;
  1780. X    int i,j;
  1781. X    
  1782. X    mvprintw(ypos,0,"The List of Possible Nation Classes:");
  1783. X    ypos+=2;
  1784. X    mvprintw(ypos++,0,"     %-8s %4s   %15s %8s %4s", "class", "who",
  1785. X        "", "magic", "cost");
  1786. X    mvprintw(ypos++,0,"     %-8s %4s   %15s %8s %4s", "--------", "----",
  1787. X        "", "-------", "----");
  1788. X    for(i=1;i<NUMCLASS;i++) {
  1789. X        if (in_str(race,Classwho[i])==TRUE) {
  1790. X            mvprintw(ypos++,0," %2d) %-8s %4s %15s", i, Class[i],
  1791. X                Classwho[i], "...............");
  1792. X            tmp = strlen(CPowlist[i]);
  1793. X            for(j=0; j < 10-tmp ; j++) {
  1794. X                addch('.');
  1795. X            }
  1796. X            printw(" %s", CPowlist[i]);
  1797. X            if (i == C_WARLORD && race == HUMAN)
  1798. X                printw(" %4d", Classcost[i]*2/3);
  1799. X            else printw(" %4d", Classcost[i]);
  1800. X        }
  1801. X    }
  1802. X    ypos++;
  1803. X    while(chk==FALSE){
  1804. X        mvprintw(ypos,0,"Enter the number of your choice: ");
  1805. X        clrtoeol();
  1806. X        refresh();
  1807. X        tmp = get_number();
  1808. X        if (tmp < 1 || tmp > NUMCLASS) {
  1809. X            newerror("Invalid Choice");
  1810. X        } else if (in_str(race,Classwho[tmp])==TRUE) {
  1811. X            chk = TRUE;
  1812. X        } else {
  1813. X            newerror("That Class is Invalid for your Race");
  1814. X        }
  1815. X    }
  1816. X    curntn->class=tmp;
  1817. X    for(tmp=ypos; tmp>4; tmp--) {
  1818. X        move(tmp,0);
  1819. X        clrtoeol();
  1820. X    }
  1821. X    
  1822. X    return( doclass( curntn->class, TRUE ) );
  1823. X}
  1824. X
  1825. Xint
  1826. Xdoclass( tmp, isupd )
  1827. Xshort    tmp;
  1828. Xint    isupd;    /* true if update, false if interactive */
  1829. X{
  1830. X    int cost;
  1831. X    long x;
  1832. X
  1833. X    /* determine number of leaders you want */
  1834. X    if((tmp == C_TRADER) || (tmp <= C_WIZARD))
  1835. X        spent[CH_LEADERS] = 5;
  1836. X    else    spent[CH_LEADERS] = 7;
  1837. X
  1838. X    /* assign the powers */
  1839. X    x=Classpow[tmp];
  1840. X
  1841. X    /* check for special case */
  1842. X    if (tmp==C_WARLORD && curntn->race==HUMAN) {
  1843. X        x ^= WARRIOR;
  1844. X        cost = Classcost[tmp]*2/3;
  1845. X    } else {
  1846. X        cost = Classcost[tmp];
  1847. X    }
  1848. X    curntn->powers |= x;
  1849. X
  1850. X    if ( isupd ) CHGMGK;
  1851. X    return(cost);
  1852. X}
  1853. X
  1854. Xint
  1855. Xnstartcst()    /* to be used for new method */
  1856. X{
  1857. X    float points=0.0;
  1858. X    char temp[LINELTH];
  1859. X    int i;
  1860. X
  1861. X    /* calculate cost for all so far */
  1862. X    for (i=0; i<CH_NUMBER; i++) {
  1863. X        points += Mcost[i] * (float) spent[i] / Munits[i];
  1864. X    }
  1865. X
  1866. X    /* extra points for starting late */
  1867. X    points -= (float) (TURN-1) / LATESTART;
  1868. X    if( (TURN-1)/LATESTART > 0.0 ) {
  1869. X        sprintf(temp,"%.1f points added for starting late",
  1870. X               (float) (TURN-1) / LATESTART);
  1871. X        newerror(temp);
  1872. X    }
  1873. X    points += 1.0;    /* round up */    
  1874. X    return((int)points);
  1875. X}
  1876. X
  1877. Xint
  1878. Xstartcost()    /* cant be used for npc nations yet!!! see below */
  1879. X{
  1880. X    float    points;    /* points */
  1881. X
  1882. X    points = ((float)curntn->tciv)/ONLPOP;
  1883. X    points += ((float)curntn->tgold)/ONLGOLD;
  1884. X    points += ((float)curntn->tmil)/ONLSOLD;
  1885. X    if(curntn->race==ORC) {
  1886. X        points += ((float)curntn->repro)*ONLREPCOST/(ONLREPRO_ORC);
  1887. X        points += ((float)curntn->aplus*2)/ONLATTACK;
  1888. X        points += ((float)curntn->dplus*2)/ONLDEFENCE;
  1889. X    } else {
  1890. X        points += ((float)curntn->aplus)/ONLATTACK;
  1891. X        points += ((float)curntn->dplus)/ONLDEFENCE;
  1892. X        points += ((float)curntn->repro)*ONLREPCOST/ONLREPRO;
  1893. X    }
  1894. X    points += ((float)curntn->maxmove)/ONLMOVE;
  1895. X    if(curntn->location==FAIR)
  1896. X        points += ONLLOCCOST;
  1897. X    else if(curntn->location==GREAT)
  1898. X        points += 2*ONLLOCCOST;
  1899. X    /* points+=ONLDBLCOST*curntn->tfood/ONLHFOOD; */
  1900. X    points -= (TURN-1) / LATESTART;    /* extra points if you start late */
  1901. X    if( TURN > 1 )
  1902. X    printf("point cost for nation %d is %.2f (bonus for latestart is %f)\n",country,points,(float) (TURN-1)/LATESTART);
  1903. X
  1904. X    points += 1.0;    /* round up */
  1905. X    return((int) points);
  1906. X}
  1907. SHAR_EOF
  1908. chmod 0640 newlogin.c || echo "restore of newlogin.c fails"
  1909. sed 's/^X//' << 'SHAR_EOF' > oMakefile &&
  1910. X#    conquer: Copyright (c) 1988 by Edward M Barlow
  1911. X#
  1912. X#    BY CHANGING THIS FILE, YOU AGREE TO ABIDE BY THE LIMITATIONS STATED IN
  1913. X#    THE LIMITED USE CONTRACT CONTAINED IN THE FILE "header.h"
  1914. X#
  1915. XMAKE    = /bin/make
  1916. XCC    = /bin/cc
  1917. XRM    = /bin/rm -f
  1918. X
  1919. X#    LN must be "ln -s" if source, data, and default span disks
  1920. XLN    = ln
  1921. XCP    = cp
  1922. XNULL    = 2>/dev/null
  1923. X
  1924. X#    This should be installed by whomever you want to own the game.
  1925. X#    I recommend "games" or "root".
  1926. X
  1927. X#if the final link does not compile change to the line below
  1928. X#LIBRARIES = -lcurses -ltermcap
  1929. XLIBRARIES = -lcurses
  1930. X
  1931. X#    this is the name of the user executable
  1932. X#    the user executable contains commands for the games players
  1933. XGAME = conquer
  1934. X#    this is the name of the administrative executable
  1935. X#    the administrative executable contains commands for the game super user
  1936. XADMIN = conqrun
  1937. X
  1938. X#    This directory is where the executables will be stored
  1939. X#    This would be the equivalent of /usr/games
  1940. XEXEDIR = /c28/smile/game/runv
  1941. X
  1942. X#    GAME IDENTIFICATION
  1943. X#    GAMEID is the game identifier
  1944. X#    DATA is the directory where an individual Conquer game data will be
  1945. X#    stored.  It is the directory you use in the -d option of the game.
  1946. X#    "make new_game" will build a world in that directory.  The current
  1947. X#    game will be automatically executed upon login (no need for -d)
  1948. X#    but if other games are compiled, you need to use -d (ie. the
  1949. X#    game automatically looks at the DATA directory it was compiled with.
  1950. XGAMEID = 1
  1951. XDATA = $(EXEDIR)/lib$(GAMEID)
  1952. X
  1953. X#    The following CFLAGS should be set by a normal user
  1954. XCFLAGS  = -DDEFAULTDIR=\"$(DATA)\" -O -s -DEXEDIR=\"$(EXEDIR)\"
  1955. X#    The following CFLAGS should be used if you wish to debug the game
  1956. X#CFLAGS  = -DDEFAULTDIR=\"$(DATA)\" -DDEBUG -g -DEXEDIR=\"$(EXEDIR)\"
  1957. X
  1958. X# AFILS are files needed for game updating...
  1959. XAFILS = combat.c cexecute.c io.c admin.c makeworl.c  navy.c spew.c \
  1960. Xnewlogin.c update.c magic.c npc.c misc.c randeven.c data.c trade.c check.c
  1961. XAOBJS = combat.o cexecuteA.o ioA.o admin.o makeworl.o  navyA.o \
  1962. Xnewlogin.o update.o magicA.o npc.o miscA.o randeven.o dataA.o \
  1963. XtradeA.o check.o $(GETOPT) spew.o
  1964. X
  1965. X# GFILS are files needed to run a normal interactive game
  1966. XGFILS = commands.c cexecute.c forms.c io.c main.c move.c navy.c \
  1967. Xmagic.c misc.c reports.c data.c display.c extcmds.c trade.c check.c
  1968. XGOBJS = commands.o cexecute.o forms.o io.o main.o move.o navy.o \
  1969. Xmagic.o misc.o reports.o data.o display.o extcmds.o trade.o check.o $(GETOPT)
  1970. X
  1971. X#txt[0-5] are input help files.  help[0-5] are output
  1972. XHELP0=txt0
  1973. XHELP1=txt1
  1974. XHELP2=txt2
  1975. XHELP3=txt3
  1976. XHELP4=txt4
  1977. XHELP5=txt5
  1978. XHELPOUT=help
  1979. X
  1980. XHEADERS=header.h data.h newlogin.h patchlevel.h
  1981. XHELPFILES= $(HELP0) $(HELP1) $(HELP2) $(HELP3) $(HELP4) $(HELP5)
  1982. XALLFILS=$(HEADERS) $(AFILS) commands.c forms.c main.c move.c \
  1983. Xreports.c display.c extcmds.c $(HELPFILES) nations Makefile README \
  1984. Xrun man.pag notes.v4 rules sort.c newhelp.c
  1985. X
  1986. Xall:    $(ADMIN) $(GAME) helpfile conqsort
  1987. X    @echo YAY! make new_game to set up permissions, zero appropriate
  1988. X    @echo initial files, move $(GAME) and $(ADMIN) to
  1989. X    @echo $(EXEDIR), and set up the world.
  1990. X    @echo If a game is in progress, make install will just move $(GAME)
  1991. X    @echo and $(ADMIN) to $(EXEDIR).
  1992. X    @echo
  1993. X
  1994. X$(ADMIN):    $(AOBJS)
  1995. X    @echo phew...
  1996. X    @echo if the next command does not compile, you might also need -ltermcap
  1997. X    @echo === compiling administrative functions
  1998. X    $(CC) -p -o $(ADMIN) $(AOBJS) $(LIBRARIES)
  1999. X
  2000. X$(GAME):    $(GOBJS)
  2001. X    @echo phew...
  2002. X    @echo if the next command does not compile, you might also need -ltermcap
  2003. X    @echo === compiling user interface
  2004. X    $(CC) -O -o $(GAME) $(GOBJS) $(LIBRARIES)
  2005. X
  2006. Xconqsort:
  2007. X    $(CC) -O -oconqsort sort.c
  2008. X
  2009. Xclobber:
  2010. X    $(RM) *.o core newhelp sed.1 sed.2 lint* \
  2011. X        conquer.doc $(GAME) $(ADMIN) $(HELPOUT)[0-5] 2>/dev/null
  2012. X
  2013. Xclean:
  2014. X    $(RM) *.o core conquer.doc sed.1 sed.2 newhelp $(HELPOUT)[0-5] 2>/dev/null
  2015. X
  2016. Xinstall:  all
  2017. X    -$(LN) $(GAME) $(EXEDIR)/$(GAME) $(NULL)
  2018. X    -$(LN) $(ADMIN) $(EXEDIR)/$(ADMIN) $(NULL)
  2019. X    -$(LN) conqsort $(EXEDIR)/conqsort $(NULL)
  2020. X    chmod 4755 $(EXEDIR)/$(GAME)
  2021. X    chmod 4750 $(EXEDIR)/$(ADMIN)
  2022. X    $(CP) conqsort nations rules $(HELPOUT)? $(DATA) $(NULL)
  2023. X
  2024. Xnew_game:  all
  2025. X    @echo Installing new game in $(EXEDIR)
  2026. X    -mkdir $(EXEDIR) 2>/dev/null
  2027. X    chmod 755 $(EXEDIR)
  2028. X    -$(LN) $(GAME) $(EXEDIR)/$(GAME) $(NULL)
  2029. X    -$(LN) $(ADMIN) $(EXEDIR)/$(ADMIN) $(NULL)
  2030. X    chmod 4755 $(EXEDIR)/$(GAME)
  2031. X    chmod 4750 $(EXEDIR)/$(ADMIN)
  2032. X    chmod 0700 run
  2033. X    @echo Copying data to library $(DATA)
  2034. X    -mkdir $(DATA) 2>/dev/null
  2035. X    chmod 751 $(DATA)
  2036. X    chmod 0600 nations
  2037. X    $(CP) nations rules $(HELPOUT)? $(DATA) $(NULL)
  2038. X    @echo now making the world
  2039. X    $(EXEDIR)/$(ADMIN) -d$(DATA) -m
  2040. X    $(EXEDIR)/$(ADMIN) -d$(DATA) -a
  2041. X
  2042. Xhelpfile:    $(HELPOUT)0
  2043. X    @echo Helpfiles built
  2044. X
  2045. X$(HELPOUT)0:    newhelp $(HELPFILES)
  2046. X    @echo Building the help files
  2047. X    newhelp
  2048. X    cat $(HELP0) | sed -f sed.1 > $(HELPOUT)0
  2049. X    cat $(HELP1) | sed -f sed.1 | sed -f sed.2 > $(HELPOUT)1
  2050. X    cat $(HELP2) | sed -f sed.1 > $(HELPOUT)2
  2051. X    cat $(HELP3) | sed -f sed.1 | sed -f sed.2 > $(HELPOUT)3
  2052. X    cat $(HELP4) | sed -f sed.1 > $(HELPOUT)4
  2053. X    cat $(HELP5) | sed -f sed.1 > $(HELPOUT)5
  2054. X    chmod 0644 $(HELPOUT)[0-5]
  2055. X    -$(RM) sed.1 sed.2
  2056. X
  2057. Xlint:
  2058. X    lint -DDEFAULTDIR=\"$(DATA)\" -DEXEDIR=\"$(EXEDIR)\" -DCONQUER $(GFILS) $(LIBRARIES)> lintg
  2059. X    lint -DDEFAULTDIR=\"$(DATA)\" -DEXEDIR=\"$(EXEDIR)\" -DADMIN $(AFILS) $(LIBRARIES) > linta
  2060. X
  2061. Xdocs:    helpfile conquer.doc
  2062. X
  2063. Xconquer.doc:    $(HELPOUT)0 $(HELPOUT)1 $(HELPOUT)2 $(HELPOUT)3 $(HELPOUT)4 $(HELPOUT)5
  2064. X    cat $(HELPOUT)?|sed -e "s/^DONE/ /g"|sed -e "s/^END//g" > conquer.doc
  2065. X
  2066. Xshar:
  2067. X    echo " lines   words chars   FILENAME" > MANIFEST
  2068. X    wc $(ALLFILS) >> MANIFEST
  2069. X    $(HOME)/src/xshar/xshar -D -c -l64 -oshar -v $(ALLFILS)
  2070. X
  2071. Xcombat.o:    data.h header.h combat.c
  2072. X    $(CC) $(CFLAGS) -DADMIN -c combat.c
  2073. Xcexecute.o:    data.h header.h cexecute.c
  2074. X    $(CC) $(CFLAGS) -DCONQUER -c cexecute.c
  2075. Xio.o:    data.h header.h  io.c
  2076. X    $(CC) $(CFLAGS) -DCONQUER -c io.c
  2077. XcexecuteA.o:    data.h header.h cexecute.c
  2078. X    $(CC) $(CFLAGS) -DADMIN -c cexecute.c
  2079. X    mv cexecute.o cexecuteA.o
  2080. XioA.o:    data.h header.h  io.c
  2081. X    $(CC) $(CFLAGS) -DADMIN -c io.c
  2082. X    mv io.o ioA.o
  2083. Xadmin.o:    data.h header.h admin.c
  2084. X    $(CC) $(CFLAGS) -DADMIN -c admin.c
  2085. Xmakeworl.o:    data.h header.h makeworl.c
  2086. X    $(CC) $(CFLAGS) -DADMIN -c makeworl.c
  2087. Xnewlogin.o:    data.h header.h newlogin.h newlogin.c
  2088. X    $(CC) $(CFLAGS) -DADMIN -c newlogin.c
  2089. Xupdate.o:    data.h header.h update.c
  2090. X    $(CC) $(CFLAGS) -DADMIN -c update.c
  2091. Xmagic.o:    data.h header.h magic.c
  2092. X    $(CC) $(CFLAGS) -DCONQUER -c magic.c
  2093. XmagicA.o:    data.h header.h magic.c
  2094. X    $(CC) $(CFLAGS) -DADMIN -c magic.c
  2095. X    mv magic.o magicA.o
  2096. Xnpc.o:    data.h header.h npc.c
  2097. X    $(CC) $(CFLAGS) -DADMIN -c npc.c
  2098. Xmisc.o:    data.h header.h misc.c
  2099. X    $(CC) $(CFLAGS) -DCONQUER -c misc.c
  2100. XmiscA.o:    data.h header.h misc.c
  2101. X    $(CC) $(CFLAGS) -DADMIN -c misc.c
  2102. X    mv misc.o miscA.o
  2103. Xrandeven.o:    data.h header.h randeven.c
  2104. X    $(CC) $(CFLAGS) -DADMIN -c randeven.c
  2105. Xdata.o:    data.h header.h data.c
  2106. X    $(CC) $(CFLAGS) -DCONQUER -c data.c
  2107. XdataA.o:    data.h header.h data.c
  2108. SHAR_EOF
  2109. echo "End of part 1, continue with part 2"
  2110. echo "2" > s2_seq_.tmp
  2111. exit 0
  2112.