/* **** ** **** **** ** ****** ** ** ** ** BZ-Source code... ** ** ** ** ** ** ** ** ** ** *** ***** **** **** **** ****** **** ** ** *** **** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **** ** ** ** **** *** ** ** ** ** ** ** ** ** ** ** ** *** ** ** ** **** **** **** ** **** Copyright (C) 1996-2001 Perttu Laine / SilverIce / KPN SilverIce / KPN productions... __ + __ __ + __ __ ( | | \ / / | | | / / \ | | \ / (-- |--' | ( (-- __) | | \/ \__ | \ | \__ \__ http://www.KAHVIPANNU.com SI-Robots sources. Use in the way you ever want... Check readme for full license information. Made for BBBS ver 4.00 and above. Author: Perttu Laine, pepe@kahvipannu.com License: You can do what ever you want with these sources, it would be nice that if you modify and spread them, you still include my copyrigths here. */ #define name "SI-Robots" #define ver "v1.3xp1" #define version "version 1.3 eXPerience-1" #define copyr "(C)opyright 2001 Perttu Laine / Silver Ice" int move,kor,x,y,vrrr,ps,ss,rx,ry,rtc,odota; int totrs,ll,rt,z,i,rtx,rty,ks,rsl,tx,ty,j,ttot; char endchoice; int clearscreen() { printf("\e[0;37;0m\e[1;1H\e[2J"); } int nextrandseed=1; int srand(int seed) { nextrandseed=seed; } int randomize() { srand(time()); } int rand() { return(((nextrandseed=nextrandseed*69069+5)>>16)&0x7fff); } int randomx() { return(rx=(rand()%35)+2); } int randomy() { return(ry=(rand()%20)+2); } int poistu() { clearscreen(); printf("%s %s\n%s\n",name,copyr,version); printf("NOTE: This is still in development.\n"); printf("NOTE: Report bugs, suggestions etc. to robots@kahvipannu.com\n\n\n"); printf("These major fixes are still needed:\n"); printf(" - Disable moving to the deadly point.\n"); printf(" (cannot move to left if you will killed then etc.)\n"); printf(" - Teleport bug fix. (now it does hang game sometimes.)\n\n"); exit(0); } int testaa_kelpaako(int t) { if (t==5&&ss<=0) return(2); if (t==0||t==5||t==10) return(1); if ((t==7)&&(x==2||y==2)) return(2); if (t==8&&y==2) return(2); if ((t==9)&&(x==36||y==2)) return(2); if (t==4&&x==2) return(2); if (t==6&&x==36) return(2); if ((t==1)&&(x==2||y==21)) return(2); if (t==2&&y==21) return(2); if ((t==3)&&(x==36||y==21)) return(2); int tmpy=y, tmpx=x; if (t==4) tmpx--; if (t==8) tmpy--; if (t==2) tmpy++; if (t==6) tmpx++; if (t==7) { tmpx--; tmpy--; } if (t==9) { tmpx++; tmpy--; } if (t==3) { tmpx++; tmpy++; } if (t==1) { tmpx--; tmpy++; } for(int f=1;f0) rtx[z]--; if((rtx[z]-x)<0) rtx[z]++; if((rty[z]-y)>0) rty[z]--; if((rty[z]-y)<0) rty[z]++; } } int placerts() { for(z=1;zhoftmp) return(1); return(0); } int pts() { char hoftmp, oma, t; int temppi; if ((int f=fopen("robots.pts","rt"))!=-1) { for (temppi=1;temppi<11;temppi++) { hoftmp[temppi]=fgets(f); t[temppi]=hoftmp[temppi]; } fclose(f); } else for (temppi=1;temppi<11;temppi++) hoftmp[temppi]="1;Mr. Smiley"; if (ps>0) { oma=sprintf("%u;%s",ps,bn_realname); if (parempi(oma,hoftmp[10])) { hoftmp[10]=oma; for (temppi=10;temppi>1;temppi--) { if (parempi(hoftmp[temppi],hoftmp[temppi-1])) { oma=hoftmp[temppi]; hoftmp[temppi]=hoftmp[temppi-1]; hoftmp[temppi-1]=oma; } } } } f=fopen("robots.pts","wt"); for (temppi=1;temppi<11;temppi++) fprintf(f,"%s\n",hoftmp[temppi]); fclose(f); f=fopen("robots.pts","rt"); char temp; char ppp=sprintf(" .-> %s - Hall Of Fame: <-' ",name); printf("%s\n",ppp); int gg; for (gg=1;gg<=strlen(ppp);gg++) printf("="); printf("\n"); for (int bar=1;bar<11;bar++) { temp[1]=fgets(f); temp[2]=copy(temp[1],1,pos(";",temp[1])-1); temp[3]=delete(temp[1],1,pos(";",temp[1])); printf("%02d: %-19s %-3s\n",bar,temp[3],temp[2]); } fclose(f); } int paintrts() { for(z=1;z<=rtc;z++) if(rtx[z]<50) printf("\e[%u;%uHo",rty[z],rtx[z]); } int checkrts() { for(z=1;z",name,ver); randomize(); clearscreen(); printf(" %s %s\n",name,version); printf(" %s\n\n",copyr); printf("+-------------------------- ---- --- -- - - - - -\n"); printf(" Robots is classic game from unix. You are smiley and you must try to avoid\n"); printf(" robots which are trying to eat you. You're lucky, because robots are little\n"); printf(" stupid. They're dead if two of them hits each other. And if they hit place \n"); printf(" where two robots have been dead.\n\n"); printf(" You can also use Spam which is tool that kills all robots which are \n"); printf(" currently touching you in some direction. But remember that you only have \n"); printf(" few Spams in every round. Use them wisely!\n\n"); printf(" Another device you can use is teleport. Teleport moves you into some random\n"); printf(" spot in the screen. Teleport just can sometimes move you just to the robots\n"); printf(" way and they can get you. So use teleport only when needed...\n\n"); printf(" Have a nice game!\n"); printf(" \nPress any key to continue.\n"); getch(); clearscreen(); printf(".%s",tex); for (viiva=1;viiva<=(35-(strlen(tex)));viiva++) printf("-"); printf(". Information:\e[0m\n"); for(kor=1;kor<21;++kor) printf("| |\n"); printf("`-----------------------------------'\n"); printf("\e[3;40HPoints:"); printf("\e[4;40HLevel:"); printf("\e[5;40HSpams:"); printf("\e[7;40HKeys:"); printf("\e[8;40HEnter teleport"); printf("\e[9;40HSpace or 0 stay ONE turn"); printf("\e[10;40H, or + stay until END of level"); printf("\e[11;40HS or 5 spam"); printf("\e[12;40HESC quit game"); printf("\e[14;40HMoving:"); printf("\e[15;40H7 8 9 Q W E"); printf("\e[16;40H \\ | / \\ | / "); printf("\e[17;40H4- * -6 or A- * -D"); printf("\e[18;40H / | \\ / | \\ "); printf("\e[19;40H1 2 3 Z X C"); rtc=6; ll=1; ks=2048; ps=0; do { vrrr=ttot=0; if (ps<2000) ss=1; if (ps>=2000 && ps<4000) ss=2; if (ps>=4000) ss=3; odota=1; ps=ps+((ll-1)*25); printf("\e[3;52H%u",ps); printf("\e[4;52H%u",ll); printf("\e[5;52H%u",ss); rsl=rtc=((ll*4)+2); ps(); placerts(); do { vrrr++; liikutus(); rtsmove(); checkrts(); paintrts(); } while(rsl>0); printf("\e[%u;%uH ",y,x); ll++; cleant(); printf("\e[20;42HPress any key to continue"); getch(); printf("\e[20;42H "); } while (bv_carrier); clearscreen(); }