home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!mcsun!chsun!pega!dr_who
- From: dr_who@pegasus.ch (Sysop of PEGASUS)
- Newsgroups: vmsnet.sources.games
- Subject: SPCEMP.C Part 05/06
- Message-ID: <1993Jun7.093332.126@pegasus.ch>
- Date: 7 Jun 93 09:33:32 +0200
- Organization: Pegasus BBS, Switzerland
- Lines: 852
- Xref: uunet vmsnet.sources.games:738
-
- ----> START OF PART 5 <----
- /********************************************************************/
- news(int msg,char string[80])
- {
- char ostring[80],zstring[80];
-
- sprintf(zstring,"SPCEMP:News.TXT");
-
- switch(msg) {
- case 1: sprintf(ostring,"%s defeated %s!",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 2: sprintf(ostring,"%s repelled an attack from %s!",player[epn].player,player[pn].player);
- optlog(ostring,zstring);
- break;
- case 3: sprintf(ostring,"%s crushed %s!",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 5: sprintf(ostring,"%s was caught spying on %s!",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 6: sprintf(ostring,"%s was torn in half by civil war!",player[pn].player);
- optlog(ostring,zstring);
- break;
- case 7: sprintf(ostring,"%s joined the %s alliance.",player[pn].player,player[pn].teamname);
- optlog(ostring,zstring);
- break;
- case 8: sprintf(ostring,"%s withdrew from the %s alliance.",player[pn].player,player[pn].teamname);
- optlog(ostring,zstring);
- break;
- case 9: sprintf(ostring,"The %s alliance was dissolved.",player[pn].teamname);
- optlog(ostring,zstring);
- break;
- case 11:sprintf(ostring,"%s: %s",player[pn].player,string);
- optlog(ostring,zstring);
- break;
- case 12:sprintf(ostring,"%s was expelled from the %s alliance.",player[epn].player,player[pn].teamname);
- optlog(ostring,zstring);
- break;
- case 20:sprintf(ostring,"%s transferd %s credits to %s`s account.",player[pn].player,string,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 41:sprintf(ostring,"%s tried to steal %s's Freighters !",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 40:sprintf(ostring,"%s tried to steal %s's Y-Wing-Fighters !",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 46:sprintf(ostring,"%s stole %s of %s's Freighters !",player[pn].player,string,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 45:sprintf(ostring,"%s stole %s of %s's Y-Wing-Fighters !",player[pn].player,string,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 50:sprintf(ostring,"%s joined the game !! ( WELCOME !! ) ",player[pn].player);
- optlog(ostring,zstring);
- break;
- case 51:sprintf(ostring,"%s finaly died !!",player[pn].player);
- optlog(ostring,zstring);
- break;
- case 52:sprintf(ostring,"%s commit suicide !!",player[pn].player);
- optlog(ostring,zstring);
- break;
- case 102:sprintf(ostring,"%s's Anti-Matter Bomb exploded on a planet from %s !!",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 103:sprintf(ostring,"Missiles from %s destroyed 30 %% of %s's population. \n",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 104:sprintf(ostring,"Missiles from %s destroyed 100 %% of %s's foodproduction. \n",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 105:sprintf(ostring,"Missiles from %s destroyed 50 %% of %s's army. \n",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 106:sprintf(ostring,"Missiles from %s destroyed 50 %% of %s's Gov. Planets. \n",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 108:
- case 109:sprintf(ostring,"%s sent a mole to %s.",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 153:sprintf(ostring,"%s repelled a thermonuclear missile attack from %s.\n",player[epn].player,player[pn].player);
- optlog(ostring,zstring);
- break;
- case 154:sprintf(ostring,"%s repelled a chemical missile attack from %s.\n",player[epn].player,player[pn].player);
- optlog(ostring,zstring);
- break;
- case 155:sprintf(ostring,"%s repelled a convetional missile attack from %s.\n",player[epn].player,player[pn].player);
- optlog(ostring,zstring);
- break;
- case 156:sprintf(ostring,"%s repelled an anti-matter missile attack from %s.\n",player[epn].player,player[pn].player);
- optlog(ostring,zstring);
- break;
- case 201:sprintf(ostring,"%s throw %s down from the uridium throne.",player[pn].player,player[epn].player);
- optlog(ostring,zstring);
- break;
- case 202:sprintf(ostring,"%s wins a place at the uridium throne.",player[pn].player);
- optlog(ostring,zstring);
- break;
- case 203:sprintf(ostring,"%s lose his place at the uridium throne.",player[pn].player);
- optlog(ostring,zstring);
- break;
-
- case 999: sprintf(ostring,"%s played some turns ",player[pn].player);
- optlog(ostring,zstring);
- break;
-
- }
- }
-
- /********************************************************************/
- optlog(char string[80],char logue[80])
- {
- time_t zeit;
- char *t[19];
- FILE *logf;
-
- zeit = time (&zeit);
- strncpy(t,ctime(&zeit),19); /* NOT AN ANSI STANDART */
-
- if(check_file(logue)==FALSE)
- logf=fopen(logue,"w");
- else
- logf=fopen(logue,"a");
-
- fprintf(logf,"[%s] ",t);
- fputs(string,logf);
- fputs("\n",logf);
- fclose(logf);
- }
-
- /*****************************************************************/
- check_stringinfile(char filename[80],char string[150])
- {
- FILE *fp;
- char line[80];
-
- fp=fopen(filename,"r");
- do
- {
- fgets(line,80,fp);
- strip_crlf(line);
- if(strstr(line,string)>0)
- {
- fclose(fp);
- return(TRUE);
- }
- } while (feof(fp)==FALSE);
-
- fclose(fp);
- return(FALSE);
- }
-
- /*****************************************************************/
- get_score(int nr)
- {
- player[nr].score = 0;
- /* planets * 100 */
- player[nr].score = player[nr].score + (100 * (player[nr].defensep + player[nr].orep + player[nr].foodp + player[nr].governp + player[nr].tradep + player[nr].tourismp));
- /* get army score */
- player[nr].score = player[nr].score + (player[nr].soldiers + player[nr].cruisers*3 + player[nr].fighters*2 + player[nr].defense*2 + player[nr].ywings*3 + player[nr].missiledefense);
- /* get army score 2 + pilots / freighters */
- player[nr].score = player[nr].score + (player[nr].agents*2 + player[nr].carriers*3 + player[nr].pilots + player[nr].freighters*2 );
-
- /** MONEY addjustments **/
- player[nr].score = player[nr].score + (player[nr].credits/1000 + player[nr].acredits/900);
-
- /**/
- if(player[nr].score_modifier>0)
- player[nr].score = player[nr].score + player[nr].score_modifier;
- if(player[nr].score<0)
- player[nr].score=0;
- }
-
- /*****************************************************************/
- points(int status)
- {
- int found=FALSE;
- int z=0;
- int x=0;
- FILE *fp;
- char line[80][500];
- char prot[2]=" ";
- char temp_player[30];
-
- if (player[pn].protection!=0)
- strcpy(prot,"*");
-
- get_score(pn);
-
- if (player[pn].score>=uridium_limit)
- strcpy(prot,"#");
-
- if(check_file("SPCEMP:PLAYERS.SCORES")==FALSE)
- {
- sleep(1);
- if(check_file("SPCEMP:PLAYERS.SCORES")==FALSE)
- {
- fp=fopen("SPCEMP:PLAYERS.SCORES","w");
- fprintf(fp,"-+-");
- fclose(fp);
- }
- }
-
- fp=fopen("SPCEMP:PLAYERS.SCORES","r");
- do
- {
- z++;
- fgets(line[z],80,fp);
- strip_crlf(line[z]);
- } while (strpbrk(line[z],"+")==0);
- fclose(fp);
-
- if(check_file("SPCEMP:PLAYERS.SCORES")==TRUE)
- delete_file("SPCEMP:PLAYERS.SCORES");
- fp=fopen("SPCEMP:PLAYERS.SCORES","w");
- for(x=1;x<z;x++)
- {
- sscanf(line[x],"%s",&temp_player);
- if((strcmp(temp_player,player[pn].player)==0)&&(status==1)) /* UPDATE */
- {
- sprintf(line[x],"%-20s |%9ld planets| %9ld pts. | %4ld moves | %2s",player[pn].player,(player[pn].orep+player[pn].defensep+player[pn].foodp+player[pn].tradep+player[pn].tourismp+player[pn].governp),player[pn].score,player[pn].played_moves,prot);
- fprintf(fp,"%s\n",line[x]);
- found=TRUE;
- }
- else
- fprintf(fp,"%s\n",line[x]);
-
- }
-
- if((status==3)||((status==1)&&(found==FALSE))) /* ADD */
- {
- x++;
- sprintf(line[x],"%-20s |%9ld planets| %9ld pts. | %4ld moves | %2s",player[pn].player,(player[pn].orep+player[pn].defensep+player[pn].foodp+player[pn].tradep+player[pn].tourismp+player[pn].governp),player[pn].score,player[pn].played_moves,prot);
- fprintf(fp,"%s\n",line[x]);
- }
- fprintf(fp,"-+-\n");
- fclose(fp);
-
- }
-
- /********************************************************************/
- remove_player()
- {
- int z=0;
- int x=0;
- FILE *fp;
- char line[80][500];
- char ostring[80];
- char temp_player[30];
-
- if(check_file("SPCEMP:PLAYERS.SCORES")==FALSE)
- {
- sleep(1);
- if(check_file("SPCEMP:PLAYERS.SCORES")==FALSE)
- {
- fp=fopen("SPCEMP:PLAYERS.SCORES","w");
- fprintf(fp,"-+-");
- fclose(fp);
- }
- }
-
- fp=fopen("SPCEMP:PLAYERS.SCORES","r");
- do
- {
- z++;
- fgets(line[z],80,fp);
- strip_crlf(line[z]);
- } while (strpbrk(line[z],"+")==0);
- fclose(fp);
-
-
- if(check_file("SPCEMP:PLAYERS.SCORES")==TRUE)
- delete_file("SPCEMP:PLAYERS.SCORES");
- fp=fopen("SPCEMP:PLAYERS.SCORES","w");
- for(x=1;x<z;x++)
- {
- sscanf(line[x],"%s",&temp_player);
- if((strcmp(temp_player,player[pn].player)==0)&&(status==1)) /* UPDATE */
- ;
- else
- fprintf(fp,"%s\n",line[x]);
-
- }
-
- fprintf(fp,"-+-\n");
- fclose(fp);
-
- x=0;
- z=0;
- if(check_file("SPCEMP:LOTTERY.USER")==FALSE)
- {
- sleep(1);
- if(check_file("SPCEMP:LOTTERY.USER")==FALSE)
- {
- fp=fopen("SPCEMP:LOTTERY.USER","w");
- fclose(fp);
- }
- }
-
- fp=fopen("SPCEMP:LOTTERY.USER","r");
- while(feof(fp)==FALSE)
- {
- z++;
- fgets(line[z],80,fp);
- strip_crlf(line[z]);
- }
- fclose(fp);
-
-
- if(check_file("SPCEMP:LOTTERY.USER")==TRUE)
- delete_file("SPCEMP:LOTTERY.USER");
- fp=fopen("SPCEMP:LOTTERY.USER","w");
- for(x=1;x<z;x++)
- {
- sscanf(line[x],"%s",&temp_player);
- if((strcmp(temp_player,player[pn].player)==0)&&(status==1)) /* UPDATE */
- ;
- else
- fprintf(fp,"%s\n",line[x]);
-
- }
-
- fclose(fp);
-
- sprintf(ostring,"SPCEMP_PLAYERS:MSG_%s.TXT",player[pn].player);
- delete(ostring);
- sprintf(ostring,"SPCEMP_PLAYERS:%s.SDAT",player[pn].player);
- delete(ostring);
- sprintf(ostring,"SPCEMP_PLAYERS:%s.TRADE",player[pn].player);
- delete(ostring);
-
- }
-
- /********************************************************************/
- e_points(int status)
- {
- int z=0;
- int x=0;
- FILE *fp;
- char line[80][500];
- char prot[2]=" ";
- char temp_player[30];
-
- if (player[epn].protection!=0)
- strcpy(prot,"*");
-
- get_score(epn);
-
- if(check_file("SPCEMP:PLAYERS.SCORES")==FALSE)
- {
- sleep(1);
- if(check_file("SPCEMP:PLAYERS.SCORES")==FALSE)
- {
- fp=fopen("SPCEMP:PLAYERS.SCORES","w");
- fprintf(fp,"-+-");
- fclose(fp);
- }
- }
-
- fp=fopen("SPCEMP:PLAYERS.SCORES","r");
- do
- {
- z++;
- fgets(line[z],80,fp);
- strip_crlf(line[z]);
- } while (strpbrk(line[z],"+")==0);
- fclose(fp);
-
- if(check_file("SPCEMP:PLAYERS.SCORES")==TRUE)
- delete_file("SPCEMP:PLAYERS.SCORES");
- fp=fopen("SPCEMP:PLAYERS.SCORES","w");
- for(x=1;x<z;x++)
- {
- sscanf(line[x],"%s",&temp_player);
- if((strcmp(temp_player,player[epn].player)==0)&&(status==1)) /* UPDATE */
- {
- sprintf(line[x],"%-20s |%9ld planets| %9ld pts. | %4ld moves | %2s",player[epn].player,(player[epn].orep+player[epn].defensep+
- player[epn].foodp+player[epn].tradep+player[epn].tourismp+player[epn].governp),player[epn].score,player[epn].played_moves,prot);
- fprintf(fp,"%s\n",line[x]);
- }
- else
- if((strcmp(temp_player,player[epn].player)!=0)&&(status!=3)) /* THE NORMAL ONES */
- fprintf(fp,"%s\n",line[x]);
- }
-
- fprintf(fp,"-+-\n");
- fclose(fp);
-
- }
-
- /*****************************************************************/
- int check_player(char *playername)
- {
- char ostring[80];
-
- sprintf(ostring,"SPCEMP_PLAYERS:%s.sdat",playername);
- return(check_file(ostring));
-
- }
-
- /*****************************************************************/
- display_users()
- {
- cls();
- printf("\n\nSpace Empire V%s list of scores\n",version);
- printf("----------------------------------------------------------------------------\n");
- printf("Name Planets Score Moves\n");
- printf("----------------------------------------------------------------------------\n");
- display_file("spcemp:players.scores",MORE);
- printf("----------------------------------------------------------------------------\n");
- }
-
- /*****************************************************************/
- show_info()
- {
- char ostring[80];
- FILE *fp;
-
- printf("\nRead documentation? [y/N] ");
- gets(ostring);
- ostring[0]=toupper(ostring[0]);
- if(ostring[0]!='Y')
- printf("");
- else
- display_file("SPCEMP:SPCEMP.DOC",MORE);
-
- /* NEWS FILE */
-
- if(check_file("SPCEMP:NEWS.TXT")==TRUE)
- {
- printf("\nRead NEWS-FILE? [y/N] ");
- gets(ostring);
- ostring[0]=toupper(ostring[0]);
- if(ostring[0]!='Y')
- printf("");
- else
- {
- printf("\n\n");
- display_file("SPCEMP:NEWS.TXT",MORE);
- printf("\n\n");
- press_return();
- }
- }
-
- /* PRIV MSG */
-
- sprintf(ostring,"SPCEMP_PLAYERS:MSG_%s.TXT",player[pn].player);
- printf("\n");
- display_file(ostring,MORE);
- printf("\n");
- press_return();
-
- }
-
- /*****************************************************************/
- bye()
- {
- int busy=FALSE;
- FILE *fp;
- char ostring[90];
-
- points(1);
- cls();
-
- if((player[pn].governp+player[pn].defensep+player[pn].foodp+player[pn].orep+player[pn].tourismp+player[pn].tradep)<=10)
- {
- player[pn].protection=0;
- put_datas(pn);
- }
-
- printf("\n\n\nVAX-SPACE-EMPIRE V %s by %sR.Sieber%s & %sN.Kuemin%s \n\n",version,ansi(TT_BOLD),ansi(TT_RESET),ansi(TT_BOLD),ansi(TT_RESET));
- printf("I hope you like the game !!\n\n");
- printf("Your score is : %d Points\n\n",player[pn].score);
- if(player[pn].moves!=0)
- printf("\n\nYou have %d moves left today.\n\n\n",player[pn].moves);
- else
- {
- printf("\n\nSorry but you are out of moves.\n");
- printf("\nSee you tomorrow !\n\n");
- }
- if(check_file("SPCEMP:BUSY.STATUS")==TRUE)
- delete_file("SPCEMP:BUSY.STATUS");
- fp = fopen("SPCEMP:BUSY.STATUS", "w");
- fprintf(fp,"%d\n",busy);
- fprintf(fp,"%s\n",player[pn].player);
- fclose(fp);
-
-
- fclose(busy_fp);
- delete_file("spcemp:in.use;1");
-
-
- exit(0);
- }
-
-
- /*****************************************************************/
- /*Lottery winner looks for a new winner at the lottery */
- /*****************************************************************/
- lottery_winner()
- {
- long tickets=0;
- int n=0;
- long z=0;
- long winner=0;
- char lottery_name[30];
- char ostring[80];
- char string[80];
- FILE *fp;
-
- if (check_file("SPCEMP:LOTTERY.USER")==TRUE)
- {
- fp=fopen("SPCEMP:LOTTERY.USER","r");
- while(feof(fp)==FALSE)
- {
- fgets(string,60,fp);
- sscanf(string,"%s %d",&player[epn].player,&n);
- tickets=tickets+n;
- n=0;
- }
- fclose(fp);
- }
- if(tickets==0)
- printf("Nobody has played lottery... No winner.\n");
- else
- {
- winner=rnd(tickets);
- printf("Winner is ticket no. %d. ",winner);
- z=tickets;
- n=0;
- fp=fopen("SPCEMP:LOTTERY.USER","r");
- while(z>0)
- {
- fgets(string,60,fp);
- sscanf(string,"%s %d",&player[epn].player,&n);
- z=z-n;
- n=0;
- }
- fclose(fp);
- printf("This ticket belongs to %s.\nThis player wins %d credits.\n",player[epn].player,(tickets*1000));
- get_datas(epn);
- player[epn].acredits=player[epn].acredits+((tickets*2000)+1000000);
- put_datas(epn);
- sprintf(string,"%s wins %d credits at the lottery.",player[epn].player,((tickets*2000)+1000000));
- optlog(string,"SPCEMP:NEWS.TXT");
- sprintf(string,"YOU win %d credits at the lottery.",((tickets*2000)+1000000));
- sprintf(ostring,"SPCEMP_PLAYERS:MSG_%s.TXT",player[epn].player);
- optlog(string,ostring);
- }
- }
-
- /*****************************************************************/
- /*Lottery maintenance */
- /*****************************************************************/
- lottery_maint()
- {
- int lottery_count=0;
- char string[80];
- FILE *fp;
-
- if (check_file("SPCEMP:LOTTERY.DAT")==TRUE)
- {
- fp=fopen("SPCEMP:LOTTERY.DAT","r");
- fgets(string,60,fp);
- sscanf(string,"%d",&lottery_count);
- fclose(fp);
- }
- lottery_count=lottery_count+1;
- if(lottery_count==lottery_turn)
- {
- /* Take a Winner */
- printf("Looking for a lottery winner.\n");
- lottery_winner();
- if(check_file("SPCEMP:LOTTERY.USER")==TRUE)
- delete_file("SPCEMP:LOTTERY.USER");
- lottery_count=0;
- }
- if(check_file("SPCEMP:LOTTERY.DAT")==TRUE)
- delete_file("SPCEMP:LOTTERY.DAT");
- fp=fopen("SPCEMP:LOTTERY.DAT","w");
- fprintf(fp,"%d",lottery_count);
- fclose(fp);
- }
-
- /*****************************************************************/
- /*Load and check for lords */
- /*****************************************************************/
- check_lord()
- {
- char last_date[12];
- char string[80];
- FILE *fp;
-
- if (check_file("SPCEMP:EMPIRE.DAT")==TRUE)
- {
- fp=fopen("SPCEMP:EMPIRE.DAT","r");
- fgets(string,60,fp);
- sscanf(string,"%s",&last_date);
- fgets(string,60,fp);
- sscanf(string,"%d",&lord_count);
- fgets(string,60,fp);
- sscanf(string,"%d",&lord_days);
- fgets(string,80,fp);
- sscanf(string,"%s",&lord_name);
- fclose(fp);
- if((lord_count==1)&&(lord_days==uridium_turn))
- win_uridium();
- if((lord_count==1)&&(lord_days>0))
- if(lord_days==1)
- printf("\n%s is sitting at the uridium throne for his first day.\n",lord_name);
- else
- printf("\n%s is sitting at the uridium throne for his %d. day.\n",lord_name,lord_days);
- if(lord_count>1)
- printf("\nThere are %d lords fighting for the uridium throne.\n",lord_count);
-
- }
- }
- /*****************************************************************/
- /*Daily maintenance */
- /*****************************************************************/
- daily_maint()
- {
- int run_daily=0;
- char last_date[12];
- char today_date[12];
- char string[80];
- FILE *fp;
-
- if (check_file("SPCEMP:EMPIRE.DAT")==FALSE)
- run_daily=TRUE;
- else
- {
- fp=fopen("SPCEMP:EMPIRE.DAT","r");
- fgets(string,60,fp);
- sscanf(string,"%s",&last_date);
- fgets(string,60,fp);
- sscanf(string,"%d",&lord_count);
- fgets(string,60,fp);
- sscanf(string,"%d",&lord_days);
- fgets(string,60,fp);
- sscanf(string,"%s",&lord_name);
- fclose(fp);
- sscanf(date,"%s",&today_date);
- if(strcmp(last_date,today_date)!=0)
- run_daily=TRUE;
- }
- if (run_daily==TRUE)
- {
- printf("\nYou are the first player today. Please wait until daily maintenance finished.\n");
- if(check_file("SPCEMP:YESTERDAY.TXT")==TRUE)
- delete_file("SPCEMP:YESTERDAY.TXT");
- if(check_file("SPCEMP:NEWS.TXT")==TRUE)
- rename("SPCEMP:NEWS.TXT","SPCEMP:YESTERDAY.TXT");
- if(lottery_turn!=0)
- lottery_maint();
- if(check_file("SPCEMP:EMPIRE.DAT")==TRUE)
- delete_file("SPCEMP:EMPIRE.DAT");
- if(lord_count==1)
- lord_days++;
- else
- lord_days=0;
- fp=fopen("SPCEMP:EMPIRE.DAT","w");
- fprintf(fp,"%s\n",date);
- fprintf(fp,"%d\n",lord_count);
- fprintf(fp,"%d\n",lord_days);
- fprintf(fp,"%s\n",lord_name);
- fclose(fp);
-
- }
- }
-
- /*****************************************************************/
- misc_menu()
- {
- cls();
- printf("\n\nMISC-MENU\n");
- printf("--------------------------------------------------\n");
- printf(" 1) Commit Suicide\n");
- printf(" 2) Send Message to an other user\n");
- printf(" 3) Send Message to all other users\n");
- printf(" 4) Display News-File (today)\n");
- printf(" 5) Display News-File (yesterday)\n");
- printf(" 6) Display Private News-File\n");
- printf(" 7) Display own statistics \n");
- printf(" 8) Display Scores \n\n");
- printf(" 9) Game Information \n");
- printf("10) GameManager Options\n");
- printf("-------------------------------[0] for Mainmenu---\n\n");
- }
-
- /*****************************************************************/
- misc_stage()
- {
- char ostring[80];
- long n=0;
- FILE *fp;
- int busy=FALSE;
- unsigned long totplanets;
-
- totplanets=player[pn].orep+player[pn].foodp+player[pn].defensep+player[pn].tradep+player[pn].tourismp;
-
- misc_menu();
-
- do
- {
- printf("Which would you like to do ? [?] MiscMenu ");
- gets(ostring);
- if(strlen(ostring)<1)
- strcpy(ostring,"0");
- sscanf(ostring,"%d",&n);
- if(ostring[0]=='?')
- {
- misc_menu();
- n=255;
- }
- if((n>0)&&(n<11))
- {
- if((n==1)&&(totplanets<25)&&(player[pn].played_moves>39))
- {
- printf("\nAre you sure ???? [y/N] ");
- gets(ostring);
- ostring[0]=toupper(ostring[0]);
- if(ostring[0]!='Y')
- printf("");
- else
- {
- remove_player();
- sprintf(ostring,"SPCEMP_PLAYERS:%s.sdat",player[pn].player);
- delete(ostring);
- news(52,"");
- cls();
- printf("\n\nYour Player entry has been %sEXTERMINATED%s ... \n\n",ansi(TT_BLINKING),ansi(TT_RESET));
- printf("If you did not like this game, try to drink a PanGalactic-Gargelbluster (tm) !\n\n");
- printf(" BYE ");
- if(check_file("SPCEMP:BUSY.STATUS")==TRUE)
- delete_file("SPCEMP:BUSY.STATUS");
- fp = fopen("SPCEMP:BUSY.STATUS", "w");
- fprintf(fp,"%d\n",busy);
- fprintf(fp,"%s\n",player[pn].player);
- fclose(fp);
- exit(0);
- }
- }
- if((n==1)&&((totplanets>25)||(player[pn].played_moves<39)))
- printf("Suicide is not a very nice thing and is only allowed with 24 planets or less and \nat least 40 played moves.\n");
- if(n==2)
- {
- printf("\nWrite message to :");
- if(getplayer()==TRUE)
- {
- printf("\n Send a message to %s : (ONLY ONE LINE PLEASE !!)\n\n",player[epn].player);
- printf(" :");
- gets(ostring);
- ostring[70]='\0';
- player_msg(11,ostring);
- printf("\n Message sent to %s . \n\n",player[epn].player);
- }
- }
- if(n==3)
- {
- printf("\nWrite message to all users:");
- {
- printf("\n Send a message : (ONLY ONE LINE PLEASE !!)\n\n");
- printf(" :");
- gets(ostring);
- ostring[70]='\0';
- news(11,ostring);
- printf("\n Global Message sent. \n\n");
- }
- }
- if(n==4)
- {
- display_file("SPCEMP:NEWS.TXT",MORE);
- }
- if(n==5)
- {
- display_file("SPCEMP:YESTERDAY.TXT",MORE);
- }
- if(n==6)
- {
- sprintf(ostring,"SPCEMP_PLAYERS:MSG_%s.TXT",player[pn].player);
- display_file(ostring,MORE);
- }
- if(n==7)
- {
- show_stats(pn);
- }
- if(n==8)
- {
- points(1);
- display_users();
- }
- if(n==9)
- {
- cls();
- printf("VMS SPACE EMPIRE V %s (%s) (c) %sR.Sieber%s & %sN.Kuemin%s \n",version,reldate,ansi(TT_BOLD),ansi(TT_RESET),ansi(TT_BOLD),ansi(TT_RESET));
- printf("----------------------------------------------------------------------\n");
- printf(" Programm Information :\n\n");
- printf(" # of moves of new players : %d turns\n",new_moves);
- printf(" New player protection : %d turns\n",original_prot);
- printf(" Normal player (daily) : %d turns\n\n",old_moves);
- printf(" Money Transfer limit a day : %ld credits\n",max_transfer);
- printf(" Interest Rates : %f, %f, %f credits\n",zins1,zins2,zins3);
- if(lottery_turn!=0)
- printf("\n Lottery after %d days.\n",lottery_turn);
- else
- printf("\n No lottery configured\n");
- if(uridium_turn!=0)
- {
- printf("\n Win a place at the uridium throne with %d credits.\n",uridium_limit);
- printf(" Stay ALONE for %d days to win the game.\n",uridium_turn);
- }
- else
- printf("\n No uridium throne configured\n\n");
- printf("\n Program-Mode : ");
- if(multiuser==TRUE)
- printf("Multi-User");
- else
- if(multiuser==FALSE)
- printf("Single-User");
- else
- printf("unknown (%d)",multiuser);
- printf("\n");
- printf(" SuperSpace Empire (c)'93 by R.Sieber and N. Kuemin (it's SHAREWARE)\n");
- printf("----------------------------------------------------------------------\n\n");
- }
- if(n==10)
- {
- printf("ENTER CODE :");
- gets(ostring);
- if(strlen(ostring)<1)
- strcpy(ostring,"0");
- sscanf(ostring,"%d",&n);
- if (n==supervisor)
- game_mgr();
- }
- }
- } while (n!=0);
-
- printf("\n");
- }
-
- ----> END OF PART 5 <----
- --
- Internet: Dr_who@pegasus.ch __
- Phone : ++41-71-71 70 42 ///
- FAX : ++41-71-71 27 87 __ /// "I'M THE DOCTORE BECAUSE
- \\\/// IT'S FUN FUN FUN ! "
- BBS Phone: ++41-71-71 55 77 \XX/ - TOM BAKER
- X.25 : +228 4752 1 2574
-