diff -ur --exclude info.nr --new-file emp4.2.12/Make.sysdefs emp4.8th/Make.sysdefs --- emp4.2.12/Make.sysdefs Fri Aug 23 20:51:39 2002 +++ emp4.8th/Make.sysdefs Tue Dec 9 00:11:42 2003 @@ -40,6 +40,9 @@ FREEBSDLFLAGS = FREEBSDMASTER = GLOBALCFLAGS="$(FREEBSDCFLAGS)" GLOBALLFLAGS="$(FREEBSDLFLAGS)" RANLIB="$(FREEBSDRANLIB)" +FREEBSDCFLAGSINET6 = -DRel4 -DFBSD -DINET6 -ansi -pedantic -Wall -W -g +FREEBSDMASTERINET6 = GLOBALCFLAGS="$(FREEBSDCFLAGSINET6)" GLOBALLFLAGS="$(FREEBSDLFLAGS)" RANLIB="$(FREEBSDRANLIB)" + APOLLOCFLAGS = -g APOLLOLFLAGS = APOLLOMASTER = GLOBALCFLAGS="$(APOLLOCFLAGS)" GLOBALLFLAGS="$(APOLLOLFLAGS)" diff -ur --exclude info.nr --new-file emp4.2.12/Makefile emp4.8th/Makefile --- emp4.2.12/Makefile Fri Aug 23 20:55:15 2002 +++ emp4.8th/Makefile Wed Nov 26 18:31:10 2003 @@ -51,6 +51,7 @@ @echo ' alpha-pthreads' @echo ' apollo' @echo ' freebsd' + @echo ' freebsd-inet6' @echo ' hp' @echo ' hpux' @echo ' irix' @@ -105,6 +106,14 @@ ($(MAKE) genlibs $(FREEBSDMASTER)) (cd src/lib/lwp; $(MAKE) $(FREEBSDMASTER)) ($(MAKE) binaries $(FREEBSDMASTER)) + ($(MAKE) install) + +freebsd-inet6: + @echo 'building a $(WORLDX) by $(WORLDY) server...' + (cd src/doconfig; $(MAKE) $(FREEBSDMASTERINET6)) + ($(MAKE) genlibs $(FREEBSDMASTERINET6)) + (cd src/lib/lwp; $(MAKE) $(FREEBSDMASTERINET6)) + ($(MAKE) binaries $(FREEBSDMASTERINET6)) ($(MAKE) install) hp: diff -ur --exclude info.nr --new-file emp4.2.12/build.conf emp4.8th/build.conf --- emp4.2.12/build.conf Tue Aug 19 00:56:49 2003 +++ emp4.8th/build.conf Tue Dec 9 19:44:38 2003 @@ -5,31 +5,32 @@ # # Please enter your name: -MYNAME = Wolfpack +MYNAME = marcolz # Please enter your user name: # (For NT and the basic emp_client build, use "USERNAME = win-empcl2.8") -USERNAME = wolfpack +USERNAME = marcolz # Please enter your e-mail address: -EMAIL = wolfpack@wolfpackempire.com +EMAIL = marcolz@stack.nl # Please enter the host name you will be running on: # (For NT you can use "HOSTNAME = localhost" as this seems to be what it # always resolves to if you use 127.0.0.1 below) -HOSTNAME = blitz.wolfpackempire.com +HOSTNAME = toad.stack.nl # Please enter the ip address of the host you will be running on: # (For NT you can use "IPADDR = 127.0.0.1") -IPADDR = 216.162.200.183 +IPADDR = 131.155.140.135 +IPV6ADDR = 2001:610:1108:5010::135 # Please enter the port you will be running on: -PORTNUM = 6665 +PORTNUM = 9899 # Please enter the directory where you want the files for the game: # (Note: Use a '/' to delimit directories. For NT, include a # drive letter.) -EMPDIR = /home/wolfpack/emp4 +EMPDIR = /home/marcolz/empire.8th # Ignore this next value for all builds except NT builds. # For NT builds, use the above path, but replace the '/' with a '\'. @@ -47,15 +48,15 @@ LD = ld # Please enter the maximum number of countries you want: -MAXNOC = 99 +MAXNOC = 32 # Please enter the world size you would like (WORLDX must be # divisible by 2): -WORLDX = 64 -WORLDY = 32 +WORLDX = 100 +WORLDY = 50 # Please enter if you are setting up a blitz (1 - yes, 0 - no) -BLITZ = 1 +BLITZ = 0 # Please enter the number of ETUs per update (must be divisible by 4): ETUS = 60 @@ -64,7 +65,7 @@ # Once per day - 1d # Once every 20 minutes - 20m # Once every 4 hours - 4h -ETUFREQ = 10m +ETUFREQ = 1d # That's it... Save this file, and type "make " to build the # server. If you are not sure of what architectures are supported, diff -ur --exclude info.nr --new-file emp4.2.12/include/land.h emp4.8th/include/land.h --- emp4.2.12/include/land.h Sat Mar 11 05:14:55 2000 +++ emp4.8th/include/land.h Mon Dec 8 23:15:00 2003 @@ -144,6 +144,7 @@ #define L_SPY bit(10) /* spy unit - way cool */ #define L_TRAIN bit(11) /* train unit - neato */ #define L_HEAVY bit(12) /* heavy unit - can't go on trains */ +#define L_SWAMP bit(13) /* swamp walk - extra speed in swamps */ #define LND_ATTDEF(b, t) (((b) * (1.0 + ((sqrt((double)(t)) / 100.0) * 4.0))) \ > 127 ? 127 : \ @@ -171,6 +172,9 @@ #define LND_XPL(b, t) (b) #define LND_MXL(b, t) (b) #define LND_COST(b, t) ((b) * (1.0 + (sqrt((double)(t)) / 100.0))) + +/* Chance to detect L_SPY unit (percent) */ +#define LND_SPY_DETECT_CHANCE(eff) ((110-(eff))/100.0) #define getland(n, p) \ ef_read(EF_LAND, n, (caddr_t)p) diff -ur --exclude info.nr --new-file emp4.2.12/include/map.h emp4.8th/include/map.h --- emp4.2.12/include/map.h Sat Mar 11 05:14:55 2000 +++ emp4.8th/include/map.h Wed Nov 26 19:21:28 2003 @@ -52,6 +52,7 @@ #define MAP_SHIP bit(0) #define MAP_LAND bit(1) #define MAP_PLANE bit(2) +#define MAP_HIGH bit(3) #define MAP_ALL MAP_SHIP | MAP_LAND | MAP_PLANE struct mapstr { diff -ur --exclude info.nr --new-file emp4.2.12/include/news.h emp4.8th/include/news.h --- emp4.2.12/include/news.h Sat Mar 11 05:14:55 2000 +++ emp4.8th/include/news.h Tue Dec 9 16:30:09 2003 @@ -142,7 +142,10 @@ #define N_WELCH_DEAL 80 #define N_LND_LOSE 81 #define N_BOARD_LAND 82 -#define N_MAX_VERB 82 +#define N_FLOOD_SECT 83 +#define N_FLOOD_UNIT 84 +#define N_FLOOD_PLANE 85 +#define N_MAX_VERB 85 #define N_FOR 1 #define N_FRONT 2 diff -ur --exclude info.nr --new-file emp4.2.12/include/player.h emp4.8th/include/player.h --- emp4.2.12/include/player.h Sat Mar 11 05:14:52 2000 +++ emp4.8th/include/player.h Wed Nov 26 19:23:10 2003 @@ -39,6 +39,9 @@ #if !defined(_WIN32) #include #endif +#ifdef INET6 +#include +#endif /* INET6 */ #include "prototype.h" #include "queue.h" #include "misc.h" @@ -48,7 +51,11 @@ struct player { struct emp_qelem queue; empth_t *proc; +#ifdef INET6 + s_char hostaddr[40]; +#else /* INET6 */ s_char hostaddr[32]; +#endif /* INET6 */ s_char hostname[512]; s_char client[128]; s_char userid[32]; @@ -98,9 +105,3 @@ #include "prototypes.h" /* must come at end, after defines and typedefs */ #endif /* _PLAYER_H_ */ - - - - - - diff -ur --exclude info.nr --new-file emp4.2.12/include/prototypes.h emp4.8th/include/prototypes.h --- emp4.2.12/include/prototypes.h Mon Aug 7 20:59:08 2000 +++ emp4.8th/include/prototypes.h Tue Dec 9 00:12:52 2003 @@ -170,7 +170,8 @@ extern int foll(void ); extern int force(void ); extern int fort(void ); -extern int is_engineer(int , int ); +extern int has_friendly_engineer(int , int , natid); +extern int land_harden(struct lndstr *, int ); extern int fuel(void ); extern int give(void ); extern int grin(void ); @@ -383,6 +384,7 @@ extern int bmaps_intersect(natid , natid ); extern int share_bmap(natid , natid , struct nstr_sect * , s_char , s_char * ); +extern int dump_map(int , s_char , int , struct nstr_sect * , int ); /* move.c */ extern double sector_mcost(struct sctstr * , int ); /* nstr_subs.c */ @@ -520,7 +522,11 @@ */ /* accept.c */ extern void player_init(void ); +#ifdef INET6 +extern struct player * player_new(int , struct sockaddr * ); +#else /* INET6 */ extern struct player * player_new(int , struct sockaddr_in * ); +#endif /* INET6 */ extern struct player * player_delete(struct player * ); extern struct player * player_next(struct player * ); extern struct player * player_prev(struct player * ); @@ -865,7 +871,7 @@ /* wu.c */ extern void clear_telegram_is_new(natid ); extern int typed_wu(natid , natid , s_char * , int ); -extern int wu(natid, natid, s_char *, ...); +extern int wu(natid, natid, s_char *, ...)__attribute__ ((format (printf, 3, 4))); /* * src/lib/update/ *.c @@ -986,6 +992,8 @@ extern int prod_ship(int , int , int * , int ); extern int shiprepair(register struct shpstr * , int * , struct natstr * , int * , int ); extern int feed_ship(struct shpstr * , register int * , int , int * , int ); +/* swamp.c */ +extern void do_swamp(struct sctstr *sp); /* * src/server diff -ur --exclude info.nr --new-file emp4.2.12/include/sect.h emp4.8th/include/sect.h --- emp4.2.12/include/sect.h Sat Jul 12 00:01:22 2003 +++ emp4.8th/include/sect.h Sun Dec 7 17:40:15 2003 @@ -150,7 +150,7 @@ #define SCT_BANK 29 /* financial */ #define SCT_REFINE 30 /* refinery */ #define SCT_ENLIST 31 /* enlistment center */ -#define SCT_PLAINS 32 /* plains sector */ +#define SCT_SWAMP 32 /* swamp sector */ #define SCT_BTOWER 33 /* Bridge tower */ #define SCT_EFFIC 34 /* used in update & budget */ diff -ur --exclude info.nr --new-file emp4.2.12/info/Commands/fortify.t emp4.8th/info/Commands/fortify.t --- emp4.2.12/info/Commands/fortify.t Mon Aug 11 20:05:10 2003 +++ emp4.8th/info/Commands/fortify.t Mon Dec 8 23:56:57 2003 @@ -17,8 +17,11 @@ A fully fortified unit is twice as hard to hurt as it normally would be, and is twice as strong on the defense. .s1 -Units fortifying in a sector containing an engineering unit -are better at it. Experiment and find out. +Supplying a negative amount as the number of mobility to use, fortifies +the units for all mobility available above the absolute amount given. +.s1 +Units fortifying in a sector containing a friendly engineering unit +are better at it. Mobility cost is only 2/3 of the normal cost. .s1 If a unit moves or retreats, it loses all fortification value. A unit that reacts to defend a sector, on the other hand, does NOT @@ -29,5 +32,9 @@ Note that fortification will not help a unit fight Guerrillas in an occupied sector (see info Guerrilla). Also note that fortifying a unit does not affect it's mission status. +.s1 +During the update units will use "spare" mobility to fortify themselves +automatically. It is as if "fortify * -67" were issued just before the +update. .s1 .SA "bomb, Unit-types, LandUnits" diff -ur --exclude info.nr --new-file emp4.2.12/info/Commands/map.t emp4.8th/info/Commands/map.t --- emp4.2.12/info/Commands/map.t Wed Nov 18 00:42:31 1998 +++ emp4.8th/info/Commands/map.t Tue Dec 9 00:18:07 2003 @@ -60,6 +60,8 @@ .s1 If you give an 's' flag, all your ships will be shown on the map. An 'l' flag does the same for land units, and a 'p' for planes. -'*' gives all of the above. +'*' shows all in this order: land units, ships, planes. + +To highlight sectors owned by yourself, use the 'h' flag. .s1 .SA "census, commodity, radar, realm, route, update, Maps" diff -ur emp4.2.12/info/Commands/newspaper.t emp4.8th/info/Commands/newspaper.t --- emp4.2.12/info/Commands/newspaper.t Mon Aug 11 20:05:10 2003 +++ emp4.8th/info/Commands/newspaper.t Wed Feb 25 19:48:54 2004 @@ -105,6 +105,11 @@ 79) Forced loan denied (by the market) 80) Failed boarding of a land unit 81) Successful boarding of a land unit + 82) Unit boarded + 83) Sector flooded + 84) Unit drowned in flooded sector + 85) Plane drowned in flooded sector + .fi .s1 .SA "headlines, Communication" diff -ur --exclude info.nr --new-file emp4.2.12/info/Concepts/Update-sequence.t emp4.8th/info/Concepts/Update-sequence.t --- emp4.2.12/info/Concepts/Update-sequence.t Thu Feb 4 03:43:08 1999 +++ emp4.8th/info/Concepts/Update-sequence.t Mon Dec 8 23:58:34 2003 @@ -45,11 +45,12 @@ c) If ship maintenance is not yet done, do it now d) If ship building is not yet done, do it now - e) If plane maintenance is not yet done, do it now - f) If plane building is not yet done, do it now - g) If unit maintenance is not yet done, do it now - h) If unit building is not yet done, do it now - i) produce for all sectors that have not yet produced + e) sail paths are sailed and orders are carried out + f) If plane maintenance is not yet done, do it now + g) If plane building is not yet done, do it now + h) If unit maintenance is not yet done, do it now + i) If unit building is not yet done, do it now + j) produce for all sectors that have not yet produced a) if the sector is a cap, it costs $$ equal to the # of etus: np->nat_money -= etus; b) people in non-sanctuary sectors eat @@ -93,6 +94,8 @@ d) Add mobility to land units 1) Units with negative mobility have their mob halved (-100 goes to -50) 2) Mobility is added + 3) If new mobility of a unit is greater than maximum, try using the + surplus for fortifying it. .fi .s1 .SA "Innards, Update" diff -ur --exclude info.nr --new-file emp4.2.12/info/Server/8th.t emp4.8th/info/Server/8th.t --- emp4.2.12/info/Server/8th.t Thu Jan 1 01:00:00 1970 +++ emp4.8th/info/Server/8th.t Wed Dec 17 18:47:54 2003 @@ -0,0 +1,44 @@ +.TH Server "8th Changes" +.NA 8th "Changes made for 8th" +.LV Expert +.NF +There are no plains in this game; There are swamps instead. +Mobility needed to move through swamps is 5 times higher than needed +in "normal" sectors. + +Units can have the "swampwalk" ability (normal sector movement cost +through swamps: 1/5th of the cost) + +Slower tech growth rates: +- log_base 3 instead of 2 +- edu lag 15 instead of 10 + +Fairland adapted to produce the swamp. +Three starting "continents" per player. +Distance between starting continents is at least 4. +All sectors surrounding a continent are 100% swamps and paths exist +between the continents consisting of 100% swamps. + +Swamps get a 80 - (4*eff/5) % chance of becoming flooded at the update. +Water gets a 80 + (eff/5) % chance of becoming a swamp at the update. +Swamps can be diked to prevent flooding, simulated by increasing +efficiency of the swamp. This efficiency is not lost when the sector is +flooded. +Swamps cannot be lmined and since there are no ships with "mine" +capability, no mines will be possible in swamp or water sectors. + +Ships can navigate through swamps. +Swamps are counted as water in respect to harbours, bridges, the "coast" +command, etc. They are much like bridges in that respect. + +All units/planes/ships can be built from tech 0. +Nukes are unchanged, at least tech 280 is needed for them. + +All 100% swamps and all "free" wildernesses are populated with 10 deity +mil. + +There are mountains. They contain 25 gold resources, just as any other +sector. Resources are the same for each sector of the same type. +GO_RENEW is _NOT_ enabled, so gold contents deplete... +.FI +.SA "Server" diff -ur --exclude info.nr --new-file emp4.2.12/info/Server/MakeSrcs emp4.8th/info/Server/MakeSrcs --- emp4.2.12/info/Server/MakeSrcs Tue Aug 19 00:57:25 2003 +++ emp4.8th/info/Server/MakeSrcs Wed Dec 17 18:49:03 2003 @@ -1 +1 @@ -INFOSRCS=Bugs.t CHANGES.CHAINSAW.t Empire2.t Empire3.t Empire4.t God.t Hidden.t History.t Merc.t Old-empire.t Options.t Wolfpack.t +INFOSRCS=8th.t Bugs.t CHANGES.CHAINSAW.t Empire2.t Empire3.t Empire4.t God.t Hidden.t History.t Merc.t Old-empire.t Options.t Wolfpack.t diff -ur --exclude info.nr --new-file emp4.2.12/info/Subjects/Server.t emp4.8th/info/Subjects/Server.t --- emp4.2.12/info/Subjects/Server.t Mon Jan 8 01:04:53 2001 +++ emp4.8th/info/Subjects/Server.t Wed Dec 10 19:18:00 2003 @@ -12,6 +12,8 @@ Changes from the Empire2 server to the Empire3 Server .L "Empire4 " Changes from the Empire3 server to the Empire4 Server +.L "8th " +Changes specific to 8th .L "Hidden " The HIDDEN option .L "History " diff -ur --exclude info.nr --new-file emp4.2.12/src/doconfig/Makefile emp4.8th/src/doconfig/Makefile --- emp4.2.12/src/doconfig/Makefile Sat Mar 11 05:41:24 2000 +++ emp4.8th/src/doconfig/Makefile Wed Nov 26 19:28:23 2003 @@ -43,9 +43,10 @@ DET = -DET=$(ETUS) DEF = -DEF="\"$(ETUFREQ)\"" DIP = -DIP="\"$(IPADDR)\"" +DIP6 = -DIP6="\"$(IPV6ADDR)\"" DUN = -DUN="\"$(USERNAME)\"" -DALL = $(DPV) $(DHN) $(DPN) $(DEM) $(DEP) $(DMC) $(DWX) $(DWY) $(DBL) $(DET) $(DEF) $(DIP) $(DUN) +DALL = $(DPV) $(DHN) $(DPN) $(DEM) $(DEP) $(DMC) $(DWX) $(DWY) $(DBL) $(DET) $(DEF) $(DIP) $(DUN) $(DIP6) all: doconfig diff -ur --exclude info.nr --new-file emp4.2.12/src/doconfig/doconfig.c emp4.8th/src/doconfig/doconfig.c --- emp4.2.12/src/doconfig/doconfig.c Wed Jun 18 19:54:48 2003 +++ emp4.8th/src/doconfig/doconfig.c Wed Nov 26 19:29:14 2003 @@ -198,6 +198,10 @@ fprintf(fp, "nowhere.land.edu\nnowhereman\n"); fprintf(fp, "%s\n%s\n", HN, UN); fprintf(fp, "%s\n%s\n", IP, UN); +#ifdef INET6 + fprintf(fp, "%s\n%s\n", IP6, UN); + fprintf(fp, "::1\n%s\n", UN); +#endif /* INET6 */ fprintf(fp, "127.0.0.1\n%s\n", UN); fclose(fp); } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/add.c emp4.8th/src/lib/commands/add.c --- emp4.2.12/src/lib/commands/add.c Fri Dec 22 00:17:57 2000 +++ emp4.8th/src/lib/commands/add.c Sun Dec 7 17:40:20 2003 @@ -173,7 +173,7 @@ sect.sct_own = 0; sect.sct_oldown = 0; if (sect.sct_type != SCT_MOUNT && - sect.sct_type != SCT_PLAINS) { + sect.sct_type != SCT_SWAMP) { sect.sct_type = SCT_RURAL; sect.sct_newtype = SCT_RURAL; } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/buil.c emp4.8th/src/lib/commands/buil.c --- emp4.2.12/src/lib/commands/buil.c Sat Mar 11 05:36:46 2000 +++ emp4.8th/src/lib/commands/buil.c Tue Apr 20 17:03:19 2004 @@ -737,8 +737,9 @@ } newx = sp->sct_x + diroff[val][0]; newy = sp->sct_y + diroff[val][1]; - if (getsect(newx, newy, §) == 0 || sect.sct_type != SCT_WATER) { - pr("%s is not a water sector\n", + if (getsect(newx, newy, §) == 0 || (sect.sct_type != SCT_WATER && + sect.sct_type != SCT_SWAMP)) { + pr("%s is not a water/swamp sector\n", xyas(newx, newy, player->cnum)); return 0; } @@ -751,6 +752,7 @@ ny = sect.sct_y + diroff[i][1]; getsect(nx, ny, &s2); if ((s2.sct_type != SCT_WATER) && + (s2.sct_type != SCT_SWAMP) && (s2.sct_type != SCT_BSPAN)) good=1; } @@ -1063,8 +1065,9 @@ } newx = sp->sct_x + diroff[val][0]; newy = sp->sct_y + diroff[val][1]; - if (getsect(newx, newy, §) == 0 || sect.sct_type != SCT_WATER) { - pr("%s is not a water sector\n", + if (getsect(newx, newy, §) == 0 || (sect.sct_type != SCT_WATER && + sect.sct_type != SCT_SWAMP)) { + pr("%s is not a water/swamp sector\n", xyas(newx, newy, player->cnum)); return 0; } @@ -1078,6 +1081,7 @@ ny = sect.sct_y + diroff[i][1]; getsect(nx, ny, &s2); if ((s2.sct_type != SCT_WATER) && + (s2.sct_type != SCT_SWAMP) && (s2.sct_type != SCT_BTOWER) && (s2.sct_type != SCT_BSPAN)) { good = 1; diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/cens.c emp4.8th/src/lib/commands/cens.c --- emp4.2.12/src/lib/commands/cens.c Sat Mar 11 05:36:46 2000 +++ emp4.8th/src/lib/commands/cens.c Tue Dec 9 18:42:50 2003 @@ -166,6 +166,7 @@ §); if (sect.sct_type == SCT_WATER || sect.sct_type == SCT_BTOWER || + sect.sct_type == SCT_SWAMP || sect.sct_type == SCT_BSPAN) { sp->sct_coastal = 1; if (start_flags != sp->sct_coastal) diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/chan.c emp4.8th/src/lib/commands/chan.c --- emp4.2.12/src/lib/commands/chan.c Sat Mar 11 05:36:46 2000 +++ emp4.8th/src/lib/commands/chan.c Mon Dec 8 23:16:40 2003 @@ -68,18 +68,15 @@ charge = 0; btucost = 0; if (!player->god && (us->nat_stat & STAT_NORM)) { - if (us->nat_btu < 254) { - pr("You need 254 btus to change your country name!\n"); - return RET_FAIL; - } if (opt_BLITZ == 0) { + if (us->nat_btu < 254) { + pr("You need 254 btus to change your country name!\n"); + return RET_FAIL; + } pr("This command costs 254 BTU's and 10%% of your money.\n"); if (!confirm("Are you sure you want to do this? ")) return RET_FAIL; btucost = 254; - /* charge = 2000; */ - /*if (us->nat_money < charge*10)*/ - /* charge = us->nat_money / 10;*/ if (us->nat_money <= 0) charge = 0; else @@ -108,10 +105,8 @@ pr("Must have a non-blank name!\n"); return RET_FAIL; } - if (opt_BLITZ == 0) { - player->dolcost += charge; - player->btused += btucost; - } + player->dolcost += charge; + player->btused += btucost; strcpy(us->nat_cnam, p); putnat(us); nreport(player->cnum, N_NAME_CHNG, 0, 1); diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/decl.c emp4.8th/src/lib/commands/decl.c --- emp4.2.12/src/lib/commands/decl.c Tue Aug 19 00:52:50 2003 +++ emp4.8th/src/lib/commands/decl.c Mon Dec 8 23:17:09 2003 @@ -92,7 +92,6 @@ who = natarg(player->argp[3], "for which country? "); if (who < 0) return RET_SYN; } - if (who == 255) return RET_SYN; natp = getnatp(who); while (nxtitem(&ni, (s_char *) &nat)) { diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/desi.c emp4.8th/src/lib/commands/desi.c --- emp4.2.12/src/lib/commands/desi.c Sat Mar 11 05:36:45 2000 +++ emp4.8th/src/lib/commands/desi.c Mon Feb 2 13:55:22 2004 @@ -103,7 +103,7 @@ sect.sct_type == SCT_BTOWER || sect.sct_type == SCT_BSPAN || sect.sct_type == SCT_WASTE || - sect.sct_type == SCT_PLAINS || + sect.sct_type == SCT_SWAMP || (opt_NO_LCMS && sect.sct_type == SCT_LIGHT) || (opt_NO_HCMS && sect.sct_type == SCT_HEAVY) || (opt_NO_OIL && sect.sct_type == SCT_OIL) || @@ -130,7 +130,7 @@ } if (!player->god) { if (des == SCT_WATER || des == SCT_MOUNT || - des == SCT_SANCT || des == SCT_PLAINS || + des == SCT_SANCT || des == SCT_SWAMP || (opt_NO_LCMS && des == SCT_LIGHT) || (opt_NO_HCMS && des == SCT_HEAVY) || (opt_NO_OIL && des == SCT_OIL) || @@ -163,10 +163,12 @@ break; if (check.sct_type == SCT_BTOWER) break; + if (check.sct_type == SCT_SWAMP) + break; } if (n > 6) { if (for_real) - pr("%s does not border on water.\n", + pr("%s does not border on water or swamp.\n", xyas(nstr.x, nstr.y, player->cnum)); if (player->god) { if (for_real) @@ -184,6 +186,8 @@ if (check.sct_type == SCT_BSPAN) break; if (check.sct_type == SCT_BTOWER) + break; + if (check.sct_type == SCT_SWAMP) break; } if (n > 6) { --- emp4.2.12/src/lib/commands/expl.c Sat Jul 12 00:01:59 2003 +++ emp4.8th/src/lib/commands/expl.c Wed Jan 21 15:19:08 2004 @@ -180,9 +180,12 @@ pr("No mobility used"); if (mcost < 0) { - pr("\nExplore aborted"); + pr("\nExplore aborted\n"); getsect(start.sct_x,start.sct_y,§); sect.sct_mobil = (u_char)mob; + sect.sct_flags &= ~MOVE_IN_PROGRESS; + putsect(§); + return RET_FAIL; }else{ /* Charge mobility */ getsect(sect.sct_x, sect.sct_y, §); @@ -319,7 +322,7 @@ case SCT_RURAL: case SCT_MOUNT: case SCT_WASTE: - case SCT_PLAINS: + case SCT_SWAMP: break; default: if (sect.sct_own != player->cnum && !player->god) diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/fort.c emp4.8th/src/lib/commands/fort.c --- emp4.2.12/src/lib/commands/fort.c Sat Mar 11 05:36:44 2000 +++ emp4.8th/src/lib/commands/fort.c Tue Dec 9 00:02:10 2003 @@ -50,8 +50,7 @@ int nunits; struct nstr_item ni; struct lndstr land; - int fort_amt, hard_amt, mob_used; - int eng; + int fort_amt, hard_amt; s_char *p; extern int land_mob_max; s_char buf[1024]; @@ -95,38 +94,7 @@ nunits++; - hard_amt = min(land.lnd_mobil, hard_amt); - - if ((land.lnd_harden + hard_amt) > land_mob_max) - hard_amt = land_mob_max - land.lnd_harden; - - eng = is_engineer(land.lnd_x, land.lnd_y); - - if (eng) - hard_amt = ((float)hard_amt * 1.5); - - if ((land.lnd_harden + hard_amt) > land_mob_max) - hard_amt = land_mob_max - land.lnd_harden; - - /* Ok, set the mobility used */ - mob_used = hard_amt; - - /* Now, if an engineer helped, it's really only 2/3rds of - that */ - if (eng) - mob_used = (int)((float)mob_used / 1.5); - - /* If we increased it, but not much, we gotta take at least 1 - mob point. */ - if (mob_used <= 0 && hard_amt > 0) - mob_used = 1; - - land.lnd_mobil -= mob_used; - if (land.lnd_mobil < 0) - land.lnd_mobil = 0; - - land.lnd_harden += hard_amt; - land.lnd_harden = min(land.lnd_harden, land_mob_max); + land_harden(&land, hard_amt); pr("%s hardened to %d\n", prland(&land), land.lnd_harden); @@ -142,19 +110,4 @@ }else pr("%d unit%s\n", nunits, splur(nunits)); return RET_OK; -} - -int -is_engineer(int x, int y) -{ - struct nstr_item ni; - struct lndstr land; - - snxtitem_xy(&ni, EF_LAND, x,y); - while(nxtitem(&ni, (s_char *)&land)){ - if (lchr[(int)land.lnd_type].l_flags & L_ENGINEER) - return 1; - } - - return 0; } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/look.c emp4.8th/src/lib/commands/look.c --- emp4.2.12/src/lib/commands/look.c Mon Aug 7 21:10:25 2000 +++ emp4.8th/src/lib/commands/look.c Mon Dec 8 23:18:17 2003 @@ -263,7 +263,6 @@ int i; int dist; double techfact(int, double); - double odds; drange = techfact(lookland->lnd_tech, (double) lookland->lnd_spy); @@ -284,8 +283,7 @@ enough not to be seen */ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0) continue; - odds = (double)(100 - lp->lnd_effic) + 0.10; - if (!(chance(odds))) + if (!(chance(LND_SPY_DETECT_CHANCE(lp->lnd_effic)))) continue; } vrange = ldround((double)((lp->lnd_vis diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/map.c emp4.8th/src/lib/commands/map.c --- emp4.2.12/src/lib/commands/map.c Sat Mar 11 05:36:42 2000 +++ emp4.8th/src/lib/commands/map.c Wed Nov 26 19:47:27 2003 @@ -112,6 +112,8 @@ case 'L': map_flags |= MAP_LAND; break; case 'p': case 'P': map_flags |= MAP_PLANE; break; + case 'H': + case 'h': map_flags |= MAP_HIGH; break; case '*': map_flags |= MAP_ALL; break; case '0': case '1': @@ -142,4 +144,85 @@ } return draw_map(bmap, origin, map_flags, &ns, as_country); +} + +int +mdump(void) +{ + register s_char *b; + int unit_type = 0; + int bmap = 0; + struct natstr *np; + s_char *str; + struct nstr_sect ns; + s_char origin = '\0'; + int as_country; + int map_flags = 0; + int i; + int where = 2; + s_char what[64]; + s_char buf[1024]; + + if (**player->argp != 'm') { + if (**player->argp == 'b') + bmap = EF_BMAP; + else if (**player->argp == 'n') + bmap = EF_NMAP; + else { + if (player->argp[0][1] == 'b') + bmap = EF_BMAP; + } + } + + if (player->argp[1] == (s_char *) 0) { + if ((str = getstring("(sects)? ", buf)) == 0) + return RET_SYN; + } else { + str = player->argp[1]; + } + + np = getnatp(player->cnum); + if (*str == '*') { + sprintf(what, "%d:%d,%d:%d", + -WORLD_X/2, WORLD_X/2-1, + -WORLD_Y/2, WORLD_Y/2-1); + if (!snxtsct(&ns, what)) + return RET_FAIL; + } else if (!snxtsct(&ns, str)) { + i=atoi(str); + if (unit_map(unit_type, i, &ns, &origin)) + return RET_FAIL; + } + b = player->argp[2]; + while (b != (s_char *)0 && (*b)){ + where = 3; + switch(*b){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': where = 2; break; + case 't': bmap = EF_MAP; *(b+1)=0;break; + default: pr("Bad flag %c!\n",*b); + break; + } + b++; + } + + as_country = player->cnum; + if (player->god){ + if (player->argp[where] != (s_char *) 0) { + as_country=atoi(player->argp[where]); + if ((as_country < 0) || (as_country > MAXNOC)){ + as_country = player->cnum; + } + } + } + + return dump_map(bmap, origin, map_flags, &ns, as_country); } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/mine.c emp4.8th/src/lib/commands/mine.c --- emp4.2.12/src/lib/commands/mine.c Sat Mar 11 05:36:42 2000 +++ emp4.8th/src/lib/commands/mine.c Sun Dec 7 23:50:19 2003 @@ -127,7 +127,9 @@ continue; shells = min(shells, land.lnd_mobil); if (!getsect(land.lnd_x, land.lnd_y, §) || + sect.sct_type == SCT_SWAMP || sect.sct_type == SCT_WATER || + sect.sct_type == SCT_BTOWER || sect.sct_type == SCT_BSPAN) { pr("You can't lay mines there!!\n"); continue; diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/new.c emp4.8th/src/lib/commands/new.c --- emp4.2.12/src/lib/commands/new.c Sat Mar 11 05:36:41 2000 +++ emp4.8th/src/lib/commands/new.c Sun Dec 7 17:40:35 2003 @@ -295,7 +295,7 @@ return; } if (sect.sct_type != SCT_MOUNT && - sect.sct_type != SCT_PLAINS) { + sect.sct_type != SCT_SWAMP) { if (sect.sct_own == 0) nfree++; else diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/orde.c emp4.8th/src/lib/commands/orde.c --- emp4.2.12/src/lib/commands/orde.c Sat Jul 12 01:11:19 2003 +++ emp4.8th/src/lib/commands/orde.c Mon Dec 8 23:20:45 2003 @@ -462,7 +462,7 @@ if (!nships) { /* 1st ship, print banner */ if (player->god) pr("own "); pr("shp# ship type x,y "); - pr("start end "); + pr("start end "); pr("len eta\n"); } nships++; @@ -479,14 +479,14 @@ /* Destination 2 */ if ( (ship.shp_destx[1]!=ship.shp_destx[0]) || (ship.shp_desty[1]!=ship.shp_desty[0]) ) { - prxy(" %2d,%-2d",ship.shp_destx[0], + prxy(" %3d,%-3d",ship.shp_destx[0], ship.shp_desty[0], player->cnum); - } else pr(" "); + } else pr(" "); if (ship.shp_autonav & AN_STANDBY) - pr(" suspended"); + pr(" suspended"); else if (ship.shp_autonav & AN_LOADING) - pr(" loading"); + pr(" loading"); else { /* ETA calculation */ @@ -494,11 +494,11 @@ ship.shp_y, ship.shp_destx[0], ship.shp_desty[0], ship.shp_own); if (!c || !*c) - pr("no route possible"); + pr(" no route possible"); else if (*c == 'h') - pr("has arrived"); + pr(" has arrived"); else if (*c == '?') - pr("route too long"); + pr(" route too long"); else { /* distance to destination */ eta_calc(&ship, c, &len, &updates); diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/sabo.c emp4.8th/src/lib/commands/sabo.c --- emp4.2.12/src/lib/commands/sabo.c Thu Aug 29 15:01:34 2002 +++ emp4.8th/src/lib/commands/sabo.c Wed Dec 10 14:19:24 2003 @@ -87,7 +87,7 @@ } putvar(V_SHELL, vec[I_SHELL] - 1, (s_char *)&land, EF_LAND); - odds = (100 - land.lnd_effic) / 100.0 + .10; + odds = LND_SPY_DETECT_CHANCE(land.lnd_effic); if (chance(odds)) { wu(0, sect.sct_own, "%s spy shot in %s during sabotage attempt.\n", @@ -99,9 +99,6 @@ continue; } - land.lnd_own = 0; - putland(land.lnd_uid, &land); - getvec(VT_ITEM, vec, (s_char *)§, EF_SECTOR); dam = landgun(3*land.lnd_effic, 7); if (vec[I_SHELL] > 20) @@ -116,6 +113,10 @@ "Sabotage in sector %s caused %d damage.\n", xyas(sect.sct_x, sect.sct_y, sect.sct_own), dam); } + + land.lnd_own = 0; + putland(land.lnd_uid, &land); + sectdamage(§, dam, 0); putsect(§); diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/commands/spy.c emp4.8th/src/lib/commands/spy.c --- emp4.2.12/src/lib/commands/spy.c Mon Aug 7 21:11:27 2000 +++ emp4.8th/src/lib/commands/spy.c Mon Dec 8 23:22:02 2003 @@ -293,7 +293,6 @@ struct lndstr land; struct nstr_item ni; s_char report[128]; - double odds; snxtitem_xy(&ni, EF_LAND, x, y); while (nxtitem(&ni, (s_char *)&land)) { @@ -303,8 +302,7 @@ continue; /* Don't always see spies */ if (lchr[(int)land.lnd_type].l_flags & L_SPY) { - odds = (double)(100 - land.lnd_effic) + 0.10; - if (!(chance(odds))) + if (!(chance(LND_SPY_DETECT_CHANCE(land.lnd_effic)))) continue; } if ((land.lnd_own != player->cnum) && land.lnd_own) { diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/common/land.c emp4.8th/src/lib/common/land.c --- emp4.2.12/src/lib/common/land.c Sat Mar 11 05:36:34 2000 +++ emp4.8th/src/lib/common/land.c Tue Dec 9 00:04:13 2003 @@ -96,3 +96,66 @@ return 0; } + +int +has_friendly_engineer(int x, int y, natid cn) +{ + struct nstr_item ni; + struct lndstr land; + + snxtitem_xy(&ni, EF_LAND, x,y); + while(nxtitem(&ni, (s_char *)&land)) { + if ((lchr[(int)land.lnd_type].l_flags & L_ENGINEER) + && (land.lnd_own == cn + || getrel(getnatp(land.lnd_own), cn) >= FRIENDLY)) + { + return 1; + } + } + + return 0; +} + +/* returns amount of mob actually used to harden. */ +int +land_harden(struct lndstr * lp, int mob_to_use) +{ + int amount, eng; + extern int land_mob_max; + + /* units on a ship can't be fortified. */ + if (lp->lnd_ship >= 0) + return 0; + + mob_to_use = min(mob_to_use, lp->lnd_mobil); + + amount = mob_to_use; + + eng = has_friendly_engineer(lp->lnd_x, lp->lnd_y, lp->lnd_own); + + if (eng) + amount = (int)((float)amount * 1.5); + + if (amount + lp->lnd_harden > land_mob_max) + amount = land_mob_max - lp->lnd_harden; + + lp->lnd_harden += amount; + + mob_to_use = amount; + + /* Now, if an engineer helped, it's really only 2/3rds of + that */ + if (eng) + mob_to_use = (int)((float)mob_to_use / 1.5); + + /* If we increased it, but not much, we gotta take at least 1 + mob point. */ + if (mob_to_use <= 0 && amount > 0) + mob_to_use = 1; + + lp->lnd_mobil -= mob_to_use; + if (lp->lnd_mobil < 0) + lp->lnd_mobil = 0; + + return amount; +} diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/common/maps.c emp4.8th/src/lib/common/maps.c --- emp4.2.12/src/lib/common/maps.c Fri Oct 6 20:19:51 2000 +++ emp4.8th/src/lib/common/maps.c Sun Dec 7 17:40:42 2003 @@ -150,7 +150,7 @@ case SCT_RURAL: case SCT_MOUNT: case SCT_WASTE: - case SCT_PLAINS: + case SCT_SWAMP: break; default: if (sect.sct_own != country && @@ -189,7 +189,7 @@ case SCT_RURAL: case SCT_MOUNT: case SCT_WASTE: - case SCT_PLAINS: + case SCT_SWAMP: break; default: if (sect.sct_own != country && @@ -252,6 +252,25 @@ wmap[y][x] = (*lchr[(int)land.lnd_type].l_name) & ~0x20; } } + if (map_flags & MAP_HIGH){ + register s_char *ptr; + struct sctstr sect; + + snxtsct_rewind(nsp); + if ((!player->god || country)) { + bzero((s_char *)bitmap, (WORLD_X * WORLD_Y) / 8); + bitinit2(nsp, bitmap, country); + } + while (nxtsct(nsp, §) && !player->aborted) { + if ((!player->god || country) && !emp_getbit(nsp->x, nsp->y, bitmap)) { + if (!player->god) + continue; + } + ptr = &wmap[nsp->dy][nsp->dx]; + if (sect.sct_own == player->cnum) + *ptr |= 0x80; + } + } if (origin) wmap[5][10] = origin & ~0x20; for (y=nsp->range.ly, i=0; i < nsp->range.height; y++, i++) { @@ -418,3 +437,183 @@ return n; } +int +dump_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp, int country) +{ + struct natstr *np; + struct range range; + struct nstr_item ni; + struct shpstr ship; + struct lndstr land; + struct plnstr plane; + coord x,y; + int i, count; + time_t now; + /* Note this is not re-entrant anyway, so we keep the buffers + around */ + static u_char *bitmap = (u_char *)0; + static s_char *wmapbuf = (s_char *)0; + static s_char **wmap = (s_char **)0; + + if (!wmapbuf) + wmapbuf = (s_char *)malloc((WORLD_Y * MAPWIDTH(1)) * sizeof(s_char)); + if (!wmap) { + wmap = (s_char **)malloc(WORLD_Y * sizeof(s_char *)); + if (wmap && wmapbuf) { + for (i = 0; i < WORLD_Y; i++) + wmap[i] = &wmapbuf[MAPWIDTH(1) * i]; + } else if (wmap) { + free((s_char *)wmap); + wmap = (s_char **)0; + } + } + if (!bitmap) + bitmap = (u_char *)malloc((WORLD_X * WORLD_Y) / 8); + if (!wmapbuf || !wmap || !bitmap) { + pr("Memory error, tell the deity.\n"); + logerror("malloc failed in draw_map\n"); + return RET_FAIL; + } + + if (bmap == EF_MAP + EF_BMAP) { + if (!confirm("Are you sure you want to revert your bmap? ")) + return RET_OK; + } + if (!player->command->c_flags & C_MOD) { + logerror("%s command needs C_MOD flag set",player->command->c_form); + player->command->c_flags |= C_MOD; + } + np = getnatp(country); + /* zap any conditionals */ + nsp->ncond = 0; + xyrelrange(np, &nsp->range, &range); + blankfill((s_char *)wmapbuf, &nsp->range, 1); + if (bmap) { + register int c; + switch (bmap) { + case EF_BMAP: + while (bmnxtsct(nsp) && !player->aborted) { + if (0 != (c = player->bmap[sctoff(nsp->x, nsp->y)])) + wmap[nsp->dy][nsp->dx] = c; + } + break; + case EF_MAP: + while (bmnxtsct(nsp) && !player->aborted) { + if (0 != (c = player->map[sctoff(nsp->x, nsp->y)])) + wmap[nsp->dy][nsp->dx] = c; + } + break; + case EF_NMAP: + do { + register s_char *ptr; + struct sctstr sect; + + if ((!player->god || country)) { + bzero((s_char *)bitmap, (WORLD_X * WORLD_Y) / 8); + bitinit2(nsp, bitmap, country); + } + while (nxtsct(nsp, §) && !player->aborted) { + if ((!player->god || country) && + !emp_getbit(nsp->x, nsp->y, bitmap)) { + if (!player->god) + continue; + } + ptr = &wmap[nsp->dy][nsp->dx]; + if (sect.sct_newtype > SCT_MAXDEF) { + *ptr = '?'; + } else { + *ptr = dchr[sect.sct_newtype].d_mnem; + switch (sect.sct_newtype) { + case SCT_WATER: + case SCT_RURAL: + case SCT_MOUNT: + case SCT_WASTE: + case SCT_SWAMP: + break; + default: + if (sect.sct_own != country && + (!player->god || country)) { + if (!player->god) + *ptr = '?'; + } + break; + } + } + } + } while (0); + break; + } + } else { + register s_char *ptr; + struct sctstr sect; + int changed = 0; + + if ((!player->god || country)) { + bzero((s_char *)bitmap, (WORLD_X * WORLD_Y) / 8); + bitinit2(nsp, bitmap, country); + } + while (nxtsct(nsp, §) && !player->aborted) { + if ((!player->god || country) && !emp_getbit(nsp->x, nsp->y, bitmap)) { + if (!player->god) + continue; + } + ptr = &wmap[nsp->dy][nsp->dx]; + if (sect.sct_type > SCT_MAXDEF) { + *ptr = '?'; + } else { + *ptr = dchr[sect.sct_type].d_mnem; + switch (sect.sct_type) { + case SCT_WATER: + case SCT_RURAL: + case SCT_MOUNT: + case SCT_WASTE: + case SCT_SWAMP: + break; + default: + if (sect.sct_own != country && + (!player->god || country)) { + if(!player->god) + *ptr = '?'; + } + break; + } + changed += map_set(player->cnum, nsp->x, nsp->y, *ptr, 0); + } + } + if (changed) + writemap(player->cnum); + } + if (player->aborted) + return RET_OK; + if (origin) + wmap[5][10] = origin & ~0x20; + + prdate(); + time(&now); + pr("DUMP MSECTOR %d\n", now); + pr("x y des\n"); + count = 0; + for (y=nsp->range.ly, i=0; i < nsp->range.height; y++, i++) { + int xval, yval, j; + + if (y >= WORLD_Y) + y -= WORLD_Y; + yval = yrel(np, y); + for (j=0; j < nsp->range.width; j++) + { + if (wmap[i][j] != ' ') + { + xval = xrel(np, nsp->range.lx + 2 * (j / 2)); + xval += ((xval + yval) & 0x1); + if (xval >= WORLD_X) + x -= WORLD_X; + + pr("%d %d %c\n", xval, yval, wmap[i][j]); + count++; + } + } + wmap[i][nsp->range.width] = '\0'; + } + pr("%d sector%s\n", count, ((1 == count) ? "" : "s")); + return RET_OK; +} diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/common/res_pop.c emp4.8th/src/lib/common/res_pop.c --- emp4.2.12/src/lib/common/res_pop.c Sat Mar 11 05:36:34 2000 +++ emp4.8th/src/lib/common/res_pop.c Sun Dec 7 17:40:46 2003 @@ -63,7 +63,7 @@ if (sp) { if (sp->sct_type == SCT_MOUNT) maxpop /= 10; - else if (sp->sct_type == SCT_PLAINS) + else if (sp->sct_type == SCT_SWAMP) maxpop /= 20; } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/global/land.c emp4.8th/src/lib/global/land.c --- emp4.2.12/src/lib/global/land.c Thu Aug 29 15:02:28 2002 +++ emp4.8th/src/lib/global/land.c Fri Jan 9 19:06:31 2004 @@ -50,199 +50,127 @@ { 2, { V_FOOD, V_MILIT }, { ((int)((ETUS*4)/20)), 20 }, -"cav cavalry", - 10, 5, 0, 0, 0, 30, 500, - 1.2, 0.5, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - L_RECON|L_LIGHT, +"swr swine riders", + 10, 5, 0, 0, 0, 0, 500, + 1.2, 0.5, 80, 32, 18, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + L_SWAMP|L_RECON|L_LIGHT, }, { 3, { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS)/4)), 1, 25 }, -"linf light infantry", - 8, 4, 0, 0, 0, 40, 300, - 1.0, 1.5, 60, 28, 15, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, - L_ASSAULT|L_LIGHT, + { ((int)((ETUS)/4)), 5, 25 }, +"lgb longbowmen", + 8, 4, 0, 0, 0, 0, 300, + 0.7, 1.5, 60, 28, 15, 2, 2, 0, 0, 0, 1, 4, 0, 0, 1, 0, + L_FLAK||L_LIGHT, }, { 2, { V_FOOD, V_MILIT }, { ((int)((ETUS*4)/10)), 100 }, "inf infantry", - 10, 5, 0, 0, 0, 50, 500, - 1.0, 1.5, 60, 25, 15, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 5, 0, 0, 0, 0, 500, + 1.0, 1.5, 60, 25, 15, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_ASSAULT|L_LIGHT, }, { 3, { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS*5)/5)), 8, 100 }, -"mtif motor inf", - 15, 10, 0, 0, 0, 190, 400, - 1.2, 2.2, 60, 33, 17, 1, 3, 0, 0, 0, 2, 3, 13, 1, 0, 0, - L_LIGHT, -}, - -{ 3, - { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS*5)/5)), 8, 100 }, -"mif mech inf", - 15, 10, 0, 0, 0, 190, 800, - 1.5, 2.5, 50, 33, 17, 1, 3, 0, 0, 0, 2, 3, 13, 1, 0, 0, - L_LIGHT, -}, - -{ 3, - { V_FOOD, V_SHELL, V_MILIT }, { ((int)((ETUS*5)/5)), 4, 100 }, "mar marines", - 10, 5, 0, 0, 0, 140,1000, - 1.4, 2.4, 60, 25, 14, 2, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, + 10, 5, 0, 0, 0, 0,1200, + 1.4, 2.4, 60, 25, 14, 2, 2, 0, 0, 0, 1, 2, 0, 0, 0, 0, L_MARINE|L_ASSAULT|L_LIGHT, }, { 10, - { V_SHELL,V_GUN,V_FOOD,V_LCM,V_HCM,V_DUST,V_BAR,V_IRON,V_PETROL,V_MILIT}, - { 200, 10, 300, 200, 100, 100, 10, 100, 300, 25}, -"sup supply", - 10, 5, 0, 0, 0, 50, 500, + { V_SHELL,V_GUN,V_FOOD,V_LCM,V_HCM,V_DUST,V_BAR,V_IRON,V_UW,V_MILIT}, + { 200, 10, 300, 200, 100, 100, 10, 100, 10, 25}, +"car cart", + 10, 5, 0, 0, 0, 0, 500, 0.1, 0.2, 80, 25, 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_LIGHT|L_SUPPLY, }, -{ 12, - { V_SHELL,V_GUN,V_FOOD,V_LCM,V_HCM,V_DUST,V_BAR,V_IRON,V_PETROL,V_MILIT,V_OIL,V_RAD}, - { 990, 200, 990, 990, 990, 500, 100, 500, 990, 990, 990, 150}, -"tra train", - 100, 50, 0, 0, 0, 40, 3500, - 0.0, 0.0, 120, 10, 25, 3, 0, 0, 0, 0, 0, 0, 0, 0, 5, 12, - L_XLIGHT|L_TRAIN|L_HEAVY|L_SUPPLY, -}, - { 0, { V_FOOD }, { 0, }, "spy infiltrator", - 10, 5, 0, 0, 0, 40, 750, - 0.0, 0.0, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 10, 5, 0, 0, 0, 0, 750, + 0.0, 0.0, 80, 32, 18, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_ASSAULT|L_RECON|L_LIGHT|L_SPY, }, { 1, { V_SHELL }, { 3, }, -"com commando", - 10, 5, 0, 0, 0, 55, 1500, - 0.0, 0.0, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, +"ter terrorist", + 10, 5, 0, 0, 0, 0, 1500, + 0.0, 0.0, 80, 32, 18, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_ASSAULT|L_RECON|L_LIGHT|L_SPY, }, -{ 3, - { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS)/5)), 5, 20 }, -"aau aa unit", - 20, 10, 0, 0, 0, 70, 500, - 0.5, 1.0, 60, 18, 20, 1, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, - L_FLAK|L_LIGHT, -}, - { 4, - { V_FOOD, V_SHELL, V_MILIT, V_GUN}, - { ((int)((ETUS*4)/10)), 40, 25, 10 }, -"art artillery", - 20, 10, 0, 0, 0, 35, 800, - 0.1, 0.4, 70, 18, 20, 1, 0, 8, 50, 5, 2, 1, 0, 0, 0, 0, - L_LIGHT, + { V_FOOD, V_SHELL, V_MILIT, V_GUN }, + { ((int)((ETUS*5)/10)), 20, 30, 6 }, +"msl mud slinger", + 20, 10, 0, 0, 0, 0, 800, + 0.2, 0.7, 60, 30, 18, 1, 1, 1, 5, 2, 1, 1, 0, 0, 0, 0, + L_SWAMP|L_LIGHT, }, { 4, { V_FOOD, V_SHELL, V_MILIT, V_GUN }, - { ((int)((ETUS*4)/20)), 20, 25, 6 }, -"lat lt artillery", - 20, 10, 0, 0, 0, 70, 500, - 0.2, 0.6, 60, 30, 18, 1, 1, 5, 10, 3, 1, 1, 0, 0, 0, 0, + { ((int)((ETUS*4)/10)), 20, 10, 10 }, +"bal ballista", + 20, 10, 0, 0, 0, 0, 2000, + 0.2, 0.6, 60, 30, 18, 1, 1, 6, 10, 7, 2, 1, 0, 0, 0, 0, L_LIGHT, }, { 4, { V_FOOD, V_SHELL, V_MILIT, V_GUN }, - { ((int)((ETUS*4)/10)), 80, 25, 12 }, -"hat hvy artillery", - 40, 20, 0, 0, 0, 100, 800, - 0.0, 0.2, 60, 12, 20, 1, 0, 11, 99, 8, 4, 1, 0, 0, 0, 0, + { ((int)(ETUS)), 80, 25, 20 }, +"hbl hvy ballista", + 40, 20, 0, 0, 0, 0, 4000, + 0.0, 0.2, 60, 12, 20, 1, 0, 5, 99, 10, 4, 1, 0, 0, 0, 0, 0, }, -{ 4, - { V_FOOD, V_SHELL, V_MILIT, V_GUN }, - { ((int)((ETUS*5)/20)), 40, 25, 10 }, -"mat mech artillery", - 20, 10, 0, 0, 0, 200, 1000, - 0.2, 0.6, 50, 35, 17, 1, 1, 8, 35, 6, 3, 3, 13, 1, 0, 0, - L_LIGHT, -}, - { 3, { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS*4)/20)), 3, 20}, + { ((int)((ETUS*4)/20)), 3, 20}, "eng engineer", - 10, 5, 0, 0, 0, 130,3000, + 10, 5, 0, 0, 0, 0,3000, 1.2, 2.4, 50, 25, 14, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, L_ENGINEER|L_ASSAULT|L_LIGHT, }, -{ 3, - { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS*5)/20)), 4, 20 }, -"meng mech engineer", - 10, 5, 0, 0, 0, 260,4500, - 1.8, 3.5, 45, 33, 15, 3, 3, 0, 0, 0, 1, 5, 25, 2, 0, 0, - L_ENGINEER|L_ASSAULT|L_LIGHT, -}, - -{ 3, - { V_FOOD, V_SHELL,V_MILIT }, - { ((int)((ETUS*5)/10)), 4, 50}, -"lar lt armor", - 10, 5, 0, 0, 0, 150, 600, - 2.0, 1.0, 50, 42, 15, 4, 4, 0, 0, 0, 1, 2, 25, 1, 0, 0, - L_RECON|L_LIGHT, -}, - -{ 3, - { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS*4)/5)), 3, 100 }, -"har hvy armor", - 20, 10, 0, 0, 0, 120, 500, - 2.0, 0.8, 50, 18, 17, 1, 1, 0, 0, 0, 2, 1, 10, 2, 0, 0, - 0, -}, - -{ 3, - { V_FOOD, V_SHELL, V_MILIT}, - { ((int)((ETUS*5)/10)), 4, 50 }, -"arm armor", - 20, 10, 0, 0, 0, 170,1000, - 3.0, 1.5, 40, 33, 16, 2, 2, 0, 0, 0, 1, 2, 13, 1, 0, 0, - L_LIGHT, +{ 2, + { V_FOOD, V_MILIT }, + { ((int)((ETUS*5)/40)), 10 }, +"rad radar unit", + 10, 5, 0, 0, 0, 0,2500, + 0.0, 0.0, 50, 33, 15, 6, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, + L_XLIGHT|L_RADAR|L_LIGHT, }, -{ 3, - { V_FOOD, V_SHELL, V_MILIT }, - { ((int)((ETUS*5)/10)), 4, 50 }, -"sec security", - 10, 5, 0, 0, 0, 170, 600, - 1.0, 2.0, 60, 25, 15, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, - L_SECURITY|L_LIGHT, +{ 2, + { V_FOOD, V_MILIT }, + { ((int)((ETUS*8)/15)), 15 }, +"vet veterans", + 75, 45, 0, 0, 0, 0, 5000, + 20.0,20.0, 60, 35, 15, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + L_SECURITY|L_RECON|L_LIGHT, }, { 2, { V_FOOD, V_MILIT }, - { ((int)((ETUS*5)/40)), 10 }, -"rad radar unit", - 10, 5, 0, 0, 0, 270,1000, - 0.0, 0.0, 50, 33, 15, 3, 0, 0, 0, 0, 0, 2, 25, 2, 1, 0, - L_XLIGHT|L_RADAR|L_LIGHT, + { ((int)((ETUS*8)/40)), 9 }, +"gen general", + 100, 50, 0, 0, 0, 0,9000, + 50.0,40.0, 50, 40, 15, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + L_SWAMP|L_RECON|L_LIGHT, }, /* name diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/global/news.c emp4.8th/src/lib/global/news.c --- emp4.2.12/src/lib/global/news.c Sat Mar 11 05:36:30 2000 +++ emp4.8th/src/lib/global/news.c Tue Dec 9 16:29:27 2003 @@ -223,7 +223,13 @@ { -3, N_FRONT, { "is repelled by %s while attempting to board a land unit", /* 81*/ "forces prove inept at boarding %s's land unit" } }, { -2, N_FRONT, { "mercenaries board one of %s's land units", -/* 82*/ "elite forces board %s land unit" } } +/* 82*/ "elite forces board %s land unit" } }, + { 0, N_HOME, { "dikes break through", +/* 83*/ "sector sinks back into the swamp" } }, + { 0, N_HOME, { "units drown in a flood", +/* 84*/ "units washed away after dike breakthrough" } }, + { 0, N_HOME, { "planes sink into the swamp", +/* 85*/ "planes washed away after dike breakthrough" } } }; int nws_maxno = (sizeof(rpt) / sizeof(struct rptstr)) - 1; diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/global/plane.c emp4.8th/src/lib/global/plane.c --- emp4.2.12/src/lib/global/plane.c Thu Aug 29 20:22:17 2002 +++ emp4.8th/src/lib/global/plane.c Wed Dec 10 00:22:27 2003 @@ -61,280 +61,53 @@ /* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ { -"f1 fighter 1", -"f1 Sopwith Camel", - 8, 2, 400, 50, 90, 1, 1,1, 4, 1, 1, - 0, - P_V|P_T|P_F }, +"ms mosquito swarm", +"ms Mosquito Swarm", + 8, 2, 400, 0, 90, 1, 3,3, 4, 1, 0, + 80, + P_X|P_L|P_V|P_T|P_F }, /* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ { -"f2 fighter 2", -"f2 P-51 Mustang", - 8, 2, 400, 80, 80, 1, 4,4, 8, 1, 1, - 0, - P_L|P_T|P_F }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jf1 jet fighter 1", -"jf1 F-4 Phantom", - 12, 4, 1000, 125, 45, 1, 14,14, 11, 2, 3, - 0, - P_T|P_F|P_L }, - - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jf2 jet fighter 2", -"jf2 AV-8B Harrier", - 12, 4, 1400, 195, 30, 1, 17,17, 14, 2, 3, - 0, - P_T|P_F|P_L|P_V }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"sf stealth fighter", -"sf F-117A Nighthawk", - 15, 5, 3000, 325, 45, 3, 19,19, 20, 2, 4, - 80, - P_T|P_F|P_L }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"es escort", -"es P-38 Lightning", - 9, 3, 700, 90, 60, 1, 5,5, 15, 1, 2, - 0, - P_ESC|P_T }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jes jet escort", -"jes F-14E jet escort", - 14, 8,1400,160, 60, 1, 10,10, 25, 2, 3, - 0, - P_ESC|P_T }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"lb lt bomber", -"lb TBD-1 Devastator", - 10, 3, 550, 60, 50, 2, 0,3, 7, 1, 1, - 0, - P_L|P_V|P_T|P_B }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jl jet lt bomber", -"jl A-6 Intruder", - 14, 4, 1000, 130, 25, 3, 0,9, 11, 2, 3, - 0, - P_T|P_B|P_L }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"mb medium bomber", -"mb medium bomber", - 14, 5, 1000, 80, 45, 4, 0,5, 14, 3, 3, - 0, - P_T|P_B }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jmb jet med bomber", -"jfb FB-111 Aardvark f/b", - 20, 10, 1800, 140, 30, 7, 8, 8, 20, 5, 5, - 0, - P_T|P_B }, -{ -"hb hvy bomber", -"hb B-26B Marauder", - 20, 6, 1100, 90, 90, 5, 0,4, 15, 2, 2, - 0, - P_B }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jhb jet hvy bomber", -"jhb B-52 Strato-Fortress", - 26, 13, 3200, 150, 80,12, 0,11, 35, 5, 6, - 0, - P_B }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"sb stealth bomber", -"sb B-2 stealth bomber", - 15, 5, 4000, 325, 25, 8, 0,15, 28, 2, 5, - 80, - P_T|P_B }, - - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"as anti-sub plane", -"as anti-sub plane", - 10, 3, 550, 100, 85, 2, 0,3, 15, 2, 2, - 0, - P_SWEEP|P_MINE|P_T|P_A }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"np naval plane", -"np naval plane", - 20, 10, 1800, 135, 70, 3, 0,4, 28, 4, 2, - 0, - P_SWEEP|P_MINE|P_C|P_T|P_A|P_L }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"nc naval chopper", -"nc AH-1 Cobra", - 8, 2, 800, 160, 55, 2, 0,3, 11, 2, 2, - 0, - P_V|P_SWEEP|P_T|P_A|P_K }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"ac attack chopper", -"ac AH-64 Apache", - 8, 2, 800, 200, 15, 1, 0,9, 11, 2, 2, - 40, - P_V|P_T|P_K }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"tc transport chopper", -"tc transport chopper", - 8, 2, 800, 135, 0, 5, 0,3, 7, 2, 2, - 40, - P_V|P_C|P_P|P_L|P_K }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"tr transport", -"tr C-56 Lodestar", - 14, 5, 1000, 85, 0, 7, 0,2, 15, 3, 3, - 0, - P_C|P_P }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"jt jet transport", -"jt C-141 Starlifter", - 18, 5, 1500, 160, 0,16, 0,9, 35, 3, 4, - 0, - P_C|P_P }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"zep Zeppelin", -"zep Zeppelin", - 6, 2, 1000, 70, 60, 2, 0,-3, 15, 3, 2, - 0, - P_S|P_V|P_T|P_C }, -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"re recon", -"re recon", - 12, 4, 800, 130, 0, 0, 0,4, 15, 2, 2, - 20, - P_S }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"sp spyplane", -"sp E2-C Hawkeye", - 15, 5, 2000, 190, 0, 0, 0,11, 32, 2, 5, - 50, - P_S }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"lst landsat", -"lst landsat", - 20, 20, 2000, 245, 0, 0, 0,3, 41, 0, 9, - 0, - P_O }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"ss spysat", -"ss KH-7 spysat", - 20, 20, 4000, 305, 0, 0, 0,3, 61, 0, 9, - 0, - P_I|P_O|P_S }, - -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"mi naval missile", -"mi Harpoon", - 8, 2, 300, 160, 50, 6, 0,5, 6, 0, 0, - 0, - P_L|P_T|P_M|P_MAR }, -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"sam sam", -"sam Sea Sparrow", - 3, 1, 200, 180, 0, 0, 0,18, 2, 0, 0, - 0, - P_L|P_F|P_E|P_M }, +"kb killer bees", +"kb Killer Bees", + 8, 2, 800, 0, 80, 1, 7,7, 8, 1, 0, + 75, + P_X|P_L|P_V|P_T|P_F }, -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"ssm", -"ssm V2", - 15, 15, 800, 145, 60, 3, 0,3, 4, 0, 0, - 0, - P_T|P_M }, /* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ { -"srbm", -"srbm Atlas", - 20, 20, 1000, 200, 60, 6, 0,5, 9, 0, 0, +"pf peregrine falcon", +"pf Peregrine Falcon", + 10, 3, 900, 0, 50, 1, 6,6, 7, 1, 0, 0, - P_T|P_M }, + P_S|P_L|P_V|P_T|P_F }, /* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ { -"irbm", -"irbm Titan", - 20, 20, 1500, 260, 60, 8, 0,10, 15, 0, 0, +"se swamp eagle", +"se Swamp Eagle", + 20, 6, 5000, 0, 40, 4, 9,9, 14, 3, 0, 0, - P_T| P_M }, + P_C|P_S|P_L|P_V|P_T|P_F|P_B }, /* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ { -"icbm", -"icbm Minuteman", - 20, 20, 3000, 310, 60,10, 0,15, 41, 0, 0, +"mg marsh gas", +"mg Marsh Gas", + 4, 2, 400, 0, 0, 0, 0,8, 2, 0, 0, 0, - P_T|P_M }, -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"slbm", -"slbm Trident", - 20, 20, 2000, 280, 60, 8, 0,6, 23, 0, 0, - 0, - P_T|P_L|P_M }, + P_V|P_L|P_F|P_E|P_M }, /* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ { -"asat anti-sat", -"asat anti-sat", - 20, 20, 2000, 305, 50, 6, 0,7, 13, 0, 4, +"mb methane bomb", +"mb Methane Bomb", + 15, 15, 2000, 0, 40, 3, 0,3, 4, 0, 0, 0, - P_O|P_M }, + P_V|P_T|P_M }, -/* name lcm hcm $$$ tch acc ld at/df ran mil gas stlth flags */ -{ -"abm anti-ballistic missile", -"abm Patriot", - 16, 8, 1500, 270, 50, 0, 0,31, 12, 0, 0, - 0, - P_N|P_M }, { "", "", 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/global/product.c emp4.8th/src/lib/global/product.c --- emp4.2.12/src/lib/global/product.c Sat Mar 11 05:36:29 2000 +++ emp4.8th/src/lib/global/product.c Mon Dec 8 22:53:03 2003 @@ -44,13 +44,13 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, "unused", "", }, { 2, { V_LCM, V_HCM}, { 2, 1 }, -V_SHELL, -1, 3, 0, 0, NAT_TLEV, 20, 10, 100, +V_SHELL, -1, 3, 0, 0, NAT_TLEV, -1, 10, 100, "shells", "shells", }, { 3, { V_OIL, V_LCM, V_HCM }, { 1, 5, 10 }, -V_GUN, -1, 30, 0, 0, NAT_TLEV, 20, 10, 100, +V_GUN, -1, 30, 0, 0, NAT_TLEV, -1, 10, 100, "guns", "guns",}, { 1, { V_OIL }, { 1 }, -V_PETROL,-1, 1, 0, 0, NAT_TLEV, 20, 10, 1000, +V_PETROL,-1, 1, 0, 0, NAT_TLEV, 0, 10, 1000, "petrol", "petrol",}, { 0, { 0 }, { 0 }, V_IRON, -1, 0,OFFSET(sctstr, sct_min),0, -1, 0, 0, 100, @@ -74,7 +74,7 @@ V_HCM, -1, 0, 0, 0, NAT_TLEV, -10, 10, 100, "heavy construction materials", "hcm", }, {3,{V_DUST,V_OIL,V_LCM}, {1,5,10}, -0, NAT_TLEV, 5*ETUS, 0, 0, NAT_ELEV, 5, 10, 100, +0, NAT_TLEV, 5*ETUS, 0, 0, NAT_ELEV, 5, 15, 100, "technological breakthroughs", "tech",}, {3,{V_DUST,V_OIL,V_LCM }, { 1, 5, 10 }, 0, NAT_RLEV, 90, 0, 0, NAT_ELEV, 5, 10, 100, diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/global/sect.c emp4.8th/src/lib/global/sect.c --- emp4.2.12/src/lib/global/sect.c Sat Mar 11 05:36:29 2000 +++ emp4.8th/src/lib/global/sect.c Mon Dec 8 16:19:33 2003 @@ -48,7 +48,7 @@ struct dchrstr dchr[SCT_MAXDEF+2] = { /* mnem prd mcst flg pkg ostr dstr value $ bld lcm hcm name */ -{ '.', 0, 0, NAVOK, NPKG,0.0, 0.0, 0, 0, 0, 0, 0, "sea" }, +{ '.', 0, 0, NAVOK, NPKG,0.0, 0.0, 0, 0, 0, 0, 0, "muddy pool" }, { '^', P_MDUST, 25, 0, NPKG,1.0, 4.0, 5, 0, 1, 0, 0, "mountain" }, { 's', 0, 0, 0, NPKG,0.0,99.0, 127, 0, 0, 0, 0, "sanctuary" }, { '\\',0, 0, 0, NPKG,0.0,99.0, 0, 0, 0, 0, 0, "wasteland" }, @@ -67,7 +67,7 @@ { 'o', P_OIL, 2, 0, NPKG,1.0, 1.5, 5, 0, 1, 0, 0, "oil field" }, { 'j', P_LCM, 2, 0, NPKG,1.0, 1.5, 3, 0, 1, 0, 0, "light manufacturing" }, { 'k', P_HCM, 2, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "heavy manufacturing" }, -{ 'f', 0, 2, 0, NPKG,2.0, 4.0, 10, 0, 5, 0, 1, "fortress" }, +{ 'f', 0, 2, 0, NPKG,3.0, 6.0, 10, 0, 5, 0, 1, "fortress" }, { 't', P_TLEV, 2, 0, NPKG,1.0, 1.5, 10, 0, 1, 0, 0, "technical center" }, { 'r', P_RLEV, 2, 0, NPKG,1.0, 1.5, 9, 0, 1, 0, 0, "research lab" }, { 'n', 0, 2, 0, NPKG,1.0, 2.0, 10, 0, 1, 0, 0, "nuclear plant" }, @@ -80,7 +80,7 @@ { 'b', P_BAR, 2, 0, BPKG,1.0,2.25, 10, 0, 1, 0, 0, "bank" }, { '%', P_PETROL, 2, 0, NPKG,1.0, 1.5, 2, 0, 1, 0, 0, "refinery" }, { 'e', 0, 2, 0, NPKG,1.0, 2.0, 7, 0, 1, 0, 0, "enlistment center" }, -{ '~', 0, 2, 0, NPKG,1.0, 1.5, 1, 0, 1, 0, 0, "plains" }, +{ '~', 0, 10, NAVOK, NPKG,0.5, 1.2, 1, 0, 1, 1, 1, "swamp" }, { '@', 0, 1, 0, NPKG,1.0, 1.5, 4, 0, 1, 0, 0, "bridge tower" }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/global/ship.c emp4.8th/src/lib/global/ship.c --- emp4.2.12/src/lib/global/ship.c Sat Mar 11 05:36:29 2000 +++ emp4.8th/src/lib/global/ship.c Sun Dec 7 19:40:51 2003 @@ -64,255 +64,24 @@ }, { 4, - { V_CIVIL, V_MILIT, V_FOOD, V_UW }, - { 300, 10, 900, 15 }, -25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ft fishing trawler", 35, 300, - M_FOOD, 0, 0, + { V_MILIT, V_FOOD , V_GUN , V_SHELL }, + { 400, 300 , 1 , 10 }, +60, 40, 40, 30, 30, 2, 0, 0, 2, 0, 30, 1, "sb swamp boat", 0, 800, + M_SEMILAND, 0, 2, }, { 8, { V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_FOOD, V_LCM, V_HCM, V_UW }, { 600, 50, 300, 50, 900, 1400, 900, 250 }, -60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 0, 0, "cs cargo ship", 20, 500, - M_SUPPLY, 0, 2, -}, - -{ 7, - { V_CIVIL, V_MILIT, V_IRON, V_DUST, V_FOOD, V_UW, V_RAD }, - { 30, 5, 990, 990, 200, 45, 990 }, -60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 30, 1, "os ore ship", 20, 500, - 0, 0, 0, -}, - -{ 4, - { V_CIVIL, V_MILIT, V_FOOD, V_UW }, - { 20, 80, 200, 1200 }, -60, 40, 20, 10, 35, 3, 0, 0, 1, 0, 0, 0, "ss slave ship", 0, 300, - 0, 0, 0, -}, - -{ 3, - { V_CIVIL, V_MILIT, V_FOOD }, - { 50, 50, 100 }, -200, 100, 20, 25, 35, 3, 0, 0, 1, 0, 30, 1, "ts trade ship", 30, 1750, - M_TRADE, 0, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 60, 10, 2, 60 }, -30, 30, 50, 25, 25, 3, 1, 1, 1, 0, 0, 0, "frg frigate", 0, 600, - M_SEMILAND, 0, 2, -}, - -{ 4, - { V_CIVIL, V_MILIT, V_FOOD, V_OIL }, - { 10, 5, 100, 1 }, -25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "oe oil exploration boat", 40, 800, - M_OIL, 0, 0, -}, - -{ 5, - { V_CIVIL, V_MILIT, V_FOOD, V_OIL, V_UW }, - { 990, 80, 990, 990, 990 }, -60, 60, 30, 15, 65, 3, 0, 0, 2, 0, 0, 0, "od oil derrick", 50, 1500, - M_OIL, 0, 0, +60, 60, 20, 10, 35, 3, 0, 0, 5, 5, 0, 0, "fl cargo flotilla", 0, 1000, + M_FLY | M_SUPPLY, 0, 4, }, { 4, { V_MILIT, V_GUN, V_SHELL, V_FOOD }, { 2, 2, 12, 5 }, -20, 10, 10, 38, 10, 2, 1, 1, 0, 0, 4, 1, "pt patrol boat", 40, 300, +20, 10, 10, 38, 10, 2, 1, 1, 0, 0, 4, 1, "pt patrol boat", 0, 500, M_TORP, 0, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 100, 40, 5, 100 }, -30, 40, 50, 30, 30, 5, 6, 3, 1, 0, 40, 1, "lc light cruiser", 45, 800, - M_MINE, 0, 2, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 120, 100, 8, 200 }, -40, 50, 70, 30, 30, 5, 8, 4, 1, 0, 30, 1, "hc heavy cruiser", 50, 1200, - 0, 0, 4, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 120, 20, 4, 120 }, -50, 50, 60, 20, 35, 3, 1, 2, 1, 0, 0, 0, "tt troop transport", 10, 800, - M_SEMILAND, 0, 2, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 200, 200, 10, 900 }, -50, 70, 95, 25, 35, 6, 10, 7, 1, 0, 50, 2, "bb battleship", 45, 1800, - 0, 0, 2, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 180, 100, 10, 400 }, -50, 60, 55, 30, 35, 6, 10, 6, 1, 0, 60, 2, "bbc battlecruiser", 75, 1500, - 0, 0, 2, -}, - -{ 6, - { V_CIVIL, V_MILIT, V_PETROL, V_FOOD, V_OIL, V_UW }, - { 30, 5, 990, 200, 990, 25 }, -60, 40, 75, 25, 45, 3, 0, 0, 1, 0, 30, 1, "tk tanker", 35, 600, - M_OILER|M_SUPPLY, 0, 0, -}, - -{ 4, - { V_MILIT, V_FOOD, V_SHELL, V_GUN }, - { 10, 90, 100, 1 }, -25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ms minesweeper", 40, 400, - M_MINE|M_SWEEP, 0, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 60, 40, 4, 80 }, -30, 30, 45, 35, 20, 4, 6, 3, 1, 0, 30, 1, "dd destroyer", 70, 600, - M_MINE|M_DCH|M_SONAR, 0, 1, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 25, 36, 5, 80 }, -30, 30, 25, 20, 5, 4, 3, 3, 0, 0, 30, 1, "sb submarine", 60, 650, - M_TORP|M_SUB|M_MINE|M_SONAR, 0, 0, -}, - -{ 8, - { V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_FOOD, V_LCM, V_HCM, V_PETROL }, - { 5, 10, 104, 20, 900, 500, 300, 100 }, -40, 40, 50, 30, 2, 3, 0, 0, 0, 0, 50, 2, "sbc cargo submarine", 150, 1200, - M_SUPPLY|M_OILER|M_SUB|M_SONAR, 0, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 175, 250, 4, 300, 180 }, -50, 60, 60, 30, 40, 5, 2, 2, 4, 20, 50, 2, "cal light carrier", 80, 2700, - M_FLY, 20, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 350, 500, 4, 500, 900 }, -60, 70, 80, 35, 40, 7, 2, 2, 10, 40, 120, 3, "car aircraft carrier", 160, 4500, - M_FLY, 40, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 350, 999, 4, 999, 900 }, -70, 80, 100, 45, 40, 9, 2, 2, 20, 4, 0, 0, "can nuc carrier", 305, 8000, - M_OILER|M_FLY|M_SUPPLY, 60, 0, -}, - -{ 4, - { V_MILIT, V_FOOD , V_GUN , V_SHELL }, - { 400, 300 , 1 , 10 }, -60, 40, 40, 30, 30, 2, 0, 0, 2, 0, 30, 1, "ls landing ship", 145, 1000, - M_LAND, 0, 6, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 60, 60, 4, 120 }, -40, 30, 50, 35, 30, 5, 2, 2, 4, 0, 40, 1, "af asw frigate", 220, 800, - M_TORP|M_SUBT|M_DCH|M_SONAR, 0, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 25, 60, 6, 500 }, -30, 40, 45, 40, 3, 6, 5, 3, 0, 0, 0, 0, "na nuc attack sub", 260, 1200, - M_TORP|M_SUB|M_MINE|M_SONAR|M_SUBT, 0, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 100, 80, 6, 40, 500 }, -40, 40, 60, 40, 35, 6, 8, 3, 10, 2, 80, 2, "ad asw destroyer", 240, 1500, - M_TORP|M_SUBT|M_DCH|M_SONAR, 0, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_FOOD, V_GUN }, - { 25, 200, 500, 1 }, -30, 40, 55, 35, 2, 6, 0, 0, 0, 0, 0, 0, "nm nuc miss sub", 270, 1500, - M_SUB|M_SONAR, 20, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_FOOD, V_GUN }, - { 25, 100, 500, 1 }, -30, 30, 35, 30, 3, 3, 0, 0, 0, 0, 30, 1, "msb missile sub", 230, 1200, - M_SUB|M_SONAR, 10, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 5, 100, 3, 500 }, -20, 20, 15, 40, 15, 3, 2, 2, 0, 0, 7, 1, "mb missile boat", 180, 500, - 0, 10, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 60, 220, 4, 120 }, -40, 30, 50, 35, 30, 5, 2, 2, 2, 0, 30, 1, "mf missile frigate", 280, 1000, - 0, 20, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 120, 500, 6, 160, 200 }, -50, 50, 70, 35, 35, 8, 8, 6, 8, 8, 35, 1, "mc missile cruiser", 290, 1500, - M_ANTIMISSILE, 40, 0, -}, - -{ 4, - { V_MILIT, V_SHELL, V_GUN, V_FOOD }, - { 100, 100, 15, 200 }, -50, 60, 80, 35, 30, 6, 1, 8, 1, 0, 60, 2, "aac aa cruiser", 130, 1500, - M_ANTIMISSILE, 0, 4, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 200, 400, 25, 40, 900 }, -50, 60, 80, 35, 30, 6, 1, 16, 30, 2, 0, 0, "agc aegis cruiser", 265, 4000, - M_ANTIMISSILE, 32, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 200, 400, 8, 40, 900 }, -50, 50, 100, 45, 35, 6, 14, 7, 10, 2, 0, 0, "ncr nuc cruiser", 325, 1800, - M_ANTIMISSILE, 20, 0, -}, - -{ 5, - { V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD }, - { 200, 120, 6, 160, 500 }, -50, 50, 80, 45, 35, 9, 10, 4, 25, 8, 0, 0, "nas nuc asw cruiser", 330, 1800, - M_TORP|M_SUBT|M_DCH|M_SONAR, 0, 0, -}, - -{ 8, - { V_CIVIL, V_MILIT, V_SHELL, V_GUN, V_PETROL, V_FOOD, V_LCM, V_HCM }, - { 50, 50, 600, 50, 999, 999, 1500, 900 }, -60, 40, 40, 45, 35, 6, 0, 0, 10, 2, 0, 0, "nsp nuc supply ship", 360, 1500, - M_SUPPLY,0,2, }, { 0, diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/player/accept.c emp4.8th/src/lib/player/accept.c --- emp4.2.12/src/lib/player/accept.c Mon Aug 11 19:58:25 2003 +++ emp4.8th/src/lib/player/accept.c Mon Dec 8 23:06:53 2003 @@ -72,13 +72,56 @@ } struct player * +#ifdef INET6 +player_new(int s, struct sockaddr *saddr) +#else /* INET6 */ player_new(int s, struct sockaddr_in *sin) +#endif /* INET6 */ { struct player *lp; struct hostent *hostp; +#ifdef INET6 + char *pname; + int plen; +#endif /* INET6 */ lp = (struct player *) calloc(1, sizeof(struct player)); bzero((s_char *)lp, sizeof(struct player)); +#ifdef INET6 + if (saddr) { + /* update uses dummy player */ + /* so does the market updater */ + emp_insque(&lp->queue, &Players); + getnameinfo(saddr, saddr->sa_len, lp->hostaddr, strlen(lp->hostaddr), NULL, 0, NI_NUMERICHOST); +#ifdef RESOLVE_IPADDRESS + switch(saddr->sa_family) + { + case AF_INET: + pname = (char *) &((struct sockaddr_in *)saddr)->sin_addr; + plen = sizeof(struct in_addr); + break; + case AF_INET6: + pname = (char *) &((struct sockaddr_in6 *)saddr)->sin6_addr; + plen = sizeof(struct in6_addr); + break; + default: + pname = NULL; + break; + } + if (pname) { + hostp = gethostbyaddr(pname, plen, saddr->sa_family); + } else hostp = NULL; + if (hostp) { + strcpy(lp->hostname, hostp->h_name); + } +#endif /* RESOLVE_IPADDRESS */ + lp->cnum = 255; + lp->curid = -1; + time(&lp->curup); + lp->iop = io_open(s, IO_READ|IO_WRITE|IO_NBLOCK, + IO_BUFSIZE, 0, 0); + } +#else /* INET6 */ if (sin) { /* update uses dummy player */ /* so does the market updater */ @@ -89,11 +132,12 @@ strcpy(lp->hostname, hostp->h_name); #endif /* RESOLVE_IPADDRESS */ lp->cnum = 255; - lp->curid = -1; + lp->curid = -1; time(&lp->curup); lp->iop = io_open(s, IO_READ|IO_WRITE|IO_NBLOCK, IO_BUFSIZE, 0, 0); } +#endif /* INET6 */ return lp; } @@ -188,6 +232,12 @@ { extern s_char *loginport; extern int errno; +#ifdef INET6 + struct addrinfo hints; + struct addrinfo *res; + int return_error; + char *service = "empire8"; +#endif /* INET6 */ struct sockaddr_in sin; struct servent *sp; int s; @@ -207,6 +257,21 @@ port = htons(atoi(loginport)); else port = sp->s_port; +#ifdef INET6 + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + return_error = getaddrinfo(NULL, loginport, &hints, &res); + if (return_error) { + logerror("inet6 getaddrinfo"); + exit(1); + } + if ((s = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) { + logerror("inet6 socket create"); + exit(1); + } +#else /* INET6 */ sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = port; sin.sin_family = AF_INET; @@ -214,6 +279,7 @@ logerror("inet socket create"); exit(1); } +#endif /* INET6 */ val = 1; #if !(defined(__linux__) && defined(__alpha__)) if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&val, sizeof(val)) < 0) { @@ -223,10 +289,17 @@ #else logerror("Alpha/Linux? You don't support SO_REUSEADDR yet, do you?\n"); #endif +#ifdef INET6 + if (bind(s, res->ai_addr, res->ai_addrlen) < 0) { + logerror("inet6 socket bind"); + exit(1); + } +#else /* INET6 */ if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) { logerror("inet socket bind"); exit(1); } +#endif /* INET6 */ #ifdef LISTENMAXCONN /* because someone in linux world didn't want to use * SOMAXCONN as defined in the header files... */ if (listen(s, LISTENMAXCONN) < 0) { @@ -242,8 +315,13 @@ maxfd = getfdtablesize() - 1; while (1) { empth_select(s, EMPTH_FD_READ); +#ifdef INET6 + len = res->ai_addrlen; + ns = accept(s, res->ai_addr, &len); +#else /* INET6 */ len = sizeof(sin); ns = accept(s, (struct sockaddr *) &sin, &len); +#endif /* INET6 */ if (ns < 0) { logerror("new socket accept"); continue; @@ -256,7 +334,11 @@ close(ns); continue; } +#ifdef INET6 + np = player_new(ns, res->ai_addr); +#else /* INET6 */ np = player_new(ns, &sin); +#endif /* INET6 */ /* XXX may not be big enough */ stacksize = 100000 /* budget */ + max(WORLD_X*WORLD_Y/2 * sizeof(int) * 7, diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/player/empmod.c emp4.8th/src/lib/player/empmod.c --- emp4.2.12/src/lib/player/empmod.c Thu Aug 29 15:00:01 2002 +++ emp4.8th/src/lib/player/empmod.c Wed Nov 26 19:56:48 2003 @@ -70,6 +70,7 @@ extern int load(); extern int look(); extern int map(); +extern int mdump(); extern int mine(); extern int move(); extern int nati(); @@ -245,6 +246,7 @@ { "bestpath ", 0, best, 0, NORM }, { "bestdistpath ", 0, best, 0, NORM }, { "bmap [s|l|p|r|t*]", 0, map, C_MOD, NORM }, +{ "bmdump [t]", 0, mdump, C_MOD, NORM }, { "board [|]", 3, boar, C_MOD, NORM+MONEY+CAP }, { "bomb ",2,bomb,C_MOD, NORM+MONEY+CAP }, { "break {sanctuary}", 1, brea, C_MOD, SANCT }, @@ -324,6 +326,7 @@ { "market [COMM]", 0, mark, 0, VIS }, { "map ", 0, map, C_MOD, VIS }, { "march ", 1, march, C_MOD, NORM+CAP }, +{ "mdump ", 0, mdump, C_MOD, VIS }, { "mine ", 2, mine, C_MOD, NORM+MONEY+CAP }, { "mission []", 2,mission,C_MOD, NORM+CAP }, { "mobupdate ", 0, mobupdate, C_MOD, GOD }, @@ -340,6 +343,7 @@ { "neweff ", 0, newe, C_MOD, NORM }, { "newspaper [days]", 0, news, 0, VIS }, { "nmap ", 0, map, C_MOD, VIS }, +{ "nmdump ", 0, mdump, C_MOD, VIS }, { "nuke ", 0, nuke, 0, NORM }, { "offer [ ]",1,offe,C_MOD, NORM+MONEY+CAP }, { "offset ", 0, offs, C_MOD, GOD }, diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/detonate.c emp4.8th/src/lib/subs/detonate.c --- emp4.2.12/src/lib/subs/detonate.c Sat Mar 11 05:36:26 2000 +++ emp4.8th/src/lib/subs/detonate.c Mon Dec 8 01:07:36 2003 @@ -118,8 +118,8 @@ makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x, sect.sct_y); sect.sct_oldown = 0; sect.sct_own = 0; - if (type == SCT_WATER || type == SCT_BSPAN || - type == SCT_BTOWER) { + if (type == SCT_WATER || type == SCT_SWAMP || + type == SCT_BSPAN || type == SCT_BTOWER) { bp = "left nothing but water in %s\n"; if (type != SCT_WATER) { sect.sct_newtype = SCT_WATER; diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/list.c emp4.8th/src/lib/subs/list.c --- emp4.2.12/src/lib/subs/list.c Sat Mar 11 05:36:26 2000 +++ emp4.8th/src/lib/subs/list.c Mon Dec 8 23:22:51 2003 @@ -138,7 +138,6 @@ struct nstr_item ni; struct lchrstr *lp; struct lndstr land; - double odds; first = 1; units = 0; @@ -161,8 +160,7 @@ } if (lp->l_flags & L_SPY) { - odds = (double)(100 - land.lnd_effic) + 0.10; - if (!(chance(odds))) + if (!(chance(LND_SPY_DETECT_CHANCE(land.lnd_effic)))) continue; } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/lndsub.c emp4.8th/src/lib/subs/lndsub.c --- emp4.2.12/src/lib/subs/lndsub.c Sun Sep 1 17:47:03 2002 +++ emp4.8th/src/lib/subs/lndsub.c Mon Dec 8 23:23:56 2003 @@ -434,7 +434,6 @@ count_sect_units(struct sctstr *sp) { int count = 0; - double odds; struct nstr_item ni; struct lndstr land; @@ -446,8 +445,7 @@ continue; /* Don't always see spies */ if (lchr[(int)land.lnd_type].l_flags & L_SPY) { - odds = (double)(100 - land.lnd_effic) + 0.10; - if (!(chance(odds))) + if (!(chance(LND_SPY_DETECT_CHANCE(land.lnd_effic)))) continue; } /* Got here, report it */ @@ -1068,6 +1066,11 @@ smobcost < LND_MINMOBCOST && mobtype != MOB_RAIL) smobcost = LND_MINMOBCOST; +/* units with swapwalk get a mobility bonus. */ + if (sp->sct_type == SCT_SWAMP && + (lchr[(int)lp->lnd_type].l_flags & L_SWAMP)) + smobcost /= 5.0; + mobcost = smobcost * 5.0 * 480.0 / (mobcost + techfact(lp->lnd_tech, mobcost)); @@ -1091,7 +1094,6 @@ int stop; s_char dp[80]; int rel; - double odds; int oldown; if (dir <= DIR_STOP || dir >= DIR_VIEW) { @@ -1181,8 +1183,7 @@ } if (rel != ALLIED && sect.sct_own != actor && sect.sct_own) { /* must be a spy */ /* Always a 10% chance of getting caught. */ - odds = (100 - llp->land.lnd_effic) + .10; - if (chance(odds)) { + if (chance(LND_SPY_DETECT_CHANCE(llp->land.lnd_effic))) { if (rel == NEUTRAL || rel == FRIENDLY) { wu(0, sect.sct_own, "%s unit spotted in %s\n", cname(player->cnum), diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/mission.c emp4.8th/src/lib/subs/mission.c --- emp4.2.12/src/lib/subs/mission.c Mon Jul 14 20:21:08 2003 +++ emp4.8th/src/lib/subs/mission.c Mon Dec 8 23:24:30 2003 @@ -681,8 +681,10 @@ dam += msl_launch_mindam(&missiles, x, y, hardtarget, EF_SECTOR, 100, "sector", victim, mission); qp=missiles.q_forw; while(qp != (&missiles)){ - qp=qp->q_forw; + newqp = qp->q_forw; + emp_remque(qp); free(qp); + qp = newqp; } } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/move.c emp4.8th/src/lib/subs/move.c --- emp4.2.12/src/lib/subs/move.c Sat Mar 11 05:36:26 2000 +++ emp4.8th/src/lib/subs/move.c Sun Dec 7 17:40:49 2003 @@ -288,7 +288,7 @@ case SCT_RURAL: case SCT_MOUNT: case SCT_WASTE: - case SCT_PLAINS: + case SCT_SWAMP: break; default: if (sect.sct_own != player->cnum && !player->god) diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/show.c emp4.8th/src/lib/subs/show.c --- emp4.2.12/src/lib/subs/show.c Fri Aug 10 00:09:22 2001 +++ emp4.8th/src/lib/subs/show.c Sun Dec 7 22:54:55 2003 @@ -100,10 +100,11 @@ { L_RECON, "recon" }, { L_RADAR, "radar" }, { L_ASSAULT, "assault" }, - { L_FLAK, "flak" }, - { L_SPY, "spy" }, - { L_TRAIN, "train" }, - { L_HEAVY, "heavy" }, + { L_FLAK, "flak" }, + { L_SPY, "spy" }, + { L_TRAIN, "train" }, + { L_HEAVY, "heavy" }, + { L_SWAMP, "swampwalk" }, { 0, 0 } }; diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/subs/takeover.c emp4.8th/src/lib/subs/takeover.c --- emp4.2.12/src/lib/subs/takeover.c Sat Aug 4 22:37:57 2001 +++ emp4.8th/src/lib/subs/takeover.c Mon Dec 8 23:24:55 2003 @@ -60,7 +60,6 @@ int che_count; int oldche; int n, vec[I_MAX+1]; - double odds; struct nstr_item ni; struct plnstr p; struct lndstr land; @@ -100,8 +99,7 @@ continue; /* Spies get a chance to hide */ if (lchr[(int)lp->lnd_type].l_flags & L_SPY) { - odds = (double)(100 - lp->lnd_effic) + 0.10; - if (!(chance(odds))) + if (!(chance(LND_SPY_DETECT_CHANCE(lp->lnd_effic)))) continue; } n = lp->lnd_effic - (30 + (random() % 100)); diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/update/Makefile emp4.8th/src/lib/update/Makefile --- emp4.2.12/src/lib/update/Makefile Sat Mar 11 05:41:00 2000 +++ emp4.8th/src/lib/update/Makefile Mon Dec 8 00:12:49 2003 @@ -38,13 +38,13 @@ OBJS = age.o anno.o bp.o deliver.o distribute.o finish.o human.o land.o \ main.o material.o mobility.o move_sat.o nat.o nav_ship.o nav_util.o \ nxtitemp.o nxtsctp.o plague.o plane.o populace.o prepare.o produce.o \ - removewants.o revolt.o sail.o sect.o ship.o + removewants.o revolt.o sail.o sect.o ship.o swamp.o NTOBJS = age.obj anno.obj bp.obj deliver.obj distribute.obj finish.obj \ human.obj land.obj main.obj material.obj mobility.obj move_sat.obj \ nat.obj nav_ship.obj nav_util.obj nxtitemp.obj nxtsctp.obj plague.obj \ plane.obj populace.obj prepare.obj produce.obj removewants.obj \ - revolt.obj sail.obj sect.obj ship.obj + revolt.obj sail.obj sect.obj ship.obj swamp.obj all: $(LIB) diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/update/mobility.c emp4.8th/src/lib/update/mobility.c --- emp4.2.12/src/lib/update/mobility.c Sat Mar 11 05:36:22 2000 +++ emp4.8th/src/lib/update/mobility.c Mon Dec 8 23:48:46 2003 @@ -398,17 +398,26 @@ extern int land_mob_max; extern float land_mob_scale; int newfuel=0; - register int value; - int can_add,have_fuel_for,total_add; double d; extern int fuel_mult; + /* + * We must use these variables because lnd_mobil and lnd_harden + * are of type s_char and might not be large enough to contain + * temporary results. + */ + register int value; + int can_add,have_fuel_for,total_add; if (lp->lnd_own == 0) return; if (lp->lnd_mobil >= land_mob_max) { lp->lnd_mobil = land_mob_max; - return; + if (lp->lnd_harden >= land_mob_max) + { + lp->lnd_harden = land_mob_max; + return; + } } /* @@ -435,8 +444,15 @@ } else { value = lp->lnd_mobil + ((float)etus * land_mob_scale); } + if (value > land_mob_max) + { + if (lp->lnd_harden < land_mob_max) + land_harden(lp, value - land_mob_max); + value = land_mob_max; + } + lp->lnd_mobil = value; return; /* Done! */ @@ -452,8 +468,15 @@ } else { value = lp->lnd_mobil + ((float)etus * land_mob_scale); } + if (value > land_mob_max) + { + if (lp->lnd_harden < land_mob_max) + land_harden(lp, value - land_mob_max); + value = land_mob_max; + } + lp->lnd_mobil = value; } else { @@ -513,7 +536,11 @@ lp->lnd_fuel -= (u_char)ldround(d,1); lp->lnd_fuel = (u_char)min(lp->lnd_fuel, lp->lnd_fuelc); - if(total_add + lp->lnd_mobil > land_mob_max) { + + if (total_add + lp->lnd_mobil > land_mob_max) { + if (lp->lnd_harden < land_mob_max) + land_harden(lp, total_add + lp->lnd_mobil - land_mob_max); + total_add = land_mob_max - lp->lnd_mobil; } diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/update/prepare.c emp4.8th/src/lib/update/prepare.c --- emp4.2.12/src/lib/update/prepare.c Sat Mar 11 05:36:21 2000 +++ emp4.8th/src/lib/update/prepare.c Mon Dec 8 00:49:47 2003 @@ -91,6 +91,8 @@ for (n=0; NULL != (sp = getsectid(n)); n++) { sp->sct_updated = 0; + do_swamp(sp); + if (sp->sct_type == SCT_WATER) continue; fill_update_array(bp, sp); diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/update/ship.c emp4.8th/src/lib/update/ship.c --- emp4.2.12/src/lib/update/ship.c Thu Dec 21 22:31:46 2000 +++ emp4.8th/src/lib/update/ship.c Tue Jan 27 20:37:41 2004 @@ -178,7 +178,10 @@ *resource -= roundavg(oil_gained * product->p_nrdep / 100.0); } - } else if (((mp->m_flags&M_FOOD)&&(sectp->sct_type==SCT_WATER)) && !player->simulation){ + } else if (((mp->m_flags&M_FOOD) && + ((SCT_SWAMP == sectp->sct_type) || + (sectp->sct_type==SCT_WATER))) && + !player->simulation) { sectp = getsectp(sp->shp_x, sp->shp_y); vec[I_FOOD] += ((vec[I_CIVIL] * etus) / 1000.0) * sectp->sct_fertil; diff -ur --exclude info.nr --new-file emp4.2.12/src/lib/update/swamp.c emp4.8th/src/lib/update/swamp.c --- emp4.2.12/src/lib/update/swamp.c Thu Jan 1 01:00:00 1970 +++ emp4.8th/src/lib/update/swamp.c Thu Jan 8 21:39:51 2004 @@ -0,0 +1,93 @@ +/* Update swamps. */ + +#include "misc.h" +#include "file.h" +#include "sect.h" +#include "gen.h" +#include "news.h" + +#define BECOME_LAND(eff) (chance(.8 + (eff / 20.0))) +#define BECOME_WATER(eff) (chance(.8 - (eff / 125.0))) + +/* Initial chances are 80% of change, deminished/enlarged by eff */ + +void +do_swamp(struct sctstr *sp) +{ + int become_lnd, i; + struct nstr_item ni; + struct lndstr land; + struct plnstr plane; + int drowned_planes[MAXNOC]; + int drowned_units[MAXNOC]; + + if ((SCT_WATER == sp->sct_type) && BECOME_LAND(sp->sct_effic)) + { + sp->sct_type = SCT_SWAMP; + sp->sct_newtype = SCT_SWAMP; + } + else if ((SCT_SWAMP == sp->sct_type) && BECOME_WATER(sp->sct_effic)) + { + if (sp->sct_own) + { + wu(0, sp->sct_own, "%s sank back into the water !\n", + ownxy(sp)); + nreport(sp->sct_own, N_FLOOD_SECT, 0, 1); + } + + sp->sct_type = SCT_WATER; + sp->sct_newtype = SCT_WATER; + sp->sct_own = 0; + sp->sct_oldown = 0; + /* Wash away... */ + /* commodities */ + for (i = 0; i < MAXSCTV; i++) + sp->sct_vamt[i] = 0; + + bzero(drowned_units, MAXNOC * sizeof(int)); + bzero(drowned_planes, MAXNOC * sizeof(int)); + /* units */ + snxtitem_xy(&ni,EF_LAND,sp->sct_x,sp->sct_y); + while(nxtitem(&ni,(s_char *)&land)){ + /* if loaded on ship, we're safe */ + if (land.lnd_ship > -1) + continue; + + mpr(land.lnd_own, "\t%s sank into the swamp.\n", + prland(&land)); + drowned_units[(int)land.lnd_own - 1]++; + land.lnd_own = 0; + land.lnd_effic = 0; + makelost(EF_LAND, land.lnd_own, land.lnd_uid, + land.lnd_x, land.lnd_y); + putland(land.lnd_uid, (s_char *)&land); + } + /* planes */ + snxtitem_xy(&ni, EF_PLANE, sp->sct_x, sp->sct_y); + while (nxtitem(&ni, (s_char *)&plane)) { + /* if loaded on ship, we're safe */ + if (plane.pln_ship > -1) + continue; + + mpr(plane.pln_own, "\t%s sank into the swamp.\n", + prplane(&plane)); + drowned_planes[(int)land.lnd_own - 1]++; + plane.pln_own = 0; + plane.pln_effic = 0; + makelost(EF_PLANE, plane.pln_own, plane.pln_uid, + plane.pln_x, plane.pln_y); + putplane(plane.pln_uid, (s_char *)&plane); + } + + for (i = 0; i < MAXNOC; i++) + { + if (drowned_units[i]) + nreport(i + 1, N_FLOOD_UNIT, + 0, drowned_units[i]); + + if (drowned_planes[i]) + nreport(i + 1, N_FLOOD_PLANE, + 0, drowned_planes[i]); + } + } +} diff -ur --exclude info.nr --new-file emp4.2.12/src/util/Makefile emp4.8th/src/util/Makefile --- emp4.2.12/src/util/Makefile Fri Aug 23 21:10:18 2002 +++ emp4.8th/src/util/Makefile Wed Nov 26 19:58:20 2003 @@ -32,6 +32,8 @@ include ../make.src include ../make.defs +CFLAGS += -Dlinux + LIBDIR = $(SRCDIR)/lib LIBS = $(LIBDIR)/libsubs.a \ diff -ur --exclude info.nr --new-file emp4.2.12/src/util/fairland.c emp4.8th/src/util/fairland.c --- emp4.2.12/src/util/fairland.c Sat Mar 11 05:36:48 2000 +++ emp4.8th/src/util/fairland.c Mon Dec 8 20:08:41 2003 @@ -800,12 +800,15 @@ void grow_islands() { - int c, x, y, isiz; + int c, i, x, y, isiz; for (c = nc; c < nc+ni; ++c) { secs = 0; - if (!place_island(c, &x, &y)) - return; + i = 0; + while (!place_island(c, &x, &y) && (i < 10)) + i++; + if (10 == i) + continue; isiz = 1 + rnd(2*is - 1); do { ++secs; @@ -1057,7 +1060,7 @@ write_sects(void) { register struct sctstr *sct; - int c, x, y, total; + int c, o, x, y, total; /* sct = §s[0][0];*/ sct = sectsbuf; @@ -1065,9 +1068,12 @@ for (x = 0; x < XSIZE; x++, sct++) { fl_sct_init(x*2 + (y & 01), y, (s_char *) sct); total = elev[sct->sct_x][y]; - if (total < LANDMIN) { + o = own[x * 2 + (y & 01)][y]; + + + if (total < LANDMIN) sct->sct_type = SCT_WATER; - } else if (total < HILLMIN) + else if ((o < nc) || (total < HILLMIN)) sct->sct_type = SCT_RURAL; else if (total < PLATMIN) sct->sct_type = SCT_MOUNT; @@ -1075,9 +1081,67 @@ sct->sct_type = SCT_RURAL; else sct->sct_type = SCT_MOUNT; + sct->sct_elev = total; sct->sct_newtype = sct->sct_type; - if (ORE) + + if ((o < nc) && (o >= 0)) + { + sct->sct_terr = o + 1; + sct->sct_own = o + 1; + } + + if (sct->sct_type == SCT_RURAL) + { + if ((o < nc) && (o >= 0)) + { + sct->sct_gmin = 25; + sct->sct_min = 50; + sct->sct_fertil = 25; + sct->sct_oil = 25; + sct->sct_uran = 2; + } + else if (rnd(100) < 70) + { + sct->sct_type = SCT_WATER; + sct->sct_newtype = SCT_WATER; + sct->sct_min = 0; + sct->sct_gmin = 0; + sct->sct_oil = 50; + sct->sct_uran = 0; + sct->sct_fertil = 25; + } + else /* 30% chance */ + { + sct->sct_type = SCT_HIWAY; + sct->sct_newtype = SCT_HIWAY; + sct->sct_gmin = 25; + sct->sct_min = 50; + sct->sct_fertil = 25; + sct->sct_oil = 25; + sct->sct_uran = 2; + } + } + else if (sct->sct_type == SCT_WATER) + { + sct->sct_type = SCT_SWAMP; + sct->sct_newtype = SCT_SWAMP; + sct->sct_effic = 100; + sct->sct_min = 0; + sct->sct_gmin = 0; + sct->sct_oil = 50; + sct->sct_uran = 0; + sct->sct_fertil = 25; + } + else if (sct->sct_type == SCT_MOUNT) + { + sct->sct_min = 0; + sct->sct_gmin = 25; + sct->sct_oil = 0; + sct->sct_uran = 0; + sct->sct_fertil = 25; + } + else add_resources(sct); } } @@ -1194,7 +1258,9 @@ if ((x == capx[c] && y == capy[c]) || (x == new_x(capx[c]+2) && y == capy[c])) iscap = 1; if ((elev[x][y] >= HILLMIN && elev[x][y] < PLATMIN) || elev[x][y] >= HIGHMIN) - return '^'; + if ((own[x][y] >= nc) || (own[x][y] < 0)) + return '^'; + return own[x][y]>=nc?'%':iscap?'#':numletter[own[x][y] % 62]; }