|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 50457 (0xc519) Types: TextFile Names: »patches01a«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Gb/patches01a«
*** ../../GB/races.h Wed Apr 26 11:22:21 1989 --- races.h Mon May 1 08:21:32 1989 *************** *** 17,22 **** --- 17,24 ---- char deflevel,defsystem,defplanetnum; /* current default */ int Playernum; char name[RNAMESIZE]; + float likes[DES_ICE]; /* what territories they like */ + char likesbest; percent translate[MAXPLAYERS]; /* translation mod for ea player */ char atwar[howmanybytes(MAXPLAYERS)]; /* war */ char allied[howmanybytes(MAXPLAYERS)]; /* allies */ *** ../../GB/tweakables.h Wed Apr 26 11:22:24 1989 --- tweakables.h Mon May 1 08:21:34 1989 *************** *** 5,22 **** * the functions using them are not recompiled so be careful. */ - /*#define UNIX_VERSION4.3 /* otherwise assumes 4.2 */ - #define VERS ".8" /* game version */ #define UPDATE_TIME 3 /* 3 hour update time */ - #define PAGER "/usr/ucb/zcat" - #include "files.h" - - - #define LOGIN_NAME_SIZE 13 #define NUM_TIMES_TO_WAIT_FOR_LOCK 20 --- 5,15 ---- *************** *** 42,60 **** #define OTHER 9 #define TOXIC 10 - #define CHAR_OWNED_LAND 'x' #define CHAR_OWNED_THING '@' ! #define CHAR_UNOWNED_LAND '-' #define CHAR_SEA '.' ! #define CHAR_OWNED_SEA ',' #define CHAR_MOUNT '^' - #define CHAR_OWNED_MOUNT 'X' #define CHAR_DIFFOWNED '?' #define CHAR_PLATED '|' #define CHAR_WASTELAND '%' ! #define CHAR_OWNED_WASTELAND '#' #define CHAR_GAS '~' #define CHAR_CLOAKED ' ' #define NAMESIZE 15 #define RNAMESIZE 25 --- 35,56 ---- #define OTHER 9 #define TOXIC 10 #define CHAR_OWNED_THING '@' ! #define CHAR_LAND '-' ! #define CHAR_OWNED_LAND 'x' #define CHAR_SEA '.' ! #define CHAR_OWNED_SEA 'x' #define CHAR_MOUNT '^' #define CHAR_DIFFOWNED '?' #define CHAR_PLATED '|' #define CHAR_WASTELAND '%' ! #define CHAR_OWNED_WASTELAND '!' #define CHAR_GAS '~' + #define CHAR_OWNED_GAS 'x' #define CHAR_CLOAKED ' ' + #define CHAR_ICE '#' + #define CHAR_OWNED_ICE 'x' + #define CHAR_OWNED_MOUNT 'X' #define NAMESIZE 15 #define RNAMESIZE 25 *************** *** 115,121 **** #define CREAT_UNIV_ITERAT 10 #define MAP_ISLANDS 10 /* # of beginning islands for makeuniv */ #define MAP_MOUNT_PERCENT 0.22 /* percentage of mountain areas */ ! #define MAP_GASGIANT_BANDMIN 30 /* min size gasgiants that have bands */ #define LANDPERCENTAGE 0.45 #define GRAV_FACTOR 0.0025 /* not sure as to what this should be*/ --- 111,117 ---- #define CREAT_UNIV_ITERAT 10 #define MAP_ISLANDS 10 /* # of beginning islands for makeuniv */ #define MAP_MOUNT_PERCENT 0.22 /* percentage of mountain areas */ ! #define MAP_GASGIANT_BANDMIN 20 /* min size gasgiants that have bands */ #define LANDPERCENTAGE 0.45 #define GRAV_FACTOR 0.0025 /* not sure as to what this should be*/ *************** *** 142,154 **** #define SYSTEMGRAVCONST 0.05 ! #define DIST_TO_LAND 5 /* moveship -- distance ship has to be to land */ ! #define DIST_TO_BURN 50 /* distance from sun needed to destroy ship */ ! #define FACTOR_DAMAGE 28.0 ! #define FACTOR_DESTPLANET 0.002 ! #define FACTOR_DAMAGE_DISTANCE 4.00 /* various compiler options that may save cpu time/disk space */ #define SHELL_DOTURN 1 /* put doturn() in shell */ --- 138,150 ---- #define SYSTEMGRAVCONST 0.05 ! #define DIST_TO_LAND 5.0 /* moveship -- distance ship has to be to land */ ! /*#define DIST_TO_BURN 50 /* distance from sun needed to destroy ship */ ! #define FACTOR_DAMAGE 388.0 ! #define FACTOR_DESTPLANET 1.004 ! #define FACTOR_DAMAGE_DISTANCE 1.00 /* various compiler options that may save cpu time/disk space */ #define SHELL_DOTURN 1 /* put doturn() in shell */ *************** *** 169,176 **** --- 165,176 ---- /* sign,abs val of number */ #define sgn(x) ( ((x)>=0) ? (1) : (-1)) #define abs(x) ( ( (x)<0) ? -(x) : (x) ) + #define MIN(x,y) ( ((x)>(y)) ? (y) : (x) ) + #define MAX(x,y) ( ((x)<(y)) ? (y) : (x) ) /* positive modulus */ #define mod(a,b,dum) ((dum)=(a)%(b),abs(dum)) + /* swap two variables */ + #define swap(a, b) ((a) ^= (b), (b) ^= (a), (a) ^= (b)) /* euclidean distance */ #define Distsq(x1,y1,x2,y2) ( ((x1)-(x2))*((x1)-(x2)) + \ ((y1)-(y2))*((y1)-(y2)) ) *************** *** 179,208 **** #define Sector(pl,x,y) (Smap[(x) + (y)*(pl).Maxx]) /* adjust temperature to displayed */ #define Temp(x) (((int)x)*25) - /* tty stuff */ - #ifdef UV_4.3 - # define tty_on() cbreak() - # define tty_off() nocbreak() - #else /* this is 4.2 */ - # define tty_on() crmode() - # define tty_off() nocrmode() - #endif /* number of AP's to add to each player in ea. system */ /* (look in doturn) */ #define LIMIT_APs 50 /* max # of APs you can have */ ! #define MIN(x,y) ( ((x)>(y)) ? (y) : (x) ) ! #define MAX(x,y) ( ((x)<(y)) ? (y) : (x) ) ! #define TYPE_EARTH 0 ! #define TYPE_ASTEROID 1 ! #define TYPE_AIRLESS 2 ! #define TYPE_GASGIANT 3 ! #define DES_SEA 0 ! #define DES_LAND 1 ! #define DES_MOUNT 2 ! #define DES_GAS 3 ! #define DES_PLATED 4 ! #define MAX_SECT_POPN 9999 --- 179,199 ---- #define Sector(pl,x,y) (Smap[(x) + (y)*(pl).Maxx]) /* adjust temperature to displayed */ #define Temp(x) (((int)x)*25) /* number of AP's to add to each player in ea. system */ /* (look in doturn) */ #define LIMIT_APs 50 /* max # of APs you can have */ ! #define TYPE_EARTH 0 ! #define TYPE_ASTEROID 1 ! #define TYPE_AIRLESS 2 ! #define TYPE_GASGIANT 3 ! #define DES_SEA 0 ! #define DES_LAND 1 ! #define DES_MOUNT 2 ! #define DES_GAS 3 ! #define DES_ICE 4 ! #define DES_PLATED 5 + #define MAX_SECT_POPN 9999 *** ../../GB/vars.h Wed Apr 26 11:22:25 1989 --- vars.h Mon May 1 08:21:35 1989 *************** *** 14,19 **** --- 14,20 ---- #define Bzero(x) bzero( (char *)&(x), sizeof(x) ) #define Malloc(x) (x *)malloc( sizeof(x) ) + #include "files.h" #include "tweakables.h" #include <sys/types.h> #include <sys/file.h> *** ../../GB/cs.c Wed Apr 26 11:22:30 1989 --- cs.c Mon May 1 08:21:39 1989 *************** *** 113,118 **** --- 113,119 ---- Dir.snum = where.snum; Dir.pnum = where.pnum; Dir.shipno = where.shipno; + printf(" csing to st %d, pl %d\n",where.snum,where.pnum); /* fix prompt */ switch (Dir.level) { *** ../../GB/daemon.c Wed Apr 26 11:22:31 1989 --- daemon.c Mon May 1 08:21:40 1989 *************** *** 4,9 **** --- 4,10 ---- */ #include "tweakables.h" + #include "files.h" #include <stdio.h> #include <signal.h> #include <time.h> *** ../../GB/doplanet.c Wed Apr 26 11:22:33 1989 --- doplanet.c Mon May 1 08:21:43 1989 *************** *** 269,275 **** /* start a meso colony */ x = int_rand(0,planet->Maxx-1); y = int_rand(0,planet->Maxy-1); ! Sector(*planet,x,y).des = DES_LAND; /* cheating. so what. */ Sector(*planet,x,y).popn = 1; Sector(*planet,x,y).owner = Stinfo[starnum][planetnum].Thing_add; } --- 269,276 ---- /* start a meso colony */ x = int_rand(0,planet->Maxx-1); y = int_rand(0,planet->Maxy-1); ! Sector(*planet,x,y).des = ! races[Stinfo[starnum][planetnum].Thing_add]->likesbest; Sector(*planet,x,y).popn = 1; Sector(*planet,x,y).owner = Stinfo[starnum][planetnum].Thing_add; } *************** *** 330,336 **** (!(p-1)->is_wasted || !(p+1)->is_wasted) && !random()%5) p->is_wasted = 0; ! } else if (p->des==DES_LAND || p->des==DES_MOUNT) { if ( y>1 && y<planet->Maxy-2 && ((p-1)->popn || (p+1)->popn) && !random()%10) --- 331,337 ---- (!(p-1)->is_wasted || !(p+1)->is_wasted) && !random()%5) p->is_wasted = 0; ! } else if (p->des==DES_LAND || p->des==DES_MOUNT || p->des==DES_ICE) { if ( y>1 && y<planet->Maxy-2 && ((p-1)->popn || (p+1)->popn) && !random()%10) *************** *** 340,348 **** } /* evaporate the oceans on novae */ ! if (Stars[starnum]->nova_stage && p->des==DES_SEA) ! if ( (x>0 && (p-1)->des==DES_LAND) || (x<planet->Maxx-1 && (p+1)->des==DES_LAND) || (y>0 && (p-planet->Maxx)->des==DES_LAND) || (y<planet->Maxy-1 && (p+planet->Maxx)->des==DES_LAND ) ) { --- 341,352 ---- } /* evaporate the oceans on novae */ ! if (Stars[starnum]->nova_stage) ! if (p->des==DES_ICE) ! p->des = DES_LAND; ! else if (p->des==DES_SEA) ! if ( (x>0 && (p-1)->des==DES_LAND) || (x<planet->Maxx-1 && (p+1)->des==DES_LAND) || (y>0 && (p-planet->Maxx)->des==DES_LAND) || (y<planet->Maxy-1 && (p+planet->Maxx)->des==DES_LAND ) ) { *************** *** 366,374 **** /* sectors have been modified for this player*/ /* & planet is compatible enough */ if (planet->info[i-1].numsectsowned && Compat[i] > 40.0) ! while (!Claims && !allexp && --timer) { printf("exploring ... timer=%d\n",timer); - /*printf("exploring player %d\n",i);*/ o = 1; Getxysect(planet, &x, &y, 1); while (!Claims && Getxysect(planet, &x, &y, 0)) { --- 370,377 ---- /* sectors have been modified for this player*/ /* & planet is compatible enough */ if (planet->info[i-1].numsectsowned && Compat[i] > 40.0) ! while (!Claims && !allexp && --timer) { printf("exploring ... timer=%d\n",timer); o = 1; Getxysect(planet, &x, &y, 1); while (!Claims && Getxysect(planet, &x, &y, 0)) { *************** *** 375,383 **** /* find out if all sectors have been explored */ o &= Sectinfo[x][y].explored[i]; p = &Sector(*planet,x,y); ! if (!p->owner && !p->is_wasted && p->des==DES_LAND && Sectinfo[x][y].explored[i]) { ! /* (water) explorations have found an island */ ! printf("found an island @ %d,%d\n",x,y); Claims = i; /* give them some free people there */ p->popn = races[i]->number_sexes; --- 378,386 ---- /* find out if all sectors have been explored */ o &= Sectinfo[x][y].explored[i]; p = &Sector(*planet,x,y); ! if (!p->owner && !p->is_wasted && p->des==races[i]->likesbest && Sectinfo[x][y].explored[i]) { ! /* explorations have found an island */ ! printf("found island @ %d,%d\n",x,y); Claims = i; /* give them some free people there */ p->popn = races[i]->number_sexes; *************** *** 410,417 **** teleg_add("resource prod. fuel prod. weapons prod. mob.pt prod.\n",telegram_buf); sprintf(buf,"%12d%12d%15d%13d\n", tot_res, tot_fuel, tot_destruct,tot_mob); teleg_add(buf,telegram_buf); ! sprintf(buf,"resource deposit depletion: %d\n", tot_resdep); ! teleg_add(buf,telegram_buf); teleg_add("total births (%%) growth of max popn support (%%)\n",telegram_buf); sprintf(buf,"%9d (%.2f%%)%23d (%.2f%%)\n", planet->popn - oldplanetpopn, --- 413,422 ---- teleg_add("resource prod. fuel prod. weapons prod. mob.pt prod.\n",telegram_buf); sprintf(buf,"%12d%12d%15d%13d\n", tot_res, tot_fuel, tot_destruct,tot_mob); teleg_add(buf,telegram_buf); ! if (tot_resdep) { ! sprintf(buf,"resource deposit depletion: %d\n", tot_resdep); ! teleg_add(buf,telegram_buf); ! } teleg_add("total births (%%) growth of max popn support (%%)\n",telegram_buf); sprintf(buf,"%9d (%.2f%%)%23d (%.2f%%)\n", planet->popn - oldplanetpopn, *************** *** 467,474 **** sgn(avg_mob[i] - planet->info[i-1].comread); } } ! planet->conditions[TOXIC] = (planet->conditions[TOXIC]*50 + ! 100.0 * planet->popn / planet->maxpopn) / 51.0; } return allmod; --- 472,479 ---- sgn(avg_mob[i] - planet->info[i-1].comread); } } ! planet->conditions[TOXIC] = (planet->conditions[TOXIC]*30 + ! 100.0 * planet->popn / planet->maxpopn) / 31.0; } return allmod; *** ../../GB/dosector.c Wed Apr 26 11:22:34 1989 --- dosector.c Mon May 1 08:21:44 1989 *************** *** 63,69 **** if (!s->eff) { tot_eff += s->eff = 1; } else { ! tot_eff += eff = round_rand(races[s->owner]->metabolism*s->popn*(0.95-logscale(s->eff))*EFF_PROD); if (s->eff+eff >= 100) { s->eff=100; /* dont go past 100%*/ tot_eff -= s->eff+eff-100; --- 63,70 ---- if (!s->eff) { tot_eff += s->eff = 1; } else { ! /*tot_eff += eff = round_rand(races[s->owner]->metabolism*s->popn*(0.95-logscale(s->eff))*EFF_PROD);*/ ! tot_eff += eff = round_rand(races[s->owner]->metabolism*s->popn*EFF_PROD/100.0); if (s->eff+eff >= 100) { s->eff=100; /* dont go past 100%*/ tot_eff -= s->eff+eff-100; *************** *** 106,114 **** reg int peep; /* peep == number of people who want to move */ - /*printf("spreading from %d,%d -- ",x,y);*/ if (peep = round_rand((float)s->popn * races[s->owner]->nonhomebodies) ) { - /*printf(" peeple=%d\n",peep);*/ #if NO_SLIDING_SCALE_AUTOMOVE if (pl->popn < POPN_MOVE_SCALE_1) { --- 107,113 ---- *************** *** 151,166 **** xd=planet->Maxx-1; else if (xd>=planet->Maxx) xd=0; /* check for planetary compatibility */ ! if (float_rand()*100.0 > Compat[ps->owner]) { ! /*printf("%d,%d incomp -- returning\n",xd,yd);*/ return; } ! pd = &Smap[yd*planet->Maxx+xd]; - if ((ps->owner==pd->owner) || (pd->des!=DES_SEA && !pd->is_wasted)) { - if (!pd->owner) { printf("claiming %d,%d (%d), %d people\n",xd,yd,ps->owner,people); pd->popn += people; --- 150,166 ---- xd=planet->Maxx-1; else if (xd>=planet->Maxx) xd=0; + + pd = &Sector(*planet,xd,yd); + /* check for planetary compatibility */ ! if (float_rand()*100.0 > Compat[ps->owner] * races[ps->owner]->likes[pd->des]) { ! /*printf("%d,%d incomp C %.2f,l %.f-- returning\n",xd,yd,Compat[ps->owner],races[ps->owner]->likes[pd->des]);*/ return; } ! if ( (ps->owner==pd->owner || !pd->owner) && !pd->is_wasted) { if (!pd->owner) { printf("claiming %d,%d (%d), %d people\n",xd,yd,ps->owner,people); pd->popn += people; *************** *** 177,188 **** reg float dfac; ps->popn -= round_rand(((float)ps->popn * pd->mobilization * ! planet->info[pd->owner-1].comread + races[pd->owner]->fighters*10)/200.0); dfac = ( (float)pd->popn * ps->mobilization * ! planet->info[ps->owner-1].comread + races[pd->owner]->fighters*10)/200.0; printf(" att %d lost %g people of %d.\n",ps->owner, ((float)ps->popn * pd->mobilization * ! planet->info[pd->owner-1].comread + races[pd->owner]->fighters*10)/200.0, pd->popn); if (pd->popn - dfac <= 0.0) { /* the invasion was successful */ if (races[ps->owner]->Thing) { --- 177,188 ---- reg float dfac; ps->popn -= round_rand(((float)ps->popn * pd->mobilization * ! planet->info[pd->owner-1].comread + races[pd->owner]->fighters*20)/200.0); dfac = ( (float)pd->popn * ps->mobilization * ! planet->info[ps->owner-1].comread + races[pd->owner]->fighters*20)/200.0; printf(" att %d lost %g people of %d.\n",ps->owner, ((float)ps->popn * pd->mobilization * ! planet->info[pd->owner-1].comread + races[pd->owner]->fighters*20)/200.0, pd->popn); if (pd->popn - dfac <= 0.0) { /* the invasion was successful */ if (races[ps->owner]->Thing) { *************** *** 196,203 **** sects_lost[pd->owner]++; sects_gained[ps->owner]++; pd->owner = ps->owner; ! pd->eff *= 0.5; ! pd->mobilization *= 0.25; tot_captured++; printf(" sec %d,%d CAPTURED",xd,yd); } else --- 196,203 ---- sects_lost[pd->owner]++; sects_gained[ps->owner]++; pd->owner = ps->owner; ! pd->eff *= 0.75; ! pd->mobilization *= 0.75; tot_captured++; printf(" sec %d,%d CAPTURED",xd,yd); } else *************** *** 205,211 **** printf(" def %d lost %g people of %d,",pd->owner, ((float)pd->popn * ps->mobilization * ! planet->info[ps->owner-1].comread + races[pd->owner]->fighters*10)/200.0, pd->popn); } } } --- 205,211 ---- printf(" def %d lost %g people of %d,",pd->owner, ((float)pd->popn * ps->mobilization * ! planet->info[ps->owner-1].comread + races[pd->owner]->fighters*20)/200.0, pd->popn); } } } *** ../../GB/doship.c Wed Apr 26 11:22:35 1989 --- doship.c Mon May 1 08:21:45 1989 *************** *** 205,210 **** --- 205,211 ---- case STYPE_POD: if (ship->notified) { /* we just arrived at this system -- explode */ + /* or, we are floating in space with no fuel -- just die */ int shfdata; reg int i,f= -1; for (i=0; i<MAXSSHIPS && Stars[ship->storbits]->shipnums[i]!=shipno; i++) ; *************** *** 215,225 **** ship->is_dead = 1; openshfdata(&shfdata); destroyship(shfdata, shipno); ! close(shfdata); ! for (i=0; f== -1 && i<Stars[ship->storbits]->numplanets; i++) if (sqrt((double)Distsq(ship->xpos, ship->ypos, Stars[ship->storbits]->xpos + planets[ship->storbits][i]->xpos, ! Stars[ship->storbits]->ypos + planets[ship->storbits][i]->ypos))/SYSTEMSIZE < float_rand()*2) f = i; teleg_add("",telegram_buf); sprintf(buf, "Bulletin\n\nSpore pod #%d has warmed and exploded.\n",shipno); --- 216,227 ---- ship->is_dead = 1; openshfdata(&shfdata); destroyship(shfdata, shipno); ! close(shfdata); ! if (ship->whatorbits==LEVEL_STAR) { ! for (i=0; f== -1 && i<Stars[ship->storbits]->numplanets; i++) if (sqrt((double)Distsq(ship->xpos, ship->ypos, Stars[ship->storbits]->xpos + planets[ship->storbits][i]->xpos, ! Stars[ship->storbits]->ypos + planets[ship->storbits][i]->ypos))/SYSTEMSIZE < float_rand()) f = i; teleg_add("",telegram_buf); sprintf(buf, "Bulletin\n\nSpore pod #%d has warmed and exploded.\n",shipno); *************** *** 242,247 **** --- 244,250 ---- for (i=1; i<=Num_races; i++) if (i!=ship->owner && isset(Stars[ship->storbits]->inhabited,i)) teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf); + } } } break; *************** *** 274,280 **** if (ship->orders.object.number2 == 0) { /* launch if no assignment */ /* steal some fuel from other players,telegram */ bool f=0; ! for (r=Num_races-1; !f && r>0; r--) if (p->info[r-1].fuel >= Shipdata[OTYPE_VN][ABIL_COST]) { p->info[ship->owner-1].fuel += Shipdata[OTYPE_VN][ABIL_FUELCAP]; --- 277,284 ---- if (ship->orders.object.number2 == 0) { /* launch if no assignment */ /* steal some fuel from other players,telegram */ bool f=0; ! if (ship->fuel < Shipdata[OTYPE_VN][ABIL_COST]) ! for (r=1; !f && r<=Num_races; r--) if (p->info[r-1].fuel >= Shipdata[OTYPE_VN][ABIL_COST]) { p->info[ship->owner-1].fuel += Shipdata[OTYPE_VN][ABIL_FUELCAP]; *************** *** 292,298 **** Stars[ship->storbits]->pnames[ship->pnumorbits]); teleg_add(buf,telegram_buf); teleg_send(TELEG_PLAYER_AUTO, f, telegram_buf); - teleg_send(TELEG_PLAYER_AUTO, 1, telegram_buf); /*}*/ ship->orders.object.number2 = 0; /* no current assignment */ --- 296,301 ---- *************** *** 306,312 **** we are engaged in building up resources/fuel. */ /* steal resources from other players,telegram */ bool f=0; ! for (r=Num_races-1; !f && r>0; r--) if (p->info[r-1].resource >= Shipdata[OTYPE_VN][ABIL_COST]) f = r; if (f) { --- 309,315 ---- we are engaged in building up resources/fuel. */ /* steal resources from other players,telegram */ bool f=0; ! for (r=Num_races; !f && r>0; r--) if (p->info[r-1].resource >= Shipdata[OTYPE_VN][ABIL_COST]) f = r; if (f) { *************** *** 325,332 **** Stars[ship->storbits]->pnames[ship->pnumorbits]); teleg_add(buf,telegram_buf); teleg_send(TELEG_PLAYER_AUTO, f, telegram_buf); - /* remove */ - teleg_send(TELEG_PLAYER_AUTO, 1, telegram_buf); /*}*/ /* if no resources to steal, more will be produced in doplanet*/ } --- 328,333 ---- *************** *** 362,367 **** --- 363,369 ---- ship->whatdest = LEVEL_STAR; } fprintf(stderr,"VN #%d headed for star %d, pl %d.\n",shipno,ship->deststar, ship->destpnum); + ship->speed = 1; /* VN's are very fastidious */ ship->orders.object.number2 = 1; /* we are assigned to go */ } *** ../../GB/examine.c Wed Apr 26 11:22:37 1989 --- examine.c Mon May 1 08:21:50 1989 *************** *** 42,48 **** } /* look through ship data file */ ! for (t=0; t<ship->type; t++) while (fgetc(fd) != '~') ; /* give report */ --- 42,48 ---- } /* look through ship data file */ ! for (t=0; t<=ship->type; t++) while (fgetc(fd) != '~') ; /* give report */ *** ../../GB/files_rw.c Wed Apr 26 11:22:37 1989 --- files_rw.c Mon May 1 08:21:50 1989 *************** *** 12,17 **** --- 12,18 ---- */ #include "tweakables.h" + #include "files.h" #include <sys/file.h> #include <signal.h> #include <errno.h> *** ../../GB/fire.c Wed Apr 26 14:27:19 1989 --- fire.c Mon May 1 08:21:52 1989 *************** *** 28,33 **** --- 28,34 ---- sectortype *sect; int dam=0,dam2=0,strength,oldstrength,maxstrength, i,from_firex= -1,from_firey= -1,firex= -1,firey= -1,Numplayersretaliate=0; + float dist; char string[PLACENAMESIZE],buf[100]; bool sameplanet = 0, fromplanetmod=0,toplanetmod=0,starmod=0,sdatamod=0; int mask,APdeductstar; *************** *** 262,267 **** --- 263,275 ---- /* block kill signals to foil cheaters */ mask = sigblock(SIGINT | SIGQUIT | SIGSTOP); + dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &dist, &sdatamod,&starmod, &fromplanetmod); + printf("Distance to target: %.0f, maximum distance: %d.\n",dist, SYSTEMSIZE); + if (dam < 0) { + printf("Target out of range!\n", SYSTEMSIZE); + fire_handler(); + } + if (from.level==LEVEL_SHIP) { from.shipptr->destruct -= strength; from.shipptr->mass -= strength*MASS_DESTRUCT; *************** *** 268,278 **** } else if (from.level==LEVEL_PLAN) fpl->info[Playernum-1].destruct -= strength; - dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &sdatamod,&starmod, &fromplanetmod); - if (dam < 0) { - printf("Target out of range! must be %d or closer.\n", SYSTEMSIZE); - fire_handler(); - } /* enemy retaliates with twice the strength (if he can) */ --- 276,281 ---- *************** *** 298,304 **** /* enemy fires at shooting sector */ if ( !(to.level==LEVEL_SHIP && to.shipptr->is_dead) ) ! dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &sdatamod,&starmod, &toplanetmod); if (from.level==LEVEL_PLAN) { --- 301,307 ---- /* enemy fires at shooting sector */ if ( !(to.level==LEVEL_SHIP && to.shipptr->is_dead) ) ! dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &dist, &sdatamod,&starmod, &toplanetmod); if (from.level==LEVEL_PLAN) { *************** *** 352,358 **** close(fire_stardata); ! printf("BOOM!!\007 %d%s.\n", dam, to.level==LEVEL_SHIP ? (to.shipptr->type==OTYPE_VN ? " Von Neumann machines destroyed" : "% damage done") : " sectors destroyed" ); --- 355,361 ---- close(fire_stardata); ! printf("BOOM!!\007 %d%s.\n", dam, to.level==LEVEL_SHIP ? (to.shipptr->type==OTYPE_VN ? " Von Neumann machines destroyed" : "% damage done") : " sectors destroyed" ); *** ../../GB/fix.c Wed Apr 26 11:22:40 1989 --- fix.c Mon May 1 08:21:53 1989 *************** *** 295,300 **** --- 295,303 ---- ch = sh->destpnum; query(CHAR, "what planet dest",0,0,&ch,0,0); sh->destpnum = ch; + ch = sh->is_dead; + query(CHAR, "is dead",0,0,&ch,0,0); + sh->is_dead = ch; ch = sh->is_docked; query(CHAR, "is docked",0,0,&ch,0,0); sh->is_docked = ch; *** ../../GB/getplace.c Wed Apr 26 11:22:41 1989 --- getplace.c Mon May 1 08:21:55 1989 *************** *** 44,53 **** where.snum = where.shipptr->storbits; where.pnum = where.shipptr->pnumorbits; /* where.shipno already taken care of */ ! printf(" |%s|\n",string); ! while (isdigit(*string)) {putchr(*string),string++;} ! putchr(*string); ! printf(" |%s|\n",string); if (*string=='/') return Getplace2(string+1,&where, ignoreexpl); else --- 44,51 ---- where.snum = where.shipptr->storbits; where.pnum = where.shipptr->pnumorbits; /* where.shipno already taken care of */ ! while (isdigit(*string)) ! string++; if (*string=='/') return Getplace2(string+1,&where, ignoreexpl); else *** ../../GB/help.c Wed Apr 26 11:22:42 1989 --- help.c Mon May 1 08:21:55 1989 *************** *** 5,10 **** --- 5,11 ---- */ #include "tweakables.h" + #include "files.h" help(APcount, argn,args) int APcount; *************** *** 25,31 **** "tactical fire name mobilize telegram\n" ); } else { ! sprintf(s,"%s %s/%s.doc*", PAGER, DOCS, args[1] ); system(s); } --- 26,32 ---- "tactical fire name mobilize telegram\n" ); } else { ! sprintf(s,"%s %s/%s.doc", PAGER, DOCS, args[1] ); system(s); } *** ../../GB/makeplanet.c Wed Apr 26 11:22:45 1989 --- makeplanet.c Mon May 1 08:22:00 1989 *************** *** 13,19 **** planettype Makeplanet(type) int type; { ! register int x,y; sectortype *s; planettype planet; int i, atmos; --- 13,19 ---- planettype Makeplanet(type) int type; { ! reg int x,y; sectortype *s; planettype planet; int i, atmos; *************** *** 54,60 **** for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des = DES_GAS; /* for gasgiant */ ! s->fert=1; } if (planet.Maxx > MAP_GASGIANT_BANDMIN) { int nbands; --- 54,61 ---- for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des = DES_GAS; /* for gasgiant */ ! s->fert = int_rand(2,15); ! s->resource = int_rand(3,20); } if (planet.Maxx > MAP_GASGIANT_BANDMIN) { int nbands; *************** *** 64,70 **** for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des = DES_SEA; /* make random bands of water */ ! s->fert += int_rand(2,3); } } for (i=0; i<=MAP_ISLANDS*2; i++) { --- 65,72 ---- for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des = DES_SEA; /* make random bands of water */ ! s->fert += int_rand(2,6); ! s->resource += int_rand(30,40); } } for (i=0; i<=MAP_ISLANDS*2; i++) { *************** *** 72,78 **** x=int_rand(1,planet.Maxx-2); s = &Sector(planet,x,y); s->des = DES_SEA; /* make random spots of water */ ! s->fert += int_rand(2,3); } } else { for (i=0; i<MAP_ISLANDS*2; i++) { --- 74,80 ---- x=int_rand(1,planet.Maxx-2); s = &Sector(planet,x,y); s->des = DES_SEA; /* make random spots of water */ ! s->fert += int_rand(2,6); } } else { for (i=0; i<MAP_ISLANDS*2; i++) { *************** *** 80,87 **** if (random()&01) { s->des=DES_MOUNT; s->is_wasted = 1; ! s->resource=int_rand(5,12); ! s->fert=int_rand(5,12); } else { s->des=DES_SEA; s->fert=int_rand(5,12); --- 82,89 ---- if (random()&01) { s->des=DES_MOUNT; s->is_wasted = 1; ! s->resource += int_rand(9,21); ! s->fert = int_rand(5,21); } else { s->des=DES_SEA; s->fert=int_rand(5,12); *************** *** 109,122 **** for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des = DES_MOUNT; /* for airless */ - /*s->is_wasted=1; /* is wasteland */ s->resource=int_rand(25,35); ! s->fert=1; } for (i=0; i<MAP_ISLANDS; i++) { s = &Sector(planet, int_rand(1,planet.Maxx-2), int_rand(1,planet.Maxy-2)); s->des = DES_LAND; ! s->fert += random()&01; s->resource+=int_rand(15,22); } Smashup(&planet,6,DES_LAND,5,1,1); /* make meteor impacts */ --- 111,124 ---- for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des = DES_MOUNT; /* for airless */ s->resource=int_rand(25,35); ! s->fert=int_rand(0,int_rand(3,10)); } + for (i=0; i<MAP_ISLANDS; i++) { s = &Sector(planet, int_rand(1,planet.Maxx-2), int_rand(1,planet.Maxy-2)); s->des = DES_LAND; ! s->fert += int_rand(3,17); s->resource+=int_rand(15,22); } Smashup(&planet,6,DES_LAND,5,1,1); /* make meteor impacts */ *************** *** 138,144 **** s = &Sector(planet,x,y); s->des = int_rand(0,3) ? DES_MOUNT : DES_LAND; s->is_wasted=1; ! s->resource=int_rand(55,85); s->fert=(char)random()&01; } --- 140,146 ---- s = &Sector(planet,x,y); s->des = int_rand(0,3) ? DES_MOUNT : DES_LAND; s->is_wasted=1; ! s->resource=int_rand(101,500); s->fert=(char)random()&01; } *************** *** 175,180 **** --- 177,184 ---- for (x=0; x<planet.Maxx; x++) { s = &Sector(planet,x,y); s->des=DES_SEA; /* make all water first */ + s->fert = int_rand(55,79); + s->resource = int_rand(20,30); } /* make first isolated islands */ for (i=0; i<=MAP_ISLANDS; i++) { *************** *** 185,192 **** s->fert = int_rand(6,20); } ! PermuteSects(&planet); /* mix up map */ ! (void)Getxysect(&planet,0,0,1); /* reset index */ landsects=0; while (landsects<=Numlandsects) --- 189,196 ---- s->fert = int_rand(6,20); } ! /*PermuteSects(&planet); /* mix up map */ ! /*(void)Getxysect(&planet,0,0,1); /* reset index */ landsects=0; while (landsects<=Numlandsects) *************** *** 195,201 **** /* make more isolated islands */ ! for (i=0; i<=MAP_ISLANDS*4; i++) { x=int_rand(0,planet.Maxx-1); y=int_rand(0,planet.Maxy-1); s = &Sector(planet,x,y); --- 199,205 ---- /* make more isolated islands */ ! for (i=0; i<=MAP_ISLANDS*3; i++) { x=int_rand(0,planet.Maxx-1); y=int_rand(0,planet.Maxy-1); s = &Sector(planet,x,y); *************** *** 205,230 **** s->fert = 45; } /* make some wasteland sectors (polar caps ) */ /* do s pole */ ! for (y=planet.Maxy; y>=planet.Maxy-4; y--) for (x=0; x<planet.Maxx; x++) if ( ((y==planet.Maxy-1) && int_rand(0,1)) || ! ((y==planet.Maxy-2) && !int_rand(0,2) && Sector(planet,x,planet.Maxy).is_wasted) ) { ! Sector(planet,x,y).is_wasted=1; ! Smap[y*planet.Maxx+x].fert /= 6; ! } /* do n pole */ ! for (y=0; y<=3; y++) for (x=0; x<planet.Maxx; x++) if ( ((y==0) && int_rand(0,1)) || ((y==1) && !int_rand(0,2) && Smap[x].is_wasted) ) { ! Smap[y*planet.Maxx+x].is_wasted=1; ! Smap[y*planet.Maxx+x].fert /= 6; ! } } ! /*###222 [lint] syntax error at or near word "return"%%%*/ ! return ( planet ); ! /*###223 [lint] syntax error at or near symbol }%%%*/ } --- 209,231 ---- s->fert = 45; } /* make some wasteland sectors (polar caps ) */ + /* { already done in Volcano } */ /* do s pole */ ! /*for (y=planet.Maxy; y>=planet.Maxy-4; y--) for (x=0; x<planet.Maxx; x++) if ( ((y==planet.Maxy-1) && int_rand(0,1)) || ! ((y==planet.Maxy-2) && !int_rand(0,2) && Sector(planet,x,planet.Maxy-1).is_wasted) ) { ! Sector(planet,x,y).des= DES_ICE; ! }*/ /* do n pole */ ! /*for (y=0; y<=3; y++) for (x=0; x<planet.Maxx; x++) if ( ((y==0) && int_rand(0,1)) || ((y==1) && !int_rand(0,2) && Smap[x].is_wasted) ) { ! Smap[y*planet.Maxx+x].des= DES_ICE; ! }*/ } ! return planet; } *************** *** 236,242 **** /* smash psuedo-meteors into the place */ { char r,x,y; ! register int x2,y2; sectortype *s; while (n--) { --- 237,243 ---- /* smash psuedo-meteors into the place */ { char r,x,y; ! reg int x2,y2; sectortype *s; while (n--) { *************** *** 263,269 **** double Distmap(x,y,x2,y2) ! register int x,y,x2,y2; { return fabs((double)x-x2) / RATIOXY + fabs( (double)y-y2); } --- 264,270 ---- double Distmap(x,y,x2,y2) ! reg int x,y,x2,y2; { return fabs((double)x-x2) / RATIOXY + fabs( (double)y-y2); } *************** *** 273,286 **** planettype *pptr; int landsectors,Numlandsects; { ! int x,y; sectortype *s; ! (void)Getxysect(pptr,&x,&y,0); ! /*x = int_rand(0,pptr->Maxx-1); ! y = int_rand(0,pptr->Maxy-1);*/ s = &Sector(*pptr,x,y); if (s->des==DES_SEA) { if (Numneighbors(pptr,x,y,DES_LAND)||Numneighbors(pptr,x,y,DES_MOUNT)) { s->des=(landsectors>(MAP_MOUNT_PERCENT*Numlandsects))?DES_LAND:DES_MOUNT; --- 274,308 ---- planettype *pptr; int landsectors,Numlandsects; { ! reg int x,y; sectortype *s; ! x = int_rand(0,pptr->Maxx-1); ! y = int_rand(0,pptr->Maxy-1); s = &Sector(*pptr,x,y); + if (y > pptr->Maxy/2) { + if (y==pptr->Maxy-1) { + s->des = DES_ICE; + return(1); + } else { + if ((Sector(*pptr,x,y+1).des==DES_ICE) && + (int_rand(-50,50)>pptr->conditions[RTEMP])) { + s->des = DES_ICE; + return(1); + } + } + } else { + if (y==0) { + s->des = DES_ICE; + return(1); + } else if ((Sector(*pptr,x,y-1).des==DES_ICE) && + (int_rand(-50,50)>pptr->conditions[RTEMP])) { + s->des = DES_ICE; + return(1); + } + } + if (s->des==DES_SEA) { if (Numneighbors(pptr,x,y,DES_LAND)||Numneighbors(pptr,x,y,DES_MOUNT)) { s->des=(landsectors>(MAP_MOUNT_PERCENT*Numlandsects))?DES_LAND:DES_MOUNT; *************** *** 298,306 **** /* return # of neighbors of a given designation that a sector has. */ int Numneighbors(p,x,y,des) planettype *p; ! register int x,y,des; { ! register int d; return (Sector(*p,mod(x-1,p->Maxx,d),y).des==des) + (Sector(*p,mod(x+1,p->Maxx,d),y).des==des) + ((y==0) ? 0 : (Sector(*p,x,y-1).des==des)) + --- 320,328 ---- /* return # of neighbors of a given designation that a sector has. */ int Numneighbors(p,x,y,des) planettype *p; ! reg int x,y,des; { ! reg int d; return (Sector(*p,mod(x-1,p->Maxx,d),y).des==des) + (Sector(*p,mod(x+1,p->Maxx,d),y).des==des) + ((y==0) ? 0 : (Sector(*p,x,y-1).des==des)) + *** ../../GB/makeuniv.c Wed Apr 26 14:33:56 1989 --- makeuniv.c Mon May 1 08:22:01 1989 *************** *** 36,43 **** scanf("%d",&lowp); printf("hi # of planets (%d-%d):",lowp,MAXPLANETS-1); scanf("%d",&hip); - printf("approx # of habitable planets:"); - scanf("%d",&e); getchr(); sprintf(str, "/bin/mkdir %s", DATADIR ); --- 36,41 ---- *************** *** 54,65 **** Bzero(*Stars[star]); Star = Stars[star]; Star->numplanets=int_rand(lowp,hip); ! Star->gravity = (float)int_rand(100000,1000000) / 100; printf("name of star (%d planets):",Star->numplanets); for (i=0; i<NAMESIZE-4; i++) putchr('.'); for (i=0; i<NAMESIZE-4; i++) ! putchr('\010'); scanf("%10[^\n]",Star->name); getchr(); Star->xpos=(float)int_rand(-UNIVSIZE,UNIVSIZE); --- 52,63 ---- Bzero(*Stars[star]); Star = Stars[star]; Star->numplanets=int_rand(lowp,hip); ! Star->gravity = int_rand(10000,100000) / 100.0; printf("name of star (%d planets):",Star->numplanets); for (i=0; i<NAMESIZE-4; i++) putchr('.'); for (i=0; i<NAMESIZE-4; i++) ! putchr('\010'); scanf("%10[^\n]",Star->name); getchr(); Star->xpos=(float)int_rand(-UNIVSIZE,UNIVSIZE); *************** *** 70,85 **** for (star=0; star<Sdata.numstars; star++) { ! Star=Stars[star]; - for (i=0; i<=Star->numplanets; i++) - types[i] = 200; - e2=e; - while (e2--) { - types[int_rand(0,Star->numplanets-1)] = TYPE_EARTH; - } for (i=0; i<Star->numplanets; i++) ! if (types[i]!=TYPE_EARTH) types[i]=int_rand(1,3); for (i=0; i<Star->numplanets; i++) { sprintf(Star->pnames[i],"%s-%s",Star->name,Romannums[i]); if (argc==2 && argv[1][1]=='v') --- 68,78 ---- for (star=0; star<Sdata.numstars; star++) { ! Star = Stars[star]; for (i=0; i<Star->numplanets; i++) ! types[i]=int_rand(TYPE_EARTH,TYPE_GASGIANT); ! for (i=0; i<Star->numplanets; i++) { sprintf(Star->pnames[i],"%s-%s",Star->name,Romannums[i]); if (argc==2 && argv[1][1]=='v') *************** *** 98,107 **** for (y=0; y<planet.Maxy; y++) { for (x=0; x<planet.Maxx; x++) { switch (Smap[y*planet.Maxx+x].des) { ! case DES_LAND: putchr(CHAR_UNOWNED_LAND); break; case DES_SEA: putchr(CHAR_SEA); break; case DES_MOUNT: putchr(CHAR_MOUNT); break; case DES_GAS: putchr(CHAR_GAS); break; } } putchr('\n'); --- 91,102 ---- for (y=0; y<planet.Maxy; y++) { for (x=0; x<planet.Maxx; x++) { switch (Smap[y*planet.Maxx+x].des) { ! case DES_LAND: putchr(CHAR_LAND); break; case DES_SEA: putchr(CHAR_SEA); break; case DES_MOUNT: putchr(CHAR_MOUNT); break; + case DES_ICE: putchr(CHAR_ICE); break; case DES_GAS: putchr(CHAR_GAS); break; + default: break; } } putchr('\n'); *** ../../GB/map.c Wed Apr 26 11:22:47 1989 --- map.c Mon May 1 08:22:02 1989 *************** *** 150,161 **** return(CHAR_OWNED_WASTELAND); if (s->VN) return(Shipltrs[OTYPE_VN]); switch (s->des) { ! case DES_SEA: return(CHAR_OWNED_SEA); ! case DES_LAND: return(Race->Thing ? CHAR_OWNED_THING : CHAR_OWNED_LAND); ! case DES_MOUNT: return(Race->Thing ? CHAR_OWNED_THING : CHAR_OWNED_MOUNT); ! case DES_GAS: return(CHAR_GAS); ! case DES_PLATED: return(CHAR_PLATED); default: return('!'); } --- 150,164 ---- return(CHAR_OWNED_WASTELAND); if (s->VN) return(Shipltrs[OTYPE_VN]); + if (Race->Thing) + return CHAR_OWNED_THING; switch (s->des) { ! case DES_SEA: return CHAR_OWNED_SEA; ! case DES_LAND: return CHAR_OWNED_LAND; ! case DES_MOUNT: return CHAR_OWNED_MOUNT; ! case DES_GAS: return CHAR_OWNED_GAS; ! case DES_PLATED: return CHAR_PLATED; ! case DES_ICE: return CHAR_OWNED_ICE; default: return('!'); } *************** *** 175,183 **** return(CHAR_WASTELAND); switch (s->des) { case DES_SEA: return(CHAR_SEA); ! case DES_LAND: return(CHAR_UNOWNED_LAND); case DES_MOUNT: return(CHAR_MOUNT); case DES_GAS: return(CHAR_GAS); case DES_PLATED: return(CHAR_PLATED); default: return('!'); } --- 178,187 ---- return(CHAR_WASTELAND); switch (s->des) { case DES_SEA: return(CHAR_SEA); ! case DES_LAND: return(CHAR_LAND); case DES_MOUNT: return(CHAR_MOUNT); case DES_GAS: return(CHAR_GAS); + case DES_ICE: return CHAR_ICE; case DES_PLATED: return(CHAR_PLATED); default: return('!'); } *** ../../GB/more.c Wed Apr 26 11:22:49 1989 --- more.c Mon May 1 08:22:05 1989 *************** *** 4,11 **** #include <sgtty.h> - char *doc_directory = "/b/o/therat/k"; - main(c, v) int c; char **v; --- 4,9 ---- *************** *** 21,27 **** int fd, pid; long t; ! sprintf(filename, "%s/%s.Z", doc_directory, s); /* could stat the file here to make sure it's there */ time(&t); --- 19,25 ---- int fd, pid; long t; ! sprintf(filename, "%s", s); /* could stat the file here to make sure it's there */ time(&t); *************** *** 105,108 **** return c; } - --- 103,105 ---- *** ../../GB/moveship.c Wed Apr 26 11:22:50 1989 --- moveship.c Mon May 1 08:22:06 1989 *************** *** 91,104 **** Ddist -= (SYSTEMSIZE - 1.0); else if (s->whatdest==LEVEL_STAR) Ddist -= PLORBITSIZE - 1.0; ! else if (s->whatdest==LEVEL_SHIP && Ddist > SYSTEMSIZE) { if (!s->notified) { s->notified = 1; teleg_add("",telegram_buf); sprintf(buf,"Telecomm from ship #%d at %s\n\n",shipno, ! prin_ship_orbits(s)); teleg_add(buf,telegram_buf); ! sprintf(buf,"%s #%d cannot find destination ship #%d.\n", Shipnames[s->type],shipno,s->destshipno); teleg_add(buf,telegram_buf); teleg_send(TELEG_PLAYER_AUTO, s->owner, telegram_buf); --- 91,105 ---- Ddist -= (SYSTEMSIZE - 1.0); else if (s->whatdest==LEVEL_STAR) Ddist -= PLORBITSIZE - 1.0; ! else if (s->whatdest==LEVEL_SHIP && Ddist > SYSTEMSIZE * 2.0) { if (!s->notified) { s->notified = 1; + s->whatdest = LEVEL_UNIV; teleg_add("",telegram_buf); sprintf(buf,"Telecomm from ship #%d at %s\n\n",shipno, ! prin_ship_orbits(s)); teleg_add(buf,telegram_buf); ! sprintf(buf,"%s #%d lost sight of destination ship #%d.\n", Shipnames[s->type],shipno,s->destshipno); teleg_add(buf,telegram_buf); teleg_send(TELEG_PLAYER_AUTO, s->owner, telegram_buf); *************** *** 111,127 **** else if (Ddist > DIST_TO_LAND) { s->fuel -= fuse; - printf(" subtracting %f fuel \n",fuse); - /* subtract the fuel's mass */ s->mass -= fuse * MASS_FUEL; /* dont overshoot */ xdest = sin(heading) * mfactor; - if (abs(xdest) > Ddist) - xdest = sgn(xdest) * Ddist; ydest = cos(heading) * mfactor; ! if (abs(ydest) > Ddist) ydest = sgn(ydest) * Ddist; s->xpos += xdest; s->ypos += ydest; } --- 112,126 ---- else if (Ddist > DIST_TO_LAND) { s->fuel -= fuse; s->mass -= fuse * MASS_FUEL; /* dont overshoot */ xdest = sin(heading) * mfactor; ydest = cos(heading) * mfactor; ! if (sqrt(xdest*xdest + ydest*ydest) > Ddist) { ! xdest = sgn(xdest) * Ddist; ydest = sgn(ydest) * Ddist; + } s->xpos += xdest; s->ypos += ydest; } *** ../../GB/orbit.c Wed Apr 26 11:22:52 1989 --- orbit.c Mon May 1 08:22:07 1989 *************** *** 41,47 **** int orbit_shdata,orbit_pdata,orbit_stardata; DontDispPlanets = DontDispShips = DontDispStars = 0; - printf(" orbit:called |%s|\n",args[1]); /* find options, set flags accordingly */ for (flag=1; flag<=argn-1; flag++) --- 41,46 ---- *************** *** 70,76 **** Lasty = Dir.lasty; Zoom = Dir.zoom; } else { - printf(" trying to orbit %s\n",args[argn-1]); where = Getplace(args[argn-1],0); Lastx = Lasty = 0.0; Zoom = 1.0; --- 69,74 ---- *************** *** 172,178 **** shipwhere.snum = where.shipptr->storbits; shipwhere.pnum = where.shipptr->pnumorbits; sprintf(gs[1],"%s",Dispplace(&shipwhere) ); - printf(" orbiting %s\n",gs[1]); orbit(0,2,gs); } break; --- 170,175 ---- *** ../../GB/order.c Wed Apr 26 14:29:29 1989 --- order.c Mon May 1 08:22:09 1989 *************** *** 9,20 **** #include <ctype.h> #include <setjmp.h> #include <signal.h> extern jmp_buf main_jenv; - extern char *Shipnames[]; - char *prin_aimed_at(), *prin_ship_dest(); int order_shdata,order_pdata,order_stardata; static bool first,prerror,was_obj = 0; --- 9,20 ---- #include <ctype.h> #include <setjmp.h> #include <signal.h> + #include <math.h> extern jmp_buf main_jenv; char *prin_aimed_at(), *prin_ship_dest(); + extern int Ignore_filelocks; int order_shdata,order_pdata,order_stardata; static bool first,prerror,was_obj = 0; *************** *** 219,227 **** tty_on(); do { c = getchr(); ! } while (iscntrl(c) && c!='\033'); switch (c) { ! case '\033': { shiptype *tempship; tempship = oldship; ship = oldship; oldship = tempship; --- 219,227 ---- tty_on(); do { c = getchr(); ! } while (iscntrl(c) && c!=''); switch (c) { ! case '': { shiptype *tempship; tempship = oldship; ship = oldship; oldship = tempship; *************** *** 246,251 **** --- 246,252 ---- case OTYPE_TRANSDEV: printw("Ready to receive."); break; + default: break; } } } *************** *** 262,273 **** ungetc(c,stdin); scanw("%43s",s); move(Erry,0); refresh(); where = Getplace(s, 1); if (!where.err) { ship->whatdest = where.level; ship->deststar = where.snum; ship->destpnum = where.pnum; ! ship->destshipno = where.shipno; } } tty_on(); --- 263,282 ---- ungetc(c,stdin); scanw("%43s",s); move(Erry,0); refresh(); + Ignore_filelocks = 1; where = Getplace(s, 1); + Ignore_filelocks = 0; if (!where.err) { + if (where.level==LEVEL_SHIP) { + /*if (sqrt(Distsq(ship->xpos, ship->ypos, where.shipptr->xpos,where.shipptr->ypos))<SYSTEMSIZE*2.0) {*/ + ship->destshipno = where.shipno; + ship->whatdest = LEVEL_SHIP; + /*} else { move(Erry,0); printw("Ship #%d can't find ship #%d.", shipno, where.shipno); }*/ + } else { ship->whatdest = where.level; ship->deststar = where.snum; ship->destpnum = where.pnum; ! } } } tty_on(); *************** *** 517,522 **** --- 526,532 ---- int sig,code; struct sigcontext *scp; { + Ignore_filelocks = 0; close(order_shdata); close(order_pdata); close(order_stardata); *** ../../GB/prof.c Wed Apr 26 11:22:55 1989 --- prof.c Mon May 1 08:22:10 1989 *************** *** 40,45 **** --- 40,52 ---- Race->conditions[NITROGEN], Race->conditions[SULFUR] ); printf(" helium %02d%% other %02d%%\n", Race->conditions[HELIUM], Race->conditions[OTHER]); + printf("Sector type preferences:\n"); + printf(" %c %.1f%% %c %.1f%%\n", CHAR_SEA, Race->likes[DES_SEA]*100, + CHAR_GAS, Race->likes[DES_GAS]*100); + printf(" %c %.1f%% %c %.1f%%\n", CHAR_MOUNT, Race->likes[DES_MOUNT]*100, + CHAR_LAND, Race->likes[DES_LAND]*100); + printf(" %c %.1f%% %c %.1f%%\n", CHAR_ICE, Race->likes[DES_ICE]*100, + CHAR_PLATED, Race->likes[DES_PLATED]*100); printf("\nRelations with other races:\nPlayer relation\n"); numraces = Numraces(); *** ../../GB/rand.c Wed Apr 26 11:22:56 1989 --- rand.c Mon May 1 08:22:11 1989 *************** *** 20,32 **** float float_rand() { ! return (-(float)random()/ 2147483648); } int int_rand(low,hi) register int low,hi; { ! return( (hi<=low) ? low : (float_rand() * (hi - low + 1)) + low ); } --- 20,32 ---- float float_rand() { ! return random()/ 2147483648.0; } int int_rand(low,hi) register int low,hi; { ! return( (hi<=low) ? low : (random() % (hi - low + 1)) + low ); } *** ../../GB/scrap.c Wed Apr 26 11:23:00 1989 --- scrap.c Mon May 1 08:22:13 1989 *************** *** 61,71 **** getplanet(scrap_pdata, &planet, Stars[s->storbits]->planetpos[s->pnumorbits]); scrapval = Shipdata[s->type][ABIL_COST] * .75 + s->resource; tty_on(); printf("%s #%d:original cost: %d\n", Shipnames[s->type], shipno, Shipdata[s->type][ABIL_COST]); ! printf(" scrap value%s: %d. Junk (y/n)?", s->resource ? "(with stockpile) " : "", scrapval); if (getchr()!='y') { --- 61,74 ---- getplanet(scrap_pdata, &planet, Stars[s->storbits]->planetpos[s->pnumorbits]); scrapval = Shipdata[s->type][ABIL_COST] * .75 + s->resource; + if (s->type==OTYPE_VN) + scrapval += (s->orders.object.number-1) * Shipdata[s->type][ABIL_COST]; tty_on(); printf("%s #%d:original cost: %d\n", Shipnames[s->type], shipno, Shipdata[s->type][ABIL_COST]); ! printf(" %s scrap value%s: %d. Junk (y/n)?", ! s->type==OTYPE_VN ? "total" : "", s->resource ? "(with stockpile) " : "", scrapval); if (getchr()!='y') { *** ../../GB/shlmisc.c Wed Apr 26 14:39:13 1989 --- shlmisc.c Mon May 1 08:22:14 1989 *************** *** 5,10 **** --- 5,11 ---- #include "vars.h" #include "races.h" + #include <curses.h> #include <signal.h> #include <ctype.h> #include <stdio.h> *************** *** 174,179 **** for (j=0; j<i; j++) putchar('.'); for (j=0; j<i; j++) ! putchar('\010'); } --- 175,199 ---- for (j=0; j<i; j++) putchar('.'); for (j=0; j<i; j++) ! putchar('\010'); } + /* tty stuff -- set cbreak mode */ + tty_on() + { + #ifdef UV_4.3 + cbreak(); + #else /* this is 4.2 */ + crmode(); + #endif + + } + + tty_off() + { + #ifdef UV_4.3 + nocbreak(); + #else /* this is 4.2 */ + nocrmode(); + #endif + } *** ../../GB/shootblast.c Wed Apr 26 11:23:01 1989 --- shootblast.c Mon May 1 08:22:15 1989 *************** *** 14,28 **** bool Nuked[MAXPLAYERS]; /* who was nuked on the planet/ship */ ! int shoot(from,to,fpl,tpl,sectorx,sectory,strength, sdatamod,starmod,planetmod) placetype from,*to; planettype *fpl,*tpl; int sectorx,sectory,strength; /* reported modifications to datafiles */ bool *sdatamod,*starmod, *planetmod; { int i; ! double dist,xfrom,yfrom,xto,yto; double str; float r; --- 14,29 ---- bool Nuked[MAXPLAYERS]; /* who was nuked on the planet/ship */ ! int shoot(from,to,fpl,tpl,sectorx,sectory,strength, dist, sdatamod,starmod,planetmod) placetype from,*to; planettype *fpl,*tpl; int sectorx,sectory,strength; + float *dist; /* reported modifications to datafiles */ bool *sdatamod,*starmod, *planetmod; { int i; ! double xfrom,yfrom,xto,yto; double str; float r; *************** *** 42,55 **** yto = to->shipptr->ypos; } ! dist = sqrt( (double)Distsq(xfrom, yfrom, xto, yto)) + 50.0; ! /* (adjust for too close) */ ! if (dist > SYSTEMSIZE) { /* out of range */ return -1; } else { ! str = (double)strength * FACTOR_DAMAGE / dist; printf(" str = %f, rad = %f\n",str,str*FACTOR_DESTPLANET); r = blast(to, tpl, sectorx, sectory, str * FACTOR_DESTPLANET, str); --- 43,55 ---- yto = to->shipptr->ypos; } ! *dist = sqrt( (double)Distsq(xfrom, yfrom, xto, yto)); ! if (*dist > SYSTEMSIZE*2.0) { /* out of range */ return -1; } else { ! str = strength * FACTOR_DAMAGE / (*dist+50.0); printf(" str = %f, rad = %f\n",str,str*FACTOR_DESTPLANET); r = blast(to, tpl, sectorx, sectory, str * FACTOR_DESTPLANET, str); *** ../../GB/teleg_send.c Wed Apr 26 11:23:03 1989 --- teleg_send.c Mon May 1 08:22:17 1989 *************** *** 5,10 **** --- 5,11 ---- #include "tweakables.h" + #include "files.h" #include <stdio.h> #include <ctype.h> #include <strings.h>