From decwrl!wuarchive!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr Sat Sep 2 09:18:00 PDT 1989 Article 726 of comp.sources.games: Path: decwrl!wuarchive!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr From: billr@saab.CNA.TEK.COM (Bill Randle) Newsgroups: comp.sources.games Subject: v08i013: conquer4 - middle earth multi-player game (V4), Patch5a Message-ID: <4513@tekred.CNA.TEK.COM> Date: 1 Sep 89 18:52:12 GMT Sender: nobody@tekred.CNA.TEK.COM Lines: 1610 Approved: billr@saab.CNA.TEK.COM Submitted-by: Adam Bryant Posting-number: Volume 8, Issue 13 Archive-name: conquer4/Patch5a Patch-To: conquer4: Volume 6, Issue 83-97 [from the author...] [[Okay, here are the latest patches to conquer version 4. Notes: The patch is in three shar files, and the shar files unpack into 5 files: patchV4.5 - patch file to go to version 4.5 CONQPS.INFO - information file on conqps psmap.c - source file for conqps psmap.h - header file for conqps psmap.ps - postscript data file for conqps Conqps is a nifty program written by Martin Forssen to generate very nice postscript displays of conquer maps. The file CONQPS.INFO describes the options available. The patch makes the following enhancements/bug fixes: o the map redisplay is now much more efficient. o the newspaper reading facility is enhanced. o god can now added or remove magics selectively. o cheat() does not cheat for 'NPC' players who have moved. o fixed major bugs with assigning of multiple magics on newlogins. o added some NPC routines to have them obey magic power limitations. o enhanced the makefile installation routines. NOTE: Ed Barlow has provided his new address and phone, and is looking for information on unix access in N.Y. See the files 'README' and 'header.h' for more info. As before, enhancements are listed in the patched 'notes.v4' file. adam bryant]] #!/bin/sh # shar: Shell Archiver (v1.22) # # This is part 1 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # # Run the following text with /bin/sh to create: # CONQPS.INFO # patchV4.5 # psmap.c # psmap.h # psmap.ps # if test -r s2_seq_.tmp then echo "Must unpack archives in sequence!" next=`cat s2_seq_.tmp`; echo "Please unpack part $next next" exit 1; fi echo "x - extracting CONQPS.INFO (Text)" sed 's/^X//' << 'SHAR_EOF' > CONQPS.INFO && X X X Description X XThe conqps program translates maps from conquer to postscript suitable for Xprinting on a postscript printer. Conqps can act as a filter, or you Xcan give filenames to it. There is a lot of options to customise the output. XBut the only option you should remember is the h option, which gives Xa brief desription of all the options. If you are anxious to try it out Xjust type 'conquer -p | conqps >psmap' which should give you a file called Xpsmap, which can be sent to a postscript printer. There is a limitation of how Xbig the maps may be, this lies in the postscript language. But at our Xsite I have been able to print 256x256 maps (I haven't tried bigger) on Xa LaserWriter II. X X Options X X There is a lot of options, but you don't need to know all of them. Some X options were put in to let advanced users get more control over the output. X Valid options are 'cfghlLnopstuvWXY'. They do the following: X X c Turns off printing of coordinates around the edge of the map. X X f fontname Sets the font to 'fontname', you can use any font that is in your X printer. Default is Times-Roman. The program also looks for X the environment variable CONQ_PSFONT. The f option overrides X both the default and the environment variable. X X g Turns off printing of the grid at the unknown parts of the map. X X h Shows a brief description of the options and some defaults. X X l If you print larger maps it's possible to exhaust the memory of your X printer. This option uses a feature in the Apple LaserWriter which X conserves memory, but gives you a smaller map. This option is not X fully tested, and should probably not be used. X X n Normally the map is centered around the parts of the world you know. X This option turns off this feature, and lets the program do as it X damn well pleases with your map :-) X X o x,y If you want to print just a small part of a bigger map use this X option. It makes conqps just to produce one page centered around X coordinates x,y. X X p type Sets the type of paper you have in the printer. Possible values X today are: A4 (European standard) LETTER (American standard) or X OTHER (should be local standard). You shouldn't have to use this X option since the person who maintains conquer at your site should X have set the right papersize as default (This is done in the X Makefile). X X s size Sets the size of each square of the map. This is useful to get X more map printed on fewer pages, but it will be smaller. X Default value is 9. X X t string Conqps tries to guess a nice title to the map for you. Normally X this is something like 'Designation Map for Nation Midkemia on X Turn 2' (this title is actually provided from the conquer program). X If however you would like to have your own title shown, just use X the t option, which replaces the default title with string. X X u Normally conqps put small pictures in some of your squares instead of X just letters. This option forces conqps not to do this, but instead X print the letters. X X v Puts conqps in verbose mode. For example you will be told how big the map X is and how big it will be on the printer. X X L,W,X,Y If none of the paper types fits your needs you can alter the size X directly with these options. All these options use one postscript X point (1/72 inch) as their unit. L sets the length of the page. X W sets the width. X sets the x coordinate for the leftmost viewable X pixel on the output, and Y sets the y coordinate. These options X are normally never used, instead you should experiment with X the p option. X X Bugs X X Hopefully no. X X X Comments X X If you have any comments or ideas mail them to d8forma@dtek.chalmers.se . X X MaF X SHAR_EOF chmod 0666 CONQPS.INFO || echo "restore of CONQPS.INFO fails" set `wc -c CONQPS.INFO`;Sum=$1 if test "$Sum" != "3751" then echo original size 3751, current size $Sum;fi echo "x - extracting patchV4.5 (Text)" sed 's/^X//' << 'SHAR_EOF' > patchV4.5 && X*** opatchlevel.h Sat Aug 26 19:04:07 1989 X--- patchlevel.h Sat Aug 26 19:04:14 1989 X*************** X*** 1 **** X! #define PATCHLEVEL 4 X--- 1 ---- X! #define PATCHLEVEL 5 X*** onotes.v4 Sat Aug 26 19:04:07 1989 X--- notes.v4 Sat Aug 26 19:04:14 1989 X*************** X*** 156,161 **** X--- 156,190 ---- X 108. made sure that NPCs do not group or disband ZOMBIES. X 109. added a NOSCORE compiler option to allow only god to see full score list. X 110. changed the class name NPC to monster. X+ ===4.0 patch number four released => 4.4 =========================== X+ 111. fixed bug with scouts being grouped by NPCs. X+ 112. fixed bug that did not provide NPCs with leaders. X+ 113. reworked cexecute.c to allow multiple magic initializations. X+ 114. touched up newlogin() and makeworld(). X+ 115. installed routines to limit NPCs by following the VOID and HIDDEN X+ powers. [] X+ 116. altered the killmagk() routine to allow addition and removal: god_magk(). X+ 117. commented out some nations from the nations file. X+ 118. tinkered with makeworl.c again. X+ 119. added in the conqps functions by Martin Forrsen. X+ 120. rewrote cheat() routine to verify that nation hadn't been touched by X+ a player during that turn. X+ 121. made a 'PLEASE WAIT' message appear on login, since response of some X+ computers is slower than expected during startup. [T. Kivinen] X+ 122. made sure fison was changed properly during 'z' command. [T. Kivinen] X+ 123. changed monster capture statements to go to end of page. [T. Kivinen] X+ 124. altered newpaper() to allow quick scaning. [T. Kivenen] X+ 125. added a rudimentary repeat command to repeat last unit affecting command. X+ 126. altered the 'reading ....' statements in DEBUG mode to go to stderr. X+ 127. ships now lose only N_CITYCOST movepoints when unloading in cities. X+ 128. shifted movement below xloc,yloc in army reports for readability. X+ 129. fixed the redrawing of sectors after movement. X+ 130. added a patch to avoid a compiler bug in display.c [Richard Caley] X+ 131. improved screen clearing routine installed. [T. Kivinen] X+ 132. revamped display under the move people command. X+ 133. added fix to make sure '-p' command checks void properly. [D. Caplinger] X+ 134. inserted a check for allowing extra clear when redrawing. X+ 135. renamed all of the conqps source files to 'psmap'. X X ------------------------------------------------------------------------- X | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4 | X*** oMakefile Sat Aug 26 19:04:06 1989 X--- Makefile Sat Aug 26 19:04:14 1989 X*************** X*** 30,35 **** X--- 30,51 ---- X # Flags to lint X LTFLG = -h -lcurses X X+ # Options for the postscript map printing program. X+ # The file 'conqps.ps' will be installed in the EXEDIR X+ # directory which is determined below. X+ # X+ # To avoid building this program, remove $(PSPROG) from X+ # both the 'all:' list and the 'install:' list X+ PSPROG = conqps X+ PSSRC = psmap.c X+ PSHEAD = psmap.h X+ PSDATA = psmap.ps X+ # Default Pagesize Setting: X+ # A4 for European page size. X+ # LETTER for American page size. X+ # OTHER for Local page size. [edit conqps.h] X+ PSPAGE = LETTER X+ X # Options for shar program, SHARLIM is limit of each shar X # file created in kilobytes and SHARNAM is the prefix for X # SHARFILE name. X*************** X*** 75,81 **** X CDEFS = -DDEFAULTDIR=\"$(DEFAULT)\" -DEXEDIR=\"$(EXEDIR)\" X X # Options flag used for non-debugging purposes X! OPTFLG = -O X X # Options flag used for debugging purposes X # [make sure to comment out 'strip' commands in install section] X--- 91,97 ---- X CDEFS = -DDEFAULTDIR=\"$(DEFAULT)\" -DEXEDIR=\"$(EXEDIR)\" X X # Options flag used for non-debugging purposes X! OPTFLG = -O X X # Options flag used for debugging purposes X # [make sure to comment out 'strip' commands in install section] X*************** X*** 124,134 **** X X HEADERS=header.h data.h newlogin.h patchlevel.h X SUPT1=nations Makefile $(HELP)[0-5] README run man.pag rules X! SUPT2=execute messages news commerce X ALLFILS=$(SUPT1) $(HEADERS) $(AFILS) commands.c forms.c main.c move.c \ X! reports.c display.c extcmds.c newhelp.c sort.c getopt.c X X! all: $(ADMIN) $(GAME) $(SORT) helpfile X @echo YAY! make new_game to set up permissions, zero appropriate X @echo initial files, move $(GAME) and $(ADMIN) to X @echo $(EXEDIR), and set up the world. X--- 140,151 ---- X X HEADERS=header.h data.h newlogin.h patchlevel.h X SUPT1=nations Makefile $(HELP)[0-5] README run man.pag rules X! SUPT2=execute messages news commerce CONQPS.INFO X ALLFILS=$(SUPT1) $(HEADERS) $(AFILS) commands.c forms.c main.c move.c \ X! reports.c display.c extcmds.c newhelp.c sort.c getopt.c \ X! $(PSSRC) $(PSHEAD) $(PSDATA) X X! all: $(ADMIN) $(GAME) $(SORT) $(PSPROG) helpfile X @echo YAY! make new_game to set up permissions, zero appropriate X @echo initial files, move $(GAME) and $(ADMIN) to X @echo $(EXEDIR), and set up the world. X*************** X*** 160,189 **** X strip $(SORT) X X clobber: X! $(RM) *.o $(HELPOUT)[0-5] $(SORT) newhelp in$(GAME) in$(SORT) in$(ADMIN) $(HELPSCR).[12] lint[aghs] conquer.doc $(GAME) $(ADMIN) $(NULL) X X clean: X! $(RM) *.o lint[aghs] conquer.doc $(NULL) X X in$(GAME): $(GAME) X -$(RM) $(EXEDIR)/$(GAME) X! $(CP) $(GAME) $(EXEDIR) X chmod 4751 $(EXEDIR)/$(GAME) X touch in$(GAME) X X in$(ADMIN): $(ADMIN) X -$(RM) $(EXEDIR)/$(ADMIN) X! $(CP) $(ADMIN) $(EXEDIR) X chmod 4751 $(EXEDIR)/$(ADMIN) X touch in$(ADMIN) X X in$(SORT): $(SORT) X -$(RM) $(EXEDIR)/$(SORT) X! $(CP) $(SORT) $(EXEDIR) X chmod 751 $(EXEDIR)/$(SORT) X touch in$(SORT) X X! install: in$(GAME) in$(ADMIN) in$(SORT) insthelp X @echo "" X @echo "Installation complete" X X--- 177,220 ---- X strip $(SORT) X X clobber: X! -$(RM) *.o $(HELPOUT)[0-5] $(PSPROG) $(SORT) $(NULL) X! -$(RM) newhelp in$(GAME) in$(SORT) in$(ADMIN) in$(PSPROG) $(NULL) X! -$(RM) $(HELPSCR).[12] lint[ag] conquer.doc $(GAME) $(ADMIN) $(NULL) X X clean: X! $(RM) *.o lint[ag] conquer.doc $(NULL) X X in$(GAME): $(GAME) X -$(RM) $(EXEDIR)/$(GAME) X! mv $(GAME) $(EXEDIR) X chmod 4751 $(EXEDIR)/$(GAME) X+ touch $(GAME) X touch in$(GAME) X X in$(ADMIN): $(ADMIN) X -$(RM) $(EXEDIR)/$(ADMIN) X! mv $(ADMIN) $(EXEDIR) X chmod 4751 $(EXEDIR)/$(ADMIN) X+ touch $(ADMIN) X touch in$(ADMIN) X X in$(SORT): $(SORT) X -$(RM) $(EXEDIR)/$(SORT) X! mv $(SORT) $(EXEDIR) X chmod 751 $(EXEDIR)/$(SORT) X+ touch $(SORT) X touch in$(SORT) X X! in$(PSPROG): $(PSPROG) X! -$(RM) $(EXEDIR)/$(PSPROG) X! mv $(PSPROG) $(EXEDIR) X! $(CP) $(PSDATA) $(EXEDIR) X! chmod 751 $(EXEDIR)/$(PSPROG) X! chmod 644 $(EXEDIR)/$(PSDATA) X! touch $(PSPROG) X! touch in$(PSPROG) X! X! install: in$(GAME) in$(ADMIN) in$(SORT) in$(PSPROG) insthelp X @echo "" X @echo "Installation complete" X X*************** X*** 194,202 **** X -mkdir $(DEFAULT)/$(GAMEID) $(NULL) X chmod 755 $(EXEDIR) X chmod 750 $(DEFAULT)/$(GAMEID) $(DEFAULT) X! $(CP) $(GAME) $(ADMIN) $(SORT) $(EXEDIR) X chmod 4755 $(EXEDIR)/$(GAME) $(EXEDIR)/$(ADMIN) X! chmod 0755 $(EXEDIR)/$(SORT) X chmod 0600 nations X chmod 0700 run X $(CP) nations rules $(DEFAULT)/$(GAMEID) X--- 225,234 ---- X -mkdir $(DEFAULT)/$(GAMEID) $(NULL) X chmod 755 $(EXEDIR) X chmod 750 $(DEFAULT)/$(GAMEID) $(DEFAULT) X! $(CP) $(GAME) $(ADMIN) $(SORT) $(PSPROG) $(PSDATA) $(EXEDIR) X chmod 4755 $(EXEDIR)/$(GAME) $(EXEDIR)/$(ADMIN) X! chmod 0755 $(EXEDIR)/$(SORT) $(EXEDIR)/$(PSPROG) X! chmod 0644 $(EXEDIR)/$(PSDATA) X chmod 0600 nations X chmod 0700 run X $(CP) nations rules $(DEFAULT)/$(GAMEID) X*************** X*** 256,262 **** X newhelp X X newhelp: dataG.o newhelp.o X! $(CC) dataG.o newhelp.o -o newhelp X X lint: X lint $(LTFLG) $(CDEFS) -DCONQUER $(GFILS) > lintg X--- 288,303 ---- X newhelp X X newhelp: dataG.o newhelp.o X! $(CC) $(OPTFLG) dataG.o newhelp.o -o newhelp X! strip newhelp X! # X! # postscript map program X! PSOPTS = -DPSFILE=\"$(EXEDIR)/$(PSDATA)\" -D$(PSPAGE) X! # X! $(PSPROG): $(PSSRC) $(PSDATA) $(PSHEAD) X! $(CC) $(OPTFLG) $(PSOPTS) $(PSSRC) -o $(PSPROG) X! # comment out the next line if debugging X! strip $(PSPROG) X X lint: X lint $(LTFLG) $(CDEFS) -DCONQUER $(GFILS) > lintg X*************** X*** 297,311 **** X X $(AOBJS): data.h header.h X X! ioG.o: data.h header.h patchlevel.h X X! ioA.o: data.h header.h patchlevel.h X X! newlogin.o: data.h header.h newlogin.h patchlevel.h X X! main.o: data.h header.h patchlevel.h X X! newhelp.c: data.h header.h patchlevel.h X X # Clear suffixes X .SUFFIXES: X--- 338,352 ---- X X $(AOBJS): data.h header.h X X! ioG.o: data.h header.h patchlevel.h io.c X X! ioA.o: data.h header.h patchlevel.h io.c X X! newlogin.o: data.h header.h newlogin.h patchlevel.h newlogin.c X X! main.o: data.h header.h patchlevel.h main.c X X! newhelp.o: data.h header.h patchlevel.h newhelp.c X X # Clear suffixes X .SUFFIXES: X*** oREADME Sat Aug 26 19:04:06 1989 X--- README Sat Aug 26 19:04:15 1989 X*************** X*** 21,26 **** X--- 21,33 ---- X "conquer-news@bu-cs.bu.edu" and addition to or deletions from the mailing X list may be sent to "conquer-news-request@bu-cs.bu.edu". X X+ NOTE: My new phone number is 212-679-1439. My work has no arpanet. If anybody X+ knows of a cheap (free??) way of getting an arpanet login I NEED ONE. I X+ basically can make no more changes to Conquer until I can get a network port, X+ and since i am "volunteering" my time for this project, I am not about to X+ spend millions of dollars to buy one... I can get a modem for my PC if X+ somebody will help me get a port somewhere. -ED- X+ X Included in this file are the following: X 1) A Brief Description of Conquer X 2) Installation (unpacking) Instructions X*** oheader.h Sat Aug 26 19:04:06 1989 X--- header.h Sat Aug 26 19:04:15 1989 X*************** X*** 12,26 **** X new software shall, for now, be the perogative of the author. X 3) loss or damage caused by this software shall not be X the responsibility of the author. X! 4) Ed Barlow shall be notified of enhancements to this software via X! electronic mail and, if there is no response, via US mail to: X X Ed Barlow X! 562 Clubhouse Dr, X! Middletown NJ 07748 X X! My home phone is 201-671-2896. Use it sparingly and call X! before 11PM if it is important. X 5) no attempt shall be made to make any money from this game or to X use any portion of this code to make any money without the X authors permission. X--- 12,34 ---- X new software shall, for now, be the perogative of the author. X 3) loss or damage caused by this software shall not be X the responsibility of the author. X! 4) Ed Barlow or Adam Bryant shall be notified of enhancements to this X! software via electronic mail and, if there is no response, via X! US mail to: X X Ed Barlow X! 115 E 34ths St. X! NY, NY 10016 X X! My home phone is 212-679-1439. Use it sparingly and call X! before 11PM if it is important. Note that I no longer have X! access to the arpanet and cant really support conquer like X! I used to. If somebody knows of a cheap (free) way of getting X! a login somewhere where there is network access - HELP ME!!!! X! Since i am "volunteering" my time for this project, I am not X! about to spend millions of dollars to buy network access... X! I can get a modem for my PC if somebody will help me get X! something to call into. -ED- X 5) no attempt shall be made to make any money from this game or to X use any portion of this code to make any money without the X authors permission. X*************** X*** 84,89 **** X--- 92,107 ---- X #define CHEAT /* npcs will cheat to keep up - this is a very weak X form of cheating. I use good npc algorithms X (i think... comments) */ X+ /*#define NPC_COUNT_ARMIES /* defined if NPC nations can always count armies X+ This makes them to cheat by seeing even VOID and X+ HIDDEN armies when counting enemy units. */ X+ /*#define NPC_SEE_SECTORS /* defined if NPC nations can always see sectors X+ This allows them to cheat by being allowed to see X+ all sector attributes of even VOID sectors. */ X+ #define NPC_SEE_CITIES /* defined if NPC nations can always see cities X+ This allows them to cheat by being able to see X+ if a VOID sector is a city/town. Simulates the X+ players ability to tell cities via movement. */ X #define STORMS /* have storms strike fleets */ X #define VULCANIZE /* add in volcano eruptions.... */ X #define PVULCAN 20 /* % chance of eruption each round (see above) */ X*************** X*** 147,153 **** X #define WARSHPCOST 20000L /* cost to build one light warship */ X #define MERSHPCOST 25000L /* cost to build one light merchant */ X #define GALSHPCOST 25000L /* cost to build one light galley */ X! #define SHIPCREW 100 /* full strength crew on a ship */ X #define SHIPHOLD 100L /* storage space of a ship unit */ X #define CITYLIMIT 8L /* % of npc pop in sctr before => city */ X #define CITYPERCENT 20L /* % of npc pop able to be in cities */ X--- 165,172 ---- X #define WARSHPCOST 20000L /* cost to build one light warship */ X #define MERSHPCOST 25000L /* cost to build one light merchant */ X #define GALSHPCOST 25000L /* cost to build one light galley */ X! #define N_CITYCOST 4 /* move lost in (un)loading in cities */ X! #define SHIPCREW 100 /* full strength crew on a ship */ X #define SHIPHOLD 100L /* storage space of a ship unit */ X #define CITYLIMIT 8L /* % of npc pop in sctr before => city */ X #define CITYPERCENT 20L /* % of npc pop able to be in cities */ X*** odata.h Sat Aug 26 19:04:06 1989 X--- data.h Sat Aug 26 19:04:15 1989 X*************** X*** 18,23 **** X--- 18,28 ---- X #define FALSE 0 X #endif X X+ /* definitions for screen redrawing */ X+ #define DONE 0 X+ #define PART 1 X+ #define FULL 2 X+ X #define SCREEN_X_SIZE (( COLS - 21) / 2) /* divide by two as only 1/2 X sectors will be shown */ X #define SCREEN_Y_SIZE ( LINES - 5 ) X*************** X*** 606,612 **** X extern long get_number(), solds_in_sector(),defaultunit(); X X extern int move_file(), land_2reachp(), land_reachp(), canbeseen(); X! extern int water_reachp(), markok(), is_habitable(); X extern int units_in_sector(), num_powers(), tofood(); X extern int get_god(), flightcost(), todigit(), getclass(), startcost(); X extern int water_2reachp(),tg_ok(), readmap(), avian(); X--- 611,617 ---- X extern long get_number(), solds_in_sector(),defaultunit(); X X extern int move_file(), land_2reachp(), land_reachp(), canbeseen(); X! extern int water_reachp(), markok(), is_habitable(), parse(); X extern int units_in_sector(), num_powers(), tofood(); X extern int get_god(), flightcost(), todigit(), getclass(), startcost(); X extern int water_2reachp(),tg_ok(), readmap(), avian(); X*************** X*** 623,629 **** X extern struct s_sector *rand_sector(); X extern void subgships(),submships(),subwships(),getspace(),sackem(); X extern void sleep(), whatcansee(), reset_god(), get_nname(), camp_info(); X! extern void main(), makebottom(), parse(), makeside(), check_mail(); X extern void checkout(),copyscreen(),bye(),credits(),init_hasseen(); X extern void combinearmies(),change_status(),reducearmy(),splitarmy(); X extern void errormsg(), clear_bottom(), addgroup(),ext_cmd(); X--- 628,634 ---- X extern struct s_sector *rand_sector(); X extern void subgships(),submships(),subwships(),getspace(),sackem(); X extern void sleep(), whatcansee(), reset_god(), get_nname(), camp_info(); X! extern void main(), makebottom(), makeside(), check_mail(); X extern void checkout(),copyscreen(),bye(),credits(),init_hasseen(); X extern void combinearmies(),change_status(),reducearmy(),splitarmy(); X extern void errormsg(), clear_bottom(), addgroup(),ext_cmd(); X*** oextcmds.c Sat Aug 26 19:04:06 1989 X--- extcmds.c Sat Aug 26 19:04:15 1989 X*************** X*** 320,326 **** X { X mvaddstr(LINES-1, 0, str); X clrtoeol(); X! mvaddstr(LINES-1, COLS-20, "PRESS ANY KEY"); X beep(); X refresh(); X getch(); X--- 320,326 ---- X { X mvaddstr(LINES-1, 0, str); X clrtoeol(); X! mvaddstr(LINES-1, COLS-16, "PRESS ANY KEY"); X beep(); X refresh(); X getch(); X*** omakeworl.c Sat Aug 26 19:04:07 1989 X--- makeworl.c Sat Aug 26 19:04:16 1989 X*************** X*** 12,18 **** X X /*Create a world*/ X X- /*DEFINE TEMPORARY VARIABLES FROM MAKEFILE*/ X #include X #include X #include X--- 12,17 ---- X*************** X*** 90,109 **** X mvaddstr(2,5,"Genesis begins... Your super user login will be 'god'."); X mvaddstr(3,0,"Non-player countries will be read in from the file 'nations',"); X mvaddstr(4,0,"and will have the same password as god, which you will soon set."); X! mvaddstr(5,0," To add players after building: conqrun -a"); X if (strcmp(datadir,"[default]")!=0) X printw(" -d %s", datadir); X addch('.'); X X! newmsg("..Zero out extraneous files from prior games"); X /* flush out beginning input */ X- while(getch()!='\n') ; X sprintf(newstring,"rm -f %s* %s* %s* %s* %s %s 2> /dev/null", X exefile, msgfile, newsfile, isonfile, tradefile, timefile); X system(newstring); X! newerror("....Initialize the nation structures"); X zeroworld(); X! newerror("Initialization complete: And there was light...."); X X valid=FALSE; X while(valid==FALSE) { /* password routine */ X--- 89,108 ---- X mvaddstr(2,5,"Genesis begins... Your super user login will be 'god'."); X mvaddstr(3,0,"Non-player countries will be read in from the file 'nations',"); X mvaddstr(4,0,"and will have the same password as god, which you will soon set."); X! mvaddstr(5,0," To add players after world creation: conqrun -a"); X if (strcmp(datadir,"[default]")!=0) X printw(" -d %s", datadir); X addch('.'); X X! newerror("..Zero out extraneous files from prior games"); X /* flush out beginning input */ X sprintf(newstring,"rm -f %s* %s* %s* %s* %s %s 2> /dev/null", X exefile, msgfile, newsfile, isonfile, tradefile, timefile); X system(newstring); X! newmsg("....Initialize the nation structures"); X zeroworld(); X! newmsg("Initialization complete: And there was light...."); X! sleep(1); X X valid=FALSE; X while(valid==FALSE) { /* password routine */ X*************** X*** 130,143 **** X strncpy(ntn[0].passwd,crypt(passwd,SALT),PASSLTH); X X /* finally ask for the secondary administrator */ X! mvaddstr(7,0,"You may now designate an alternate ruler for this world."); X while(TRUE) { X! mvaddstr(8,0,"What demi-god shall rule this world? "); X clrtoeol(); X refresh(); X get_nname( newstring ); X if (strlen(newstring)==0) { X! newerror("God blesses this world with his presense!"); X (void) strcpy(ntn[0].leader,LOGIN); X mvaddstr(7,0,"Demi-God: [none]"); X clrtoeol(); X--- 129,144 ---- X strncpy(ntn[0].passwd,crypt(passwd,SALT),PASSLTH); X X /* finally ask for the secondary administrator */ X! mvaddstr(7,0,"You may designate an other user as an alternate \"god\" for this world."); X! mvaddstr(8,0,"Enter System Login of alternate user or hit return to continue."); X while(TRUE) { X! mvaddstr(9,0,"What demi-god shall co-rule this world: "); X clrtoeol(); X refresh(); X get_nname( newstring ); X if (strlen(newstring)==0) { X! newmsg("God will personally rule this world!!!"); X! sleep(1); X (void) strcpy(ntn[0].leader,LOGIN); X mvaddstr(7,0,"Demi-God: [none]"); X clrtoeol(); X*************** X*** 145,151 **** X } else if (strlen(newstring) <= LEADERLTH) { X if (getpwnam(newstring)!=NULL) { X sprintf(tempc,"The demi-god %s may administrate this new world.",newstring); X! newerror(tempc); X (void) strncpy(ntn[0].leader,newstring,LEADERLTH); X mvprintw(7,0,"Demi-God: %s",ntn[0].leader); X clrtoeol(); X--- 146,152 ---- X } else if (strlen(newstring) <= LEADERLTH) { X if (getpwnam(newstring)!=NULL) { X sprintf(tempc,"The demi-god %s may administrate this new world.",newstring); X! newmsg(tempc); X (void) strncpy(ntn[0].leader,newstring,LEADERLTH); X mvprintw(7,0,"Demi-God: %s",ntn[0].leader); X clrtoeol(); X*************** X*** 252,258 **** X mvaddstr(14,0,"known as god) decreed 'conqrun -m'!!!"); X X /*initialize variables */ X! newerror("Day 1... And the variables were initialized."); X move(11,0); X clrtoeol(); X move(12,0); X--- 253,260 ---- X mvaddstr(14,0,"known as god) decreed 'conqrun -m'!!!"); X X /*initialize variables */ X! newmsg("Day 1... And the variables were initialized."); X! sleep(1); X move(11,0); X clrtoeol(); X move(12,0); X*************** X*** 426,434 **** X for(X=0;Xpowers,long2var); X getchar(); X } X! exenewmgk(long2var); X long2var=0; X break; X } X--- 248,258 ---- X printf("\nERROR ON MAGIC READ country=%d %ld != %ld (or of %ld)",country,longvar,curntn->powers,long2var); X getchar(); X } X! for(armynum=0;armynum<=MAXPOWER;armynum++) { X! longvar = 1L << armynum; X! if (longvar & long2var) X! exenewmgk(longvar); X! } X long2var=0; X break; X } X*** oforms.c Sat Aug 26 19:04:06 1989 X--- forms.c Sat Aug 26 19:04:16 1989 X*************** X*** 788,794 **** X X /* quick exit on invalid entry */ X if (i<0 || i>MAXHELP) { X! redraw=FALSE; X makebottom(); X return; X } X--- 788,794 ---- X X /* quick exit on invalid entry */ X if (i<0 || i>MAXHELP) { X! redraw=DONE; X makebottom(); X return; X } X*************** X*** 863,885 **** X { X int lineno; X FILE *fp, *fopen(); X! int newpage,choice,done=FALSE; X! short pagenum=1; X int i,ydist,xdist; X char line[LINELTH],name[FILELTH]; X! X /* check to make sure that there are newspapers */ X if (TURN==0) { X clear_bottom(0); X errormsg("no news to read"); X! redraw=FALSE; X makebottom(); X return; X } X X clear_bottom(0); X ydist=LINES-3; X xdist=0; X /* check for all newspapers up until the current turn */ X for (i=TURN-1;i>=0 && i>=TURN-MAXNEWS;i--) { X sprintf(line," %d) %s of Year %d",TURN-i, X--- 863,891 ---- X { X int lineno; X FILE *fp, *fopen(); X! int newpage,choice,done; X! short pagenum,subpage; X int i,ydist,xdist; X char line[LINELTH],name[FILELTH]; X! int readold; X! int c; X! X /* check to make sure that there are newspapers */ X if (TURN==0) { X clear_bottom(0); X errormsg("no news to read"); X! redraw=DONE; X makebottom(); X return; X } X X+ /* set to 1 if news already read and redraw is needed */ X+ readold=0; X+ readoldp: /* label to jump if reading old pages */ X clear_bottom(0); X ydist=LINES-3; X xdist=0; X+ X /* check for all newspapers up until the current turn */ X for (i=TURN-1;i>=0 && i>=TURN-MAXNEWS;i--) { X sprintf(line," %d) %s of Year %d",TURN-i, X*************** X*** 895,935 **** X mvaddstr(LINES-4,0,"Read Which Newspaper:"); X standend(); X refresh(); X /* get the choice */ X choice = getch() - '0'; X /* make sure the choice is valid */ X if (choice<1 || choice > MAXNEWS) { X makebottom(); X! redraw=FALSE; X return; X } X! X sprintf(name,"%s%d",newsfile,TURN-choice); X if ((fp=fopen(name,"r"))==NULL) { X clear_bottom(0); X sprintf(line,"unable to open news file <%s>",name); X errormsg(line); X! redraw=FALSE; X makebottom(); X return; X } X X /*open and read one page */ X newpage=FALSE; X line[0]='\0'; X strcpy(name,""); X! X! /*clear out any proceeding blanks*/ X! while(done==FALSE && strlen(name)==0) X if(fgets(name,80,fp)==NULL) done=TRUE; X X! while(done==FALSE){ X if(newpage==FALSE){ X clear(); X lineno=5; X newpage=TRUE; X standout(); X! mvprintw(0,23,"CONQUER NEWS REPORT page %d",pagenum); X mvprintw(1,28,"%s of Year %d",PSEASON(TURN-choice),YEAR(TURN-choice)); X mvprintw(3,37-strlen(name)/2,"%s",name+2); X standend(); X--- 901,960 ---- X mvaddstr(LINES-4,0,"Read Which Newspaper:"); X standend(); X refresh(); X+ X /* get the choice */ X choice = getch() - '0'; X /* make sure the choice is valid */ X if (choice<1 || choice > MAXNEWS) { X+ if (readold) X+ return; X makebottom(); X! redraw=DONE; X return; X } X! /* select page to read */ X! pagenum=1; X! backpage: /* label for reading previous pages. pagenum set to page */ X sprintf(name,"%s%d",newsfile,TURN-choice); X if ((fp=fopen(name,"r"))==NULL) { X clear_bottom(0); X sprintf(line,"unable to open news file <%s>",name); X errormsg(line); X! if (readold) X! return; X! redraw=DONE; X makebottom(); X return; X } X X /*open and read one page */ X+ forpage: /* label for reading forward pages. pagenum set to page */ X+ subpage=1; X newpage=FALSE; X line[0]='\0'; X strcpy(name,""); X! /* reading to correct page */ X! i=0; X! done=FALSE; X! while(done==FALSE && iLINES-4) newpage=FALSE; X else if(strlen(line)>2) { X--- 965,980 ---- X } X } else if(fgets(line,80,fp)==NULL) done=TRUE; X else { X! if(line[1]!='.' && line[1]!=':') { X strcpy(name,line); X newpage=FALSE; X! pagenum=todigit(line[0]); X! subpage=1; X } else { X if(todigit(line[0])!=pagenum) { X newpage=FALSE; X pagenum=todigit(line[0]); X+ subpage=1; X } X else if(lineno>LINES-4) newpage=FALSE; X else if(strlen(line)>2) { X*************** X*** 959,970 **** X if(newpage==FALSE||done==TRUE){ X standout(); X /* constants since news is 80 col format */ X! mvaddstr(LINES-2,24,"HIT ANY KEY TO CONTINUE"); X! mvaddstr(LINES-1,25,"TO END NEWS HIT SPACE"); X standend(); X refresh(); X! if(getch()==' ') done=TRUE; X } X! } X fclose(fp); X } X--- 986,1045 ---- X if(newpage==FALSE||done==TRUE){ X standout(); X /* constants since news is 80 col format */ X! mvaddstr(LINES-2,4,"N=next page, P=previous page, 1-5=jump to page, O=Read other news"); X! mvaddstr(LINES-1,12,"ANY OTHER KEY TO ADVANCE -- TO END NEWS HIT SPACE"); X standend(); X refresh(); X! stayhere: X! c=getch(); X! switch (c) { X! case 'N': X! case 'n': X! /* go forward a page */ X! if (subpage!=1 && done!=TRUE) { X! pagenum++; X! if (pagenum>5) pagenum=5; X! goto forpage; X! } else if (done==TRUE) { X! goto stayhere; X! } X! break; X! case 'P': X! case 'p': X! /* go backward a page */ X! if (subpage==1) pagenum--; X! pagenum--; X! if (pagenum<1) pagenum=1; X! fclose(fp); X! goto backpage; X! break; X! case '1': X! case '2': X! case '3': X! case '4': X! case '5': X! /* goto a specific page */ X! i=todigit(c); X! if (i<=pagenum) { X! pagenum=i; X! fclose(fp); X! goto backpage; X! } else { X! pagenum=i; X! goto forpage; X! } X! break; X! case ' ': X! done=TRUE; X! break; X! case 'O': X! case 'o': X! readold=1; X! fclose(fp); X! goto readoldp; X! break; X! } X } X! } while (done==FALSE); X fclose(fp); X } X*** oreports.c Sat Aug 26 19:04:08 1989 X--- reports.c Sat Aug 26 19:04:17 1989 X*************** X*** 58,64 **** X (P_AXLOC==XREAL && P_AYLOC==YREAL))) X men=TRUE; X if (!men) { X! redraw=FALSE; X clear_bottom(0); X errormsg("no armies to display"); X makebottom(); X--- 58,64 ---- X (P_AXLOC==XREAL && P_AYLOC==YREAL))) X men=TRUE; X if (!men) { X! redraw=DONE; X clear_bottom(0); X errormsg("no armies to display"); X makebottom(); X*************** X*** 78,86 **** X if (count%MAXINROW==0) { X /* diplay header information */ X mvaddstr(ypos+1,0,"soldiers :"); X! mvaddstr(ypos+2,0,"movement :"); X! mvaddstr(ypos+3,0,"x location:"); X! mvaddstr(ypos+4,0,"y location:"); X mvaddstr(ypos+5,0,"status :"); X mvaddstr(ypos+6,0,"unit type :"); X mvaddstr(ypos+7,0,"cost/turn :"); X--- 78,86 ---- X if (count%MAXINROW==0) { X /* diplay header information */ X mvaddstr(ypos+1,0,"soldiers :"); X! mvaddstr(ypos+2,0,"x location:"); X! mvaddstr(ypos+3,0,"y location:"); X! mvaddstr(ypos+4,0,"movement :"); X mvaddstr(ypos+5,0,"status :"); X mvaddstr(ypos+6,0,"unit type :"); X mvaddstr(ypos+7,0,"cost/turn :"); X*************** X*** 90,98 **** X mvprintw(ypos,xpos,"%d:",armynum); X standend(); X mvprintw(ypos+1,xpos,"%ld",P_ASOLD); X! mvprintw(ypos+2,xpos,"%d",P_AMOVE); X! mvprintw(ypos+3,xpos,"%d",(int)P_AXLOC); X! mvprintw(ypos+4,xpos,"%d",(int)P_AYLOC); X if(P_ASTAT>=NUMSTATUS) X mvprintw(ypos+5,xpos,"group %d",P_ASTAT-NUMSTATUS); X else X--- 90,98 ---- X mvprintw(ypos,xpos,"%d:",armynum); X standend(); X mvprintw(ypos+1,xpos,"%ld",P_ASOLD); X! mvprintw(ypos+2,xpos,"%d",(int)P_AXLOC); X! mvprintw(ypos+3,xpos,"%d",(int)P_AYLOC); X! mvprintw(ypos+4,xpos,"%d",P_AMOVE); X if(P_ASTAT>=NUMSTATUS) X mvprintw(ypos+5,xpos,"group %d",P_ASTAT-NUMSTATUS); X else X*************** X*** 491,497 **** X if(count==0){ X clear_bottom(0); X errormsg("no navies"); X! redraw=FALSE; X makebottom(); X return; X } X--- 491,497 ---- X if(count==0){ X clear_bottom(0); X errormsg("no navies"); X! redraw=DONE; X makebottom(); X return; X } X*** ocombat.c Sat Aug 26 19:04:06 1989 X--- combat.c Sat Aug 26 19:04:17 1989 X*************** X*** 46,54 **** X--- 46,57 ---- X register int i,j; X char **fought; /* TRUE if already fought in sctr */ X int temp,ctry; X+ int initialized=FALSE; /* TRUE if arrays initialized */ X short armynum,nvynum; X int valid; X int count=0; X+ struct s_nation *nptr; X+ struct army *aptr; X X fought = (char **) m2alloc(MAPX,MAPY,sizeof(char)); X X*************** X*** 61,85 **** X X for(ctry=NTOTAL-1;ctry>0;ctry--) if(isactive(ntn[ctry].active)) { X X /*army combat*/ X! for(j=0;j0) X! &&(ntn[ctry].arm[j].stat>=ATTACK) X! &&(ntn[ctry].arm[j].stat<=SORTIE X! ||ntn[ctry].arm[j].stat>=NUMSTATUS) X! &&(fought[ntn[ctry].arm[j].xloc][ntn[ctry].arm[j].yloc]==0)){ X X /* someone can initiate combat in xspot,yspot */ X! xspot=ntn[ctry].arm[j].xloc; X! yspot=ntn[ctry].arm[j].yloc; X fought[xspot][yspot]=TRUE; X X /*initialize matrix*/ X! for(temp=0;temp0;ctry--) if(isactive(ntn[ctry].active)) { X X+ nptr = &ntn[ctry]; X+ X /*army combat*/ X! for(j=0;jarm[j]; X! if((aptr->sold>0) X! &&(aptr->stat>=ATTACK) X! &&(aptr->stat<=SORTIE||aptr->stat>=NUMSTATUS) X! &&(!fought[aptr->xloc][aptr->yloc])){ X X /* someone can initiate combat in xspot,yspot */ X! xspot=aptr->xloc; X! yspot=aptr->yloc; X fought[xspot][yspot]=TRUE; X X /*initialize matrix*/ X! if( !initialized ) { X! for(temp=0;tempHOSTILE)) { X valid=TRUE; X if( sct[xspot][yspot].owner==ctry ) { X dnation=ctry; X--- 102,108 ---- X &&(AYLOC==yspot) X &&(countdstatus[country]>HOSTILE)) { X valid=TRUE; X if( sct[xspot][yspot].owner==ctry ) { X dnation=ctry; X*************** X*** 114,138 **** X count++; X } X X! if(valid==TRUE) fight(); X } X X /*navy combat*/ X for(j=0;jnvy[j].warships!=0) X! &&(fought[nptr->nvy[j].xloc][nptr->nvy[j].yloc]==0) X! &&(sct[nptr->nvy[j].xloc][nptr->nvy[j].yloc].altitude==WATER)){ X X! xspot=nptr->nvy[j].xloc; X! yspot=nptr->nvy[j].yloc; X fought[xspot][yspot]=1; X X /*initialize matrix*/ X! if( !initialized ){ X! for(temp=0;tempHOSTILE)){ X valid=TRUE; X anation=ctry; X dnation=country; X--- 162,168 ---- X &&(countdstatus[country]>HOSTILE)){ X valid=TRUE; X anation=ctry; X dnation=country; X*************** X*** 158,164 **** X owner[count]=country; X count++; X } X! if(valid==TRUE) navalcbt(); X } X } X free(fought); X--- 171,180 ---- X owner[count]=country; X count++; X } X! if(valid==TRUE) { X! navalcbt(); X! initialized=FALSE; X! } X } X } X free(fought); X*** omove.c Sat Aug 26 19:04:07 1989 X--- move.c Sat Aug 26 19:04:17 1989 X*************** X*** 55,61 **** X clrtoeol(); X if((P_NMOVE==0)) { X errormsg("That Fleet is Not Able Move Any Farther"); X! redraw=FALSE; X armornvy=AORN; X return; X } X--- 55,61 ---- X clrtoeol(); X if((P_NMOVE==0)) { X errormsg("That Fleet is Not Able Move Any Farther"); X! redraw=DONE; X armornvy=AORN; X return; X } X*************** X*** 65,71 **** X clrtoeol(); X if(P_AMOVE==0){ X errormsg("That Unit is Not Able to Move"); X! redraw=FALSE; X armornvy=AORN; X return; X } X--- 65,71 ---- X clrtoeol(); X if(P_AMOVE==0){ X errormsg("That Unit is Not Able to Move"); X! redraw=DONE; X armornvy=AORN; X return; X } X*************** X*** 76,82 **** X refresh(); X if( getch() == 'y' ) P_ASTAT=ATTACK; X else { X! redraw=FALSE; X armornvy=AORN; X return; X } X--- 76,82 ---- X refresh(); X if( getch() == 'y' ) P_ASTAT=ATTACK; X else { X! redraw=DONE; X armornvy=AORN; X return; X } X*************** X*** 153,159 **** X break; X case ' ': /* redraw map */ X valid=FALSE; X! redraw=TRUE; X coffmap(); X /*see within one sector of unit*/ X if(hilmode==3) { X--- 153,161 ---- X break; X case ' ': /* redraw map */ X valid=FALSE; X! centermap(); X! clear(); X! redraw=PART; X coffmap(); X /*see within one sector of unit*/ X if(hilmode==3) { X*************** X*** 488,493 **** SHAR_EOF echo "End of part 1" echo "File patchV4.5 is continued in part 2" echo "2" > s2_seq_.tmp exit 0