xskat-4.0/0040755000076400001440000000000010054675046011042 5ustar ggusersxskat-4.0/bitmaps.c0100644000076400001440000000151307063510232012631 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define BITMAPS_C #include "bitmaps.h" #define static #include "icon.xbm" #include "symbs.xbm" #include "symbl.xbm" #undef static #include "cards.c" xskat-4.0/bitmaps.h0100644000076400001440000001073510051361103012634 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef BITMAPS_H #define BITMAPS_H #undef EXTERN #ifdef BITMAPS_C #define EXTERN #else #define EXTERN extern #endif #define icon_width 32 #define icon_height 32 extern unsigned char icon_bits[]; #define symbs_width 384 #define symbs_height 26 extern unsigned char symbs_bits[]; #define symbl_width 576 #define symbl_height 40 extern unsigned char symbl_bits[]; extern unsigned char back_gif[]; extern unsigned char heb_gif[]; extern unsigned char hed_gif[]; extern unsigned char hek_gif[]; extern unsigned char kab_gif[]; extern unsigned char kad_gif[]; extern unsigned char kak_gif[]; extern unsigned char krb_gif[]; extern unsigned char krd_gif[]; extern unsigned char krk_gif[]; extern unsigned char pib_gif[]; extern unsigned char pid_gif[]; extern unsigned char pik_gif[]; extern unsigned char e10_gif[]; extern unsigned char e7_gif[]; extern unsigned char e8_gif[]; extern unsigned char e9_gif[]; extern unsigned char ea_gif[]; extern unsigned char ek_gif[]; extern unsigned char eo_gif[]; extern unsigned char eu_gif[]; extern unsigned char g10_gif[]; extern unsigned char g7_gif[]; extern unsigned char g8_gif[]; extern unsigned char g9_gif[]; extern unsigned char ga_gif[]; extern unsigned char gk_gif[]; extern unsigned char go_gif[]; extern unsigned char gu_gif[]; extern unsigned char h10_gif[]; extern unsigned char h7_gif[]; extern unsigned char h8_gif[]; extern unsigned char h9_gif[]; extern unsigned char ha_gif[]; extern unsigned char hk_gif[]; extern unsigned char ho_gif[]; extern unsigned char hu_gif[]; extern unsigned char s10_gif[]; extern unsigned char s7_gif[]; extern unsigned char s8_gif[]; extern unsigned char s9_gif[]; extern unsigned char sa_gif[]; extern unsigned char sk_gif[]; extern unsigned char so_gif[]; extern unsigned char su_gif[]; EXTERN unsigned char *fr_gif[4][3] #ifdef BITMAPS_C = { {kak_gif,kad_gif,kab_gif}, {hek_gif,hed_gif,heb_gif}, {pik_gif,pid_gif,pib_gif}, {krk_gif,krd_gif,krb_gif} } #endif ; EXTERN unsigned char *de_gif[4][8] #ifdef BITMAPS_C = { {sa_gif,s10_gif,sk_gif,so_gif,su_gif,s9_gif,s8_gif,s7_gif}, {ha_gif,h10_gif,hk_gif,ho_gif,hu_gif,h9_gif,h8_gif,h7_gif}, {ga_gif,g10_gif,gk_gif,go_gif,gu_gif,g9_gif,g8_gif,g7_gif}, {ea_gif,e10_gif,ek_gif,eo_gif,eu_gif,e9_gif,e8_gif,e7_gif} } #endif ; EXTERN unsigned char *backsd_gif[1] #ifdef BITMAPS_C = { back_gif } #endif ; EXTERN unsigned char ggde_flg[4][8] #ifdef BITMAPS_C = { {1,0,0,0,0,1,1,1}, {1,0,0,0,0,1,1,1}, {1,1,0,0,0,1,1,1}, {1,1,0,0,0,1,1,1} } #endif ; EXTERN unsigned char de_flg[4][8] #ifdef BITMAPS_C = { {0,0,0,0,0,0,0,0}, {1,0,0,0,0,1,1,0}, {0,0,0,0,0,1,1,1}, {2,0,0,0,0,0,1,0} } #endif ; EXTERN struct { char *name; unsigned char **pos; } map_gif[45] #ifdef BITMAPS_C = { {"back",&backsd_gif[0]}, {"heb",&fr_gif[1][2]}, {"hed",&fr_gif[1][1]}, {"hek",&fr_gif[1][0]}, {"kab",&fr_gif[0][2]}, {"kad",&fr_gif[0][1]}, {"kak",&fr_gif[0][0]}, {"krb",&fr_gif[3][2]}, {"krd",&fr_gif[3][1]}, {"krk",&fr_gif[3][0]}, {"pib",&fr_gif[2][2]}, {"pid",&fr_gif[2][1]}, {"pik",&fr_gif[2][0]}, {"e10",&de_gif[3][1]}, {"e7",&de_gif[3][7]}, {"e8",&de_gif[3][6]}, {"e9",&de_gif[3][5]}, {"ea",&de_gif[3][0]}, {"ek",&de_gif[3][2]}, {"eo",&de_gif[3][3]}, {"eu",&de_gif[3][4]}, {"g10",&de_gif[2][1]}, {"g7",&de_gif[2][7]}, {"g8",&de_gif[2][6]}, {"g9",&de_gif[2][5]}, {"ga",&de_gif[2][0]}, {"gk",&de_gif[2][2]}, {"go",&de_gif[2][3]}, {"gu",&de_gif[2][4]}, {"h10",&de_gif[1][1]}, {"h7",&de_gif[1][7]}, {"h8",&de_gif[1][6]}, {"h9",&de_gif[1][5]}, {"ha",&de_gif[1][0]}, {"hk",&de_gif[1][2]}, {"ho",&de_gif[1][3]}, {"hu",&de_gif[1][4]}, {"s10",&de_gif[0][1]}, {"s7",&de_gif[0][7]}, {"s8",&de_gif[0][6]}, {"s9",&de_gif[0][5]}, {"sa",&de_gif[0][0]}, {"sk",&de_gif[0][2]}, {"so",&de_gif[0][3]}, {"su",&de_gif[0][4]} } #endif ; #endif /* BITMAPS_H */ xskat-4.0/Makefile0100644000076400001440000000321707061525214012475 0ustar ggusers # xskat - a card game for 1 to 3 players. # Copyright (C) 2000 Gunter Gerhardt # # This program is free software; you can redistribute it freely. # Use it at your own risk; there is NO WARRANTY. # # Redistribution of modified versions is permitted # provided that the following conditions are met: # 1. All copyright & permission notices are preserved. # 2.a) Only changes required for packaging or porting are made. # or # 2.b) It is clearly stated who last changed the program. # The program is renamed or # the version number is of the form x.y.z, # where x.y is the version of the original program # and z is an arbitrary suffix. CFLAGS = LDFLAGS = -L/usr/X11R6/lib -lX11 # perhaps you need one of: -lsocket -lnsl #DEFL = -DDEFAULT_LANGUAGE=\"german\" DEFL = -DDEFAULT_LANGUAGE=\"english\" DEFI = -DDEFAULT_IRC_SERVER=\"irc.fu-berlin.de\" SHELL = /bin/sh OBJECTS = skat.o ramsch.o null.o bitmaps.o xio.o xdial.o irc.o text.o xskat: $(OBJECTS) $(CC) $(OBJECTS) $(LDFLAGS) -o $@ clean: rm -f $(OBJECTS) xskat ckdef: @echo Checking defs.h;\ sed -n "1,/######/p" defs.h > defs;\ cat *.c|sed -n 's/^\([a-zA-Z].*\)(.*)/\1();/p' >> defs;\ diff defs defs.h || mv defs defs.h;\ rm -f defs text.o: text.c text.h defs.h $(CC) $(CFLAGS) $(DEFL) -c $< -o $@ irc.o: irc.c irc.h defs.h skat.h xio.h xdial.h text.h $(CC) $(CFLAGS) $(DEFI) -c $< -o $@ skat.o: skat.h defs.h text.h null.o: null.h defs.h skat.h ramsch.o: ramsch.h defs.h skat.h xio.o: xio.h defs.h skat.h bitmaps.h irc.h text.h xdial.o: xdial.h defs.h xio.h skat.h ramsch.h irc.h text.h bitmaps.o: bitmaps.h symbs.xbm symbl.xbm icon.xbm cards.c xskat-4.0/irc.c0100644000076400001440000007457610054655672012006 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define IRC_C #include #include #include #include #include #include #include #include "defs.h" #include "skat.h" #include "xio.h" #include "xdial.h" #include "text.h" #include "irc.h" VOID irc_log(s,in) char *s; int in; { static FILE *f; static int ini,nl; if (!irc_logfile) return; if (!ini) { f=strcmp(irc_logfile,"-")?fopen(irc_logfile,irc_logappend?"a":"w"):stdout; if (!f) { fprintf(stderr,"Can't write file %s\n",irc_logfile); irc_logfile=0; return; } ini=nl=1; } if (nl) { fputs(in?"<-":"->",f); nl=0; } fprintf(f,"%s",s); if (strchr(s,'\n')) { nl=1; fflush(f); } } VOID irc_out(s) char *s; { write(irc_o,s,strlen(s)); irc_log(s,0); } VOID irc_print(s) char *s; { unsigned char c; while ((c=*s++)) { if (c>=' ' || c=='\b' || c=='\t' || c=='\n' || c=='\r') { while (fputc(c,stderr)==EOF); } } fflush(stderr); } VOID irc_printnl(s) char *s; { irc_print(s); irc_print("\n"); } char *irc_getline() { static char buf[1024]; static int siz,rst; static ssize_t cnt; char *ptr; ptr=buf; if (rst) { while (cnt--) *ptr++=buf[++siz]; cnt=siz=ptr-buf; rst=0; ptr=buf; } if (cnt<=0) { ptr=buf+siz; cnt=read(irc_i,ptr,sizeof(buf)-siz); } if (cnt>0) { while (cnt && *ptr!='\n') cnt--,ptr++; siz=ptr-buf; if (cnt) { cnt--; *ptr=0; rst=1; if (*buf!=':' || !(ptr=strchr(buf,' ')) || strncmp(ptr+1,"322",3)) { irc_log(buf,1); irc_log("\n",1); } return buf; } if (siz==sizeof(buf)) { cnt=siz=0; } } return 0; } int irc_xinput(s,l) char *s; int l; { s[l]=0; switch (s[0]) { case '\r': if (!irc_inplen) return 0; s[0]='\n'; break; case '\b':case 127: if (irc_inplen) { strcpy(s,"\b \b"); } else { s[0]=l=0; } break; case ' ': case '\t': if (!irc_inplen) return 0; break; case 0x1B: return 0; } irc_print(s); if (s[0]=='\n') { irc_inpbuf[irc_inplen]=0; irc_talk(irc_inpbuf); irc_inplen=0; } else if (s[0]=='\b') { irc_inplen--; } else if (irc_inplen+l=100) idx[sn]=0; } VOID irc_sync(q) char *q; { int idx[3],n=0; sscanf(q,"%d,%d,%d\n",&idx[0],&idx[1],&idx[2]); while (idx[irc_pos]!=irc_histidx[irc_pos]) { irc_out("notice "); irc_out(irc_channel); irc_out(irc_history[irc_pos][idx[irc_pos]]); irc_incidx(idx,irc_pos); if (++n>3) { n=0; sleep(3); } } } VOID irc_sendsync(f) int f; { char buf[1024]; sprintf(buf,"notice %s :/sync%s %d,%d,%d\n", irc_channel, f?"":"ed",irc_histidx[0],irc_histidx[1],irc_histidx[2]); irc_out(buf); irc_tick=ticker; } VOID irc_checksync() { if (irc_state==IRC_PLAYING && ticker-irc_tick>(30+5*irc_pos)*1000 && !lost[0] && !lost[1] && !lost[2]) { irc_sendsync(1); } } VOID irc_alarm() { if (irc_bell) { XBell(dpy[0],100); XFlush(dpy[0]); } } VOID irc_talk(msg) char *msg; { static int ini,len; static char buf[1024],channel[1024],nick[IRC_NICK_LEN+1]; int i,c; char *p,plb[80]; irc_checksync(); irc_checkhist(); if (!ini) { if (fcntl(fileno(stdin),F_SETFL, fcntl(fileno(stdin),F_GETFL)|O_NONBLOCK)<0) { fprintf(stderr,"Fcntl stdin failed\n"); exitus(1); } ini=1; } while (msg || (c=getchar())!=EOF) { if (msg) { len=strlen(msg); c='\n'; p=msg; } else p=buf; if (len>=sizeof(buf)) len=0; if (c=='\n') { if (len) { buf[len]=0; if (irc_match("/join ",&p)) { irc_out("privmsg "); irc_out(irc_channel); irc_out(" :--> "); irc_out(p); irc_out("\n"); irc_out("part "); irc_out(irc_channel); irc_out("\n"); strcpy(channel,p); irc_channel=channel; irc_out("join "); irc_out(irc_channel); irc_out("\n"); } else if (irc_match("/who",&p)) { irc_out("who "); irc_out(irc_channel); irc_out("\n"); } else if (irc_match("/list",&p)) { if (*p==' ') { strncpy(irc_substr,p+1,sizeof(irc_substr)-1); } else { strcpy(irc_substr,"xskat"); } irc_out("list\n"); } else if (irc_match("/sync",&p)) { irc_sendsync(1); } else if (irc_match("/bell",&p)) { irc_bell^=1; irc_alarm(); } else if (irc_match("/nick",&p)) { if (*p++==' ') { strncpy(nick,p,IRC_NICK_LEN); nick[IRC_NICK_LEN]=0; irc_sendnick(nick); } else { irc_printnl(irc_nick); } } else if (irc_match("/pos ",&p)) { if (irc_state==IRC_TALK) { irc_pos=atoi(p); irc_pos--; if (irc_pos<0 || irc_pos>2) irc_pos=-1; irc_pr_sd(textarr[TX_POSITION].t[lang[0]],irc_pos+1); } } else if (irc_match("/ramsch ",&p)) { if (irc_state==IRC_TALK) { playramsch=atoi(p); if (playramsch<0) playramsch=0; else if (playramsch>2) playramsch=2; irc_pr_ramsch(playramsch); } } else if (irc_match("/sramsch ",&p)) { if (irc_state==IRC_TALK) { playsramsch=istrue(p); irc_pr_sramsch(playsramsch); } } else if (irc_match("/skattoloser ",&p)) { if (irc_state==IRC_TALK) { rskatloser=istrue(p); irc_pr_rskatloser(rskatloser); } } else if (irc_match("/kontra ",&p)) { if (irc_state==IRC_TALK) { playkontra=atoi(p); if (playkontra<0) playkontra=0; else if (playkontra>2) playkontra=2; irc_pr_kontra(playkontra); } } else if (irc_match("/bock ",&p)) { if (irc_state==IRC_TALK) { playbock=atoi(p); if (playbock<0) playbock=0; else if (playbock>2) playbock=2; irc_pr_bock(playbock); } } else if (irc_match("/resumebock ",&p)) { if (irc_state==IRC_TALK) { resumebock=istrue(p); irc_pr_resumebock(resumebock); } } else if (irc_match("/spitze ",&p)) { if (irc_state==IRC_TALK) { spitzezaehlt=atoi(p); if (spitzezaehlt<0) spitzezaehlt=0; else if (spitzezaehlt>2) spitzezaehlt=2; irc_pr_spitze(spitzezaehlt); } } else if (irc_match("/revolution ",&p)) { if (irc_state==IRC_TALK) { revolution=istrue(p); irc_pr_revolution(revolution); } } else if (irc_match("/klopfen ",&p)) { if (irc_state==IRC_TALK) { klopfen=istrue(p); irc_pr_klopfen(klopfen); } } else if (irc_match("/schenken ",&p)) { if (irc_state==IRC_TALK) { schenken=istrue(p); irc_pr_schenken(schenken); } } else if (irc_match("/oldrules ",&p)) { if (irc_state==IRC_TALK) { oldrules=istrue(p); irc_pr_oldrules(oldrules); } } else if (irc_match("/bockevents ",&p)) { if (irc_state==IRC_TALK) { bockevents=atoi(p); irc_pr_bockevents(bockevents); } } else if (irc_match("/alist ",&p)) { if (irc_state==IRC_TALK) { alist[0]=istrue(p); irc_pr_alist(alist[0]); } } else if (irc_match("/tlist ",&p)) { if (irc_state==IRC_TALK) { alist[0]=istrue(p)?2:0; irc_pr_alist(alist[0]); } } else if (irc_match("/start ",&p)) { if (irc_state==IRC_TALK) { geber=atoi(p); if (geber<1 || geber>3) geber=0; else geber=left(geber); irc_pr_start(geber); } } else if (irc_match("/s1 ",&p)) { if (irc_state==IRC_TALK) { strateg[0]=atoi(p); if (strateg[0]<-4) strateg[0]=-4; else if (strateg[0]>0) strateg[0]=0; irc_pr_s1(strateg[0]); } } else if (irc_match("/default",&p)) { if (irc_state==IRC_TALK) { playramsch=playsramsch=playkontra=playbock=resumebock=0; spitzezaehlt=revolution=klopfen=schenken=bockevents=oldrules=0; rskatloser=0; irc_printnl(textarr[TX_OFFIZIELLE_REGELN].t[lang[0]]); } } else if (irc_match("/rules",&p)) { if (irc_state==IRC_TALK) { irc_showrules(playramsch,playsramsch,playkontra,playbock, resumebock,spitzezaehlt,revolution,klopfen, schenken,bockevents,geber,alist[0],strateg[0], oldrules,rskatloser); irc_sendrules(); } } else if (irc_match("/go",&p)) { if (irc_state==IRC_TALK || irc_state==IRC_SERVER) { if (!strcmp(irc_channel,"#xskat")) { irc_printnl(textarr[TX_NICHT_HIER].t[lang[0]]); } else { irc_clients=0; irc_2player=*p=='2'; irc_out("notice "); irc_out(irc_channel); irc_out(" :/server "); irc_out(textarr[TX_XSKAT].t[lang[0]]); irc_out("\n"); sprintf(plb,textarr[TX_WARTEN_AUF_SPIELER_N].t[lang[0]],2); irc_printnl(plb); irc_state=IRC_SERVER; } } } else if (irc_match("/quote ",&p)) { irc_out(p); irc_out("\n"); } else if (irc_match("/help",&p)) { for (i=TX_IRC_HELP01;i<=TX_IRC_HELPXX;i++) { irc_printnl(textarr[i].t[lang[0]]); } } else if (irc_match("/quit",&p)) { exitus(1); } else if (*p=='/') { irc_printnl(textarr[TX_UNBEKANNTES_KOMMANDO].t[lang[0]]); } else { if (!strcmp(p,"go") || !strcmp(p,"go2")) { sprintf(plb,textarr[TX_SOLLTE_DAS_GO_X_SEIN].t[lang[0]],p+2); irc_printnl(plb); } else { irc_out("privmsg "); irc_out(irc_channel); irc_out(" :"); irc_out(p); irc_out("\n"); } } len=0; } } else { buf[len++]=c; } msg=0; } } char *irc_copyname(t,f) char *t,*f; { char *p; p=strchr(f,'~'); *p=0; strcpy(t,f); return p+1; } int irc_senderok(s) char *s; { switch (irc_pos) { case 0:return !strcmp(irc_conf[1].nick,s)?2: !irc_2player && !strcmp(irc_conf[2].nick,s)?3:0; case 1:return !strcmp(irc_conf[0].nick,s)?1: !irc_2player && !strcmp(irc_conf[2].nick,s)?3:0; default:return !strcmp(irc_conf[0].nick,s)?1: !strcmp(irc_conf[1].nick,s)?2:0; } } VOID irc_histsave(sn,s) int sn; char *s; { irc_out(s); s=strchr(strchr(s,' ')+1,' '); if (irc_history[sn][irc_histidx[sn]]) { free(irc_history[sn][irc_histidx[sn]]); } if (!(irc_history[sn][irc_histidx[sn]]=(char *)malloc(strlen(s)+1))) { nomem(); } strcpy(irc_history[sn][irc_histidx[sn]],s); irc_incidx(irc_histidx,sn); } VOID irc_sendbtev(sn,bt) int sn,bt; { char buf[1024]; sprintf(buf,"notice %s :/cmd%02dbt %d\n", irc_channel,irc_histidx[sn],bt); irc_histsave(sn,buf); } VOID irc_sendxyev(sn,x,y,opt) int sn,x,y,opt; { char buf[1024]; sprintf(buf,"notice %s :/cmd%02dxy %d,%d,%d\n", irc_channel,irc_histidx[sn],x,y,opt); irc_histsave(sn,buf); } VOID irc_sendsort(sn) int sn; { char buf[1024]; sprintf(buf,"notice %s :/cmd%02dso %d,%d,%d\n", irc_channel,irc_histidx[sn], sort1[sn],sort2[sn],alternate[sn]); irc_histsave(sn,buf); } VOID irc_sendschenken(sn) int sn; { char buf[1024]; sprintf(buf,"notice %s :/cmd%02dsc\n", irc_channel,irc_histidx[sn]); irc_histsave(sn,buf); } VOID irc_sendloeschen(sn) int sn; { char buf[1024]; sprintf(buf,"notice %s :/cmd%02dcl\n", irc_channel,irc_histidx[sn]); irc_histsave(sn,buf); } VOID irc_addcmd(sn,idx,p) int sn,idx; char *p; { if (irc_history[sn][idx]) free(irc_history[sn][idx]); else irc_histcnt[sn]++; if (!(irc_history[sn][idx]=(char *)malloc(strlen(p)+1))) nomem(); strcpy(irc_history[sn][idx],p); } int irc_getcmd(sn,fh,q) int sn,fh; char *q; { int idx,bt,x,y,opt,s1,s2,a,ok; char *p=q; ok=0; sscanf(q,"%d",&idx); q+=2; if (idx!=irc_histidx[sn]) { if (irc_histidx[sn]-idx+(idx>irc_histidx[sn]?100:0)>50) { if (!irc_histcnt[sn]) irc_sendsync(1); else irc_addcmd(sn,idx,p); } return ok; } if (irc_match("bt ",&q)) { sscanf(q,"%d\n",&bt); if (actdial[sn]) { irc_incidx(irc_histidx,sn); hndl_btevent(sn,bt); ok=1; } } else if (irc_match("xy ",&q)) { sscanf(q,"%d,%d,%d\n",&x,&y,&opt); if (hndl_button(sn,x,y,opt,0)) { irc_incidx(irc_histidx,sn); ok=1; } } else if (irc_match("so ",&q)) { sscanf(q,"%d,%d,%d\n",&s1,&s2,&a); irc_incidx(irc_histidx,sn); ok=1; sort1[sn]=s1; sort2[sn]=s2; alternate[sn]=a; initscr(sn,1); } else if (irc_match("sc",&q)) { irc_incidx(irc_histidx,sn); ok=1; di_schenken(sn); } else if (irc_match("cl",&q)) { irc_incidx(irc_histidx,sn); ok=1; setsum(1); save_list(); } if (!ok && !fh) irc_addcmd(sn,idx,p); return ok; } VOID irc_checkhist() { int ok,sn,idx; do { ok=0; for (sn=0;sn=0;i--) { if (irc_conf[0].pos==i) irc_conf[i]=irc_conf[0]; else if (!irc_2player && irc_conf[1].pos==i) irc_conf[i]=irc_conf[1]; } i=irc_pos; strcpy(irc_conf[i].nick,irc_nick); irc_conf[i].sort1=sort1[0]; irc_conf[i].alternate=alternate[0]; irc_conf[i].large=desk[0].large; irc_conf[i].nimmstich=nimmstich[0][0]; irc_conf[i].abkuerz=abkuerz[0]; strcpy(irc_conf[i].spnames[0],spnames[0][0][0]); strcpy(irc_conf[i].spnames[1],spnames[0][1][0]); for (i=0;i "); irc_printnl(q); if (irc_inplen) { irc_inpbuf[irc_inplen]=0; irc_print(irc_inpbuf); } } VOID irc_parse(s) char *s; { char *p,*q,nick[IRC_NICK_LEN+1]; char plb[80]; int i,sn,nickerr,colon; static int ini; static char mynick[IRC_NICK_LEN+1]; nickerr=0; colon=*s==':'; if (colon) { s++; strncpy(nick,s,IRC_NICK_LEN); nick[IRC_NICK_LEN]=0; for (i=0,p=s;i"); irc_getrules(q); } } else { irc_msg(nick,q); } } else if (q && irc_match("PRIVMSG",&p)) { irc_msg(nick,q); } else if (irc_match("JOIN",&p)) { if (!strncmp(irc_nick,nick,9) && !ini) { strcpy(mynick,nick); irc_nick=mynick; irc_out("mode "); irc_out(irc_nick); irc_out(" +i\n"); for (i=TX_IRC_INTRO1;i<=TX_IRC_INTROX;i++) { irc_printnl(textarr[i].t[lang[0]]); } ini=1; } else { irc_alarm(); irc_printnl(s); } } else if (irc_match("NICK ",&p)) { irc_printnl(s); irc_nickchanged(nick,p); } else if (irc_match("QUIT",&p)) { if (irc_state==IRC_PLAYING && (sn=irc_senderok(nick)) && !lost[0] && !lost[1] && !lost[2]) { lost[sn-1]=1; finish(sn-1,0); } } else if (irc_match("432",&p) || irc_match("433",&p)) { nickerr=1; irc_printnl(s); if (irc_state==IRC_OFFLINE) irc_changenick(1); } else if (irc_match("322",&p)) { if ((p=strchr(p+1,' ')) && (!irc_substr[0] || strstr(p,irc_substr))) { p++; if (*p==':') p++; irc_printnl(p); irc_log(s-1,1); irc_log("\n",1); } } else if (*p>='0' && *p<='9') { if ((p=strchr(p,' ')) && (p=strchr(p+1,' '))) { p++; if (*p==':') p++; irc_printnl(p); } } else { irc_printnl(s); } } else { irc_printnl(s); } } else if (irc_match("PING",&s)) { p=strchr(s,':'); if (p) { irc_out("PONG "); irc_out(p+1); irc_out("\n"); } } else if (p=s,irc_match("Connection closed",&s)) { irc_printnl(p); exitus(1); } else { irc_printnl(s); } if (irc_state==IRC_OFFLINE && colon && !nickerr) { irc_out("join "); irc_out(irc_channel); irc_out("\n"); irc_state=IRC_TALK; } } VOID irc_connect() { int pipe1fd[2]; int pipe2fd[2]; char buf[20]; #ifdef SIGTSTP signal(SIGTSTP,SIG_IGN); #endif pipe(pipe1fd); pipe(pipe2fd); if (fcntl(pipe1fd[0],F_SETFL, fcntl(pipe1fd[0],F_GETFL)|O_NONBLOCK)<0) { fprintf(stderr,"Fcntl pipe failed\n"); exitus(1); } if ((irc_telnetpid=fork())<0) { fprintf(stderr,"Fork failed\n"); exitus(1); } if (!irc_telnetpid) { if (dup2(pipe2fd[0],fileno(stdin))<0 || dup2(pipe1fd[1],fileno(stdout))<0 || dup2(fileno(stdout),fileno(stderr))<0) { fprintf(stderr,"Dup failed\n"); exitus(1); } close(pipe1fd[0]); close(pipe1fd[1]); close(pipe2fd[0]); close(pipe2fd[1]); sprintf(buf,"%d",irc_port); execlp(irc_telnet,irc_telnet,irc_hostname,buf,NULL); fprintf(stderr,"Exec '%s' failed\n",irc_telnet); exitus(1); } close(pipe1fd[1]); close(pipe2fd[0]); irc_i=pipe1fd[0]; irc_o=pipe2fd[1]; } VOID irc_init() { char *l; irc_state=IRC_OFFLINE; xinitplayers(); irc_connect(); irc_checknick(); irc_print("*** "); irc_print(textarr[TX_XSKAT].t[lang[0]]); irc_printnl(" ***"); irc_printnl(textarr[TX_README_IRC].t[lang[0]]); irc_print("Login "); irc_print(irc_user); irc_print(","); irc_print(irc_nick); irc_print(","); irc_printnl(irc_realname); irc_out("user "); irc_out(irc_user); irc_out(" xskat xskat :"); irc_out(irc_realname); irc_out("\n"); irc_sendnick(irc_nick); for (;;) { while ((l=irc_getline())) { irc_parse(l); if (irc_state==IRC_PLAYING) { irc_tick=ticker; return; } } irc_talk((char *)0); waitt(100,0); } } xskat-4.0/irc.h0100644000076400001440000000316507063510330011760 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef IRC_H #define IRC_H #include #undef EXTERN #ifdef IRC_C #define EXTERN #else #define EXTERN extern #endif #define IRC_NICK_LEN 30 enum { IRC_OFFLINE, IRC_TALK, IRC_SERVER, IRC_PLAYING }; EXTERN pid_t irc_telnetpid; EXTERN int irc_i,irc_o; EXTERN int irc_state,irc_clients; EXTERN int irc_play; EXTERN int irc_2player,irc_pos; EXTERN int irc_port; EXTERN int irc_bell; EXTERN int irc_logappend; EXTERN int irc_histidx[3],irc_histcnt[3]; EXTERN int irc_inplen; EXTERN long irc_tick; EXTERN char *irc_telnet,*irc_host,*irc_channel; EXTERN char *irc_nick,*irc_user,*irc_realname; EXTERN char *irc_logfile; EXTERN char *irc_history[3][100]; EXTERN char irc_substr[100]; EXTERN char irc_inpbuf[1024]; EXTERN struct { char nick[IRC_NICK_LEN+1]; int sort1,alternate,large; int nimmstich,pos,abkuerz; char spnames[2][10]; } irc_conf[3]; EXTERN char irc_defaulthost[] #ifdef IRC_C =DEFAULT_IRC_SERVER #endif ; #endif /* IRC_H */ xskat-4.0/README-de0100644000076400001440000000144010045741556012304 0ustar ggusers XSkat ermöglicht es, das Kartenspiel Skat entsprechend der offiziellen Skatordnung zu spielen. Bis zu 3 Spieler können vom Computer simuliert werden. Dieses Programm ist freie Software; es kann frei verbreitet werden. Verwendung auf eigenes Risiko; es gibt KEINE GARANTIE. Die Weitergabe veränderter Versionen ist erlaubt, solange die folgenden Bedingungen eingehalten werden: 1. Alle Angaben zu Copyright & Bedingungen bleiben erhalten. 2.a) Nur Änderungen zwecks Paketierung oder Portierung werden gemacht. oder 2.b) Es wird deutlich gekennzeichnet, wer das Programm geändert hat. Das Programm wird umbenannt oder die Versionsnummer hat die Form x.y.z, wobei x.y die Version des originalen Programms ist und z ein beliebiger Zusatz. Gunter Gerhardt (http://www.xskat.de) xskat-4.0/xio.c0100644000076400001440000024546410054665146012021 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define XIO_C #include #include #include #include #include #include #include #include #include #ifdef __EMX__ /* XFree OS/2 */ #include #endif #include #include #include #include #include #include #include "defs.h" #include "skat.h" #include "bitmaps.h" #include "xio.h" #include "irc.h" #include "text.h" VOID change_gc(sn,fg,gcp) int sn; unsigned long fg; GC *gcp; { XGCValues gcv; gcv.foreground=fg; XChangeGC(dpy[sn],gcp[sn],GCForeground,&gcv); } VOID change_gcbg(sn,bg,gcp) int sn; unsigned long bg; GC *gcp; { XGCValues gcv; gcv.background=bg; XChangeGC(dpy[sn],gcp[sn],GCBackground,&gcv); } VOID change_gcxor(sn,fg) int sn; unsigned long fg; { change_gc(sn,fg^bgpix[sn],gcxor); } int istrue(s) char *s; { char h[5]; int i; for (i=0;i<4 && *s;i++,s++) { h[i]=tolower(*s); } h[i]=0; return h[0]=='0'?0:h[0]=='1'?1:!strcmp(h,"true"); } VOID v_gtextnc(sn,n,c,x,y,w,t) int sn,n,c,x,y,w; char *t; { int l; l=strlen(t); if (n) x+=(w-XTextWidth(dfont[sn],t,l))/2; y+=(charh[sn]+dfont[sn]->ascent-dfont[sn]->descent)/2+1-gfx3d[sn]; if (c) { change_gcbg(sn,btpix[sn],gc); } XDrawImageString(dpy[sn],win[sn],gc[sn],x,y,t,l); XDrawImageString(dpy[sn],bck[sn],gc[sn],x,y,t,l); if (c) { change_gcbg(sn,bgpix[sn],gc); } } VOID v_gtextc(sn,c,x,y,w,t) int sn,c,x,y,w; char *t; { v_gtextnc(sn,1,c,x,y,w,t); } VOID v_gtext(sn,x,y,w,t) int sn,x,y,w; char *t; { v_gtextc(sn,0,x,y,w,t); } VOID clr_text(sn,x,y) int sn,x,y; { x+=4; y++; change_gc(sn,btpix[sn],gc); XFillRectangle(dpy[sn],win[sn],gc[sn],x,y, 64*desk[sn].f/desk[sn].q-8,charh[sn]-2); XFillRectangle(dpy[sn],bck[sn],gc[sn],x,y, 64*desk[sn].f/desk[sn].q-8,charh[sn]-2); change_gc(sn,fgpix[sn],gc); } VOID b_text(s,str) int s; tx_typ *str; { int sn,x; for (sn=0;snt[lang[sn]]); } } } VOID do_msaho(sn,str) int sn; char *str; { clr_text(sn,desk[sn].pboxx,desk[sn].pboxy); v_gtextc(sn,1,desk[sn].pboxx,desk[sn].pboxy,desk[sn].cardw,str); clr_text(sn,desk[sn].pboxx+desk[sn].cardw,desk[sn].pboxy); v_gtextc(sn,1,desk[sn].pboxx+desk[sn].cardw,desk[sn].pboxy,desk[sn].cardw, textarr[TX_PASSE].t[lang[sn]]); } VOID draw_skat(sn) int sn; { putcard(sn,cards[30],desk[sn].skatx,desk[sn].skaty); putcard(sn,cards[31],desk[sn].skatx+desk[sn].cardw, desk[sn].skaty); skatopen=1; } VOID home_skat() { int sn=spieler; homecard(sn,0,0); homecard(sn,0,1); umdrueck=skatopen=0; backopen[0]=backopen[1]=backopen[2]=1; spitzeopen=1; } VOID nimm_stich() { int sn=ausspl,i; for (i=0;i<3;i++) { homecard(sn,1,i); } stichopen=0; } VOID drop_card(i,s) int i,s; { int sn,sna[3],x1[3],y1[3],x2[3],y2[3]; static int l2r[3]; if (stich==10) backopen[s]=0; for (sn=0;sn>3]++; cards[i]=-1; stdwait(); } int query_err(d,e) Display *d; XErrorEvent *e; { colerr=1; return 0; } int closest_col(sn,xcol) int sn; XColor *xcol; { static int f[3]; static XColor xcm[3][256]; int i,j,k,pl; long r,g,b; int ps[9],sp; if (XAllocColor(dpy[sn],cmap[sn],xcol)) return 1; pl=desk[sn].plan; if (pl<2 || pl>8 || wpix[sn]>=1<=1<red; g=xcol->green; b=xcol->blue; for (sp=0;sp<(1<red=xcm[sn][j].red; xcol->green=xcm[sn][j].green; xcol->blue=xcm[sn][j].blue; if (XAllocColor(dpy[sn],cmap[sn],xcol)) return 1; ps[sp]=j; } return 0; } unsigned long get_col(sn,ucol,prog,col,defcol,defpix,xcol) int sn; char *ucol,*prog,*col,*defcol; unsigned long defpix; XColor *xcol; { char *spec; spec=XGetDefault(dpy[sn],prog,col); if ((ucol && XParseColor(dpy[sn],cmap[sn],ucol,xcol) && closest_col(sn,xcol)) || (spec && XParseColor(dpy[sn],cmap[sn],spec,xcol) && closest_col(sn,xcol)) || (defcol && XParseColor(dpy[sn],cmap[sn],defcol,xcol) && closest_col(sn,xcol))) { if (desk[sn].col>2) { color[sn][desk[sn].col++]=*xcol; } return xcol->pixel; } xcol->pixel=defpix; XQueryColor(dpy[sn],cmap[sn],xcol); return defpix; } VOID calc_desk(sn) int sn; { desk[sn].x=0; desk[sn].y=0; desk[sn].cardw=desk[sn].large?96:64; desk[sn].cardh=desk[sn].large?141:94; desk[sn].f=desk[sn].large?3:1; desk[sn].q=desk[sn].large?2:1; desk[sn].w=10*desk[sn].cardw; desk[sn].h=desk[sn].large?600:400; desk[sn].com1x=desk[sn].x+desk[sn].cardw; desk[sn].com2x=desk[sn].x+desk[sn].w-2*desk[sn].cardw; desk[sn].com1y=desk[sn].com2y=desk[sn].y+3; if (ouveang && sn!=spieler) { if (spieler==left(sn)) { desk[sn].com2y+=desk[sn].cardh+11*desk[sn].f/desk[sn].q; } else { desk[sn].com1y+=desk[sn].cardh+11*desk[sn].f/desk[sn].q; } } desk[sn].cardx=(desk[sn].w-desk[sn].cardw)/9; desk[sn].playx=desk[sn].x+(desk[sn].w-desk[sn].cardw-9*desk[sn].cardx)/2; desk[sn].playy=desk[sn].y+desk[sn].h-desk[sn].cardh-2; desk[sn].skatx=desk[sn].x+(desk[sn].w-2*desk[sn].cardw)/2; desk[sn].skaty=desk[sn].y+desk[sn].cardh+51*desk[sn].f/desk[sn].q; desk[sn].stichx=desk[sn].x+(desk[sn].w-3*desk[sn].cardw)/2; desk[sn].stichy=desk[sn].skaty; desk[sn].cbox1x=desk[sn].com1x; desk[sn].cbox2x=desk[sn].com2x; desk[sn].cboxy=desk[sn].com1y+desk[sn].cardh+11*desk[sn].f/desk[sn].q; desk[sn].pboxx=desk[sn].skatx; desk[sn].pboxy=desk[sn].skaty+desk[sn].cardh+13*desk[sn].f/desk[sn].q; } VOID extractnam(sn,str) int sn; char *str; { int ln; for (ln=0;lnpw_name) fputs(pwd->pw_name,f); if (pwd->pw_gecos) fprintf(f,"(%s)",pwd->pw_gecos); } if (!uname(&uts)) { fprintf(f,"@%s",uts.nodename); #ifndef __hpux fprintf(f,".%s",uts.domainname); #endif fprintf(f,"(%s",uts.sysname); fprintf(f,",%s)",uts.machine); } fputc('\n',f); fclose(f); } #endif } int getcode(bpos,csiz,msk,thegif) int *bpos,csiz,msk; unsigned char *thegif; { int pos; long c; pos=*bpos>>3; c=thegif[pos]+(thegif[pos+1]<<8); if (csiz>=8) c+=(long)thegif[pos+2]<<16; c>>=*bpos&7; *bpos+=csiz; return c&msk; } VOID decompgif(thedata,thepic,themap,cmapsize) unsigned char *thedata,*thepic,**themap; int *cmapsize; { unsigned char b,*p; int i,bpos,cnt,csiz,isiz,cd,mc,cc,ec; int ac,pc,ic,ff,fc,lc,bmsk,msk; static int a[4096],e[4096],c[4097]; static unsigned char thegif[138*88]; bpos=cnt=pc=lc=0; thedata+=10; *cmapsize=1<<((*thedata++&7)+1); bmsk=*cmapsize-1; thedata+=2; *themap=thedata; thedata+=*cmapsize*3+10; ec=(cc=1<<(csiz=*thedata++))+1; fc=ff=cc+2; isiz=++csiz; msk=(mc=1<=fc) { ac=pc; c[cnt++]=lc; } while (ac>bmsk) { c[cnt++]=e[ac]; ac=a[ac]; } c[cnt]=lc=ac&bmsk; for (i=cnt;i>=0;i--) *thepic++=c[i]; cnt=0; a[fc]=pc; e[fc++]=lc; pc=ic; if (fc>=mc && csiz<12) { msk=(1<<++csiz)-1; mc<<=1; } } cd=getcode(&bpos,csiz,msk,thegif); } } VOID drawimg(sn,c,f,w,x,y) int sn,c,f,w,x,y; { long i,j,k; int l,p,r,g,b,m,s,gr,tc,idx,ld,pd,an; static unsigned char thepic[138][88]; static int fsdbuf[2][138][3]; static int smlbuf[138][3]; static int smcbuf[138][3]; static XPoint xp[256][32]; unsigned long pm[256]; static int pc[16][16][16]; unsigned char (*themap)[256][3]; int xn[256]; XColor xc,*xcp; int cmapsize; decompgif(f<0?backsd_gif[0]:blatt[sn]>=2?de_gif[f][w]:fr_gif[f][w], (unsigned char *)thepic,(unsigned char **)&themap,&cmapsize); tc=desk[sn].plan>=12 && desk[sn].col>2 && desk[sn].large; xcp=&color[sn][0]; if (!tc) { for (i=0;i<=0xffff;i+=0x1111) { for (j=0;j<=0xffff;j+=0x1111) { for (k=0;k<=0xffff;k+=0x1111) { l=0; ld=abs(xcp[l].red-i)+abs(xcp[l].green-j)+abs(xcp[l].blue-k); for (p=1;p220 && xc.green<100 && xc.blue<100) { if (xc.blue<50) xc.blue=50; xc.green+=xc.blue+50; xc.blue=0; } if (xc.red==255 && xc.green==255 && xc.blue==255) { pm[i]=wpix[sn]; } else { xc.red<<=8; xc.green<<=8; xc.blue<<=8; pm[i]=closest_col(sn,&xc)?xc.pixel:bpix[sn]; } } } if (f<0 || blatt[sn]<2) { gr=f<0; m=0; } else { if (ggcards) { gr=ggde_flg[f][w]>>1; m=ggde_flg[f][w]&1; } else { gr=de_flg[f][w]>>1; m=de_flg[f][w]&1; } } idx=0; for (j=0;j<138;j++) { fsdbuf[idx][j][0]=fsdbuf[idx][j][1]=fsdbuf[idx][j][2]=0; smlbuf[j][0]=-1; smcbuf[j][0]=-1; } idx=1-idx; for (i=(desk[sn].large?87:86+(f<0));i>=0;i--) { s=f<0 && i>43?1:2; k=!i && m?desk[sn].large?88:58:0; if (!desk[sn].large && !((i+s)%3)) { for (j=(gr?137:68);j>=0;j--) { p=thepic[j][i]; smlbuf[j][0]=(*themap)[p][0]; smlbuf[j][1]=(*themap)[p][1]; smlbuf[j][2]=(*themap)[p][2]; } continue; } for (j=0;j<138;j++) { fsdbuf[idx][j][0]=fsdbuf[idx][j][1]=fsdbuf[idx][j][2]=0; } idx=1-idx; for (j=(gr?137:68);j>=0;j--) { p=thepic[j][i]; if (!desk[sn].large && !((j+2)%3)) { if (j) { smcbuf[j-1][0]=(*themap)[p][0]; smcbuf[j-1][1]=(*themap)[p][1]; smcbuf[j-1][2]=(*themap)[p][2]; fsdbuf[idx][j-1][0]+=fsdbuf[idx][j][0]; fsdbuf[idx][j-1][1]+=fsdbuf[idx][j][1]; fsdbuf[idx][j-1][2]+=fsdbuf[idx][j][2]; } continue; } if (!tc) { r=(*themap)[p][0]; g=(*themap)[p][1]; b=(*themap)[p][2]; an=1; if (smlbuf[j][0]>=0) { r+=smlbuf[j][0]; g+=smlbuf[j][1]; b+=smlbuf[j][2]; smlbuf[j][0]=-1; an++; } if (smcbuf[j][0]>=0) { r+=smcbuf[j][0]; g+=smcbuf[j][1]; b+=smcbuf[j][2]; smcbuf[j][0]=-1; an++; } if (an>1) { r/=an; g/=an; b/=an; } if (blatt[sn]==3 && f==3 && r>220 && g<100 && b<100) { if (b<50) b=50; g+=b+50; b=0; } if (r==255 && g==255 && b==255) { p=desk[sn].col; r=g=b=0; } else { if (desk[sn].col<=2) { if (r>=127) r=r*19/16; if (g>=127) g=g*19/16; if (b>=127) b=b*19/16; } r+=fsdbuf[idx][j][0]; if (r<0) r=0; else if (r>255) r=255; g+=fsdbuf[idx][j][1]; if (g<0) g=0; else if (g>255) g=255; b+=fsdbuf[idx][j][2]; if (b<0) b=0; else if (b>255) b=255; if (desk[sn].col<=2) { if (r<127) r=r*11/16; if (g<127) g=g*11/16; if (b<127) b=b*11/16; } p=pc[r/0x11][g/0x11][b/0x11]; r-=xcp[p].red>>8; g-=xcp[p].green>>8; b-=xcp[p].blue>>8; } } else { r=g=b=0; } if (desk[sn].large) { xp[p][xn[p]].x=x+i+1; xp[p][xn[p]].y=y+j+1; xn[p]++; if (!gr) { xp[p][xn[p]].x=x+88-i+m-k; xp[p][xn[p]].y=y+138-j; xn[p]++; } } else { xp[p][xn[p]].x=x+(i+s)*2/3-m+k; xp[p][xn[p]].y=y+(j+2)*2/3; xn[p]++; if (!gr) { xp[p][xn[p]].x=x+59-(i+s)*2/3+m-k; xp[p][xn[p]].y=y+93-(j+2)*2/3; xn[p]++; } } if (j) { fsdbuf[idx][j-1][0]+=r*10/27; fsdbuf[idx][j-1][1]+=g*10/27; fsdbuf[idx][j-1][2]+=b*10/27; fsdbuf[1-idx][j-1][0]+=r-r*20/27; fsdbuf[1-idx][j-1][1]+=g-g*20/27; fsdbuf[1-idx][j-1][2]+=b-b*20/27; } fsdbuf[1-idx][j][0]+=r*10/27; fsdbuf[1-idx][j][1]+=g*10/27; fsdbuf[1-idx][j][2]+=b*10/27; if (xn[p]==32) { change_gc(sn,tc?pm[p]:xcp[p].pixel,gc); XDrawPoints(dpy[sn],cardpx[sn][c+1],gc[sn],xp[p],32,CoordModeOrigin); xn[p]=0; } } } for (p=0;p<256;p++) { if (xn[p]) { change_gc(sn,tc?pm[p]:xcp[p].pixel,gc); XDrawPoints(dpy[sn],cardpx[sn][c+1],gc[sn],xp[p],xn[p],CoordModeOrigin); } } } VOID create_card(sn,c) int sn,c; { int i,j,p,x,y,x1,y1,x2,y2,x3,y3,f,pf,upf,w,ww,hh; x=2; y=0; f=c>>3; pf=blatt[sn]==1?f==0?4:f==2?5:f:f; upf=desk[sn].col>pf && desk[sn].col>2; w=c&7; XFillRectangle(dpy[sn],cardpx[sn][c+1],gcbck[sn],0,0, desk[sn].cardw,desk[sn].cardh); if (((KOENIG<=w && w<=BUBE) || c<0 || blatt[sn]>=2)) { drawimg(sn,c,c<0?c:f,w-(blatt[sn]>=2?0:KOENIG),x,y); } else { change_gc(sn,wpix[sn],gc); XFillRectangle(dpy[sn],cardpx[sn][c+1],gc[sn],x+1,y+1, 60*desk[sn].f/desk[sn].q-2,92*desk[sn].f/desk[sn].q); } change_gc(sn,bpix[sn],gc); if (desk[sn].large) { ww=89; hh=139; } else { ww=59; hh=93; } for (i=(desk[sn].large?8:5);i<(desk[sn].large?82:55);i++) { XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+i, y); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+i, y+hh); } for (j=(desk[sn].large?8:5);j<(desk[sn].large?132:89);j++) { XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x, y+j); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+ww, y+j); } for (i=0;i<(desk[sn].large?9:5);i++) { XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+frm[desk[sn].large][i][0], y+frm[desk[sn].large][i][1]); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+ww-frm[desk[sn].large][i][0], y+hh-frm[desk[sn].large][i][1]); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+frm[desk[sn].large][i][0], y+hh-frm[desk[sn].large][i][1]); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+ww-frm[desk[sn].large][i][0], y+frm[desk[sn].large][i][1]); } change_gc(sn,bgpix[sn],gc); for (i=1;i<(desk[sn].large?5:3);i++) { for (j=1;j<(desk[sn].large?6:4)-i;j++) { XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+i, y+j); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+ww-i, y+hh-j); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+i, y+hh-j); XDrawPoint(dpy[sn],cardpx[sn][c+1], gc[sn], x+ww-i, y+j); } } change_gc(sn,fgpix[sn],gc); if (c>=0) { if (blatt[sn]<2) { change_gcxor(sn,(upf?color[sn][pf].pixel:bpix[sn])^ wpix[sn]^bgpix[sn]); p=cnts[w]; do { x1=f*16*desk[sn].f/desk[sn].q; y1=0; if (bigs[p+1]>70) x1+=64*desk[sn].f/desk[sn].q; x2=x1+16*desk[sn].f/desk[sn].q; y2=y1+16*desk[sn].f/desk[sn].q; x3=bigs[p++]; y3=bigs[p++]; if (!desk[sn].large) { x3=x3*2/3+(KOENIG<=w && w<=BUBE && p-2!=cnts[w]?1:0); y3=y3*2/3+(KOENIG<=w && w<=BUBE && p-2!=cnts[w]?1:0); } if (upf) { XCopyPlane(dpy[sn],symbs[sn],cardpx[sn][c+1],gcxor[sn], x1+2*desk[sn].cardw,y1,x2-x1,y2-y1,x+x3,y+y3,1); } else { XCopyPlane(dpy[sn],symbs[sn],cardpx[sn][c+1],gcxor[sn], x1,y1,x2-x1,y2-y1,x+x3,y+y3,1); } } while (p!=cnts[w+1]); } else { change_gcxor(sn,bpix[sn]^wpix[sn]^bgpix[sn]); } for (p=0;p<8;p+=2) { if (blatt[sn]<2) { x1=f*8*desk[sn].f/desk[sn].q; y1=16*desk[sn].f/desk[sn].q; if (smls[p+1]>50) x1+=32*desk[sn].f/desk[sn].q; x2=x1+8*desk[sn].f/desk[sn].q; y2=y1+8*desk[sn].f/desk[sn].q; if (KOENIG<=w && w<=BUBE) { x3=smls[p]; y3=smls[p+1]; } else { x3=smlz[p]; y3=smlz[p+1]+(!desk[sn].large && p>3?1:0); } if (!desk[sn].large) { x3=x3*2/3+(p&2?1:0); y3=y3*2/3+(p>3?1:0); } if (upf) { XCopyPlane(dpy[sn],symbs[sn],cardpx[sn][c+1],gcxor[sn], x1+2*desk[sn].cardw,y1,x2-x1,y2-y1,x+x3,y+y3,1); } else { XCopyPlane(dpy[sn],symbs[sn],cardpx[sn][c+1],gcxor[sn], x1,y1,x2-x1,y2-y1,x+x3,y+y3,1); } } if (blatt[sn]<2) { x1=256+(w==AS?lang[sn]*20:w==ZEHN?p>3?23:0:w<=BUBE? (w-KOENIG+1)*5+lang[sn]*20:(p>3?31:8)+(w-NEUN)*5); } else { x1=256+(w==ZEHN?p>3?23:0:w<=BUBE?(w-KOENIG+1)*5+35: (p>3?31:8)+(w-NEUN)*5); } x1=x1*desk[sn].f/desk[sn].q; y1=(w!=ZEHN && w<=BUBE?p>3?7:0:14)+1; y1=y1*desk[sn].f/desk[sn].q; x2=x1+(w==ZEHN?8:5)*desk[sn].f/desk[sn].q; y2=y1+7*desk[sn].f/desk[sn].q; x3=smlc[p]-(w==ZEHN?p&2?4:2:0); y3=smlc[p+1]; if (!desk[sn].large) { x3=x3*2/3+(w==ZEHN?p&2?0:2:0); y3=y3*2/3+(p>3?1:0); } if (blatt[sn]<2 || w!=AS) { XCopyPlane(dpy[sn],symbs[sn],cardpx[sn][c+1],gcxor[sn], x1,y1,x2-x1,y2-y1,x+x3,y+y3,1); } } } change_gcxor(sn,fgpix[sn]); } VOID xinitwin(sn,argc,argv) int sn,argc; char **argv; { Pixmap icon,iconmask; XClassHint classhint; XGCValues gcv; int i,gcvf; GC igc[3]; win[sn]=XCreateSimpleWindow(dpy[sn],DefaultRootWindow(dpy[sn]), desk[sn].x,desk[sn].y,desk[sn].w,desk[sn].h, 0,fgpix[sn],bgpix[sn]); cursor[sn][0]=XCreateFontCursor(dpy[sn],XC_hand2); cursor[sn][1]=XCreateFontCursor(dpy[sn],XC_watch); XDefineCursor(dpy[sn],win[sn],cursor[sn][1]); gcvf=GCGraphicsExposures|GCForeground|GCBackground; gcv.graphics_exposures=False; gcv.font=dfont[sn]->fid; gcv.foreground=fgpix[sn]; gcv.background=bgpix[sn]; gc[sn]=XCreateGC(dpy[sn],win[sn],gcvf|GCFont,&gcv); gcv.foreground=bgpix[sn]; gcv.background=fgpix[sn]; gcbck[sn]=XCreateGC(dpy[sn],win[sn],gcvf,&gcv); gcv.foreground=fgpix[sn]^bgpix[sn]; gcv.background=0; gcv.function=GXxor; gcxor[sn]=XCreateGC(dpy[sn],win[sn],gcvf|GCFunction,&gcv); symbs[sn]=XCreateBitmapFromData(dpy[sn],win[sn],(char *)symbs_bits, symbs_width,symbs_height); if (symbs[sn]==None) nomem(); if (desk[sn].col>3) { icon=XCreatePixmap(dpy[sn],win[sn],icon_width,icon_height,desk[sn].plan); iconmask=XCreatePixmap(dpy[sn],win[sn],icon_width,icon_height,1); if (icon==None || iconmask==None) nomem(); gcv.foreground=0; gcv.background=0; igc[sn]=XCreateGC(dpy[sn],iconmask,gcvf,&gcv); XFillRectangle(dpy[sn],iconmask,igc[sn],0,0,icon_width,icon_height); change_gc(sn,1,igc); XCopyPlane(dpy[sn],symbs[sn],iconmask,igc[sn],128,0,16,16,1,1,1); XCopyPlane(dpy[sn],symbs[sn],iconmask,igc[sn],128+16,0,16,16,16,16,1); XCopyPlane(dpy[sn],symbs[sn],iconmask,igc[sn],128+32,0,16,16,16,1,1); XCopyPlane(dpy[sn],symbs[sn],iconmask,igc[sn],128+48,0,16,16,1,16,1); XFreeGC(dpy[sn],igc[sn]); wmhints.flags|=IconMaskHint; wmhints.icon_mask=iconmask; change_gc(sn,wpix[sn],gc); XFillRectangle(dpy[sn],icon,gc[sn],0,0,icon_width,icon_height); change_gcxor(sn,color[sn][0].pixel^wpix[sn]^bgpix[sn]); XCopyPlane(dpy[sn],symbs[sn],icon,gcxor[sn],128,0,16,16,1,1,1); change_gcxor(sn,color[sn][1].pixel^wpix[sn]^bgpix[sn]); XCopyPlane(dpy[sn],symbs[sn],icon,gcxor[sn],128+16,0,16,16,16,16,1); change_gcxor(sn,color[sn][2].pixel^wpix[sn]^bgpix[sn]); XCopyPlane(dpy[sn],symbs[sn],icon,gcxor[sn],128+32,0,16,16,16,1,1); change_gcxor(sn,color[sn][3].pixel^wpix[sn]^bgpix[sn]); XCopyPlane(dpy[sn],symbs[sn],icon,gcxor[sn],128+48,0,16,16,1,16,1); change_gcxor(sn,fgpix[sn]); change_gc(sn,fgpix[sn],gc); } else { icon=XCreateBitmapFromData(dpy[sn],DefaultRootWindow(dpy[sn]), (char *)icon_bits, icon_width,icon_height); if (icon==None) nomem(); } classhint.res_name=prog_name; classhint.res_class=prog_name; XSetClassHint(dpy[sn],win[sn],&classhint); XSetStandardProperties(dpy[sn],win[sn],title[sn],title[sn],icon, argv,argc,&szhints[sn]); #ifdef PWinGravity szhints[sn].win_gravity= (geom_f[sn]&XNegative? (geom_f[sn]&YNegative? SouthEastGravity:NorthEastGravity): (geom_f[sn]&YNegative? SouthWestGravity:NorthWestGravity)); szhints[sn].flags|=PWinGravity; XSetWMNormalHints(dpy[sn],win[sn],&szhints[sn]); #endif if (szhints[sn].flags&USPosition) { XMoveWindow(dpy[sn],win[sn],szhints[sn].x,szhints[sn].y); } wmhints.flags|=IconPixmapHint; wmhints.icon_pixmap=icon; XSetWMHints(dpy[sn],win[sn],&wmhints); if (desk[sn].large) { XFreePixmap(dpy[sn],symbs[sn]); symbs[sn]=XCreateBitmapFromData(dpy[sn],win[sn],(char *)symbl_bits, symbl_width,symbl_height); if (symbs[sn]==None) nomem(); } bck[sn]=XCreatePixmap(dpy[sn],win[sn],desk[sn].w,desk[sn].h,desk[sn].plan); if (bck[sn]==None) nomem(); for (i=0;i<33;i++) { cardpx[sn][i]=XCreatePixmap(dpy[sn],win[sn], desk[sn].cardw,desk[sn].cardh, desk[sn].plan); if (cardpx[sn][i]==None) nomem(); create_card(sn,i-1); } XFillRectangle(dpy[sn],win[sn],gcbck[sn],0,0,desk[sn].w,desk[sn].h); XFillRectangle(dpy[sn],bck[sn],gcbck[sn],0,0,desk[sn].w,desk[sn].h); if (!irc_play || irc_pos==sn) { XSelectInput(dpy[sn],win[sn],ButtonPressMask|ExposureMask| KeyPressMask|KeyReleaseMask); XMapWindow(dpy[sn],win[sn]); } } VOID xinitplayers() { int sn; for (sn=1;sn<3;sn++) { disp_name[sn]=disp_name[0]; dpy[sn]=dpy[0]; cmap[sn]=cmap[0]; desk[sn]=desk[0]; bpix[sn]=bpix[0]; wpix[sn]=wpix[0]; bgpix[sn]=bgpix[0]; fgpix[sn]=fgpix[0]; btpix[sn]=btpix[0]; mkpix[sn]=mkpix[0]; w3dpix[sn]=w3dpix[0]; b3dpix[sn]=b3dpix[0]; gfx3d[sn]=gfx3d[0]; memcpy((VOID *)color[sn],(VOID *)color[0],sizeof(color[0])); title[sn]=title[0]; dfont[sn]=dfont[0]; charw[sn]=charw[0]; charh[sn]=charh[0]; useoptfile[sn]=useoptfile[0]; mbutton[sn]=mbutton[0]; keyboard[sn]=keyboard[0]; abkuerz[sn]=abkuerz[0]; nimmstich[sn][0]=nimmstich[0][0]; sort1[sn]=sort1[0]; alternate[sn]=alternate[0]; alist[sn]=alist[0]; hints[sn]=hints[0]; blatt[sn]=blatt[0]; lang[sn]=lang[0]; briefmsg[sn]=briefmsg[0]; trickl2r[sn]=trickl2r[0]; geom_f[sn]=geom_f[0]; geom_x[sn]=geom_x[0]; geom_y[sn]=geom_y[0]; szhints[sn]=szhints[0]; } } int closecol(x,r) int x,*r; { int i; for (i=1;x>r[i];i++); return i-(r[i]-x>x-r[i-1]); } VOID find_cardcol(bm,r,col) unsigned char *bm; int *r,col[6][6][6]; { int i,s; bm+=10; s=1<<((*bm++&7)+1); bm+=2; for (i=0;i=8) { c=0; } else if (desk[sn].plan>=7) { c=1; } else if (desk[sn].plan>=6) { c=2; } else { c=3; } for (;c<4;c++) { for (i=0;i<6-c;i++) { for (j=0;j<6-c;j++) { for (k=0;k<6-c;k++) { col[i][j][k]=0; } } } for (i=0;i<4;i++) { for (j=0;j<3;j++) { find_cardcol(fr_gif[i][j],ramp[c],col); } for (j=0;j<8;j++) { find_cardcol(de_gif[i][j],ramp[c],col); } } find_cardcol(backsd_gif[0],ramp[c],col); ncol=0; for (i=0;i<6-c;i++) { for (j=0;j<6-c;j++) { for (k=0;k<6-c;k++) { if (col[i][j][k]) { xc.red=ramp[c][i]<<8; xc.green=ramp[c][j]<<8; xc.blue=ramp[c][k]<<8; if (closest_col(sn,&xc)) { color[sn][desk[sn].col+ncol++]=xc; } else { i=j=k=7; } } } } } if (i<7) { desk[sn].col+=ncol; return; } for (i=0;i1) { for (i=0;i<6 && closest_col(sn,&color[sn][i]);i++); if (i!=6) { if (i==4) color[sn][i++]=color[sn][0]; if (i==5) color[sn][i++]=color[sn][2]; else i=0; } } else i=0; color[sn][i].pixel=wpix[sn]; color[sn][i].red=color[sn][i].green=color[sn][i].blue=0xffff; i++; color[sn][i].pixel=bpix[sn]; color[sn][i].red=color[sn][i].green=color[sn][i].blue=0; i++; desk[sn].col=i; fgpix[sn]=get_col(sn,fg_col,prog_name,"foreground",NULL,bpix[sn],&fgcol); borw=(long)fgcol.red+fgcol.green+fgcol.blue<0x1E000L?wpix[sn]:bpix[sn]; if (gfx3d[sn]<0) { res=XGetDefault(dpy[sn],prog_name,"3d"); gfx3d[sn]=(!res && desk[sn].plan>1) || (res && istrue(res)); } if (gfx3d[sn]) { bgpix[sn]=get_col(sn,bg_col,prog_name,"3dbackground", desk[sn].plan>1?"#cccccccccccc": borw==wpix[sn]?"white":"black", borw,&nocol); btpix[sn]=get_col(sn,bt_col,prog_name,"3dbutton", desk[sn].plan>1?"#dddddddddddd": borw==wpix[sn]?"white":"black", borw,&nocol); w3dpix[sn]=get_col(sn,w3d_col,prog_name,"3dtop",NULL,wpix[sn],&nocol); b3dpix[sn]=get_col(sn,b3d_col,prog_name,"3dbot",NULL,bpix[sn],&nocol); } else { bgpix[sn]=get_col(sn,bg_col,prog_name,"background",NULL,borw,&nocol); btpix[sn]=get_col(sn,bt_col,prog_name,"button",NULL,borw,&nocol); } mkpix[sn]=get_col(sn,mk_col,prog_name,"mark", desk[sn].plan>1?"#ffff00000000":"black", bpix[sn],&nocol); card_colors(sn); if (desk[sn].large<0) { res=XGetDefault(dpy[sn],prog_name,"large"); if (res) desk[sn].large=istrue(res); if (desk[sn].large<0) { desk[sn].large=XDisplayWidth(dpy[sn],scr)>960 && XDisplayHeight(dpy[sn],scr)>600; } } calc_desk(sn); if (!title[sn] && !(title[sn]=XGetDefault(dpy[sn],prog_name,"title"))) title[sn]=prog_name; if (!geom_f[sn] && (res=XGetDefault(dpy[sn],prog_name,"geometry"))) { geom_f[sn]=XParseGeometry(res,&geom_x[sn],&geom_y[sn],&w,&h); } if (!font_name && !(font_name=XGetDefault(dpy[sn],prog_name,"font"))) { font_name=desk[sn].large?"10x20":"9x15"; } if (!(dfont[sn]=XLoadQueryFont(dpy[sn],font_name))) { fprintf(stderr,"Font %s not found\n",font_name); exitus(1); } charw[sn]=dfont[sn]->max_bounds.width; charh[sn]=dfont[sn]->max_bounds.ascent+dfont[sn]->max_bounds.descent+1; if (desk[sn].large && charh[sn]<21) charh[sn]=21; else if (charh[sn]<16) charh[sn]=16; charh[sn]+=gfx3d[sn]+(charh[sn]&1); if (sn) { res=XGetDefault(dpy[sn],prog_name,"useoptfile"); useoptfile[sn]=res && istrue(res); } else { useoptfile[sn]=1; } if (!mbuttonset[sn] && (res=XGetDefault(dpy[sn],prog_name,"menubutton"))) { mbutton[sn]=atoi(res); } if (mbutton[sn]<0 || mbutton[sn]>5) mbutton[sn]=0; if (!keyboardset[sn] && (res=XGetDefault(dpy[sn],prog_name,"keyboard"))) { keyboard[sn]=atoi(res); } if (keyboard[sn]<0 || keyboard[sn]>2) keyboard[sn]=1; if (!abkuerzset[sn] && (res=XGetDefault(dpy[sn],prog_name,"shortcut"))) { abkuerz[sn]=atoi(res); if (abkuerz[sn]<0 || abkuerz[sn]>2) abkuerz[sn]=1; } if (!tdelayset[sn] && (res=XGetDefault(dpy[sn],prog_name,"tdelay"))) { nimmstich[sn][0]=(int)(atof(res)*10+.5); } if (nimmstich[sn][0]<0) nimmstich[sn][0]=7; else if (nimmstich[sn][0]>101) nimmstich[sn][0]=101; if (!downupset[sn]) { res=XGetDefault(dpy[sn],prog_name,"down"); downup=!res || istrue(res); } sort1[sn]=!downup; if (!altseqset[sn]) { res=XGetDefault(dpy[sn],prog_name,"alt"); if (!res && sn) altseq=alternate[0]; else altseq=res && istrue(res); } alternate[sn]=!!altseq; if (!alistset[sn]) { res=XGetDefault(dpy[sn],prog_name,"alist"); if (res) { alist[sn]=istrue(res); } else { res=XGetDefault(dpy[sn],prog_name,"tlist"); if (!res && sn) alist[sn]=alist[0]; else alist[sn]=res && istrue(res)?2:0; } } if ((res=XGetDefault(dpy[sn],prog_name,"alias"))) { extractnam(sn,res); if (!sn) { strcpy(usrname[0],spnames[0][0][0]); strcpy(usrname[1],spnames[0][1][0]); } } if (!hintsset[sn]) { res=XGetDefault(dpy[sn],prog_name,"hint"); if (!res && sn) hints[sn]=hints[0]; else hints[sn]=res && istrue(res); } if (!blattset[sn]) { res=XGetDefault(dpy[sn],prog_name,"cards"); if (res) { blatt[sn]=atoi(res); if (blatt[sn]<0 || blatt[sn]>3) blatt[sn]=1; } else if (sn) { blatt[sn]=blatt[0]; } } if (!langset[sn]) { res=XGetDefault(dpy[sn],prog_name,"language"); if (!res && sn) lang[sn]=lang[0]; else lang[sn]=langidx(res); } if (!briefmsgset[sn]) { res=XGetDefault(dpy[sn],prog_name,"briefmsg"); if (!res && sn) briefmsg[sn]=briefmsg[0]; else briefmsg[sn]=res && istrue(res); } if (!trickl2rset[sn]) { res=XGetDefault(dpy[sn],prog_name,"trickl2r"); if (!res && sn) trickl2r[sn]=trickl2r[0]; else trickl2r[sn]=res && istrue(res); } if (!sn) { if (!game_file) { if (!getdeffn(prog_name,&game_file,"game","")) { game_file=0; } } logdef=!prot_file && getdeffn(prog_name,&prot_file,"log","xskat.log"); if (logging<0) { res=XGetDefault(dpy[sn],prog_name,"dolog"); logging=(res && istrue(res)) || (!res && logdef); } if (unformatted<0) { res=XGetDefault(dpy[sn],prog_name,"formatted"); unformatted=!(res && istrue(res)); } if (!opt_file) { getdeffn(prog_name,&opt_file,"opt","xskat.opt"); } if (!ramschset && (res=XGetDefault(dpy[sn],prog_name,"ramsch"))) { playramsch=atoi(res); if (playramsch<0) playramsch=0; else if (playramsch>2) playramsch=2; } if (!sramschset && (res=XGetDefault(dpy[sn],prog_name,"sramsch"))) { playsramsch=istrue(res); } if (!rskatloserset && (res=XGetDefault(dpy[sn],prog_name,"skattoloser"))) { rskatloser=istrue(res); } if (!kontraset && (res=XGetDefault(dpy[sn],prog_name,"kontra"))) { playkontra=atoi(res); if (playkontra<0) playkontra=0; else if (playkontra>2) playkontra=2; } if (!bockset && (res=XGetDefault(dpy[sn],prog_name,"bock"))) { playbock=atoi(res); if (playbock<0) playbock=0; else if (playbock>2) playbock=2; } if (!bockeventsset && (res=XGetDefault(dpy[sn],prog_name,"bockevents"))) { bockevents=atoi(res); } if (!resumebockset && (res=XGetDefault(dpy[sn],prog_name,"resumebock"))) { resumebock=istrue(res); } if (!spitzezaehltset && (res=XGetDefault(dpy[sn],prog_name,"spitze"))) { spitzezaehlt=atoi(res); if (spitzezaehlt<0) spitzezaehlt=0; else if (spitzezaehlt>2) spitzezaehlt=2; } if (!revolutionset && (res=XGetDefault(dpy[sn],prog_name,"revolution"))) { revolution=istrue(res); } if (!klopfenset && (res=XGetDefault(dpy[sn],prog_name,"klopfen"))) { klopfen=istrue(res); } if (!schenkenset && (res=XGetDefault(dpy[sn],prog_name,"schenken"))) { schenken=istrue(res); } if (!oldrulesset && (res=XGetDefault(dpy[sn],prog_name,"oldrules"))) { oldrules=istrue(res); } if (irc_play<0) { res=XGetDefault(dpy[sn],prog_name,"irc"); irc_play=res && istrue(res); } if (irc_logappend<0) { res=XGetDefault(dpy[sn],prog_name,"irclogappend"); irc_logappend=res && istrue(res); } if (!list_file) { getdeffn(prog_name,&list_file, irc_play?"irclist":"list", irc_play?"xskat.irc":"xskat.lst"); } if (!cards_file) { getdeffn(prog_name,&cards_file,"cardsfile","xskat.cards"); } if (!irc_host && !(irc_host=XGetDefault(dpy[sn],prog_name,"ircserver")) && !(irc_host=getenv("IRCSERVER"))) { irc_host=irc_defaulthost; } strncpy(irc_hostname,irc_host,35); irc_hostname[35]=0; if (irc_play) { game_file=0; if (irc_pos<0 && (res=XGetDefault(dpy[sn],prog_name,"ircpos"))) { irc_pos=atoi(res); } irc_pos--; if (irc_pos<0 || irc_pos>2) irc_pos=-1; if (!irc_telnet && !(irc_telnet=XGetDefault(dpy[sn],prog_name,"irctelnet"))) { irc_telnet="telnet"; } if (irc_port<0 && ((res=XGetDefault(dpy[sn],prog_name,"ircport")) || (res=getenv("IRCPORT")))) { irc_port=atoi(res); } if (irc_port<0) irc_port=6667; if (!irc_channel && !(irc_channel=XGetDefault(dpy[sn],prog_name,"ircchannel"))) { irc_channel="#xskat"; } if (!irc_nick && !(irc_nick=XGetDefault(dpy[sn],prog_name,"ircnick")) && !(irc_nick=getenv("IRCNICK")) && !(irc_nick=getenv("IRCUSER")) && !(irc_nick=getenv("LOGNAME"))) { irc_changenick(0); } if (!irc_user && !(irc_user=XGetDefault(dpy[sn],prog_name,"ircuser")) && !(irc_user=getenv("IRCUSER")) && !(irc_user=getenv("LOGNAME"))) { irc_user="XSkat"; } if (!irc_realname && !(irc_realname=XGetDefault(dpy[sn],prog_name,"ircrealname")) && !(irc_realname=getenv("IRCNAME"))) { if ((pwd=getpwuid(getuid())) && pwd->pw_gecos) { irc_realname=pwd->pw_gecos; if ((res=strchr(irc_realname,','))) *res=0; } if (!irc_realname || !*irc_realname) { irc_realname="XSkat player"; } } if (!irc_logfile) { getdeffn(prog_name,&irc_logfile,"irclog","xskat.ilg"); } } if (geber<0) { if ((res=XGetDefault(dpy[sn],prog_name,"start"))) { geber=atoi(res); } if (geber<1 || geber>3) geber=0; else geber=left(geber); } for (i=0;i<2;i++) { if (!stgset[i]) { stgs[1]=i+'1'; if ((res=XGetDefault(dpy[sn],prog_name,stgs))) { strateg[i]=atoi(res); } } if (strateg[i]<-4) strateg[i]=-4; else if (strateg[i]>0) strateg[i]=0; } if (prot_file && !*prot_file) prot_file=0; if (opt_file && !*opt_file) opt_file=0; if (game_file && !*game_file) game_file=0; if (list_file && !*list_file) list_file=0; if (irc_logfile && !*irc_logfile) irc_logfile=0; if (cards_file && !*cards_file) cards_file=0; } if ((geom_f[sn]&(XValue|YValue))==(XValue|YValue)) { szhints[sn].x=geom_f[sn]&XNegative? XDisplayWidth(dpy[sn],scr)+geom_x[sn]-desk[sn].w:geom_x[sn]; szhints[sn].y=geom_f[sn]&YNegative? XDisplayHeight(dpy[sn],scr)+geom_y[sn]-desk[sn].h:geom_y[sn]; szhints[sn].flags|=USPosition; } szhints[sn].flags|=PMinSize|PMaxSize; szhints[sn].min_width=szhints[sn].max_width=desk[sn].w; szhints[sn].min_height=szhints[sn].max_height=desk[sn].h; cw=1; for (ln=0;ln3 && (nw=(XTextWidth(dfont[sn],textarr[i].t[ln],len)+len-1)/len)>cw) { cw=nw; } } } if (cw=buflen || feof(f) || strcmp(buf+cdst,"GIF87aX") || (buf[cdst+8]!=(char)0x45 && buf[cdst+8]!=(char)0x8a)) { cd--; bufidx=cdst; continue; } *(map_gif[cd].pos)=buf+cdst; ggcards=0; } fclose(f); } VOID set_conames() { int ln,sn; char buf[40]; if (!usrname[0][0]) strcpy(usrname[0],"~"); if (!usrname[1][0]) strcpy(usrname[1],"~"); for (ln=0;ln1) { if (!strcmp(argv[1],"-help") || !strcmp(argv[1],"-h")) { usage(); exitus(0); } else if (!strcmp(argv[1],"-nopre")) { nopre=1; } else if (!strcmp(argv[1],"-color")) { bwcol=1; } else if (!strcmp(argv[1],"-mono")) { bwcol=0; } else if (!strcmp(argv[1],"-3d")) { gfx3d[0]=1; } else if (!strcmp(argv[1],"-2d")) { gfx3d[0]=0; } else if (!strcmp(argv[1],"-frenchcards")) { blatt[0]=0; blattset[0]=1; } else if (!strcmp(argv[1],"-french4cards")) { blatt[0]=1; blattset[0]=1; } else if (!strcmp(argv[1],"-germancards")) { blatt[0]=2; blattset[0]=1; } else if (!strcmp(argv[1],"-german4cards")) { blatt[0]=3; blattset[0]=1; } else if (!strcmp(argv[1],"-noshortcut")) { abkuerz[0]=0; abkuerzset[0]=1; } else if (!strcmp(argv[1],"-askshortcut")) { abkuerz[0]=1; abkuerzset[0]=1; } else if (!strcmp(argv[1],"-shortcut")) { abkuerz[0]=2; abkuerzset[0]=1; } else if (!strcmp(argv[1],"-iconic") || !strcmp(argv[1],"-i")) { wmhints.flags|=StateHint; wmhints.initial_state=IconicState; } else if (!strcmp(argv[1],"-down")) { downup=1; downupset[0]=1; } else if (!strcmp(argv[1],"-up")) { downup=0; downupset[0]=1; } else if (!strcmp(argv[1],"-alt")) { altseq=1; altseqset[0]=1; } else if (!strcmp(argv[1],"-seq")) { altseq=0; altseqset[0]=1; } else if (!strcmp(argv[1],"-dolog")) { logging=1; } else if (!strcmp(argv[1],"-nolog")) { logging=0; } else if (!strcmp(argv[1],"-fmt")) { unformatted=0; } else if (!strcmp(argv[1],"-unfmt")) { unformatted=1; } else if (!strcmp(argv[1],"-large")) { desk[0].large=1; } else if (!strcmp(argv[1],"-small")) { desk[0].large=0; } else if (!strcmp(argv[1],"-alist")) { alist[0]=1; alistset[0]=1; } else if (!strcmp(argv[1],"-nlist")) { alist[0]=0; alistset[0]=1; } else if (!strcmp(argv[1],"-tlist")) { alist[0]=2; alistset[0]=1; } else if (!strcmp(argv[1],"-noramsch")) { playramsch=0; ramschset=1; } else if (!strcmp(argv[1],"-ramsch")) { playramsch=1; ramschset=1; } else if (!strcmp(argv[1],"-ramschonly")) { playramsch=2; ramschset=1; } else if (!strcmp(argv[1],"-sramsch")) { playsramsch=1; sramschset=1; } else if (!strcmp(argv[1],"-nosramsch")) { playsramsch=0; sramschset=1; } else if (!strcmp(argv[1],"-skattolast")) { rskatloser=0; rskatloserset=1; } else if (!strcmp(argv[1],"-skattoloser")) { rskatloser=1; rskatloserset=1; } else if (!strcmp(argv[1],"-nokontra")) { playkontra=0; kontraset=1; } else if (!strcmp(argv[1],"-kontra")) { playkontra=1; kontraset=1; } else if (!strcmp(argv[1],"-kontra18")) { playkontra=2; kontraset=1; } else if (!strcmp(argv[1],"-nobock")) { playbock=0; bockset=1; } else if (!strcmp(argv[1],"-bock")) { playbock=1; bockset=1; } else if (!strcmp(argv[1],"-bockramsch")) { playbock=2; bockset=1; } else if (!strcmp(argv[1],"-resumebock")) { resumebock=1; resumebockset=1; } else if (!strcmp(argv[1],"-noresumebock")) { resumebock=0; resumebockset=1; } else if (!strcmp(argv[1],"-spitze")) { spitzezaehlt=1; spitzezaehltset=1; } else if (!strcmp(argv[1],"-spitze2")) { spitzezaehlt=2; spitzezaehltset=1; } else if (!strcmp(argv[1],"-nospitze")) { spitzezaehlt=0; spitzezaehltset=1; } else if (!strcmp(argv[1],"-revolution")) { revolution=1; revolutionset=1; } else if (!strcmp(argv[1],"-norevolution")) { revolution=0; revolutionset=1; } else if (!strcmp(argv[1],"-klopfen")) { klopfen=1; klopfenset=1; } else if (!strcmp(argv[1],"-noklopfen")) { klopfen=0; klopfenset=1; } else if (!strcmp(argv[1],"-schenken")) { schenken=1; schenkenset=1; } else if (!strcmp(argv[1],"-noschenken")) { schenken=0; schenkenset=1; } else if (!strcmp(argv[1],"-newrules")) { oldrules=0; oldrulesset=1; } else if (!strcmp(argv[1],"-oldrules")) { oldrules=1; oldrulesset=1; } else if (!strcmp(argv[1],"-fastdeal")) { fastdeal=1; fastdealset=1; } else if (!strcmp(argv[1],"-slowdeal")) { fastdeal=0; fastdealset=1; } else if (!strcmp(argv[1],"-hint")) { hints[0]=1; hintsset[0]=1; } else if (!strcmp(argv[1],"-nohint")) { hints[0]=0; hintsset[0]=1; } else if (!strcmp(argv[1],"-briefmsg")) { briefmsg[0]=1; briefmsgset[0]=1; } else if (!strcmp(argv[1],"-verbosemsg")) { briefmsg[0]=0; briefmsgset[0]=1; } else if (!strcmp(argv[1],"-trickl2r")) { trickl2r[0]=1; trickl2rset[0]=1; } else if (!strcmp(argv[1],"-notrickl2r")) { trickl2r[0]=0; trickl2rset[0]=1; } else if (!strcmp(argv[1],"-irc")) { irc_play=1; } else if (!strcmp(argv[1],"-noirc")) { irc_play=0; } else if (!strcmp(argv[1],"-irclogappend")) { irc_logappend=1; irc_play=1; } else if (!strcmp(argv[1],"-irclogoverwrite")) { irc_logappend=0; irc_play=1; } else if (!strcmp(argv[1],"-pk")) { pkoption=1; } else if ((argv[1][0]!='-') && numsp<3) { disp_name[numsp++]=argv[1]; } else if (argc>2) { if (!strcmp(argv[1],"-display") || !strcmp(argv[1],"-d")) { disp_name[0]=argv[2]; } else if (!strcmp(argv[1],"-geometry") || !strcmp(argv[1],"-g")) { geom_f[0]=XParseGeometry(argv[2],&geom_x[0],&geom_y[0],&w,&h); } else if (!strcmp(argv[1],"-name") || !strcmp(argv[1],"-n")) { prog_name=argv[2]; } else if (!strcmp(argv[1],"-title") || !strcmp(argv[1],"-T")) { title[0]=argv[2]; } else if (!strcmp(argv[1],"-fg")) { fg_col=argv[2]; } else if (!strcmp(argv[1],"-bg")) { bg_col=argv[2]; } else if (!strcmp(argv[1],"-bt")) { bt_col=argv[2]; } else if (!strcmp(argv[1],"-3dtop")) { w3d_col=argv[2]; } else if (!strcmp(argv[1],"-3dbot")) { b3d_col=argv[2]; } else if (!strcmp(argv[1],"-mark")) { mk_col=argv[2]; } else if (!strncmp(argv[1],"-color",6) && (i=atoi(argv[1]+6))>=1 && i<=20) { if (i<=4) ccol[i-1]=argv[2]; } else if (!strcmp(argv[1],"-mb")) { mbutton[0]=atoi(argv[2]); mbuttonset[0]=1; } else if (!strcmp(argv[1],"-keyboard")) { keyboard[0]=atoi(argv[2]); keyboardset[0]=1; } else if (!strcmp(argv[1],"-tdelay")) { nimmstich[0][0]=(int)(atof(argv[2])*10+.5); tdelayset[0]=1; } else if (!strcmp(argv[1],"-font") || !strcmp(argv[1],"-fn")) { font_name=argv[2]; } else if (!strcmp(argv[1],"-list") || !strcmp(argv[1],"-l")) { list_file=argv[2]; } else if (!strcmp(argv[1],"-bockevents")) { bockevents=atoi(argv[2]); bockeventsset=1; } else if (!strcmp(argv[1],"-opt")) { opt_file=argv[2]; } else if (!strcmp(argv[1],"-log")) { prot_file=argv[2]; logging=1; } else if (!strcmp(argv[1],"-game")) { game_file=argv[2]; } else if (!strcmp(argv[1],"-lang")) { lang[0]=langidx(argv[2]); langset[0]=1; } else if (!strcmp(argv[1],"-start")) { geber=atoi(argv[2]); if (geber<1 || geber>3) geber=0; else geber=left(geber); } else if (!strcmp(argv[1],"-auto")) { numgames=atoi(argv[2]); if (numgames<1) numgames=1; } else if (!strcmp(argv[1],"-s1")) { strateg[0]=atoi(argv[2]); stgset[0]=1; } else if (!strcmp(argv[1],"-s2")) { strateg[1]=atoi(argv[2]); stgset[1]=1; } else if (!strcmp(argv[1],"-s3")) { strateg[2]=atoi(argv[2]); stgset[2]=1; } else if (!strcmp(argv[1],"-irctelnet")) { irc_telnet=argv[2]; irc_play=1; } else if (!strcmp(argv[1],"-ircserver")) { irc_host=argv[2]; irc_play=1; irc_hostset=1; } else if (!strcmp(argv[1],"-ircport")) { irc_port=atoi(argv[2]); irc_play=1; } else if (!strcmp(argv[1],"-ircchannel")) { irc_channel=argv[2]; irc_play=1; } else if (!strcmp(argv[1],"-ircnick")) { irc_nick=argv[2]; irc_play=1; } else if (!strcmp(argv[1],"-ircuser")) { irc_user=argv[2]; irc_play=1; } else if (!strcmp(argv[1],"-ircrealname")) { irc_realname=argv[2]; irc_play=1; } else if (!strcmp(argv[1],"-ircpos")) { irc_pos=atoi(argv[2]); irc_play=1; } else if (!strcmp(argv[1],"-irclog")) { irc_logfile=argv[2]; irc_play=1; } else { invopt(argv[1]); } argc--;argv++; } else { invopt(argv[1]); } argc--;argv++; } init_text(); if (numgames) { numsp=irc_play=0; if (!langset[0]) lang[0]=langidx((char *)0); lang[2]=lang[1]=lang[0]; if (geber<0) geber=0; if (logging<0) logging=0; if (unformatted<0) unformatted=1; for (i=0;i<3;i++) { if (strateg[i]<-4) strateg[i]=-4; else if (strateg[i]>0) strateg[i]=0; } } else { xinitres(0); } read_list(); if (irc_play) { setsum(0); read_opt(); set_conames(); irc_init(); } else { read_opt(); for (sn=1;sn1) refresh(); } VOID stdwait() { waitt(700,2); } VOID backgr(sn,x,y,w,h) int sn,x,y,w,h; { XFillRectangle(dpy[sn],bck[sn],gcbck[sn],x,y,w,h); XFillRectangle(dpy[sn],win[sn],gcbck[sn],x,y,w,h); } VOID putdesk(sn,x,y) int sn,x,y; { backgr(sn,x,y,desk[sn].cardw,desk[sn].cardh); } VOID drawcard(sn,c,x,y) int sn,c,x,y; { XCopyArea(dpy[sn],cardpx[sn][c+1],win[sn],gc[sn],0,0, desk[sn].cardw,desk[sn].cardh,x,y); XCopyArea(dpy[sn],cardpx[sn][c+1],bck[sn],gc[sn],0,0, desk[sn].cardw,desk[sn].cardh,x,y); } VOID putcard(sn,i,x,y) int sn,i,x,y; { if (i<0) putdesk(sn,x,y); else drawcard(sn,i,x,y); } VOID putback(sn,x,y) int sn,x,y; { drawcard(sn,-1,x,y); } VOID hint_line(sn,c,gcp) int sn,c; GC *gcp; { int xyarr[4]; xyarr[0]=(c<30?desk[sn].playx:desk[sn].skatx)+ (c%10)*desk[sn].cardx+7*desk[sn].f/desk[sn].q; xyarr[1]=(c<30?desk[sn].playy:desk[sn].skaty) -5*desk[sn].f/desk[sn].q; xyarr[2]=xyarr[0]+desk[sn].cardx-16*desk[sn].f/desk[sn].q+1; xyarr[3]=xyarr[1]; XDrawLine(dpy[sn],win[sn],gcp[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); XDrawLine(dpy[sn],bck[sn],gcp[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); } VOID show_hint(sn,c,d) int sn,c,d; { static int lm[3][2]; if (lm[sn][c]) { hint_line(sn,lm[sn][c]-1,gcbck); } if (d) { change_gc(sn,mkpix[sn],gc); hint_line(sn,hintcard[c],gc); change_gc(sn,fgpix[sn],gc); lm[sn][c]=hintcard[c]+1; } else { lm[sn][c]=0; } } VOID putamark(sn,s) int sn,s; { int a,b,xp1,xp2,yp,xyarr[4]; if (sn==s || ouveang || (spitzeang && !sptzmrk)) return; a=48*desk[sn].f/desk[sn].q-4; b=48*desk[sn].f/desk[sn].q-2; change_gc(sn,mkpix[sn],gc); xp1=desk[sn].com1x+32*desk[sn].f/desk[sn].q; xp2=desk[sn].com2x+32*desk[sn].f/desk[sn].q; yp=desk[sn].com1y+2*desk[sn].f/desk[sn].q; xyarr[0]=(s==left(sn)?xp1:xp2)-a/2; xyarr[1]=yp; xyarr[2]=xyarr[0]+a-4*desk[sn].f/desk[sn].q+3; xyarr[3]=xyarr[1]; XDrawLine(dpy[sn],win[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); XDrawLine(dpy[sn],bck[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); xyarr[1]=yp+89*desk[sn].f/desk[sn].q; xyarr[3]=xyarr[1]; XDrawLine(dpy[sn],win[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); XDrawLine(dpy[sn],bck[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); xyarr[0]=(s==left(sn)?xp1:xp2)-b/2; xyarr[1]=yp+1; xyarr[2]=xyarr[0]+b-4*desk[sn].f/desk[sn].q+3; xyarr[3]=xyarr[1]; XDrawLine(dpy[sn],win[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); XDrawLine(dpy[sn],bck[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); xyarr[1]=yp+88*desk[sn].f/desk[sn].q; xyarr[3]=xyarr[1]; XDrawLine(dpy[sn],win[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); XDrawLine(dpy[sn],bck[sn],gc[sn],xyarr[0],xyarr[1],xyarr[2],xyarr[3]); change_gc(sn,fgpix[sn],gc); } VOID putmark(s) int s; { int sn; for (sn=0;sn=0 && c0==cards[sn*10+i]) hintcard[0]=sn*10+i; if (c1>=0 && c1==cards[sn*10+i]) hintcard[1]=sn*10+i; if (hintcard[0]!=-1 && !iscomp(sn) && hints[sn]) { if (phase==SPIELEN && sn==(ausspl+vmh)%3) { show_hint(sn,0,1); } else if (phase==DRUECKEN && sn==spieler) { show_hint(sn,0,1); show_hint(sn,1,1); } } putcard(sn,cards[sn*10+i], desk[sn].playx+i*desk[sn].cardx,desk[sn].playy); } } if (phase!=ANSAGEN) { di_info(sn,-1); if (predef && (!ouveang || sn==spieler) && (sn || !nopre)) { x=desk[sn].w/2; y=desk[sn].y+2*charh[sn]; v_gtext(sn,x,y,0,textarr[TX_VORDEFINIERTES_SPIEL].t[lang[sn]]); } } if (phase!=ANSAGEN && ouveang) { if (sn==spieler) { for (sn=0;sn=desk[sn].skaty && y=desk[sn].playy || zw) { x-=desk[sn].playx; if (x<0) return 0; c=x/desk[sn].cardx; if (c>9) c=9; s=zw?left(sn)==spieler?left(spieler):left(sn):sn; if (cards[10*s+c]>=0) return c+1+(zw?10:0); } return 0; } int hndl_reizen(sn,x,y) int sn,x,y; { int b; if (x<=desk[sn].pboxx+60*desk[sn].f/desk[sn].q) b=0; else b=desk[sn].cardw; if (x>=desk[sn].pboxx+3*desk[sn].f/desk[sn].q+b && x<=desk[sn].pboxx+60*desk[sn].f/desk[sn].q+b && y>=desk[sn].pboxy+1 && y<=desk[sn].pboxy+16*desk[sn].f/desk[sn].q) { di_delres(sn); if (b) maxrw[sn]=0; else { maxrw[sn]=999-1; } do_entsch(); return 1; } return 0; } int hndl_druecken(sn,x,y) int sn,x,y; { int c,sna[1],x1[1],y1[1],x2[1],y2[1]; c=card_at(sn,x,y,0); if (c) { c--; swap(&cards[10*sn+c],&cards[drkcd+30]); if (hintcard[0]==10*sn+c) { hintcard[0]=drkcd+30; if (hints[sn]) show_hint(sn,0,0); } else if (hintcard[0]==drkcd+30) hintcard[0]=10*sn+c; if (hintcard[1]==10*sn+c) { hintcard[1]=drkcd+30; if (hints[sn]) show_hint(sn,1,0); } else if (hintcard[1]==drkcd+30) hintcard[1]=10*sn+c; sna[0]=sn; x1[0]=desk[sn].playx+c*desk[sn].cardx; y1[0]=desk[sn].playy; x2[0]=desk[sn].skatx+drkcd*desk[sn].cardw; y2[0]=desk[sn].skaty; movecard(1,sna,x1,y1,x2,y2); putcard(sn,cards[drkcd+30],x2[0],y2[0]); initscr(sn,1); drkcd=1-drkcd; return 1; } if (x>=desk[sn].pboxx+27*desk[sn].f/desk[sn].q && x<=desk[sn].pboxx+100*desk[sn].f/desk[sn].q && y>=desk[sn].pboxy+1 && y<=desk[sn].pboxy+16*desk[sn].f/desk[sn].q) inv_fbox(spieler,1); else return 0; if (hints[sn] && hintcard[0]!=-1) { show_hint(sn,0,0); show_hint(sn,1,0); } stdwait(); inv_fbox(spieler,0); if (trumpf==5 && (((cards[30]&7)==BUBE) || ((cards[31]&7)==BUBE))) { di_buben(); return 1; } rem_fbox(spieler); drbut=0; if (trumpf==5) { putback(sn,desk[sn].skatx,desk[sn].skaty); putback(sn,desk[sn].skatx+desk[sn].cardw,desk[sn].skaty); if (ramschspiele && klopfen) { di_klopfen(spieler); } else { vmh=left(vmh); if (vmh) di_schieben(); else start_ramsch(); } return 1; } home_skat(); save_skat(1); for (c=0;c<2;c++) { stsum+=cardw[cards[c+30]&7]; gespcd[cards[c+30]]=1; cards[c+30]=-1; } gedr=2; do_ansagen(); return 1; } int hndl_tauschen(sn,x,y) int sn,x,y; { int c,c1,zw,mi,d[2],sna[2],x1[2],y1[2],x2[2],y2[2]; mi=left(sn)==spieler?left(spieler):left(sn); c=card_at(sn,x,y,1); if (c) { zw=c>10; c=(c-1)%10; c1=tauschcard!=-1?tauschcard%10:0; x1[0]=desk[sn].playx+c*desk[sn].cardx; y1[0]=zw?desk[sn].skaty:desk[sn].playy; x2[0]=desk[sn].playx+c1*desk[sn].cardx; y2[0]=zw?desk[sn].playy:desk[sn].skaty; d[0]=(zw?4:-4)*desk[sn].f/desk[sn].q; if (!iscomp(mi)) { x1[1]=desk[mi].playx+c*desk[mi].cardx; y1[1]=zw?desk[mi].playy:desk[mi].skaty; x2[1]=desk[mi].playx+c1*desk[mi].cardx; y2[1]=zw?desk[mi].skaty:desk[mi].playy; d[1]=(zw?4:-4)*desk[mi].f/desk[mi].q; } if (tauschcard!=-1) { if ((zw?mi:sn)==tauschcard/10) { if (c==c1) return 1; putdesk(sn,x2[0],y1[0]+d[0]); putcard(sn,cards[tauschcard],x2[0],y1[0]); if (!iscomp(mi)) { putdesk(mi,x2[1],y1[1]-d[1]); putcard(mi,cards[tauschcard],x2[1],y1[1]); } } else { swap(&cards[tauschcard],&cards[10*(zw?mi:sn)+c]); sna[0]=sn; if (!iscomp(mi)) sna[1]=mi; movecard(iscomp(mi)?1:2,sna,x1,y1,x2,y2); putdesk(sn,x2[0],y2[0]-d[0]); if (!iscomp(mi)) putdesk(mi,x2[1],y2[1]+d[1]); revolutionsort(0); tauschcard=-1; if (tauschdone) { tauschdone=0; } return 1; } } tauschcard=10*(zw?mi:sn)+c; putdesk(sn,x1[0],y1[0]); putcard(sn,cards[tauschcard],x1[0],y1[0]+d[0]); if (!iscomp(mi)) { putdesk(mi,x1[1],y1[1]); putcard(mi,cards[tauschcard],x1[1],y1[1]-d[1]); } return 1; } if (x>=desk[sn].pboxx+27*desk[sn].f/desk[sn].q && x<=desk[sn].pboxx+100*desk[sn].f/desk[sn].q && y>=desk[sn].pboxy+1 && y<=desk[sn].pboxy+16*desk[sn].f/desk[sn].q) inv_fbox(sn,1); else return 0; stdwait(); inv_fbox(sn,0); rem_fbox(sn); tauschdone|=left(sn)==spieler?1:2; if (iscomp(mi) || tauschdone==3) { clr_desk(1); spielphase(); } else { tauschply=mi; put_fbox(mi,TX_FERTIG); } return 1; } int hndl_spielen(sn,x,y) int sn,x,y; { int i,c; c=card_at(sn,x,y,0); if (c) { di_delres(sn); c--; calc_poss(sn); for (i=0;i=3) { di_eingabe(sn); errcnt[sn]=0; } } } else { errcnt[sn]=0; if (send && irc_play) irc_sendxyev(sn,x,y,opt); } return ok; } VOID setcurs(f) int f; { int x,y,w,sn,snn,newsn=-1; char clr[100]; static int actsn=-1,wsn=-1,wtime; static int ur[3]; for (sn=0;sn=0) newsn=ktrply; else if (sn==spieler) newsn=sn; if (numsp==1) newsn=0; break; case SPIELEN: if (stich==1 && trumpf==5 && !ur[sn]) { di_info(sn,-1); ur[sn]=1; } if (stich==2) ur[sn]=0; if (sn==(ausspl+vmh)%3) newsn=sn; break; case SCHENKEN: newsn=schenkply; break; case NIMMSTICH: for (snn=0;snn=0) XDefineCursor(dpy[actsn],win[actsn],cursor[actsn][1]); actsn=newsn; if (actsn>=0) { for (sn=0;sn=0) { if (phase!=WEITER && phase!=REVOLUTION) di_info(f-1,actsn); } if (actsn==-1) wtime=0; if (phase==REIZEN && bockspiele && !ramschspiele) wtime=15*1000; if (!wtime || wtime>=15*1000) { if (wsn!=-1 && (actsn!=wsn || wtime==16*1000 || (phase!=REIZEN && phase!=SPIELEN && phase!=NIMMSTICH))) { x=desk[wsn].w/2; y=(desk[wsn].pboxy+desk[wsn].playy)/2; w=5*desk[wsn].cardw/XTextWidth(dfont[wsn]," ",1)+1; if (w>99) w=99; clr[w]=0; while (w) clr[--w]=' '; v_gtext(wsn,x,y,0,clr); wsn=-1; if (wtime==16*1000) wtime-=1500; if (phase!=REIZEN && phase!=SPIELEN && phase!=NIMMSTICH) wtime=0; } if (wtime==15*1000 && (phase==REIZEN || phase==SPIELEN || phase==NIMMSTICH)) { wsn=actsn; x=desk[wsn].w/2; y=(desk[wsn].pboxy+desk[wsn].playy)/2; if (phase==REIZEN) { if (bockspiele && !ramschspiele) { v_gtext(wsn,x,y,0,textarr[TX_BOCK_SPIEL].t[lang[wsn]]); } } else if (numsp!=1) { v_gtext(wsn,x,y,0,textarr[TX_DU_BIST_DRAN].t[lang[wsn]]); } } } wtime+=50; } xskat-4.0/xio.h0100644000076400001440000000673610053572555012023 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef XIO_H #define XIO_H #include #include #include "text.h" #undef EXTERN #ifdef XIO_C #define EXTERN #else #define EXTERN extern #endif EXTERN tx_typ tspnames[3][2]; EXTERN int charw[3],charh[3]; EXTERN int lost[3]; EXTERN Display *dpy[3]; EXTERN Colormap cmap[3]; EXTERN Window win[3]; EXTERN unsigned long bpix[3],wpix[3],fgpix[3],bgpix[3],btpix[3]; EXTERN unsigned long b3dpix[3],w3dpix[3],mkpix[3]; EXTERN int gfx3d[3]; EXTERN GC gc[3],gcbck[3],gcxor[3]; EXTERN XFontStruct *dfont[3]; EXTERN int ggcards; EXTERN Pixmap bck[3]; EXTERN Pixmap symbs[3]; EXTERN Pixmap cardpx[3][33]; EXTERN Cursor cursor[3][2]; EXTERN int actbtn[3]; EXTERN int skatopen,stichopen,spitzeopen,backopen[3]; EXTERN int ktrply,sptzmrk,schenkply; EXTERN int revolsort,tauschcard,tauschdone,tauschply; EXTERN long ticker; EXTERN char *prog_name; EXTERN char *disp_name[3]; EXTERN char *font_name; EXTERN char *title[3]; EXTERN char *fg_col; EXTERN char *bg_col; EXTERN char *b3d_col; EXTERN char *w3d_col; EXTERN char *mk_col; EXTERN char *bt_col; EXTERN char *ccol[4]; EXTERN int nopre; EXTERN int bwcol; EXTERN int downup; EXTERN int altseq; EXTERN int geom_f[3],geom_x[3],geom_y[3]; EXTERN int colerr; EXTERN XSizeHints szhints[3]; EXTERN XWMHints wmhints; EXTERN struct { int num,act; struct { int x1,y1,x2,y2,f; } p[21]; } selpos[3]; EXTERN struct { int large; int x,y,w,h; int col,plan; int com1x,com2x,com1y,com2y; int playx,playy; int skatx,skaty; int stichx,stichy; int cbox1x,cbox2x,cboxy; int pboxx,pboxy; int cardx,cardw,cardh; int f,q; } desk[3]; EXTERN XColor color[3][256] #ifdef XIO_C = {{ {0,0xffff,0x0000,0x0000}, {0,0xffff,0x0000,0x0000}, {0,0x0000,0x0000,0x0000}, {0,0x0000,0x0000,0x0000}, {0,0xff00,0xb400,0x0000}, {0,0x0000,0xb400,0x0000} }} #endif ; EXTERN int cnts[] #ifdef XIO_C = { 0,2,22,26,30,34,52,68,82 } #endif ; EXTERN int bigs[] #ifdef XIO_C = { 33,60, 15,6, 51,6, 33,24, 15,43, 51,43, 15,77, 51,77, 33,93, 15,111, 51,111, 7,9, 60,107, 7,9, 60,107, 7,9, 60,107, 15,6, 51,6, 15,43, 51,43, 33,60, 15,77, 51,77, 15,111, 51,111, 15,6, 51,6, 33,33, 15,60, 51,60, 33,87, 15,111, 51,111, 15,6, 51,6, 33,33, 15,60, 51,60, 15,111, 51,111 } #endif ; EXTERN int smls[] #ifdef XIO_C = { 2,23, 77,23, 2,105, 77,105 } #endif ; EXTERN int smlz[] #ifdef XIO_C = { 4,16, 75,16, 4,112, 75,112 } #endif ; EXTERN int smlc[] #ifdef XIO_C = { 6,5, 78,5, 6,126, 78,126 } #endif ; EXTERN int frm[2][9][2] #ifdef XIO_C = { { {1,4},{1,3},{2,2}, {3,1},{4,1},{0,0}, {0,0},{0,0},{0,0} }, { {1,7},{1,6},{1,5}, {2,4},{3,3},{4,2}, {5,1},{6,1},{7,1} } } #endif ; EXTERN int ramp[4][6] #ifdef XIO_C = { {0, 70,100,150,180,255}, {0, 70,150,180,255,255}, {0, 70,180,255,255,255}, {0,180,255,255,255,255} } #endif ; #endif /* XIO_H */ xskat-4.0/README0100644000076400001440000000132010045741547011713 0ustar ggusers XSkat lets you play the card game Skat as defined by the official Skat Order. Up to 3 players may be simulated by the computer. This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. Gunter Gerhardt (http://www.xskat.de) xskat-4.0/configure0100755000076400001440000000007007147272355012750 0ustar ggusers#!/bin/sh # # Create Makefile from Imakefile # xmkmf -a xskat-4.0/Imakefile0100644000076400001440000000243607171643160012653 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ /*DEFL=-DDEFAULT_LANGUAGE=\"german\"*/ DEFL=-DDEFAULT_LANGUAGE=\"english\" DEFI=-DDEFAULT_IRC_SERVER=\"irc.fu-berlin.de\" DEFINES=$(DEFL) $(DEFI) LOCAL_LIBRARIES=$(XLIBONLY) OBJS=skat.o ramsch.o null.o bitmaps.o xio.o xdial.o irc.o text.o SRCS=skat.c ramsch.c null.c bitmaps.c xio.c xdial.c irc.c text.c ComplexProgramTarget(xskat) /* If you don't need the German man page, delete the next line */ InstallManPage(xskat-de,$(MANDIR)) ckdef: @echo Checking defs.h;\ sed -n "1,/######/p" defs.h > defs;\ cat *.c|sed -n 's/^\([a-zA-Z].*\)(.*)/\1();/p' >> defs;\ diff defs defs.h || mv defs defs.h;\ rm -f defs xskat-4.0/xskat.man0100644000076400001440000006356310053744247012702 0ustar ggusers.\" -*- nroff -*- .\" .\" xskat - a card game for 1 to 3 players. .\" Copyright (C) 2004 Gunter Gerhardt .\" .\" This program is free software; you can redistribute it freely. .\" Use it at your own risk; there is NO WARRANTY. .\" .\" Redistribution of modified versions is permitted .\" provided that the following conditions are met: .\" 1. All copyright & permission notices are preserved. .\" 2.a) Only changes required for packaging or porting are made. .\" or .\" 2.b) It is clearly stated who last changed the program. .\" The program is renamed or .\" the version number is of the form x.y.z, .\" where x.y is the version of the original program .\" and z is an arbitrary suffix. .\" .TH XSKAT 6 "May 2004" .SH NAME xskat \- a card game for 1 to 3 players. .SH SYNOPSIS .B xskat .RB [ \-display | \-d .IR display ] .RB [ \-geometry | \-g .IR geometry ] .RB [ \-font | \-fn .IR font ] .RB [ \-iconic | \-i ] .RB [ \-title | \-T .IR string ] .RB [ \-name .IR prog ] .RB [ \-fg .IR color ] .RB [ \-bg .IR color ] .RB [ \-bt .IR color ] .RB [ \-mark .IR color ] .RB [ \-3d ] .RB [ \-2d ] .RB [ \-3dtop .IR color ] .RB [ \-3dbot .IR color ] .RB [ \-mb .IR button# ] .RB [ \-keyboard .IR number ] .RB [ \-tdelay .IR seconds ] .RB [ \-fastdeal ] .RB [ \-slowdeal ] .RB [ \-help | \-h ] .RB [ \-frenchcards ] .RB [ \-french4cards ] .RB [ \-germancards ] .RB [ \-german4cards ] .RB [ \-color ] .RB [ \-mono ] .RB [ \-color1 .IR color ] .RB ".." " " [ \-color4 .IR color ] .RB [ \-large ] .RB [ \-small ] .RB [ \-up ] .RB [ \-down ] .RB [ \-alt ] .RB [ \-seq ] .RB [ \-list | \-l .IR file ] .RB [ \-alist ] .RB [ \-nlist ] .RB [ \-tlist ] .RB [ \-log .IR file ] .RB [ \-dolog ] .RB [ \-nolog ] .RB [ \-fmt ] .RB [ \-unfmt ] .RB [ \-game .IR file ] .RB [ \-briefmsg ] .RB [ \-verbosemsg ] .RB [ \-trickl2r ] .RB [ \-notrickl2r ] .RB [ \-lang .IR language ] .RB [ \-start .IR player# ] .RB [ \-s1 .IR number ] .RB [ \-s2 .IR number ] .RB [ \-s3 .IR number ] .RB [ \-ramsch ] .RB [ \-noramsch ] .RB [ \-ramschonly ] .RB [ \-sramsch ] .RB [ \-nosramsch ] .RB [ \-skattolast ] .RB [ \-skattoloser ] .RB [ \-kontra ] .RB [ \-nokontra ] .RB [ \-kontra18 ] .RB [ \-bock ] .RB [ \-nobock ] .RB [ \-bockramsch ] .RB [ \-bockevents .IR number ] .RB [ \-resumebock ] .RB [ \-noresumebock ] .RB [ \-spitze ] .RB [ \-spitze2 ] .RB [ \-nospitze ] .RB [ \-revolution ] .RB [ \-norevolution ] .RB [ \-klopfen ] .RB [ \-noklopfen ] .RB [ \-schenken ] .RB [ \-noschenken ] .RB [ \-hint ] .RB [ \-nohint ] .RB [ \-newrules ] .RB [ \-oldrules ] .RB [ \-shortcut ] .RB [ \-noshortcut ] .RB [ \-askshortcut ] .RB [ \-irc ] .RB [ \-noirc ] .RB [ \-irctelnet .IR program ] .RB [ \-ircserver .IR hostname ] .RB [ \-ircport .IR number ] .RB [ \-ircchannel .IR name ] .RB [ \-ircnick .IR name ] .RB [ \-ircuser .IR name ] .RB [ \-ircrealname .IR name ] .RB [ \-ircpos .IR number ] .RB [ \-irclog .IR file ] .RB [ \-irclogappend ] .RB [ \-irclogoverwrite ] .RB [ \-auto .IR #ofgames ] .RB [ \-opt .IR file ] .RB [ \-pk ] .RI [ player\fB@\fIdisplay... ] .SH DESCRIPTION .B XSkat lets you play the card game Skat as defined by the official Skat Order. .PP Up to 3 players may be simulated by the computer. .PP After starting the game a mouse click or ESC/F1 will bring up a menu. Other useful keys are: Space, Return, Tab, Cursor left/right/up/down. The rest of the game controls should be fairly obvious. .PP An introduction to Skat can be found at .br http://www.xskat.de/xskat.html .SH OPTIONS In the following descriptions, the player starting .B XSkat is called player1. .TP .PD 0 .BI \-display " display name" .TP .PD 0 .BI \-geometry " geometry specification" .TP .PD 0 .BI \-font " font name" " \fR(default: 9x15 or 10x20)" .TP .PD 0 .B \-iconic .TP .PD 0 .BI \-title " window title" .TP .PD 0 .BI \-name " application resource name" .TP .PD 0 .BI \-fg " foreground color" .TP .PD .BI \-bg " background color" The usual X toolkit options. .TP .BI \-bt " color" The color of dialog buttons. .TP .BI \-mark " color" The color of the marks that indicate .br who is forehand (during bidding), .br who is the Soloist, .br which card the computer would play, .br or the keyboard focus .br (default: red or black). .TP .B \-3d Use a 3D look for dialogs (default). .TP .B \-2d Use the old, flat style (default on monochrome screens). .TP .BI \-3dtop " color" The color used for the lines around the top and left sides of 3D buttons (default: white). .TP .BI \-3dbot " color" The color used for the lines around the bottom and right sides of 3D buttons (default: black). .TP .BI \-mb " menu button" The number of the mouse button that brings up the menu (default: 0 = any button). .TP .BI \-keyboard " number" Define how much of the user interface may be controlled by the keyboard. The number has the following meaning: .nf .ne 3 0 : Nothing. 1 : More (default). 2 : Everything. .fi .TP .BI \-tdelay " seconds" Specifies how long the last trick will be visible. A delay of more than 10 seconds means that the trick will be removed after pressing a mouse button. In multiplayer mode the largest specified value is used (default: 0.7). .TP .BI \-fastdeal Deal the cards without any time consuming animation. .TP .BI \-slowdeal Deal the cards slowly (default). .TP .B \-help Show a short help text. .TP .B \-frenchcards Play with French suited cards. .TP .B \-french4cards Change the colors of diamond and spade to orange and green, so that the 4 suits have easily distinguishable colors (default). .TP .B \-germancards Use German cards. .TP .B \-german4cards Change the color of acorns to brown, so that the 4 suits have easily distinguishable colors. .TP .B \-color Use colored cards. If there are not enough colors left, the number of colors used to draw the cards will be reduced appropriately (default). .TP .B \-mono Use b&w cards. .TP .BR \-color1 " .. " \-color4 Redefine the colors of the suits diamond, heart, spade and club. Selecting .B \-french4cards overrides the colors for diamond and spade. .TP .BR \-large " and " \-small Select the size of the main window (default: as large as possible). .TP .B \-down Sort cards downwards (default). .TP .B \-up Sort cards upwards. .TP .B \-alt Sort cards in alternating order. .TP .B \-seq Sort cards in sequential order (default). .TP .BI \-list " filename" The file for saving/restoring the game list (default: $HOME/.xskat.lst or ./xskat.lst if HOME isn't set. For IRC games: .irc instead of .lst). .TP .B \-alist Alternative form of listing. .TP .B \-nlist Normal form of listing (default). .TP .B \-tlist Listing with tournament scoring. .TP .BI \-log " filename" Turn on automatic logging, i.e. append logs of all games to .I filename (\- means stdout). .TP .B \-dolog Turn on automatic logging (default file: $HOME/.xskat.log or ./xskat.log). .TP .B \-nolog Turn off automatic logging (default). Logs of individual games may still be saved during the game. .TP .B \-fmt Write formatted log files, i.e. use backspaces for underlining and boldface. .TP .B \-unfmt Write unformatted log files (default). .TP .BI \-game " filename" Read predefined games from .I filename (\- means stdin). Not available for IRC play. See also section FILES below. .TP .B \-briefmsg Indicate who is forehand (during bidding) and who is the Soloist by displaying a small mark on the back of the cards. .TP .B \-verbosemsg Additionally print out everyones position and what is being played (default). .TP .B \-trickl2r Put down the cards of a trick from left to right (default). .TP .B \-notrickl2r Place the cards corresponding to the players positions. .TP .BI \-lang " language" Currently available: English and German (default: $LANG/$LANGUAGE is tried first. Then: see Imakefile/Makefile). .TP .BI \-start " number" The player who starts dealing cards (default: 2). .TP .PD 0 .BI \-s1 " number" .TP .PD 0 .BI \-s2 " number" .TP .PD .BI \-s3 " number" Change the playing strenght of the computer players. .br .B s1 corresponds to the left computer in single player mode or to the one and only computer in two player mode. .br .B s2 corresponds to the right computer in single player mode. .br .B s3 is only useful with .BR \-auto . .br The number must be between \-4 (weak) and 0 (default). .TP .B \-ramsch Play a game of Ramsch when all players pass. .br The following rules are currently implemented: .br The Skat remains face down until it goes to the winner of the last trick (or to the loser of the game, s.b.). The amount lost is the number of card points taken. If two players tie for most card points, they both lose. If all tie, the score is 0. If one player takes no tricks (a virgin) the amount lost by the loser is doubled. Someone taking all the tricks (forced march) wins 120 points. .TP .B \-noramsch Don't play Ramsch (default). .TP .B \-ramschonly Play Ramsch each game. .TP .B \-sramsch Play Schieberamsch instead of simple Ramsch. .br The rules are: .br Each player in turn, starting with Forehand, may pick up the Skat and discard two cards face down. It's not allowed to pass on jacks. The score is doubled each time a player doesn't pick up the Skat. .TP .B \-nosramsch Don't play Schieberamsch (default). .TP .B \-skattoloser At the end of a Ramsch game the Skat is awarded to the loser(s). This will increase the loss. .TP .B \-skattolast The Skat goes to the winner of the last trick (default). .TP .B \-kontra Allow opponents to say 'Kontra' which doubles the score of the game. The Soloist may reply 'Re' to double the score again. .TP .B \-nokontra Disallow Kontra (default). .TP .B \-kontra18 Only an opponent who said at least 18 may say 'Kontra'. .TP .B \-bock Play a Bockround after some special event. The score is doubled in the next 3 games. If an event causing a new Bockround happens before the current Bockround is over or several Bockround events happen at the same time, the number of Bockrounds still to play is increased appropriately. .TP .B \-nobock Don't play Bockrounds (default). .TP .B \-bockramsch Play a round of compulsory Ramsch after each Bockround. Before a game of Ramsch begins, each player in turn, starting with Forehand, may declare to play Grand Hand instead. After a Grand Hand the same player deals again because this game does not count towards completing the Ramschround. .TP .BI \-bockevents " number" Specify the events that cause a Bockround. .nf .ne 8 (1) A game is lost with 60 points. (2) A successful Grand Hand. (4) A successful Kontra (opponents win). (8) A game with Kontra & Re. (16) A player's score ends in 3 equal digits. (32) A player's score is a multiple of 100. (64) A game value of +72 or more. (128) A game value of +96 or more. .fi Add up the numbers in parentheses to specify the desired events (default: 0). .br Notes: .br A Kontra where the Soloist said Re but lost counts as one event not two (events 4 and 8). .br To check a player's score, the current listing options of player1 are used (events 16 and 32). A score that is a multiple of 1000 counts as one event. .br The game value (events 64 and 128) is the normal value without considering any doubling caused by Ramsch, Kontra or Bock. .TP .B \-resumebock Resume unfinished Bockrounds after quitting and restarting .BR XSkat . The number of games to play is read from the game list file. .TP .B \-noresumebock Don't resume Bockrounds (default). .TP .B \-spitze Allow the Soloist to declare Spitze. This means that the last trick must be made with the lowest trump to win the game. This will be indicated to the other players by displaying the lowest trump. The game multiplier is increased by 1. It's not allowed to say Spitze in a Grand with 4 jacks. .TP .B \-spitze2 Declaring Spitze increases the multiplier by 2. .TP .B \-nospitze Don't allow Spitze (default). .TP .B \-revolution Enable a special variation of Null ouvert. After the Soloist's cards are exposed the opponents can look at each other's cards and rearrange the cards between their two hands in any way they wish before the start of the play. Revolution is worth 92 points. .TP .B \-norevolution Don't allow Revolution (default). .TP .B \-klopfen During a Ramschround you may knock (klopfen) at the beginning of a game to indicate that you think you won't lose. This will double the score of the game. Klopfen is not possible if you don't pick up the Skat in Schieberamsch. .TP .B \-noklopfen Don't allow Klopfen (default). .TP .B \-schenken If the opponents decide at the start of the play that they cannot defeat the Soloist, they can give up. This is done by selecting Schenken from the main menu during the first trick when it's your turn. If the Soloist accepts, the score is as though the game was won simply. The Soloist can insist on playing on, but in that case has to make the opponents Schneider to win. The score in this case is as for an announced Schneider (the multiplier is increased by 2). If the Soloist goes on the opponents can schenken again, giving the Soloist the Schneider. The Soloist can accept Schneider or insist on playing on for Schwarz. .TP .B \-noschenken Don't allow Schenken (default). .TP .B \-hint Put a mark over the card the computer would play. .TP .B \-nohint Don't show computer hints (default). .TP .B \-newrules Use the official rules of 01/01/1999: .br Lost Hand games count double. .br The Grand Ouvert multiplier is 24. .br (default) .TP .B \-oldrules Lost Hand games count simple. .br The Grand Ouvert multiplier is 36. .TP .B \-shortcut Always finish the game when the remaining tricks will all go to one side. .TP .B \-noshortcut Play each trick. .TP .B \-askshortcut Ask whether a shortcut should be taken (default). .TP .B \-irc Play via Internet Relay Chat. This option will establish a connection to an IRC server where you can join other people for a game of Skat. .br How it works: .br Start .B XSkat from an xterm. Wait until the server has printed the welcome message. You are now on channel #xskat where new games should be planned. Everything you type into the xterm will be sent to everyone else on this channel. After you have found one or two other players and agreed upon the name of a new channel (say #xskat123), you should type .BR /join " #xskat123." When all players are on the new channel, exactly one player has to type .BR /go " (or " /go2 if there are only 2 players) to start the game. Now you can play and talk. .TP .B \-noirc Don't use IRC (default). .TP .BI \-irctelnet " program" Specify the program that will be used to connect to the IRC server. If you are sitting behind a firewall, a program like rtelnet must be used and you may have to set $SOCKS_SERVER to the name of your firewall host (default: telnet). .TP .BI \-ircserver " host-name" Select an IRC server near you! (default: $IRCSERVER or irc.fu-berlin.de, if not changed in the Imakefile/Makefile) .TP .BI \-ircport " number" The port of the IRC server to connect to (default: $IRCPORT or 6667). .TP .BI \-ircchannel " name" The channel to join initially (default: #xskat). .TP .BI \-ircnick " name" Your IRC nickname. If your nick is already used by someone else, a different nick will be generated automatically. Some servers allow a nick length of 30, others limit it to 9 characters. (default: $IRCNICK or $IRCUSER or $LOGNAME or xskatNNNN). .TP .BI \-ircuser " name" Your user/login name. Note: most servers don't like faked user names (default: $IRCUSER or $LOGNAME). .TP .BI \-ircrealname " name" Your real name (default: $IRCNAME or the entry from the passwd file or 'XSkat player'). .TP .BI \-ircpos " number" Select your position relative to the other players. Positions are numbered clockwise 1, 2 and 3. Player 2 will start dealing if not specified otherwise with .BR \-start " or " /start . If you don't specify your position or there is a conflict with someone else's choice or you give an invalid number (3 in a 2 player game), this will be fixed automatically. Choosing the right positions is important if you want to continue with a saved game list (default: 0 = I don't care). .TP .BI \-irclog " file" Everything sent to or received from the IRC server is saved to this file (\- means stdout). It may be useful for debugging (default: $HOME/.xskat.ilg or ./xskat.ilg). .TP .B \-irclogappend Append output to the log file. .TP .B \-irclogoverwrite Overwrite existing log file (default). .TP .B IRC commands: .br .BR /nick " name, " /nick \- change or display your nickname. .br .B /who \- is on the current channel ? .br .B /list, /list string \- show all channels that match the word xskat or the specified string. This will take some time on networks with a large number of channels. Trying to stop the listing will terminate the program. .br .BR /pos " number \- see " \-ircpos . .br .B /bell \- toggle the alarm bell. When on, the bell will ring each time someone joins your channel or sends a message to you. The bell is off initially. .br .B /quit \- terminate .BR XSkat . .br .B /sync \- if messages get lost due to a net-split (or because someone left the channel during play), .B XSkat will detect this and in most cases should be able to synchronize automatically (within 30 seconds) after the connection is reestablished. Typing .B /sync will try this immediately. .br .BR /quote " command args" \- for those who know what they are doing. .br The following commands are only useful for the player who will start the game by typing .B /go because that player will determine the rules of the game. .br .B /default \- set the official rules. .br .B /ramsch, /sramsch, /skattoloser, /kontra, /bock, /resumebock, .B /spitze, /revolution, /klopfen, /schenken, /oldrules, .B /bockevents, /alist, /tlist, /start, /s1 \- change the rules of the game. All of these require an argument (a number or True/False) just like the resources with the same name. .br .B /rules \- show the current rules to everyone on your channel. .TP .B Notes: The version numbers of all participating programs must be equal. .br Most options cannot be changed during the game. Options that can be changed are not saved to a file. .br The game list can only be cleared during bidding or when it's your turn to play a card. There is a different default game list for IRC games (see .BR \-list ). .br It's possible to type into the xterm or the game window (which is recommended), but changing input sources in the middle of a line won't work. .br If you want better input line editing and a split screen try the program ssfe. It is used like this: ssfe \-raw xskat \-irc .br You can omit .B \-irc when you specify any of the other IRC options. .TP .BI \-auto " #ofgames" Three computers play the specified number of games without human interaction. The resulting scores are printed. .br With this option, no resources are read, and the game list is saved only if .B \-list is specified. .TP .BI \-opt " filename" The file for saving/restoring all interactively changeable options of all players (default: $HOME/.xskat.opt or ./xskat.opt). Command line options take precedence over options specified in this file which in turn override resource specifications. This may be changed with the .B useoptfile resource. .TP .BI \-pk If you want the computer to deal a Good Hand every time. (as requested by Petra K.) Alternatively, pressing F6 three times will result in a Good Hand for the next game. Does not work in multiplayer mode. .TP .IB player @ display Specifies the display of the second and third player (but is ignored for IRC games). The .IB player @ part may be omitted if the .B alias resource is set on .IR display . .SH RESOURCES .PP Command line options take precedence over resource specifications for player1. .TP .B geometry, font, title, foreground, background The usual X11 resources. .TP .B mark (see .BR \-mark ). .TP .B button (used for 2D buttons, see .BR \-bt ). .TP .B 3dbutton (used for 3D buttons, see .BR \-bt , default: a shade of gray). .TP .B 3dbackground (used for 3D dialogs, see .BR \-bg , default: a different shade of gray). .TP .B 3d True or False (see .BR \-3d " and " \-2d ). .TP .B 3dtop (see .BR \-3dtop ). .TP .B 3dbot (see .BR \-3dbot ). .TP .B menubutton (see .BR \-mb ). .TP .B keyboard (see .BR \-keyboard ). .TP .B tdelay (see .BR \-tdelay ). .TP .B fastdeal True or False (see .BR \-fastdeal " and " \-slowdeal ).(#) .TP .B cards 0, 1, 2 or 3 (see .BR \-frenchcards ", " \-french4cards ", " .BR \-germancards " and " \-german4cards ). .TP .B color True or False (see .BR \-color " and " \-mono ). .TP .B color1 .. color4 (see .BR \-color1 " .. " \-color4 ). .TP .B large True or False (see .BR \-large " and " \-small ). .TP .B down True or False (see .BR \-down " and " \-up ). .TP .B alt True or False (see .BR \-alt " and " \-seq ). .TP .B list (see .BR \-list ).(#) .TP .B alist True or False (see .BR \-alist " and " \-nlist ). .TP .B tlist True or False (see .BR \-tlist " and " \-nlist ). .TP .B log (see .BR \-log ).(#) .TP .B dolog True or False (see .BR \-dolog " and " \-nolog ).(#) .TP .B formatted True or False (see .BR \-fmt " and " \-unfmt ).(#) .TP .B game (see .BR \-game ).(#) .TP .B briefmsg True or False (see .BR \-briefmsg " and " \-verbosemsg ). .TP .B trickl2r True or False (see .BR \-trickl2r " and " \-notrickl2r ). .TP .B language (see .BR \-lang ). .TP .B start (see .BR \-start ).(#) .TP .B s1, s2 (see .BR \-s1 ", " \-s2 ).(#) .TP .B ramsch 0, 1 or 2 (see .BR \-noramsch ", " \-ramsch " and " \-ramschonly ).(#) .TP .B sramsch True or False (see .BR \-sramsch " and " \-nosramsch ).(#) .TP .B skattoloser True or False (see .BR \-skattoloser " and " \-skattolast ).(#) .TP .B kontra 0, 1 or 2 (see .BR \-nokontra ", " \-kontra " and " \-kontra18 ).(#) .TP .B bock 0, 1 or 2 (see .BR \-nobock ", " \-bock " and " \-bockramsch ).(#) .TP .B bockevents (see .BR \-bockevents ).(#) .TP .B resumebock True or False (see .BR \-resumebock " and " \-noresumebock ).(#) .TP .B spitze 0, 1 or 2 (see .BR \-nospitze ", " \-spitze " and " \-spitze2 ).(#) .TP .B revolution True or False (see .BR \-revolution " and " \-norevolution ).(#) .TP .B klopfen True or False (see .BR \-klopfen " and " \-noklopfen ).(#) .TP .B schenken True or False (see .BR \-schenken " and " \-noschenken ).(#) .TP .B hint True or False (see .BR \-hint " and " \-nohint ). .TP .B oldrules True or False (see .BR \-oldrules " and " \-newrules ).(#) .TP .B shortcut 0, 1 or 2 (see .BR \-noshortcut ", " \-askshortcut " and " \-shortcut ). .TP .B irc True or False (see .BR \-irc " and " \-noirc ).(#) .TP .B irctelnet (see .BR \-irctelnet ).(#) .TP .B ircserver (see .BR \-ircserver ).(#) .TP .B ircport (see .BR \-ircport ).(#) .TP .B ircchannel (see .BR \-ircchannel ).(#) .TP .B ircnick (see .BR \-ircnick ).(#) .TP .B ircuser (see .BR \-ircuser ).(#) .TP .B ircrealname (see .BR \-ircrealname ).(#) .TP .B ircpos (see .BR \-ircpos ).(#) .TP .B irclist (see .BR \-list ).(#) .TP .B irclog (see .BR \-irclog ).(#) .TP .B irclogappend True or False (see .BR \-irclogappend " and " \-irclogoverwrite ).(#) .TP .B opt (see .BR \-opt ).(#) .TP .B useoptfile True or False (default: False). This is a resource for multiplayer mode (but not for IRC). It is ignored for player1. If set to True, the contents of the option file, which is owned by player1, are used. This means that you may end up with someone else's preferred settings if player1 used this file in a different multiplayer game. .TP .B alias The player's real name (max. 2 words of 9 characters, default: $LOGNAME). .PP Only player1 may specify the resources marked with (#). .PP Filenames starting with ~/ are interpreted correctly if HOME is set. .SH FILES An example of a file specifying predefined games: .nf .ne 7 # The following block specifies the distribution # of cards for player1, 2, 3 and Skat(0). # A 10 K Q J 9 8 7 2 2 2 2 2 0 3 3 # Diamond 2 2 2 2 2 3 3 3 # Heart 1 1 1 1 1 3 3 3 # Spade 1 1 1 1 1 0 3 3 # Club .ne 7 # The following is not the same game ! # Player numbers rotate 3 -> 2 -> 1 -> 3 # (and depend on the start option). 2 2 2 2 2 0 3 3 2 2 2 2 2 3 3 3 1 1 1 1 1 3 3 3 1 1 1 1 1 0 3 3 .ne 4 repeat # Repeat the above games forever. # The following lines take effect only # when you delete the 'repeat'. .ne 9 random_seed 123456 0 2 # Specifies the random number which determines # card distribution for all following games. # The second number lets you skip that many # games in the sequence. # The third (optional) number defines # who will start dealing cards (see \-start). # An additional L or R following this number will # rotate the cards left or right. .ne 3 # The random_seed will be shown in game logs # to allow easy replay. Just type: # echo random_seed 123456 0 2 | xskat -game - .fi .SH NOTES There are no official rules for the variations Ramsch, Kontra, Bock, Spitze, Revolution, Klopfen and Schenken. .PP If executing .BR "xskat player@otherhost:0" " on " yourhost gives an error message you could try the command .BR "xhost yourhost" " on " otherhost to grant .B yourhost access to .BR otherhost "'s " display. .PP If you replay a game with your own cards, it doesn't matter whether 'Forehand changes' is set to 'yes' or 'no'. .PP Some versions of telnet have a bug, that prevents them from reading input from a pipe correctly. See README.IRC for a fix or put this into your ~/.telnetrc: .nf .ne 3 irc.fu-berlin.de set echo off set escape off set rlogin off set flushoutput off set interrupt off set quit off set eof off set erase off set kill off set lnext off set susp off set reprint off set worderase off set start off set stop off set forw1 off set forw2 off set ayt off .fi Leading blanks are important! Change the irc server line appropriately. .SH AUTHOR Gunter Gerhardt .PP The latest version is always available at .br http://www.xskat.de/xskat.html .nf This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. Card images used with permission by Spielkartenfabrik Altenburg GmbH, Marke ASS Altenburger Leipziger Strasse 7, 04600 Altenburg, Germany .fi xskat-4.0/symbl.xbm0100644000076400001440000004324706722565517012717 0ustar ggusers#define symbl_width 576 #define symbl_height 40 static unsigned char symbl_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x99, 0xc7, 0x87, 0x67, 0xc6, 0x03, 0x33, 0xf3, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x99, 0xcf, 0xcf, 0x6f, 0xe6, 0x07, 0x33, 0xfb, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xff, 0x00, 0xb3, 0x8d, 0xd9, 0xcc, 0x6c, 0x63, 0x06, 0xb3, 0x99, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x14, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0xb3, 0x87, 0xd9, 0xcc, 0xec, 0x61, 0x06, 0xf3, 0x98, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x50, 0x41, 0x05, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1c, 0x00, 0xf0, 0xc1, 0x07, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0xbf, 0x87, 0xd9, 0xc7, 0xef, 0x61, 0x06, 0xf3, 0x98, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0xa8, 0xa2, 0x0a, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x55, 0x00, 0x00, 0x55, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0xe3, 0x0f, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0xbf, 0x87, 0xd9, 0xcc, 0xef, 0x61, 0x06, 0xf3, 0x98, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x54, 0x55, 0x15, 0x80, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xaa, 0x00, 0x80, 0xaa, 0x00, 0xe0, 0x88, 0x03, 0x70, 0x08, 0x07, 0x00, 0x7f, 0x00, 0xfc, 0xf7, 0x1f, 0x80, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xff, 0x00, 0x80, 0xff, 0x00, 0xe0, 0x88, 0x03, 0x70, 0x08, 0x07, 0xb3, 0x8d, 0xd9, 0xcc, 0x6c, 0x63, 0x37, 0xb3, 0x99, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x00, 0xa8, 0xaa, 0x0a, 0xc0, 0xff, 0x01, 0x00, 0x7f, 0x00, 0x40, 0x55, 0x01, 0x40, 0x55, 0x01, 0xf0, 0xc9, 0x07, 0xf8, 0x88, 0x0f, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x1f, 0xc0, 0xff, 0x01, 0x00, 0x7f, 0x00, 0xc0, 0xff, 0x01, 0xc0, 0xff, 0x01, 0xf0, 0xc9, 0x07, 0xf8, 0x88, 0x1f, 0xb3, 0x99, 0xcf, 0xcf, 0x6c, 0xe6, 0xf3, 0x33, 0xfb, 0xf9, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x01, 0x54, 0x55, 0x15, 0xe0, 0xff, 0x03, 0x70, 0x3e, 0x07, 0xa0, 0xaa, 0x02, 0xa0, 0xaa, 0x02, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0xc0, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xe0, 0xff, 0x03, 0x70, 0x3e, 0x07, 0xe0, 0xff, 0x03, 0xe0, 0xff, 0x03, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0xb3, 0x99, 0xc7, 0xc7, 0x6c, 0xc6, 0xe7, 0x31, 0xf3, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x02, 0xa8, 0xaa, 0x0a, 0xf0, 0xff, 0x07, 0xf8, 0x9c, 0x0f, 0x50, 0x55, 0x05, 0x50, 0x55, 0x05, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0xe0, 0xff, 0x03, 0xfc, 0xff, 0x1f, 0xf0, 0xff, 0x07, 0xf8, 0x9c, 0x0f, 0xf0, 0xff, 0x07, 0xf0, 0xff, 0x07, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x54, 0x55, 0x15, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0xa8, 0xaa, 0x0a, 0xa8, 0xaa, 0x0a, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0xf0, 0xff, 0x07, 0xfc, 0xff, 0x1f, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x0a, 0xa8, 0xaa, 0x0a, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0x50, 0x55, 0x05, 0x54, 0x55, 0x15, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0xf0, 0xff, 0x07, 0xfc, 0xff, 0x1f, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x0f, 0xb3, 0x19, 0x9e, 0xcf, 0x6c, 0xe6, 0xe3, 0x31, 0xf3, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x50, 0x55, 0x05, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0xa0, 0xaa, 0x02, 0xa8, 0xaa, 0x0a, 0xf0, 0xff, 0x07, 0xf8, 0x9c, 0x0f, 0xf0, 0xff, 0x07, 0xf0, 0xff, 0x07, 0xf8, 0xff, 0x0f, 0xfc, 0xff, 0x1f, 0xe0, 0xff, 0x03, 0xfc, 0xff, 0x1f, 0xf0, 0xff, 0x07, 0xf8, 0x9c, 0x0f, 0xb3, 0x19, 0xdf, 0xcf, 0x6c, 0xc6, 0xf7, 0x33, 0xfb, 0xf9, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x02, 0xa0, 0xaa, 0x02, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0x40, 0x55, 0x01, 0x54, 0x55, 0x15, 0xe0, 0xff, 0x03, 0x70, 0x3e, 0x07, 0xe0, 0xff, 0x03, 0xe0, 0xff, 0x03, 0xf8, 0xff, 0x0f, 0xfc, 0xc9, 0x1f, 0xc0, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xe0, 0xff, 0x03, 0x70, 0x3e, 0x07, 0x33, 0x9b, 0xd9, 0xcc, 0xcc, 0xe6, 0x36, 0x63, 0x9b, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x01, 0x40, 0x55, 0x01, 0xf0, 0xc9, 0x07, 0xf8, 0x88, 0x0f, 0x80, 0xaa, 0x00, 0xa8, 0xaa, 0x0a, 0xc0, 0xff, 0x01, 0x00, 0x7f, 0x00, 0xc0, 0xff, 0x01, 0xc0, 0xff, 0x01, 0xf0, 0xc9, 0x07, 0xf8, 0x88, 0x0f, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x1f, 0xc0, 0xff, 0x01, 0x00, 0x7f, 0x00, 0x3f, 0x9e, 0xd9, 0xcc, 0x8f, 0x67, 0x36, 0xc0, 0x9b, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x00, 0x80, 0xaa, 0x00, 0xe0, 0x88, 0x03, 0x70, 0x08, 0x07, 0x00, 0x55, 0x00, 0x54, 0x55, 0x15, 0x80, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xff, 0x00, 0x80, 0xff, 0x00, 0xe0, 0x88, 0x03, 0x70, 0x08, 0x07, 0x00, 0x7f, 0x00, 0xfc, 0xf7, 0x1f, 0x80, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x3f, 0x9e, 0x99, 0xcf, 0x8f, 0x67, 0x36, 0xc0, 0x9b, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x55, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x2a, 0x00, 0xa8, 0xa2, 0x0a, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0xe3, 0x0f, 0x00, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x33, 0x9e, 0xd9, 0xcc, 0x8c, 0x67, 0x36, 0xc0, 0x9b, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x14, 0x00, 0x50, 0x41, 0x05, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1c, 0x00, 0xf0, 0xc1, 0x07, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x33, 0x9b, 0xd9, 0xcc, 0xcc, 0x66, 0x36, 0x60, 0x9b, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x14, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3e, 0x00, 0xbf, 0x19, 0xdf, 0xcf, 0x6f, 0xe6, 0x37, 0x30, 0xfb, 0x99, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x7f, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x9e, 0x19, 0x9e, 0x8f, 0x67, 0xc6, 0x33, 0x30, 0xf3, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xe3, 0xf1, 0xf8, 0xf1, 0x0c, 0x87, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0xf7, 0xfb, 0xf9, 0xf9, 0x8d, 0xc7, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x36, 0x9b, 0x81, 0x99, 0xcd, 0xc1, 0x8c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x15, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xc0, 0x1d, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xf6, 0x9b, 0xc1, 0x98, 0xcd, 0xc0, 0x8c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xa0, 0x2a, 0x70, 0x00, 0x07, 0x20, 0x00, 0x00, 0xf8, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xe0, 0x3f, 0x70, 0x00, 0x07, 0x20, 0x00, 0x00, 0xf8, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xe6, 0xf3, 0xc0, 0x98, 0xcd, 0x87, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x40, 0x15, 0xf8, 0x80, 0x0f, 0x50, 0x00, 0x02, 0x70, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xe0, 0x3f, 0xf8, 0x80, 0x0f, 0x70, 0x00, 0x02, 0x70, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x06, 0x9b, 0x61, 0x98, 0xcd, 0xcf, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0xa1, 0x2a, 0xfc, 0x41, 0x17, 0xa8, 0x00, 0x05, 0x20, 0xe0, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xe1, 0x3f, 0xfc, 0x41, 0x17, 0xf8, 0x00, 0x07, 0x20, 0xe0, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x86, 0x9b, 0x61, 0x98, 0xdd, 0xcc, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x42, 0x15, 0xfc, 0xe1, 0x3a, 0x54, 0x81, 0x0a, 0xac, 0xf1, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc3, 0x1f, 0xfc, 0xe1, 0x3a, 0xfc, 0x81, 0x0f, 0xac, 0xf1, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xe7, 0xf9, 0x31, 0xf8, 0xdd, 0xcf, 0xef, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x81, 0x0a, 0xac, 0xf1, 0x7f, 0xaa, 0x42, 0x15, 0xfc, 0xe1, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x81, 0x0f, 0xac, 0xf1, 0x7f, 0xfe, 0xc3, 0x1f, 0xfc, 0xe1, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xe3, 0xf0, 0x30, 0xf0, 0x8c, 0x87, 0xe7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x05, 0x20, 0xe0, 0x3a, 0x54, 0xa1, 0x2a, 0xfc, 0x41, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x07, 0x20, 0xe0, 0x3a, 0xfc, 0xe1, 0x3f, 0xfc, 0x41, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x02, 0x70, 0x40, 0x12, 0xa8, 0x40, 0x15, 0xf8, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x02, 0x70, 0x40, 0x12, 0xf8, 0xe0, 0x3f, 0xf8, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xf8, 0x00, 0x07, 0x50, 0xa0, 0x2a, 0x70, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xf8, 0x00, 0x07, 0x70, 0xe0, 0x3f, 0x70, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x20, 0x40, 0x15, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x20, 0xc0, 0x1d, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xskat-4.0/symbs.xbm0100644000076400001440000001731706722566475012731 0ustar ggusers#define symbs_width 384 #define symbs_height 26 static unsigned char symbs_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x9d, 0x63, 0x92, 0x41, 0xc9, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00, 0x80, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00, 0x80, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xa9, 0xa4, 0x94, 0x4a, 0x42, 0x25, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x28, 0x0a, 0xc0, 0x01, 0xe0, 0x03, 0x40, 0x01, 0x40, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xe0, 0x03, 0x38, 0x0e, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0x6f, 0xa4, 0xf3, 0x46, 0x42, 0x23, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 0x54, 0x15, 0xe0, 0x03, 0xe0, 0x03, 0xa0, 0x02, 0xa0, 0x02, 0x80, 0x00, 0xc0, 0x01, 0xf0, 0x07, 0x7c, 0x1f, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0x80, 0x00, 0xc0, 0x01, 0x69, 0xa4, 0x94, 0x46, 0x42, 0x23, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x0a, 0xaa, 0x2a, 0xf8, 0x0f, 0xe0, 0x03, 0x50, 0x05, 0x50, 0x05, 0xbc, 0x1e, 0x9c, 0x1c, 0xf8, 0x0f, 0xfe, 0x3f, 0xf8, 0x0f, 0xe0, 0x03, 0xf0, 0x07, 0xf0, 0x07, 0xbc, 0x1e, 0x9c, 0x1c, 0xa9, 0xa4, 0x94, 0x4a, 0x4b, 0x25, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x15, 0x54, 0x15, 0xfc, 0x1f, 0xdc, 0x1d, 0xa8, 0x0a, 0xa8, 0x0a, 0xfe, 0x3f, 0xbe, 0x3e, 0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0xdc, 0x1d, 0xf8, 0x0f, 0xf8, 0x0f, 0xfe, 0x3f, 0xbe, 0x3e, 0x29, 0x9d, 0x93, 0x92, 0x33, 0xc9, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x2a, 0xaa, 0x2a, 0xfe, 0x3f, 0xbe, 0x3e, 0x54, 0x15, 0x54, 0x15, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xbe, 0x3e, 0xfc, 0x1f, 0xfc, 0x1f, 0xfe, 0x3f, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x15, 0x54, 0x15, 0xfe, 0x3f, 0xfe, 0x3f, 0xaa, 0x2a, 0xaa, 0x2a, 0xfe, 0x3f, 0xbe, 0x3e, 0xfc, 0x1f, 0xfc, 0x1f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xbe, 0x3e, 0x29, 0x39, 0x97, 0xd2, 0x31, 0xc9, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x0a, 0xa8, 0x0a, 0xfe, 0x3f, 0xbe, 0x3e, 0x54, 0x15, 0x54, 0x15, 0xfc, 0x1f, 0xdc, 0x1d, 0xf8, 0x0f, 0xf8, 0x0f, 0xfe, 0x3f, 0xbe, 0x3e, 0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0xdc, 0x1d, 0x49, 0xa5, 0x94, 0xd4, 0x4a, 0x2a, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 0x50, 0x05, 0xbc, 0x1e, 0x9c, 0x1c, 0xa8, 0x0a, 0xaa, 0x2a, 0xf8, 0x0f, 0xe0, 0x03, 0xf0, 0x07, 0xf0, 0x07, 0xbc, 0x1e, 0x9c, 0x1c, 0xf8, 0x0f, 0xfe, 0x3f, 0xf8, 0x0f, 0xe0, 0x03, 0x89, 0xa5, 0x94, 0x58, 0x0a, 0x2c, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0xa0, 0x02, 0x80, 0x00, 0xc0, 0x01, 0x50, 0x05, 0x54, 0x15, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0x80, 0x00, 0xc0, 0x01, 0xf0, 0x07, 0x7c, 0x1f, 0xe0, 0x03, 0xe0, 0x03, 0x8f, 0x25, 0xf7, 0x58, 0x0a, 0x2c, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x40, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xa0, 0x02, 0x28, 0x0a, 0xc0, 0x01, 0xe0, 0x03, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xe0, 0x03, 0x38, 0x0e, 0xc0, 0x01, 0xe0, 0x03, 0x49, 0xa5, 0x94, 0x54, 0x0a, 0x2a, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0x40, 0x01, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00, 0x80, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0x26, 0x39, 0x67, 0x92, 0x09, 0xc9, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xc6, 0x3c, 0x13, 0x63, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x29, 0xa1, 0x94, 0x90, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x08, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x08, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0xce, 0x90, 0x94, 0x90, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x36, 0x1c, 0x1c, 0x08, 0x08, 0x08, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x36, 0x1c, 0x1c, 0x08, 0x08, 0x08, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x28, 0x91, 0x94, 0x63, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x2a, 0x3e, 0x2a, 0x14, 0x14, 0x3e, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x3e, 0x2a, 0x1c, 0x1c, 0x3e, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x28, 0x89, 0xb4, 0x94, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x3e, 0x7f, 0x2a, 0x2a, 0x3e, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x3e, 0x7f, 0x3e, 0x3e, 0x3e, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0xc6, 0x08, 0x13, 0x63, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x2a, 0x14, 0x36, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x2a, 0x1c, 0x36, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x08, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x08, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; xskat-4.0/xskat-de.man0100644000076400001440000007012410053576524013260 0ustar ggusers.\" -*- nroff -*- .\" .\" xskat - a card game for 1 to 3 players. .\" Copyright (C) 2004 Gunter Gerhardt .\" .\" This program is free software; you can redistribute it freely. .\" Use it at your own risk; there is NO WARRANTY. .\" .\" Redistribution of modified versions is permitted .\" provided that the following conditions are met: .\" 1. All copyright & permission notices are preserved. .\" 2.a) Only changes required for packaging or porting are made. .\" or .\" 2.b) It is clearly stated who last changed the program. .\" The program is renamed or .\" the version number is of the form x.y.z, .\" where x.y is the version of the original program .\" and z is an arbitrary suffix. .\" .TH XSKAT 6 "Mai 2004" .SH NAME xskat \- ein Kartenspiel f\(:ur 1 bis 3 Spieler .SH SYNOPSIS .B xskat .RB [ \-display | \-d .IR Display ] .RB [ \-geometry | \-g .IR Geometrie ] .RB [ \-font | \-fn .IR Zeichensatz ] .RB [ \-iconic | \-i ] .RB [ \-title | \-T .IR Text ] .RB [ \-name .IR Programm ] .RB [ \-fg .IR Farbe ] .RB [ \-bg .IR Farbe ] .RB [ \-bt .IR Farbe ] .RB [ \-mark .IR Farbe ] .RB [ \-3d ] .RB [ \-2d ] .RB [ \-3dtop .IR Farbe ] .RB [ \-3dbot .IR Farbe ] .RB [ \-mb .IR Tastennummer ] .RB [ \-keyboard .IR Zahl ] .RB [ \-tdelay .IR Sekunden ] .RB [ \-fastdeal ] .RB [ \-slowdeal ] .RB [ \-help | \-h ] .RB [ \-frenchcards ] .RB [ \-french4cards ] .RB [ \-germancards ] .RB [ \-german4cards ] .RB [ \-color ] .RB [ \-mono ] .RB [ \-color1 .IR Farbe ] .RB ".." " " [ \-color4 .IR Farbe ] .RB [ \-large ] .RB [ \-small ] .RB [ \-up ] .RB [ \-down ] .RB [ \-alt ] .RB [ \-seq ] .RB [ \-list | \-l .IR Datei ] .RB [ \-alist ] .RB [ \-nlist ] .RB [ \-tlist ] .RB [ \-log .IR Datei ] .RB [ \-dolog ] .RB [ \-nolog ] .RB [ \-fmt ] .RB [ \-unfmt ] .RB [ \-game .IR Datei ] .RB [ \-briefmsg ] .RB [ \-verbosemsg ] .RB [ \-trickl2r ] .RB [ \-notrickl2r ] .RB [ \-lang .IR Sprache ] .RB [ \-start .IR Spielernummer ] .RB [ \-s1 .IR Zahl ] .RB [ \-s2 .IR Zahl ] .RB [ \-s3 .IR Zahl ] .RB [ \-ramsch ] .RB [ \-noramsch ] .RB [ \-ramschonly ] .RB [ \-sramsch ] .RB [ \-nosramsch ] .RB [ \-skattolast ] .RB [ \-skattoloser ] .RB [ \-kontra ] .RB [ \-nokontra ] .RB [ \-kontra18 ] .RB [ \-bock ] .RB [ \-nobock ] .RB [ \-bockramsch ] .RB [ \-bockevents .IR Zahl ] .RB [ \-resumebock ] .RB [ \-noresumebock ] .RB [ \-spitze ] .RB [ \-spitze2 ] .RB [ \-nospitze ] .RB [ \-revolution ] .RB [ \-norevolution ] .RB [ \-klopfen ] .RB [ \-noklopfen ] .RB [ \-schenken ] .RB [ \-noschenken ] .RB [ \-hint ] .RB [ \-nohint ] .RB [ \-newrules ] .RB [ \-oldrules ] .RB [ \-shortcut ] .RB [ \-noshortcut ] .RB [ \-askshortcut ] .RB [ \-irc ] .RB [ \-noirc ] .RB [ \-irctelnet .IR Programm ] .RB [ \-ircserver .IR Name ] .RB [ \-ircport .IR Zahl ] .RB [ \-ircchannel .IR Name ] .RB [ \-ircnick .IR Name ] .RB [ \-ircuser .IR Name ] .RB [ \-ircrealname .IR Name ] .RB [ \-ircpos .IR Zahl ] .RB [ \-irclog .IR Datei ] .RB [ \-irclogappend ] .RB [ \-irclogoverwrite ] .RB [ \-auto .IR Zahl ] .RB [ \-opt .IR Datei ] .RB [ \-pk ] .RI [ Spieler\fB@\fIDisplay... ] .SH BESCHREIBUNG .B XSkat erm\(:oglicht es, das Kartenspiel Skat entsprechend der offiziellen Skatordnung zu spielen. .PP Bis zu 3 Spieler k\(:onnen vom Computer simuliert werden. .PP Nach dem Start des Spiels bringt ein Maus-Klick oder ESC/F1 ein Men\(:u zur Anzeige. Andere n\(:utzliche Tasten sind: Leertaste, Eingabe, Tabulator, Cursor links/rechts/hoch/runter. Der Rest der Spielkontrollen sollte offensichtlich genug sein. .PP Eine Einf\(:uhrung in das Skatspiel gibt es unter .br http://www.xskat.de .SH OPTIONEN In den folgenden Beschreibungen wird der Spieler, der .B XSkat startet, Spieler1 genannt. .TP .PD 0 .BI \-display " Displayname" .TP .PD 0 .BI \-geometry " Geometrie-Spezifikation" .TP .PD 0 .BI \-font " Zeichensatz" " \fR(Voreinstellung: 9x15 oder 10x20)" .TP .PD 0 .B \-iconic .TP .PD 0 .BI \-title " Fenstertitel" .TP .PD 0 .BI \-name " Programm-Resourcename" .TP .PD 0 .BI \-fg " Vordergrundfarbe" .TP .PD .BI \-bg " Hintergrundfarbe" Die \(:ublichen Optionen des X Toolkit. .TP .BI \-bt " Farbe" Die Farbe der Tastenfl\(:achen. .TP .BI \-mark " Farbe" Die Farbe der Markierungen, die anzeigen, .br wer Vorhand ist (beim Reizen), .br wer Alleinspieler ist, .br welche Karte der Computer vorschl\(:agt, .br oder wo der Tastatur-Fokus ist .br (Voreinstellung: Rot oder Schwarz). .TP .B \-3d Darstellung in 3D (Voreinstellung). .TP .B \-2d Verwende die alte, flache Darstellung (Voreinstellung f\(:ur monochrome Bildschirme). .TP .BI \-3dtop " Farbe" Die Farbe, die f\(:ur die linken und oberen R\(:ander der 3D-Tasten verwendet wird. (Voreinstellung: Wei\(ss). .TP .BI \-3dbot " Farbe" Die Farbe, die f\(:ur die rechten und unteren R\(:ander der 3D-Tasten verwendet wird. (Voreinstellung: Schwarz). .TP .BI \-mb " Tastennummer" Die Nummer der Maus-Taste, die das Men\(:u \(:offnet (Voreinstellung: 0 = jede). .TP .BI \-keyboard " Zahl" Definiere, wieviel von der Benutzeroberfl\(:ache mit der Tastatur gesteuert werden kann. Die Zahl bedeutet: .nf .ne 3 0 : Nichts. 1 : Mehr (Voreinstellung). 2 : Alles. .fi .TP .BI \-tdelay " Sekunden" Legt fest, wie lange der letzte Stich sichtbar bleibt. Eine Verz\(:ogerung von mehr als 10 Sekunden bedeutet, da\(ss der Stich erst nach einem Maus-Klick entfernt wird. Im Mehrspieler-Modus wird der gr\(:o\(sste angegebene Wert verwendet (Voreinstellung: 0.7). .TP .BI \-fastdeal Gib die Karten ohne zeitraubende Animationen aus. .TP .BI \-slowdeal Gib die Karten langsam aus (Voreinstellung). .TP .B \-help Kurze Auflistung aller Optionen. .TP .B \-frenchcards Spiele mit Franz\(:osischem Blatt. .TP .B \-french4cards F\(:arbe zur leichteren Unterscheidbarkeit Karo orange und Pik gr\(:un (Voreinstellung). .TP .B \-germancards Verwende ein Deutsches Blatt. .TP .B \-german4cards F\(:arbe zur leichteren Unterscheidbarkeit Eicheln braun. .TP .B \-color Benutze farbige Karten. Wenn nicht genug Farben verf\(:ugbar sind, wird die Farbanzahl entsprechend reduziert (Voreinstellung). .TP .B \-mono Benutze schwarz-wei\(sse Karten. .TP .BR \-color1 " .. " \-color4 W\(:ahle die Farben f\(:ur Karo, Herz, Pik und Kreuz. Die Angabe .B \-french4cards gewinnt bei Karo und Pik. .TP .BR \-large " und " \-small W\(:ahle die Gr\(:o\(sse des Hauptfensters (Voreinstellung: so gro\(ss wie m\(:oglich). .TP .B \-down Sortiere Karten abw\(:arts (Voreinstellung). .TP .B \-up Sortiere Karten aufw\(:arts. .TP .B \-alt Sortiere Karten in alternierender Reihenfolge. .TP .B \-seq Sortiere Karten in sequentieller Reihenfolge (Voreinstellung). .TP .BI \-list " Dateiname" Die Datei zur Speicherung der Spielliste (Voreinstellung: $HOME/.xskat.lst oder ./xskat.lst, falls HOME nicht gesetzt ist. F\(:ur IRC-Spiele: .irc statt .lst). .TP .B \-alist Alternative Form der Listenf\(:uhrung. .TP .B \-nlist Normale Form der Listenf\(:uhrung (Voreinstellung). .TP .B \-tlist Liste mit Turnierz\(:ahlung. .TP .BI \-log " Datei" Schalte automatische Protokollierung ein, d.h. Protokolle aller Spiele werden an die .I Datei (\- bedeutet Standard-Ausgabe) angeh\(:angt. .TP .B \-dolog Schalte automatische Protokollierung ein. (Voreingestellte Datei: $HOME/.xskat.log oder ./xskat.log). .TP .B \-nolog Schalte automatische Protokollierung aus (Voreinstellung). Protokolle einzelner Spiele k\(:onnen trotzdem noch gespeichert werden. .TP .B \-fmt Erzeuge formatierte Protokoll-Dateien, d.h. mit Unterstreichungen und Fettschrift. .TP .B \-unfmt Erzeuge unformatierte Protokoll-Dateien (Voreinstellung). .TP .BI \-game " Datei" Lies vordefinierte Spiele aus der .I Datei (\- bedeutet Standard-Eingabe). In IRC-Spielen nicht verf\(:ugbar. Siehe auch den Abschnitt DATEIEN weiter unten. .TP .B \-briefmsg Zeige durch eine kleine rote Markierung auf den Karten an, wer Vorhand ist (beim Reizen) und wer der Alleinspieler ist. .TP .B \-verbosemsg Gib zus\(:atzlich aus, wer wo sitzt und was gespielt wird (Voreinstellung). .TP .B \-trickl2r Lege die Karten eines Stichs von links nach rechts hin (Voreinstellung). .TP .B \-notrickl2r Lege die Karten entsprechend der Spielerpositionen. .TP .BI \-lang " Sprache" Momentan verf\(:ugbar: Deutsch und Englisch (Voreinstellung: $LANG/$LANGUAGE wird zuerst gepr\(:uft. Dann: siehe Imakefile/Makefile). .TP .BI \-start " Spielernummer" Der Spieler, der zuerst gibt (Voreinstellung: 2). .TP .PD 0 .BI \-s1 " Zahl" .TP .PD 0 .BI \-s2 " Zahl" .TP .PD .BI \-s3 " Zahl" \(:Andere die Spielst\(:arke der Computer-Spieler. .br .B s1 ist der linke Computer im Einzelspieler-Modus oder der einzige Computer im 2-Spieler-Modus. .br .B s2 ist der rechte Computer im Einzelspieler-Modus. .br .B s3 ist nur mit .B \-auto sinnvoll. .br Die Zahl mu\(ss zwischen \-4 (schwach) und 0 (Voreinstellung) liegen. .TP .B \-ramsch Spiele einen Ramsch wenn alle Spieler einpassen. .br Die folgenden Regeln sind momentan implementiert: .br Der Skat bleibt verdeckt liegen, bis er an den Gewinner des letzten Stichs geht (oder an den Verlierer des Spiels, s.u.). Der Verlust wird durch die Anzahl der eingefahrenen Kartenpunkte bestimmt. Wenn zwei Spieler hierbei Gleichstand haben, verlieren beide. Wenn alle gleichauf liegen, wird das Spiel mit 0 bewertet. Wenn ein Spieler ohne Stiche bleibt (Jungfrau), verdoppelt sich der Verlust des Verlierers. Falls aber jemand alle Stiche macht (Durchmarsch), gewinnt er 120 Punkte. .TP .B \-noramsch Spiele keinen Ramsch (Voreinstellung). .TP .B \-ramschonly Spiele jedes Spiel Ramsch. .TP .B \-sramsch Spiele Schieberamsch anstatt einfachen Ramsch. .br Die Regeln sind: .br Jeder Spieler, beginnend mit Vorhand, darf den Skat aufnehmen und 2 Karten verdeckt weitergeben. Es ist nicht erlaubt, Buben zu schieben. Der Spielwert wird verdoppelt f\(:ur jedes Mal, das ein Spieler den Skat nicht aufnimmt. .TP .B \-nosramsch Spiele keinen Schieberamsch (Voreinstellung). .TP .B \-skattoloser Am Ende des Ramschspiels geht der Skat an den(die) Verlierer, wodurch sich der Verlust erh\(:oht. .TP .B \-skattolast Der Skat geht an den Gewinner des letzten Stichs (Voreinstellung). .TP .B \-kontra Erlaube den Gegnern 'Kontra' zu sagen, was den Wert des Spiels verdoppelt. Der Alleinspieler kann mit 'Re' antwortet, was eine weitere Verdoppelung bewirkt. .TP .B \-nokontra Verbiete Kontra (Voreinstellung). .TP .B \-kontra18 Nur ein Gegner der wenigstens 18 gesagt hat, darf 'Kontra' sagen. .TP .B \-bock Spiele eine Bock-Runde nach einem besonderen Ereignis. Der Spielwert der folgenden 3 Spiele wird verdoppelt. Wenn innerhalb einer Bock-Runde ein weiteres Bock-Ereignis eintritt oder mehrere Bock-Ereignisse gleichzeitig geschehen, wird die entsprechende Zahl Bock-Runden zus\(:atzlich gespielt. .TP .B \-nobock Spiele keine Bock-Runden (Voreinstellung). .TP .B \-bockramsch Spiele eine Runde Ramsch nach jeder Bock-Runde. Bevor ein Ramsch beginnt, darf jeder Spieler, beginnend mit Vorhand, erkl\(:aren, ob er lieber Grand Hand spielen will. Nach einem Grand Hand gibt derselbe Spieler nochmal, weil dieses Spiel nicht zu den 3 Spielen der Ramsch-Runde z\(:ahlt. .TP .BI \-bockevents " Zahl" Spezifiziere die Bock-Ereignisse. .nf .ne 8 (1) Ein Spiel wird mit 60 Augen verloren. (2) Ein gewonnener Grand Hand. (4) Ein erfolgreicher Kontra (Gegner gewinnen). (8) Ein Spiel mit Kontra & Re. (16) Ein Spielstand endet in 3 gleichen Ziffern. (32) Ein Spielstand ist ein Vielfaches von 100. (64) Ein mit 72 oder mehr gewonnenes Spiel. (128) Ein mit 96 oder mehr gewonnenes Spiel. .fi Addiere die Zahlen in Klammern um die gew\(:unschten Ereignisse festzulegen (Voreinstellung: 0). .br Anmerkungen: .br Ein Kontra, in dem der Alleinspieler Re sagte und verlor, z\(:ahlt als ein Ereignis nicht als zwei (Ereignisse 4 und 8). .br Die Bewertung eines Spielstandes wird entsprechend der eingestellten Z\(:ahlweise von Spieler1 durchgef\(:uhrt (Ereignisse 16 und 32). Ein Spielstand, der ein Vielfaches von 1000 ist, z\(:ahlt als ein Ereignis. .br Als Spielwert (Ereignis 64 und 128) gilt der normale Wert ohne irgendwelche Verdoppelungen wegen Ramsch, Kontra oder Bock. .TP .B \-resumebock Setze nicht beendete Bock-Runden beim n\(:achsten Spielstart von .BR XSkat fort. Die Zahl der noch ausstehenden Spiele wird aus der Spiellisten-Datei gelesen. .TP .B \-noresumebock Setze Bock-Runden nicht fort (Voreinstellung). .TP .B \-spitze Erlaube dem Alleinspieler Spitze anzusagen. Das bedeutet, da\(ss er den letzte Stich mit dem niedrigsten Trumpf machen mu\(ss, um das Spiel zu gewinnen. Diese Absicht wird erkl\(:art, indem der niedrigste Trumpf den anderen Spielern offen gezeigt wird. Der Multiplikator f\(:ur das Spiel erh\(:oht sich daf\(:ur um 1. In einem Grand mit 4 Buben kann Spitze nicht angesagt werden. .TP .B \-spitze2 Spitze erh\(:oht den Multiplikator um 2. .TP .B \-nospitze Die Ansage von Spitze ist nicht m\(:oglich (Voreinstellung). .TP .B \-revolution Erm\(:ogliche eine besondere Variante von Null Ouvert. Nachdem der Alleinspieler die Karten aufgedeckt hat, d\(:urfen die Gegner einander in die Karten schauen und diese beliebig austauschen bevor das Spiel beginnt. Revolution z\(:ahlt 92 Punkte. .TP .B \-norevolution Verbiete Revolution (Voreinstellung). .TP .B \-klopfen W\(:ahrend einer Ramsch-Runde kann man am Anfang des Spiels klopfen, um anzuzeigen, da\(ss man nicht verlieren wird. Dies verdoppelt den Spielwert. Klopfen ist nicht m\(:oglich, wenn man den Skat in einem Schieberamsch nicht aufnimmt. .TP .B \-noklopfen Klopfen nicht erlauben (Voreinstellung). .TP .B \-schenken Falls die Gegner am Anfang des Spiels meinen, da\(ss sie nicht gewinnen werden, k\(:onnen sie aufgeben. Dies geschieht durch Auswahl von Schenken aus dem Hauptmen\(:u w\(:ahrend des ersten Stiches, statt eine Karte zu spielen. Wenn der Alleinspieler dies akzeptiert, gilt das Spiel als einfach gewonnen. Sollte er aber darauf bestehen, weiter zu spielen, mu\(ss er die Gegner dann Schneider machen. Dies wird daher wie ein angesagter Schneider bewertet (Multiplikator um 2 erh\(:oht). Die Gegner k\(:onnen dem Alleinspieler auch den Schneider schenken. Dies kann er wieder ablehnen und sagt damit Schwarz an. .TP .B \-noschenken Schenken nicht erlauben (Voreinstellung). .TP .B \-hint Markiere die Karte, die der Computer spielen w\(:urde. .TP .B \-nohint Zeige keine Computer-Vorschl\(:age (Voreinstellung). .TP .B \-newrules Neue offizielle Regeln vom 1.1.1999: .br Verlorene Handspiele z\(:ahlen doppelt. .br Der Multiplikator f\(:ur Grand Ouvert ist 24. .br (Voreinstellung) .TP .B \-oldrules Verlorene Handspiele z\(:ahlen einfach. .br Der Multiplikator f\(:ur Grand Ouvert ist 36. .TP .B \-shortcut Beende das Spiel, wenn die restlichen Stiche alle an eine Partei gehen. .TP .B \-noshortcut Spiele jeden Stich. .TP .B \-askshortcut Frage, ob die Abk\(:urzung genommen werden soll (Voreinstellung). .TP .B \-irc Spiele via Internet Relay Chat. Diese Option stellt eine Verbindung zu einem IRC-Server her, wo man mit anderen Leuten eine Runde Skat spielen kann. .br Und das geht so: .br Starte .B XSkat in einem xterm. Warte, bis der Server die Begr\(:u\(ssungsmeldung anzeigt. Nun ist man auf dem Kanal #xskat, wo neue Spiele geplant werden sollen. Alles was in das xterm getippt wird, wird als Nachricht an alle auf diesem Kanal geschickt. Wenn sich zwei oder drei Spieler gefunden haben und sich auf den Namen f\(:ur einen neuen Kanal (z.B. #xskat123) geeinigt haben, sollten alle den Kanal mit .BR /join " #xskat123" wechseln. Wenn dann alle auf dem neuen Kanal angekommen sind, mu\(ss genau ein Spieler .BR /go " (oder " /go2 falls nur 2 Spieler da sind) eintippen, um das Spiel zu starten. Nun kann man spielen und reden. .TP .B \-noirc Benutze kein IRC (Voreinstellung). .TP .BI \-irctelnet " Programm" Legt das Programm fest, das die Verbindung zum IRC-Server aufbaut. Falls man hinter einem Firewall sitzt, ist evtl. ein Programm wie rtelnet erforderlich und $SOCKS_SERVER mu\(ss auf den Namen des Firewalls gesetzt werden (Voreinstellung: telnet). .TP .BI \-ircserver " Name" W\(:ahle einen IRC-Server in der N\(:ahe! (Voreinstellung: $IRCSERVER oder irc.fu-berlin.de, falls nicht im Imakefile/Makefile ge\(:andert) .TP .BI \-ircport " Zahl" Der Port des IRC-Servers (Voreinstellung: $IRCPORT oder 6667). .TP .BI \-ircchannel " Name" Der anf\(:anglich aufzusuchende Kanal (Voreinstellung: #xskat). .TP .BI \-ircnick " Name" Der eigene IRC-Name. Falls dieser bereits vergeben ist, wird automatisch ein anderer erzeugt. Einige Server erlauben Namen mit 30 Zeichen, andere haben eine Begrenzung auf 9. (Voreinstellung: $IRCNICK oder $IRCUSER oder $LOGNAME oder xskatNNNN). .TP .BI \-ircuser " Name" Der Benutzer/Login-Name. Anmerkung: Viele Server m\(:ogen keine gef\(:alschten Namen. (Voreinstellung: $IRCUSER oder $LOGNAME). .TP .BI \-ircrealname " Name" Der eigene Name (Voreinstellung: $IRCNAME oder der Eintrag aus der Datei passwd oder 'XSkat player'). .TP .BI \-ircpos " Zahl" Festlegung der Position relativ zu den anderen Spielern. Positionen werden im Uhrzeigersinn mit 1, 2 und 3 bezeichnet. Der Spieler 2 beginnt mit Geben, falls mit .BR \-start " oder " /start nichts anderes spezifiziert wird. Wenn man seine Position nicht angibt, eine Position doppelt vergeben ist, oder eine ung\(:ultige Zahl (3 bei nur 2 Spielern) w\(:ahlt, wird dies automatisch korrigiert. Die Auswahl der richtigen Position ist wichtig, falls ein gespeichertes Spiel fortgesetzt werden soll. (Voreinstellung: 0 = egal). .TP .BI \-irclog " Datei" Alle Daten vom/zum IRC-Server werden in diese Datei geschrieben (\- bedeutet Standard-Ausgabe). Dies kann zur Fehlersuche hilfreich sein (Voreinstellung: $HOME/.xskat.ilg oder ./xskat.ilg). .TP .B \-irclogappend H\(:ange Ausgaben an die Protokolldatei an. .TP .B \-irclogoverwrite \(:Uberschreibe eine existierende Datei (Voreinstellung). .TP .B IRC-Befehle: .br .BR /nick " Name, " /nick \- \(:andere IRC-Namen oder zeige ihn an. .br .B /who \- wer ist auf dem aktuellen Kanal ? .br .B /list, /list Text \- zeige alle Kan\(:ale an, die das Wort xskat bzw. den Text enthalten. Dies kann auf Netzwerken mit vielen Kan\(:alen einige Zeit dauern. Der Versuch die Ausgabe zu stoppen, beendet das Programm. .br .BR /pos " Zahl \- siehe " \-ircpos . .br .B /bell \- Umschalten des akustischen Signals. Wenn eingeschaltet, wird jedesmal ein Ton erzeugt, wenn jemand auf dem Kanal hinzukommt oder eine Nachricht verschickt. Das Signal ist anf\(:anglich aus. .br .B /quit \- beende .BR XSkat . .br .B /sync \- falls Nachrichten aufgrund von Netzwerk-Problemen verloren gehen (oder weil jemand den Kanal im Spiel wechselte), sollte .B XSkat dies erkennen und in den meisten F\(:allen die Synchronisation automatisch (innerhalb von 30 Sekunden) nach dem Wiederherstellen der Verbindung ausf\(:uhren. Die Eingabe von .B /sync versucht dies sofort. .br .BR /quote " command args" \- f\(:ur die IRC-Experten. .br Die folgenden Befehle sind nur sinnvoll f\(:ur den Spieler, der mittels .B /go das Spiel startet, weil dieser die Regeln des Spiels festlegt. .br .B /default \- Spiele nach offiziellen Regeln. .br .B /ramsch, /sramsch, /skattoloser, /kontra, /bock, /resumebock, .B /spitze, /revolution, /klopfen, /schenken, /oldrules, .B /bockevents, /alist, /tlist, /start, /s1 \- \(:andere die Regeln des Spiels. Alle diese Befehle erfordern noch eine Zahl oder True/False, genau wie die X11-Resource mit demselben Namen. .br .B /rules \- zeige allen Mitspielern die aktuellen Regeln an. .TP .B Anmerkungen: Die Versionsnummern aller teilnehmenden Programme mu\(ss gleich sein. .br Die meisten Optionen k\(:onnen w\(:ahrend des Spiels nicht ver\(:andert werden. Optionen, die ge\(:andert werden k\(:onnen, werden nicht in einer Datei gesichert. .br Die Spielliste kann nur beim Reizen gel\(:oscht werden, oder wenn man eine Karte auszuspielen hat. Es gibt eine alternative Spielliste f\(:ur IRC-Spiele (siehe .BR \-list ). .br Es ist m\(:oglich, ins xterm zu tippen oder in das Spiel-Fenster (was empfohlen wird), aber mitten im Satz zu wechseln, wird nicht funktionieren. .br Eine bessere Eingabem\(:oglichkeit und einen geteilten Bildschirm bietet das Programm ssfe. Es wird wie folgt verwendet: ssfe \-raw xskat \-irc .br Man kann .B \-irc weglassen, wenn noch andere IRC-Optionen verwendet werden. .TP .BI \-auto " Zahl" Drei Computer spielen die angegebene Anzahl von Spielen gegeneinander. Die Resultate werden ausgegeben. .br Bei diese Option werden keine X11-Resourcen gelesen und die Spielliste wird nur gespeichert, wenn .B \-list verwendet wird. .TP .BI \-opt " Datei" Diese Datei enth\(:alt alle interaktiv \(:anderbaren Optionen f\(:ur alle Spieler (Voreinstellung: $HOME/.xskat.opt oder ./xskat.opt). Kommandozeilen-Optionen haben Vorrang vor Optionen aus dieser Datei, welche aber wiederum Resource-Angaben \(:uberlagern. Dies kann mit der Resource .B useoptfile ver\(:andert werden. .TP .BI \-pk Wenn der Computer immer ein Gutes Blatt geben soll. (auf besonderen Wunsch von Petra K.) Alternativ ergibt dreimaliges Dr\(:ucken von F6 ein Gutes Blatt im jeweils n\(:achsten Spiel. Funktioniert nicht im Mehrspieler-Modus. .TP .IB Spieler @ Display Spezifiziert das Display f\(:ur den zweiten und dritten Spieler (wird aber bei IRC-Spielen ignoriert). Der .IB Spieler @ Teil kann weggelassen werden, wenn die Resource .B alias auf dem .I Display gesetzt ist. .SH RESOURCEN .PP Kommandozeilen-Optionen haben Vorrang vor Resource-Spezifikationen f\(:ur Spieler1. .TP .B geometry, font, title, foreground, background Die \(:ublichen X11-Resourcen. .TP .B mark (siehe .BR \-mark ). .TP .B button (wird f\(:ur 2D-Tasten verwendet, siehe .BR \-bt ). .TP .B 3dbutton (wird f\(:ur 3D-Tasten verwendet, siehe .BR \-bt , Voreinstellung: ein Grauton). .TP .B 3dbackground (wird in 3D-Darstellung verwendet, siehe .BR \-bg , Voreinstellung: ein anderes Grau). .TP .B 3d True oder False (siehe .BR \-3d " und " \-2d ). .TP .B 3dtop (siehe .BR \-3dtop ). .TP .B 3dbot (siehe .BR \-3dbot ). .TP .B menubutton (siehe .BR \-mb ). .TP .B keyboard (siehe .BR \-keyboard ). .TP .B tdelay (siehe .BR \-tdelay ). .TP .B fastdeal True oder False (siehe .BR \-fastdeal " und " \-slowdeal ).(#) .TP .B cards 0, 1, 2 oder 3 (siehe .BR \-frenchcards ", " \-french4cards ", " .BR \-germancards " und " \-german4cards ). .TP .B color True oder False (siehe .BR \-color " und " \-mono ). .TP .B color1 .. color4 (siehe .BR \-color1 " .. " \-color4 ). .TP .B large True oder False (siehe .BR \-large " und " \-small ). .TP .B down True oder False (siehe .BR \-down " und " \-up ). .TP .B alt True oder False (siehe .BR \-alt " und " \-seq ). .TP .B list (siehe .BR \-list ).(#) .TP .B alist True oder False (siehe .BR \-alist " und " \-nlist ). .TP .B tlist True oder False (siehe .BR \-tlist " und " \-nlist ). .TP .B log (siehe .BR \-log ).(#) .TP .B dolog True oder False (siehe .BR \-dolog " und " \-nolog ).(#) .TP .B formatted True oder False (siehe .BR \-fmt " und " \-unfmt ).(#) .TP .B game (siehe .BR \-game ).(#) .TP .B briefmsg True oder False (siehe .BR \-briefmsg " und " \-verbosemsg ). .TP .B trickl2r True oder False (siehe .BR \-trickl2r " und " \-notrickl2r ). .TP .B language (siehe .BR \-lang ). .TP .B start (siehe .BR \-start ).(#) .TP .B s1, s2 (siehe .BR \-s1 ", " \-s2 ).(#) .TP .B ramsch 0, 1 oder 2 (siehe .BR \-noramsch ", " \-ramsch " und " \-ramschonly ).(#) .TP .B sramsch True oder False (siehe .BR \-sramsch " und " \-nosramsch ).(#) .TP .B skattoloser True oder False (siehe .BR \-skattoloser " und " \-skattolast ).(#) .TP .B kontra 0, 1 oder 2 (siehe .BR \-nokontra ", " \-kontra " und " \-kontra18 ).(#) .TP .B bock 0, 1 oder 2 (siehe .BR \-nobock ", " \-bock " und " \-bockramsch ).(#) .TP .B bockevents (siehe .BR \-bockevents ).(#) .TP .B resumebock True oder False (siehe .BR \-resumebock " und " \-noresumebock ).(#) .TP .B spitze 0, 1 oder 2 (siehe .BR \-nospitze ", " \-spitze " und " \-spitze2 ).(#) .TP .B revolution True oder False (siehe .BR \-revolution " und " \-norevolution ).(#) .TP .B klopfen True oder False (siehe .BR \-klopfen " und " \-noklopfen ).(#) .TP .B schenken True oder False (siehe .BR \-schenken " und " \-noschenken ).(#) .TP .B hint True oder False (siehe .BR \-hint " und " \-nohint ). .TP .B oldrules True oder False (siehe .BR \-oldrules " und " \-newrules ).(#) .TP .B shortcut 0, 1 oder 2 (siehe .BR \-noshortcut ", " \-askshortcut " und " \-shortcut ). .TP .B irc True oder False (siehe .BR \-irc " und " \-noirc ).(#) .TP .B irctelnet (siehe .BR \-irctelnet ).(#) .TP .B ircserver (siehe .BR \-ircserver ).(#) .TP .B ircport (siehe .BR \-ircport ).(#) .TP .B ircchannel (siehe .BR \-ircchannel ).(#) .TP .B ircnick (siehe .BR \-ircnick ).(#) .TP .B ircuser (siehe .BR \-ircuser ).(#) .TP .B ircrealname (siehe .BR \-ircrealname ).(#) .TP .B ircpos (siehe .BR \-ircpos ).(#) .TP .B irclist (siehe .BR \-list ).(#) .TP .B irclog (siehe .BR \-irclog ).(#) .TP .B irclogappend True oder False (siehe .BR \-irclogappend " und " \-irclogoverwrite ).(#) .TP .B opt (siehe .BR \-opt ).(#) .TP .B useoptfile True oder False (Voreinstellung: False). Dies ist eine Resource f\(:ur den Mehrspieler-Modus (aber nicht f\(:ur IRC). Sie wird ignoriert f\(:ur Spieler1. Wenn auf True, wird der Inhalt der Optionsdatei von Spieler1 benutzt. Das bedeutete, da\(ss man evtl. an die Einstellungen von sonstwem ger\(:at, wenn Spieler1 diese Datei in einem anderem Spiel verwendet hat. .TP .B alias Der Name des Spielers (max. 2 Worte mit je 9 Zeichen, Voreinstellung: $LOGNAME). .PP Nur Spieler1 kann die mit (#) markierten Resourcen setzen. .PP Dateinamen, die mit ~/ beginnen, werden richtig behandelt, falls HOME gesetzt ist. .SH DATEIEN Ein Beispiel f\(:ur eine Datei mit vordefinierten Spielen: .nf .ne 7 # Der folgende Block gibt die Kartenverteilung # f\(:ur Spieler1, 2, 3 und den Skat(0) an. # A 10 K D B 9 8 7 2 2 2 2 2 0 3 3 # Karo 2 2 2 2 2 3 3 3 # Herz 1 1 1 1 1 3 3 3 # Pik 1 1 1 1 1 0 3 3 # Kreuz .ne 7 # Das folgende ist nicht das gleiche Spiel ! # Spieler-Nummern rotieren 3 -> 2 -> 1 -> 3 # (und h\(:angen von der start-Option ab). 2 2 2 2 2 0 3 3 2 2 2 2 2 3 3 3 1 1 1 1 1 3 3 3 1 1 1 1 1 0 3 3 .ne 4 repeat # Wiederhole obige Spiele. # Die folgenden Zeilen wirken nur, # wenn das 'repeat' entfernt wird. .ne 9 random_seed 123456 0 2 # Spezifiziert die Zufallszahl, welche die # Kartenverteilung f\(:ur alle folgenden Spiele vorgibt. # Die zweite Zahl l\(:a\(sst einen entsprechend viele # Spiele in der Abfolge \(:uberspringen. # Die dritte (optionale) Zahl definiert, # wer mit dem Geben beginnt (siehe \-start). # Ein zus\(:atzliches L oder R hinter dieser Zahl # rotiert die Karten links oder rechts herum. .ne 3 # random_seed wird in Spiel-Protokollen angezeigt, # um ein einfaches Wiederholen zu erm\(:oglichen: # echo random_seed 123456 0 2 | xskat -game - .fi .SH ANMERKUNGEN Es gibt keine offiziellen Regeln f\(:ur die Varianten Ramsch, Kontra, Bock, Spitze, Revolution, Klopfen und Schenken. .PP Falls der Aufruf .BR "xskat player@otherhost:0" " auf " yourhost eine Fehlermeldung gibt, kann man versuchen, mit dem Befehl .BR "xhost yourhost" " auf " otherhost den Zugriff f\(:ur .B yourhost auf das Display von .B otherhost zu erlauben. .PP Wenn man ein Spiel mit den eigenen Karten wiederholt, macht es keinen Unterschied, ob 'Vorhand wechselt' auf 'Ja' oder 'Nein' steht. .PP Einige Versionen von telnet haben einen Fehler, der verhindert, da\(ss Eingaben von einer Pipe richtig gelesen werden. Siehe README.IRC-de f\(:ur eine Korrektur oder schreibe in ~/.telnetrc: .nf .ne 3 irc.fu-berlin.de set echo off set escape off set rlogin off set flushoutput off set interrupt off set quit off set eof off set erase off set kill off set lnext off set susp off set reprint off set worderase off set start off set stop off set forw1 off set forw2 off set ayt off .fi Die f\(:uhrenden Leerzeichen sind wichtig! Die IRC-Server-Zeile ist entsprechend anzupassen. .SH AUTOR Gunter Gerhardt .PP Die aktuelle Version liegt immer unter .br http://www.xskat.de .nf Dieses Programm ist freie Software; es kann frei verbreitet werden. Verwendung auf eigenes Risiko; es gibt KEINE GARANTIE. Die Weitergabe ver\(:anderter Versionen ist erlaubt, solange die folgenden Bedingungen eingehalten werden: 1. Alle Angaben zu Copyright & Bedingungen bleiben erhalten. 2.a) Nur \(:Anderungen zwecks Paketierung oder Portierung werden gemacht. oder 2.b) Es wird deutlich gekennzeichnet, wer das Programm ge\(:andert hat. Das Programm wird umbenannt oder die Versionsnummer hat die Form x.y.z, wobei x.y die Version des originalen Programms ist und z ein beliebiger Zusatz. Verwendung der Kartenbilder mit Genehmigung der Spielkartenfabrik Altenburg GmbH, Marke ASS Altenburger Leipziger Stra\(sse 7, 04600 Altenburg .fi xskat-4.0/icon.xbm0100644000076400001440000000156406012201704012466 0ustar ggusers#define icon_width 32 #define icon_height 32 static unsigned char icon_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x01, 0xa0, 0x02, 0x80, 0x03, 0xa0, 0x02, 0xc0, 0x07, 0x50, 0x05, 0xf0, 0x1f, 0xac, 0x1a, 0xf8, 0x3f, 0x52, 0x25, 0xfc, 0x7f, 0xad, 0x5a, 0xfc, 0x7f, 0x52, 0x25, 0xfc, 0x7f, 0xac, 0x1a, 0xfc, 0x7f, 0x50, 0x05, 0x78, 0x3d, 0xa0, 0x02, 0x00, 0x01, 0xa0, 0x02, 0x80, 0x03, 0x40, 0x01, 0xc0, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x28, 0x28, 0xe0, 0x03, 0x54, 0x54, 0xe0, 0x03, 0xaa, 0xaa, 0xe0, 0x03, 0x54, 0x55, 0xdc, 0x1d, 0xaa, 0xaa, 0xbe, 0x3e, 0x54, 0x55, 0xfe, 0x3f, 0xa8, 0x2a, 0xbe, 0x3e, 0x50, 0x15, 0x9c, 0x1c, 0xa0, 0x0a, 0xc0, 0x01, 0x40, 0x05, 0xe0, 0x03, 0x80, 0x02, 0xf0, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; xskat-4.0/INSTALL-de0100755000076400001440000000026507171644213012462 0ustar ggusers#!/bin/sh # Erzeuge Makefile aus Imakefile ./configure # Übersetze das Programm make # Starte das Programm ./xskat # Endgültige Installation (als root) make install install.man xskat-4.0/defs.h0100644000076400001440000001663010053715412012126 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef DEFS_H #define DEFS_H #ifdef __STDC__ #define VOID void #else #define VOID int #endif #endif /* DEFS_H */ /* Generated stuff follows: #############################################################################*/ VOID irc_log(); VOID irc_out(); VOID irc_print(); VOID irc_printnl(); char *irc_getline(); int irc_xinput(); int irc_match(); VOID irc_sendnick(); VOID irc_pr_ss(); VOID irc_pr_bs(); VOID irc_pr_sd(); VOID irc_pr_ramsch(); VOID irc_pr_sramsch(); VOID irc_pr_rskatloser(); VOID irc_pr_kontra(); VOID irc_pr_bock(); VOID irc_pr_resumebock(); VOID irc_pr_spitze(); VOID irc_pr_revolution(); VOID irc_pr_klopfen(); VOID irc_pr_schenken(); VOID irc_pr_oldrules(); VOID irc_pr_bockevents(); VOID irc_pr_alist(); VOID irc_pr_start(); VOID irc_pr_s1(); VOID irc_sendrules(); VOID irc_incidx(); VOID irc_sync(); VOID irc_sendsync(); VOID irc_checksync(); VOID irc_alarm(); VOID irc_talk(); char *irc_copyname(); int irc_senderok(); VOID irc_histsave(); VOID irc_sendbtev(); VOID irc_sendxyev(); VOID irc_sendsort(); VOID irc_sendschenken(); VOID irc_sendloeschen(); VOID irc_addcmd(); int irc_getcmd(); VOID irc_checkhist(); VOID irc_getrules(); VOID irc_getserverconf(); VOID irc_putserverconf(); VOID irc_putclientconf(); VOID irc_setpos(); VOID irc_getclientconf(); VOID irc_changenick(); VOID irc_checknick(); VOID irc_nickchanged(); VOID irc_msg(); VOID irc_parse(); VOID irc_connect(); VOID irc_init(); VOID init_null(); VOID testnull(); int kleiner_w(); int kleiner(); int hat(); int n_anwert(); int n_anspiel(); int n_abwert(); int n_abwerfen(); int minmax(); int minmaxfb(); int drunter(); int drunterdrue(); VOID m_nsp(); VOID m_nns(); VOID null_stich(); VOID null_sort(); int null_dicht(); VOID revolutiondist(); VOID start_ramsch(); VOID init_ramsch(); int zweibuben(); int bubeanspielen(); int sicher(); VOID moeglklein(); VOID nimm_bube(); VOID moegldrunter(); int ggdurchmarsch(); VOID m_bvr(); VOID m_bmr(); VOID m_bhr(); VOID m_bramsch(); int unsich_fb(); int comp_sramsch(); VOID ramsch_stich(); VOID ramsch_result(); int testgrandhand(); int left(); int right(); int iscomp(); VOID swap(); VOID setrnd(); int rndval(); int rnd(); VOID synerr(); int get_game(); int gutesblatt(); VOID mischen(); int lower(); VOID sort(); VOID calc_rw(); VOID do_geben(); VOID do_sagen(); VOID do_passen(); VOID do_akzept(); VOID do_msagen(); VOID do_mhoeren(); VOID do_entsch(); VOID do_reizen(); VOID drueck(); VOID truempfe(); int tr_voll(); int sage_kontra(); int sage_re(); int testgrand(); VOID calc_inhand(); int testhand(); VOID calc_drueck(); VOID nextgame(); VOID save_skat(); int check_bockevents(); VOID update_list(); VOID do_grandhand(); VOID set_prot(); VOID do_handspiel(); VOID do_druecken(); VOID do_handok(); VOID do_ansagen(); VOID karobube(); int karobubespielen(); VOID do_angesagt(); VOID spielphase(); int higher(); VOID calc_result(); VOID get_next(); VOID save_list(); VOID setsum(); VOID modsum(); VOID read_opt_srpk(); VOID read_opt(); VOID save_opt(); VOID read_list(); VOID fill_st(); int maxnimm(); VOID next_stich(); VOID finishgame(); VOID do_next(); VOID calc_poss(); VOID c_high(); VOID calc_high(); int zweihoechste(); int ignorieren(); int genugdrin(); int gewinnstich(); int uebernehmen(); VOID schmieren(); int einstechen(); int niedrighoch(); int ueberdoerfer(); int bubeausspielen(); int trumpfausspielen(); int hochausspielen(); VOID schenke(); int zehnblank(); int fabwerfen(); VOID abwerfen(); int buttern(); int hatas(); int schnippeln(); VOID nichtspitze(); int spitzefangen(); int restbeimir(); VOID m_bvsp(); VOID m_bmsp(); VOID m_bhsp(); VOID m_bvns(); VOID m_bmns(); VOID m_bhns(); VOID m_bsp(); VOID m_bns(); VOID make_best(); VOID adjfb(); VOID do_spielen(); VOID computer(); VOID play(); int main(); VOID init_text(); char *idxlang(); int langidx(); VOID info_reiz(); int trumpf_idx(); VOID info_spiel(); VOID info_stich(); VOID clear_info(); VOID set_names(); int ismemb(); VOID init_di(); VOID init_dials(); VOID prverz(); int ob_disabled(); VOID cleanip(); VOID cleanirchost(); VOID cleanname(); VOID hndl_btevent(); VOID button_press(); VOID draw_wedge(); VOID draw_actbtn(); VOID draw_selpos(); VOID new_selpos(); VOID new_actbtn(); VOID set_selpos(); VOID del_selpos(); VOID manpage(); VOID polldisps(); VOID hndl_events(); VOID getob_xywhbd(); VOID create_dial(); VOID findlastex(); VOID create_di(); VOID create_diopt(); VOID remove_dial(); VOID remove_di(); VOID draw_3d(); VOID draw_dial(); VOID draw_di(); VOID refresh(); VOID prspnam(); VOID di_info(); VOID di_hand(); VOID next_grandhand(); VOID di_grandhand(); VOID di_term(); VOID di_ende(); VOID di_loesch(); VOID di_ansage(); VOID di_kontra(); VOID di_rekontra(); VOID di_konre(); VOID di_ktrnext(); VOID di_dicht(); VOID di_weiter(); VOID di_wiederweiter(); VOID di_klopfen(); VOID di_schenken(); VOID di_geschenkt(); VOID di_wiederschenken(); VOID di_nichtschenken(); VOID di_schieben(); int di_verdoppelt(); VOID di_buben(); VOID di_spiel(); VOID list_fun(); VOID di_delliste(); VOID di_liste(); int ger_toupper(); VOID pformat(); VOID prot_fun(); VOID im_skat(); VOID di_proto(); VOID di_resultdi(); VOID di_result(); VOID di_delres(); VOID di_options(); VOID di_copyr(); VOID di_grafik(); VOID di_strateg(); VOID di_varianten(); VOID di_ramschopts(); VOID di_bockevents(); VOID di_geschwindigkeit(); VOID di_mehrspieler(); VOID di_lanspiel(); VOID di_eigenertisch(); VOID di_anderertisch(); VOID di_warteauf(); VOID di_irc(); VOID di_eingabe(); VOID di_wieder(); VOID di_input(); VOID change_gc(); VOID change_gcbg(); VOID change_gcxor(); int istrue(); VOID v_gtextnc(); VOID v_gtextc(); VOID v_gtext(); VOID clr_text(); VOID b_text(); VOID do_msaho(); VOID draw_skat(); VOID home_skat(); VOID nimm_stich(); VOID drop_card(); int query_err(); int closest_col(); unsigned long get_col(); VOID calc_desk(); VOID extractnam(); VOID extractnamln(); VOID usage(); VOID invopt(); VOID nomem(); VOID finish(); int ioerr(); VOID exitus(); VOID startirc(); int getdeffn(); VOID logit(); int getcode(); VOID decompgif(); VOID drawimg(); VOID create_card(); VOID xinitwin(); VOID xinitplayers(); int closecol(); VOID find_cardcol(); VOID card_colors(); VOID xinitres(); VOID xstoreres(); VOID read_cards(); VOID set_conames(); VOID xinit(); VOID waitt(); VOID stdwait(); VOID backgr(); VOID putdesk(); VOID drawcard(); VOID putcard(); VOID putback(); VOID hint_line(); VOID show_hint(); VOID putamark(); VOID putmark(); VOID remmark(); VOID movecard(); VOID homecard(); VOID givecard(); VOID initscr(); VOID spielendscr(); VOID revolutionsort(); VOID revolutionscr(); VOID clr_desk(); VOID draw_box(); VOID put_box(); VOID rem_box(); VOID inv_box(); VOID put_fbox(); VOID rem_fbox(); VOID inv_fbox(); int card_at(); int hndl_reizen(); int hndl_druecken(); int hndl_tauschen(); int hndl_spielen(); int hndl_nimmstich(); int hndl_button(); VOID setcurs(); xskat-4.0/ramsch.c0100644000076400001440000003121507174600003012450 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define RAMSCH_C #include "defs.h" #include "skat.h" #include "ramsch.h" VOID start_ramsch() { vmh=0; spieler=geber; save_skat(1); home_skat(); remmark(0); phase=SPIELEN; } VOID init_ramsch() { int sn; sramschstufe=0; trumpf=5; spieler=geber; reizp=-1; stich=1; handsp=0; vmh=0; ouveang=0; sort2[0]=sort2[1]=sort2[2]=0; prot2.sramsch=playsramsch; save_skat(0); info_reiz(); info_spiel(); for (sn=0;sn>3)==3 || (c1>>3)==3) { if ((c0>>3)==0 || (c1>>3)==0) { if (gespb) { playcd=(c1>>3)==0; } else { playcd=(c1>>3)==3; } } else { playcd=(c0>>3)==3; } return 1; } if ((c0>>3)==2 || (c1>>3)==2) { if ((c0>>3)==0 || (c1>>3)==0) { if (gespb) { playcd=(c1>>3)==0; } else { playcd=(c1>>3)==2; } } return 1; } return 1; } if (vmh==1 || (vmh==2 && ((stcd[0]&7)!=BUBE)+((stcd[1]&7)!=BUBE)==1)) { if ((c0>>3)==3 || (c1>>3)==3) { if ((c0>>3)==0 || (c1>>3)==0) { if (gespb>1) { playcd=(c1>>3)==0; } else { playcd=(c1>>3)==3; } return 1; } if ((c0>>3)==1 || (c1>>3)==1) { if (gespb>1) { playcd=(c1>>3)==1; } else { if (stcd[0]==(2<<3|BUBE) || (vmh==2 && stcd[1]==(2<<3|BUBE))) { playcd=(c1>>3)==1; } else { playcd=(c1>>3)==3; } } return 1; } return 1; } if ((c0>>3)==2 || (c1>>3)==2) { if ((c0>>3)==0 || (c1>>3)==0) { if (gespb>1) { playcd=(c1>>3)==0; } else { if (stcd[0]==(1<<3|BUBE) || (vmh==2 && stcd[1]==(1<<3|BUBE))) { playcd=(c1>>3)==0; } else { playcd=(c1>>3)==2; } } } return 1; } return 1; } if ((stcd[0]&7)!=BUBE && (stcd[1]&7)!=BUBE) { playcd=(c1>>3)==3 || (c1>>3)==2; } else { playcd=(c1>>3)==1 || (c1>>3)==0; } return 1; } int bubeanspielen() { int bb,nbb,j; bb=-1; nbb=0; for (j=0;j>3) { bb=j; } } } if (nbb>1 || bb<0) return 0; for (j=0;j<4;j++) { if (gespcd[j<<3|BUBE]==2) { return 0; } } playcd=bb; return 1; } int sicher(fb,pc,le) int fb,*pc,*le; { int i,j,mkz,akz; int mk[7],ak[7],p[7]; *le=0; if (hatnfb[left(ausspl+vmh)][fb]==1 && hatnfb[right(ausspl+vmh)][fb]==1) { return 1; } mkz=akz=0; for (i=7;i>=0;i--) { if (i==BUBE) continue; if (gespcd[fb<<3|i]!=2) { for (j=0;j1?1:0]; if ((cards[possi[*pc]]&7)<=ZEHN) { *pc=p[0]; } if (mkz==1 && (cards[possi[*pc]]&7)>ZEHN) { *le=1; } return 0; } return 1; } VOID moeglklein() { int pc,fb,fp,mgb,mgp; for (pc=1;pc>3; fp=cards[possi[playcd]]>>3; mgb=(vmh || hatnfb[left(ausspl)][fb]!=1 || hatnfb[right(ausspl)][fb]!=1); mgp=(vmh || hatnfb[left(ausspl)][fp]!=1 || hatnfb[right(ausspl)][fp]!=1); if ((cards[possi[playcd]]&7)==BUBE) { if ((cards[possi[pc]]&7)==BUBE) { if (cards[possi[pc]]>>3>cards[possi[playcd]]>>3) { playcd=pc; } } else if (mgb) { playcd=pc; } } else { if ((cards[possi[pc]]&7)!=BUBE) { if ((((cards[possi[pc]]&7)>(cards[possi[playcd]]&7)) && ((cards[possi[pc]]&7)!=ACHT || (cards[possi[playcd]]&7)!=DAME || !vmh || gespcd[(cards[possi[pc]]&~7)|NEUN]==2) && mgb) || !mgp) { playcd=pc; } } else if (!mgp) { playcd=pc; } } } } VOID nimm_bube() { int pc; if (stich>=7 || cardw[stcd[0]&7]+cardw[stcd[1]&7]>4 || (gespcd[BUBE]!=2 && gespcd[1<<3|BUBE]!=2 && gespcd[2<<3|BUBE]!=2 && gespcd[3<<3|BUBE]!=2)) return; for (pc=0;pc>3; for (pc=1;pc>3!=fb) break; } fr=pc!=possc; f=0; wc=30; for (pc=0;pc>3); } else { w1=7-(cards[possi[pc]]&7); if (!sicher(cards[possi[pc]]>>3,&pcl,&le)) { w1+=10; } } if ((cards[possi[playcd]]&7)==BUBE) { w2=30+(cards[possi[playcd]]>>3); } else { w2=7-(cards[possi[playcd]]&7); if (!sicher(cards[possi[playcd]]>>3,&pcl,&le)) { w2+=10; } } } else { w1=7-(cards[possi[pc]]&7); w2=7-(cards[possi[playcd]]&7); } if (w1>w2) { playcd=pc; wc=w1; } } else { playcd=pc; f=1; } } } if (!f) { moeglklein(); } else if (fr && vmh==2 && wc<10) nimm_bube(); } int ggdurchmarsch() { int i,j,h,bb,sn; if (rstich[0]+rstich[1]+rstich[2]>1 || (stcd[0]&7)==SIEBEN || (vmh==2 && stich!=1 && !higher(stcd[0],stcd[1]))) return 0; sn=(ausspl+vmh)%3; for (i=3;i>=0;i--) { if (gespcd[bb=i<<3|BUBE]!=2) { for (i=0;i<10;i++) { if (cards[sn*10+i]==bb) return 0; } break; } } if (((stcd[0]&7)==BUBE && ((hatnfb[left(ausspl)][4]==1 && hatnfb[right(ausspl)][4]==1) || (gespcd[0<<3|BUBE]==2 && gespcd[1<<3|BUBE]==2 && gespcd[2<<3|BUBE]==2 && gespcd[3<<3|BUBE]==2))) || (stcd[0]&7)lef || (rswert[cards[possi[pc]]&7]>rswert[cards[possi[playcd]]&7] && le>=lef)) { playcd=pc; lef=le; } } else { playcd=pc; lef=le; f=1; } } } if (!f || (cards[possi[playcd]]&7)<=ZEHN) { playcd=0; moeglklein(); } } VOID m_bmr() { if (ggdurchmarsch()) return; if (zweibuben()) return; moegldrunter(stcd[0]); } VOID m_bhr() { if (ggdurchmarsch()) return; if (zweibuben()) return; moegldrunter(higher(stcd[0],stcd[1])?stcd[0]:stcd[1]); } VOID m_bramsch() { playcd=0; if (!vmh) m_bvr(); else if (vmh==1) m_bmr(); else m_bhr(); } int unsich_fb(sn,s) int sn,*s; { int fb,pc,le,n; for (possc=0;possc<10;possc++) { possi[possc]=sn*10+possc; } n=0; for (fb=0;fb<4;fb++) { s[fb]=1; if (!sicher(fb,&pc,&le)) { s[fb]=0; n++; } } return n; } int comp_sramsch(sn) int sn; { int fb,n,i,j,c,ea,bb,dum; int p[4],t[4],s[4],o[4],b[4]; dum=0; n=unsich_fb(sn,s); bb=b[0]=b[1]=b[2]=b[3]=0; for (i=0;i<10;i++) { c=cards[sn*10+i]; if ((c&7)==BUBE) bb++,b[c>>3]=1; } if (ramschspiele && klopfen && !playsramsch) { if ((n<=3 && (!n || bb<=1)) || (n<=2 && (!n || bb<=2))) { return di_verdoppelt(0,1); } } if (playsramsch) { if (sn==left(ausspl)) { if ((n<=3 && !bb) || (n==1 && bb<=1 && !b[3]) || !n) { return di_verdoppelt(0,0); } } else if ((n==3 && !bb) || (n==2 && bb<=1 && !b[3]) || (n==1 && bb<=2) || !n) { return di_verdoppelt(0,0); } } if (!playsramsch) return 0; for (fb=0;fb<4;fb++) { for (c=0;c<8;c++) inhand[fb][c]=0; p[fb]=t[fb]=0; o[fb]=fb; } if (((vmh && prot2.verdopp[right(ausspl+vmh)]!=1) || (vmh==2 && prot2.verdopp[right(ausspl+vmh)]==1 && prot2.verdopp[left(ausspl+vmh)]!=1)) && (((cards[30]&7)>ZEHN && (cards[31]&7)>ZEHN) || (cards[30]&7)==SIEBEN || (cards[31]&7)==SIEBEN) && ((cards[30]&7)>=NEUN || (cards[31]&7)>=NEUN)) { ggdurchm[sn]=1; } for (i=0;i<2;i++) { for (j=0;j<10;j++) { if (cardw[cards[10*sn+j]&7]>cardw[cards[30+i]&7]) { swap(&cards[30+i],&cards[10*sn+j]); } } if ((cards[30+i]&7)==BUBE) { for (j=0;j<10;j++) { if ((cards[10*sn+j]&7)!=BUBE) { swap(&cards[30+i],&cards[10*sn+j]); break; } } } } for (i=0;i<10;i++) spcards[i]=cards[sn*10+i]; spcards[10]=cards[30]; spcards[11]=cards[31]; bb=b[0]=b[1]=b[2]=b[3]=0; for (i=0;i<12;i++) { c=spcards[i]; if ((c&7)!=BUBE) { p[c>>3]+=cardw[c&7]; t[c>>3]++; inhand[c>>3][c&7]=1; } else bb++,b[c>>3]=1; } for (fb=0;fb<4;fb++) { for (i=fb+1;i<4;i++) { if (p[o[fb]]stsum) { stsum=rstsum[1]; spieler=1; } else if (rstsum[1]==stsum) { spieler=2; maxn++; } if (rstsum[2]>stsum) { stsum=rstsum[2]; spieler=2; maxn=1; } else if (rstsum[2]==stsum) { spieler=1-spieler; maxn++; } spgew=0; if (maxn==3) { spieler=spwert=stsum=0; } else { spwert=stsum; if (maxn==2) { stsum=120-2*stsum; spgew=1; if (rskatloser) { spwert+=rskatsum; } } else if (rskatloser) { stsum+=rskatsum; spwert+=rskatsum; } } nspwert=0; switch (rstich[0]+rstich[1]+rstich[2]) { case 1: nspwert=spwert=stsum=120; spgew=1; mes2=1; break; case 2: mes1=1; spwert*=2; break; } for (i=0;i=3 && as>=2 && as+zehn>=3) || (bb==4 && as>=2) || testgrand(bb,b,sn==hoerer)); } xskat-4.0/ramsch.h0100644000076400001440000000200307063510163012452 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef RAMSCH_H #define RAMSCH_H #undef EXTERN #ifdef RAMSCH_C #define EXTERN #else #define EXTERN extern #endif EXTERN int rswert[8] #ifdef RAMSCH_C = { 0,0,4,5,0,3,2,1 } #endif ; EXTERN int ggdmw[8] #ifdef RAMSCH_C = { 7,6,5,0,4,1,2,3 } #endif ; EXTERN int rstsum[3],rstich[3]; EXTERN int ggdurchm[3]; #endif /* RAMSCH_H */ xskat-4.0/null.c0100644000076400001440000001764607063510220012157 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define NULL_C #include "defs.h" #include "skat.h" #include "null.h" VOID init_null() { int i; for (i=0;i<4;i++) { wirftabfb[i]=0; hattefb[i]=0; aussplfb[i]=0; nochinfb[i]=8; } } VOID testnull(sn) int sn; { int i,f,c; int a[4],l[4],n[4],m[4],h[4],s[4],mfb[4]; naussplfb[sn]=-1; if (null_dicht(sn,1,&cards[30],(int *)0,mfb,(int *)0)) { for (i=0;i<4 && mfb[i];i++); if (sn!=ausspl || i<4) { if (sn==ausspl) naussplfb[sn]=i; maxrw[sn]=nullw[revolution?4:3]; return; } } for (i=0;i<4;i++) a[i]=l[i]=n[i]=m[i]=h[i]=s[i]=0; f=1; for (i=0;i<10;i++) { c=cards[10*sn+i]; a[c>>3]++; if ((c&7)>BUBE) l[c>>3]++; else if ((c&7)>3]=1; else m[c>>3]=1; if ((c&7)==NEUN) n[c>>3]=1; if ((c&7)==SIEBEN) s[c>>3]=1; } for (i=0;i<4;i++) { if ((a[i] && l[i]!=a[i] && l[i]<2) || (l[i]==1 && n[i]) || (l[i]!=3 && !m[i] && h[i]) || (a[i]>2 && !s[i])) f=0; } if (f) maxrw[sn]=nullw[1]; } int kleiner_w(w1,w2) int w1,w2; { if (w1==ZEHN) return w2<=BUBE; if (w2==ZEHN) return w1>BUBE; return w1>w2; } int kleiner(i,j) int i,j; { return kleiner_w(cards[possi[i]]&7,cards[possi[j]]&7); } int hat(i) int i; { return !hatnfb[spieler][cards[possi[i]]>>3]; } int n_anwert(c) int c; { int fb,i,m; fb=c>>3; if (hatnfb[spieler][fb]) return 0; for (i=AS;i<=SIEBEN;i=i==AS?KOENIG:i==BUBE?ZEHN:i==ZEHN?NEUN:i+1) { if (c==(fb<<3|i)) return 1; if (gespcd[fb<<3|i]!=2) break; } if ((c&7)==SIEBEN) { m=left(ausspl)!=spieler?left(ausspl):right(ausspl); if (hatnfb[m][fb]!=1 && nochinfb[fb]>4) return 2; } if (wirftabfb[fb]) return 5; if (aussplfb[fb]) return 3; if (hattefb[fb]) return 6; return 4; } int n_anspiel() { int i,j,ci,cj,wi,wj; j=0; for (i=1;iwj || (wi==wj && kleiner(i,j))) j=i; } return j; } int n_abwert(c) int c; { int fb,i,n; fb=c>>3; if ((c&7)>=ACHT) return 0; for (i=0;i>3==fb) n++; } if (n<3) return 5; return 4; } int n_abwerfen() { int i,j,ci,cj,wi,wj; j=0; for (i=1;iwj || (wi==wj && !kleiner(i,j))) j=i; } return j; } int minmax(f) int f; { int i,j,hi,hj; j=0; for (i=1;i>3==fb) || (cards[possi[i]]>>3==fb && kleiner(i,j)^f)) j=i; } return j<0?0:j; } int drunter(f) int f; { int i,j; j=0; for (i=1;i>3; i=-1; for (w=stcd[0]&7;w>=AS;w=w==NEUN?ZEHN:w==ZEHN?BUBE:w==KOENIG?AS:w-1) { if (i<0) { i=0; continue; } for (i=0;i>3]) { if (null_dicht(spieler,handsp,&prot2.skat[1][0],&ufb,(int *)0,(int *)0)) { playcd=minmax(1); } else { playcd=minmaxfb(1,ufb); } } else playcd=drunter(vmh==2?!higher(stcd[0],stcd[1]):0); } VOID m_nns(s) int s; { int sga; if (revolang && spieler!=ausspl) { playcd=minmax(0); return; } sga=spieler==ausspl; if (!vmh) playcd=n_anspiel(); else if (hatnfb[s][stcd[0]>>3]) playcd=n_abwerfen(); else if (vmh==1) { if (sga) playcd=drunter(0); else playcd=drunterdrue(); } else if (higher(stcd[0],stcd[1])^sga) { playcd=minmax(1); } else { playcd=minmax(0); if (!higher(stcd[!sga],cards[possi[playcd]])) { playcd=minmax(1); } } } VOID null_stich() { int i,fb1,fb2; for (i=0;i<3;i++) { nochinfb[stcd[i]>>3]--; } fb1=stcd[0]>>3; if (ausspl!=spieler) { fb2=stcd[(spieler-ausspl+3)%3]>>3; if (fb1!=fb2) { wirftabfb[fb2]=1; } else { hattefb[fb2]=1; } } else { aussplfb[fb1]=1; hattefb[fb1]=1; } } VOID null_sort(arr,cnt) int *arr,cnt; { int i,swp; do { swp=0; for (i=0;i=30) c=cd[i-30]; else c=cards[i]; if (c!=-1 && c>>3==fb) { if (sn*10<=i && i<=sn*10+9) sp[spc++]=c&7; else ns[nsc++]=c&7; } } if (sfb) { el=fb; sfbc[el]=spc; for (i=0;i1 && nsc>1) { *mpt=0; for (i=1;i>3==sfb[fb]) { swap(&cards[10*k+i],&cards[10*p+ct[p]]); ct[p]++; } } } } } return; } cdc[0]=cdc[1]=cdc[2]=cdc[3]=0; cnt=0; for (j=0,k=sn;j<2;j++,k=mi) { for (i=0;i<10;i++) { c=cards[10*k+i]; if (c>>3==ufb) { swap(&cards[10*k+i],&cards[10*sn+cnt]); cnt++; } } } for (j=0,k=sn;j<2;j++,k=mi) { for (i=0;i<10;i++) { c=cards[10*k+i]; cd[c>>3][cdc[c>>3]++]=c&7; } } for (fb=0;fb<4;fb++) { null_sort(cd[fb],cdc[fb]); } fb=0; while (cnt<10) { while (fb==ufb || !cdc[fb]) fb=(fb+1)%4; for (j=0,k=sn;j<2;j++,k=mi) { for (i=0;i<10;i++) { c=cards[10*k+i]; if (c==(fb<<3|cd[fb][cdc[fb]-1])) { swap(&cards[10*k+i],&cards[10*sn+cnt]); cnt++; cdc[fb]--; fb=(fb+1)%4; i=10; j=2; } } } } } xskat-4.0/null.h0100644000076400001440000000161307063510224012153 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2000 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef NULL_H #define NULL_H #undef EXTERN #ifdef NULL_C #define EXTERN #else #define EXTERN extern #endif EXTERN int wirftabfb[4],hattefb[4],aussplfb[4],nochinfb[4]; EXTERN int naussplfb[3]; #endif /* NULL_H */ xskat-4.0/README.IRC0100644000076400001440000000321606731542575012344 0ustar ggusers------------------------------------------------------------- ### XSkat times: every Fri 13:30 and Sun 18:00 MET/MEST ### ------------------------------------------------------------- XSkat-IRC and telnet ==================== Some versions of telnet have a bug, that prevents them from reading input from a pipe correctly. Arbitrary characters are mapped to control characters (ex: 'd' -> 'Ctrl-C'). This is because the call tcgetattr used to determine the terminal control characters - fails if stdin isn't a tty (which is OK) - modifies its return parameter anyway (which wasn't expected) If you have problems using the IRC feature of XSkat, you can patch telnet or try the workaround below. Patch for the BSD-based Linux-telnet ==================================== --- telnet.98.02.16.NE/telnet/sys_bsd.c~ Mon Feb 16 03:17:37 1998 +++ telnet.98.02.16.NE/telnet/sys_bsd.c Fri May 28 21:43:51 1999 @@ -248,9 +248,7 @@ nttyb = ottyb; #else /* USE_TERMIO */ - tcgetattr(0, &old_tc); - - new_tc = old_tc; + if (!tcgetattr(0, &old_tc)) new_tc = old_tc; #ifndef VDISCARD termFlushChar = CONTROL('O'); Workaround ========== If your telnet reads ~/.telnetrc, put something like this into that file: irc.fu-berlin.de display set echo ^E set escape ^] set rlogin off set flushoutput ^O set interrupt ^C set quit ^\\ set eof ^D set erase ^? set kill ^U set lnext ^V set susp ^Z set reprint ^R set worderase ^W set start ^Q set stop ^S set forw1 off set forw2 off set ayt ^T Leading blanks are important! Change the irc server line appropriately. The display command may be omitted. It just shows, whether telnet has a problem. xskat-4.0/README.IRC-de0100644000076400001440000000334707175631073012732 0ustar ggusers----------------------------------------------------------- ### XSkat-Zeiten: jeden Fr 13:30 und So 18:00 MEZ/MESZ ### ----------------------------------------------------------- XSkat-IRC und telnet ==================== Einige Versionen von telnet haben einen Fehler, der verhindert, daß Eingaben von einer Pipe richtig gelesen werden. Beliebige Zeichen werden in Steuerzeichen umgesetzt (z.B.: 'd' -> 'Ctrl-C'). Dies liegt daran, daß der Aufruf tcgetattr, der die Steuerzeichen des Terminals ermitteln soll, - fehlschlägt, wenn stdin kein TTY ist (was OK ist) - trotzdem die Rückgabewerte modifiziert (was nicht erwartet wurde) Wer Probleme beim XSkat-Spiel über IRC hat, kann telnet ändern oder die unten gezeigte Ersatzlösung ausprobieren. Korrektur des BSD-basierten Linux-telnet ======================================== --- telnet.98.02.16.NE/telnet/sys_bsd.c~ Mon Feb 16 03:17:37 1998 +++ telnet.98.02.16.NE/telnet/sys_bsd.c Fri May 28 21:43:51 1999 @@ -248,9 +248,7 @@ nttyb = ottyb; #else /* USE_TERMIO */ - tcgetattr(0, &old_tc); - - new_tc = old_tc; + if (!tcgetattr(0, &old_tc)) new_tc = old_tc; #ifndef VDISCARD termFlushChar = CONTROL('O'); Ersatzlösung ============ In die Datei ~/.telnetrc kann der folgende Abschnitt eingefügt werden: irc.fu-berlin.de display set echo ^E set escape ^] set rlogin off set flushoutput ^O set interrupt ^C set quit ^\\ set eof ^D set erase ^? set kill ^U set lnext ^V set susp ^Z set reprint ^R set worderase ^W set start ^Q set stop ^S set forw1 off set forw2 off set ayt ^T Die führenden Leerzeichen sind wichtig! Die IRC-Server-Zeile ist entsprechend anzupassen. Das display-Kommando kann weggelassen werden. Es zeigt lediglich, ob telnet das Problem hat. xskat-4.0/skat.c0100644000076400001440000017455010054414112012142 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define SKAT_C #include #include #include #include #include #include "defs.h" #include "skat.h" #include "text.h" int left(s) int s; { return (s+1)%3; } int right(s) int s; { return (s+2)%3; } int iscomp(s) int s; { return s>=numsp; } VOID swap(i,j) int *i,*j; { int h; h=*i; *i=*j; *j=h; } VOID setrnd(s,v) long *s,v; { *s=v<<1?v:-1; } int rndval(s,m) long *s; int m; { register long h=*s; int i; for (i=0;i<7;i++) h=(h<<16)|((((h<<1)^(h<<4))>>16)&0xffff); *s=h; return h&m; } int rnd(m) int m; { return rndval(&seed[1],m); } VOID synerr(f,s) FILE *f; char *s; { int c,l,n; fprintf(stderr,"Error in file %s",game_file); if (feof(f)) fputs(": unexpected EOF\n",stderr); else { fprintf(stderr," reading: '%s'\n",s); fputs("before:\n",stderr); l=3; n=200; while (l && n) { if ((c=fgetc(f))==EOF) l=0; else { if (c=='\n') l--; n--; fputc(c,stderr); } } } fclose(f); game_file=0; } int get_game() { static int opened; static FILE *f; char s[100],*p; int i,n,cpos[4],cmax[4],state,rep; long num; if (predef==1) predef=0; if (!game_file) return 0; if (!opened) { if (!strcmp(game_file,"-")) { game_file="stdin"; f=stdin; } else { f=fopen(game_file,"r"); } if (!f) { fprintf(stderr,"Can't open file %s\n",game_file); exitus(1); } opened=1; } state=rep=n=0; while (state!=4) { if (fscanf(f," %99s",s)!=1) { if (!state) break; synerr(f,""); return 0; } else if (*s=='#') { do { fgets(s,99,f); } while (s[strlen(s)-1]!='\n' && s[0]); } else if (!strcmp(s,"random_seed")) { if (!state) state=2; else { synerr(f,s); return 0; } } else if (!strcmp(s,"repeat")) { if (!state) { if (rep) break; rewind(f); rep=1; } else { synerr(f,s); return 0; } } else { num=strtol(s,&p,10); if (p!=s+strlen(s)) { synerr(f,s); return 0; } switch (state) { case 0: cpos[0]=30;cmax[0]=2; cpos[1]=sager*10;cmax[1]=10; cpos[2]=geber*10;cmax[2]=10; cpos[3]=hoerer*10;cmax[3]=10; state=1; case 1: if (num<0 || num>3 || !cmax[num]) { synerr(f,s); return 0; } cards[cpos[num]]=n; cpos[num]++; cmax[num]--; n++; if (n==32) { predef=1; return 1; } break; case 2: predef=2; setrnd(&seed[0],savseed=num); state=3; break; case 3: gamenr=num; while (num-->0) { for (i=0;i<32;i++) rndval(&seed[0],0); } if (fscanf(f," %d",&i)==1) { if (i>=1 && i<=3) { geber=i-1; hoerer=ausspl=left(geber); sager=right(geber); } } if (fscanf(f," %99s",s)==1) { if (toupper(*s)=='L') rotateby=-1; else if (toupper(*s)=='R') rotateby=1; } state=4; break; } } } fclose(f); game_file=0; return 0; } int gutesblatt() { int i,c,tr,bb,bs,as,ze; int t[4]; t[0]=t[1]=t[2]=t[3]=0; bb=bs=as=ze=0; for (i=0;i<12;i++) { c=cards[i<10?i:20+i]; if ((c&7)==BUBE) { bb++; if (i>9) bs++; } else t[c>>3]++; } tr=0; for (i=1;i<4;i++) { if (t[i]>=t[tr]) tr=i; } for (i=0;i<12;i++) { c=cards[i<10?i:20+i]; if ((c&7)!=BUBE && c>>3!=tr) { switch (c&7) { case AS:as++;break; case ZEHN:ze++;break; } } } tr+=bb; return (tr>5 || (tr==5 && as+ze>1) || (bb>2 && as>1)) && bs; } VOID mischen() { int i,j; static int savecards[32]; if (wieder) { for (i=0;i<32;i++) cards[i]=savecards[i]; if (wieder==1) { if (vorhandwn) rotateby=(rotateby+3)%3-1; for (i=0;i<10;i++) swap(&cards[i],&cards[10+i]); for (i=0;i<10;i++) swap(&cards[10+i],&cards[20+i]); } else if (wieder==3) { if (vorhandwn) rotateby=(rotateby+2)%3-1; for (i=0;i<10;i++) swap(&cards[i],&cards[20+i]); for (i=0;i<10;i++) swap(&cards[20+i],&cards[10+i]); } wieder=0; } else if (!get_game()) { do { for (i=0;i<32;i++) cards[i]=i; for (i=0;i<32;i++) swap(&cards[i],&cards[rndval(&seed[0],31)]); for (i=0;i<10;i++) swap(&cards[geber*10+i],&cards[i]); for (i=0;i<10;i++) swap(&cards[hoerer*10+i],&cards[geber==1?i:10+i]); if (rotateby<0) { for (i=0;i<10;i++) swap(&cards[i],&cards[10+i]); for (i=0;i<10;i++) swap(&cards[10+i],&cards[20+i]); } else if (rotateby>0) { for (i=0;i<10;i++) swap(&cards[i],&cards[20+i]); for (i=0;i<10;i++) swap(&cards[20+i],&cards[10+i]); } gamenr++; } while ((pkoption==1 || pkoption==4) && numsp==1 && !gutesblatt()); if (pkoption>1) pkoption=0; } for (i=0;i<32;i++) savecards[i]=cards[i]; setrnd(&seed[1],seed[0]); for (i=0;i<32;i++) gespcd[i]=0; for (i=0;i<4;i++) gespfb[i]=0; butternok=0; for (i=0;i<3;i++) { for (j=0;j<5;j++) hatnfb[i][j]=0; } gstsum=0; astsum=0; } int lower(c1,c2,n) int c1,c2,n; { int f1,f2,w1,w2; if (c1<0) return 1; if (c2<0) return 0; f1=c1>>3; f2=c2>>3; w1=c1&7; w2=c2&7; if (n) { if (sortw[f1]sortw[f2]) return 0; if (w1==ZEHN) return w2<=BUBE; if (w2==ZEHN) return w1>BUBE; return w1>w2; } if (w2==BUBE) { if (w1!=BUBE) return 1; return f1sortw[f2]) return 0; return w1>w2; } } VOID sort(sn) int sn; { int i,j,f=sn*10; int hatfb[4],fbsum,firstf,sptz; sortw[0]=0; sortw[1]=1; sortw[2]=2; sortw[3]=3; if (alternate[sn]) { hatfb[0]=hatfb[1]=hatfb[2]=hatfb[3]=0; for (i=f;i=0 && ((cards[i]&7)!=BUBE || sort2[sn])) { hatfb[cards[i]>>3]=1; } } if (!sort2[sn] && trumpf>=0 && trumpf<4 && hatfb[trumpf]) { hatfb[trumpf]=0; firstf=trumpf; } else firstf=-1; fbsum=hatfb[0]+hatfb[1]+hatfb[2]+hatfb[3]; if ((hatfb[0] || hatfb[1]) && (hatfb[2] || hatfb[3])) { switch (fbsum) { case 4: sortw[1]=2; sortw[2]=1; break; case 3: if (hatfb[0] && hatfb[1]) { sortw[0]=0; sortw[1]=2; sortw[2]=sortw[3]=1; } else { sortw[2]=0; sortw[3]=2; sortw[0]=sortw[1]=1; } break; case 2: if (firstf>1) { sortw[0]=sortw[1]=1; sortw[2]=sortw[3]=0; } break; } } } if (sn==spieler && spitzeang && !sort2[sn]) { sptz=trumpf==4?BUBE:SIEBEN|trumpf<<3; } else sptz=-2; for (i=f;i>3]=1; bb++; } else t[c>>3]++; } tr=0; for (i=1;i<4;i++) { if (t[i]>=t[tr]) tr=i; } for (i=0;i<10;i++) { c=cards[10*s+i]; if ((c&7)!=BUBE && c>>3!=tr) { switch (c&7) { case AS:as++;break; case ZEHN:ze++;break; default:dk+=cardw[c&7]; } } } if ((bb+t[tr]==4 && ( (as==2 && ze>=2) || (as>=3) )) || (bb+t[tr]==5 && ( (dk+10*ze>=39) || (as>=1 && ze>=1 && dk+10*ze>=11 && b[3]) || (as>=2 && dk+10*ze) || (as>=3) )) || (bb+t[tr]==6 && ( (dk+10*ze>=14) || (ze+as) )) || bb+t[tr]>=7 ) { f=2; if (b[3]) { while (f<5 && b[4-f]) f++; } maxrw[s]=f*rwert[tr]; } if (!maxrw[s]) testnull(s); if (!maxrw[s] && (((b[3] || b[2] || bb==2) && ((b[3] && b[2] && as>=2) || (bb+t[tr]==4 && as>=1 && dk+10*ze+11*as>=29) || (bb+t[tr]==5 && dk+10*ze+11*as>=19) || (bb+t[tr]==5 && ze+as>1) || (bb+t[tr]==6 && bb>2) || (bb+t[tr]==6 && dk+10*ze>=8))) || (bb+t[tr]==4 && bb && as>1) || (bb+t[tr]==5 && as>1) || (bb+t[tr]==5 && dk+10*ze+11*as>=32))) maxrw[s]=18; if (!maxrw[s] && (((b[3] || b[2] || bb==2) && (bb+t[tr]==6)) || (bb+t[tr]==4 && bb>1 && as) || (bb+t[tr]==4 && bb && as && ze && dk) || (bb+t[tr]==5 && bb && as && ze) || (bb+t[tr]==5 && bb && ze && dk>4) || (bb+t[tr]==5 && bb && ze>1) || (bb+t[tr]==5 && bb>1) || (bb+t[tr]==6 && dk+10*ze+11*as>=8))) maxrw[s]=17; stg=strateg[numsp==0?s:numsp==1?s-1:0]; if (stg<0 && rnd(3)<-stg) { if (maxrw[s]>17) maxrw[s]=17; else if (maxrw[s]==17 || rnd(7)<-stg) maxrw[s]=2*rwert[tr]; else maxrw[s]=17; } } VOID do_geben() { int sn,i; static int f; sort2[0]=sort2[1]=sort2[2]=0; prot2.verdopp[0]=prot2.verdopp[1]=prot2.verdopp[2]=0; schnang=schwang=ouveang=spitzeang=revolang=0; ndichtw=0; hintcard[0]=-1; hintcard[1]=-1; for (sn=0;sn1) { init_ramsch(); } else { putmark(hoerer); put_box(sager); put_box(hoerer); for (sn=numsp;sn<3;sn++) calc_rw(sn); phase=REIZEN; } } VOID do_sagen(s,w) int s,w; { char str[4]; tx_typ tt; int ln; for (ln=0;ln=rw || (maxrw[sager]==17 && rw==18)) { do_sagen(sager,rw); saho=0; if (sager==hoerer) { spieler=sager; do_handspiel(); } } else { do_passen(sager); if (sager==geber || sager==hoerer) { if (sager==hoerer) { reizp--; do_handspiel(); } else { if (reizp) { spieler=hoerer; reizp--; do_handspiel(); } else { rem_box(sager); sager=hoerer; } } } else { rem_box(sager); sager=geber; put_box(sager); } } } else { if (maxrw[hoerer]>=rw) { do_akzept(hoerer); reizp++; saho=1; } else { do_passen(hoerer); if (sager==geber) { spieler=sager; do_handspiel(); } else { rem_box(hoerer); rem_box(sager); hoerer=sager; sager=geber; reizp++; saho=1; put_box(hoerer); put_box(sager); } } } } VOID do_reizen() { while (phase==REIZEN && ((iscomp(sager) && saho) || (iscomp(hoerer) && !saho))) { do_entsch(); } if (phase==REIZEN) { if (saho) do_msagen(sager,reizw[reizp]); else do_mhoeren(hoerer); } } VOID drueck(f,n,p) int f,n,*p; { int i,j; for (i=trumpf!=5;i<8 && n && gedr<2;i++) { if (inhand[f][i]) { inhand[f][i]=0; (*p)-=cardw[i]; if (!gedr && cards[31]==(f<<3)+i) { swap(&cards[30],&cards[31]); } else { for (j=0;j<10;j++) { if (cards[spieler*10+j]==(f<<3)+i) { swap(&cards[30+gedr],&cards[10*spieler+j]); break; } } } gedr++; n--; } } } VOID truempfe() { int i,c; for (c=0;c<2;c++) { if ((cards[30+c]&7)==BUBE || cards[30+c]>>3==trumpf) { for (i=0;i<10;i++) { if ((cards[10*spieler+i]&7)!=BUBE && cards[10*spieler+i]>>3!=trumpf) { swap(&cards[30+c],&cards[10*spieler+i]); break; } } } } } int tr_voll(sn,f) int sn,f; { int i,c,t,a,z,n[4],ze[4]; if (trumpf==-1 || trumpf==4) return f; t=a=z=0; n[0]=n[1]=n[2]=n[3]=0; ze[0]=ze[1]=ze[2]=ze[3]=0; for (i=0;i<10;i++) { c=cards[10*sn+i]; if ((c&7)==BUBE || c>>3==trumpf) t++; else if ((c&7)==AS) a++; else if ((c&7)==ZEHN) z++,ze[c>>3]=1; else n[c>>3]++; } if (f) { return t>7 || (t>6 && a+z); } return (t>5 || (t>4 && a+z) || (t>3 && a>2)) && !(t==4 && ((ze[0] && !n[0]) || (ze[1] && !n[1]) || (ze[2] && !n[2]) || (ze[3] && !n[3]))); } int sage_kontra(sn) int sn; { return tr_voll(sn,0); } int sage_re(sn) int sn; { return tr_voll(sn,1); } int testgrand(bb,b,vh) int bb,b[4],vh; { int i,j,fl,ih,g3,g4,as,ze,ko,a[4],bz; bz=2; for (j=0;j<4;j++) { a[j]=0; for (i=0;i<8;i++) { if (i>=BUBE || i==ZEHN) continue; a[j]+=inhand[j][i]; } if (inhand[j][ZEHN] && !a[j]) bz=1; } if (bb==2 && spieler!=ausspl) bz=1; as=inhand[0][AS]+inhand[1][AS]+inhand[2][AS]+inhand[3][AS]; ze=inhand[0][ZEHN]+inhand[1][ZEHN]+inhand[2][ZEHN]+inhand[3][ZEHN]; ko=inhand[0][KOENIG]+inhand[1][KOENIG]+inhand[2][KOENIG]+inhand[3][KOENIG]; if (bb==2 && as>2 && ze) return bz; if (bb && as>2 && ze==4) return bz; if (as==4 && ze>3-bb) return 2; if (as==4 && ze>2-bb) return 1; if (bb<=2 && (!b[3] || bb!=2 || spieler!=ausspl)) return 0; fl=g3=g4=0; for (i=0;i<4;i++) { ih=0; for (j=0;j<8;j++) { if (j!=BUBE && inhand[i][j]) ih++; } for (j=0;j<8;j++) { if (j!=BUBE) { if (inhand[i][j]) fl++; else if (7-ih>j) break; } } if ((ih>4) || (ih>3 && (inhand[i][AS] || inhand[i][ZEHN]))) g4=1; if (ih>4 && (inhand[i][AS] || inhand[i][ZEHN])) g3=1; if (ih>3 && inhand[i][AS] && inhand[i][ZEHN]) g3=1; } if (fl+bb>5) return bz; if (bb==4 && g4) return bz; if ((bb==3 && (b[3] || vh) && g3)) return bz; return fl+bb>4 && b[3] && !(bb+as==5 && !ze && !ko); } VOID calc_inhand(sn) int sn; { int i,c; for (i=0;i<4;i++) { for (c=0;c<8;c++) inhand[i][c]=0; } for (i=0;i<10;i++) { c=cards[10*sn+i]; if (c>=0) { inhand[c>>3][c&7]=1; } } } int testhand() { int i,c,f,bb,as; int b[4],t[4],p[4],o[4]; for (i=0;i<4;i++) { b[i]=t[i]=p[i]=0; o[i]=i; } bb=0; for (i=0;i<4;i++) { for (c=0;c<8;c++) inhand[i][c]=0; } for (i=0;i<10;i++) { c=spcards[i]; if ((c&7)==BUBE) { b[c>>3]=1; bb++; } else { p[c>>3]+=cardw[c&7]; t[c>>3]++; inhand[c>>3][c&7]=1; } } for (i=1;i<4;i++) { if (inhand[i][ZEHN] && !inhand[i][AS] && !inhand[i][KOENIG]) { o[i]=0; o[0]=i; break; } } f=3; while (f<5 && b[4-f]==b[3]) f++; trumpf=0; while (f*rwert[trumpf]t[trumpf] || (t[i]==t[trumpf] && p[i]<=p[trumpf])) trumpf=i; } if (testgrand(bb,b,spieler==ausspl)==2) { trumpf=4; return 1; } as=0; for (i=0;i<4;i++) { if (inhand[i][AS] && i!=trumpf) as++; } if (t[trumpf]+bb>7 && as) return 1; return 0; } #define DRUECKEN(T,N,C)\ {\ for (i=0;x && i<4;i++) {\ if (i!=trumpf && t[i]==(T) && (C)) {\ drueck(i,N,&p[i]);\ t[i]-=(N);\ x=0;\ break;\ }\ }\ } #define LUSCHE()\ (\ inhand[i][SIEBEN] || inhand[i][ACHT] || inhand[i][NEUN]\ ) VOID calc_drueck() { int i,j,c,f,bb,n,sp,tr,x; int b[4],t[4],p[4],o[4]; int savecards[32]; if (iscomp(spieler)) { if (maxrw[spieler]==nullw[0] || maxrw[spieler]==nullw[1] || maxrw[spieler]==nullw[2] || maxrw[spieler]==nullw[3] || maxrw[spieler]==nullw[4]) { trumpf=-1; if (maxrw[spieler]!=nullw[0] && maxrw[spieler]!=nullw[2]) handsp=1; if (maxrw[spieler]>=nullw[3]) ouveang=1; if (maxrw[spieler]==nullw[4]) revolang=1; gedr=2; return; } if (testhand()) { gedr=2; handsp=1; return; } } else { for (i=0;i<32;i++) savecards[i]=cards[i]; } for (i=0;i<4;i++) { b[i]=t[i]=p[i]=0; } bb=0; for (i=0;i<4;i++) { for (c=0;c<8;c++) inhand[i][c]=0; } for (i=0;i<12;i++) { c=spcards[i]; if ((c&7)==BUBE) { b[c>>3]=1; bb++; } else { p[c>>3]+=cardw[c&7]; t[c>>3]++; inhand[c>>3][c&7]=1; } } f=2; while (f<5 && b[4-f]==b[3]) f++; trumpf=0; if (iscomp(spieler)) { while (f*rwert[trumpf]t[trumpf] || (t[i]==t[trumpf] && p[i]<=p[trumpf])) trumpf=i; } tr=t[trumpf]; truempfe(); do { x=1; if (!gedr) { DRUECKEN(1,1,inhand[i][ZEHN]); DRUECKEN(2,1,inhand[i][ZEHN] && (inhand[i][DAME] || LUSCHE())); DRUECKEN(1,1,inhand[i][KOENIG]); DRUECKEN(2,2,inhand[i][KOENIG] && inhand[i][DAME]); DRUECKEN(1,1,inhand[i][DAME]); DRUECKEN(2,2,inhand[i][KOENIG] && LUSCHE()); DRUECKEN(2,2,inhand[i][DAME] && LUSCHE()); DRUECKEN(2,2,inhand[i][ZEHN] && inhand[i][KOENIG]); DRUECKEN(1,1,!p[i]); DRUECKEN(2,2,!p[i]); DRUECKEN(2,1,inhand[i][AS] && inhand[i][KOENIG]); DRUECKEN(2,1,inhand[i][AS] && inhand[i][DAME]); DRUECKEN(2,1,inhand[i][AS] && LUSCHE()); } else { DRUECKEN(1,1,inhand[i][ZEHN]); DRUECKEN(2,1,inhand[i][ZEHN] && (inhand[i][DAME] || LUSCHE())); DRUECKEN(1,1,inhand[i][KOENIG]); DRUECKEN(1,1,inhand[i][DAME]); DRUECKEN(1,1,!p[i]); DRUECKEN(2,1,inhand[i][KOENIG] && LUSCHE()); DRUECKEN(2,1,inhand[i][DAME] && LUSCHE()); DRUECKEN(2,1,inhand[i][KOENIG] && inhand[i][DAME]); DRUECKEN(2,1,!p[i]); DRUECKEN(2,1,inhand[i][AS] && inhand[i][KOENIG]); DRUECKEN(2,1,inhand[i][AS] && inhand[i][DAME]); DRUECKEN(2,1,inhand[i][AS] && LUSCHE()); DRUECKEN(2,1,inhand[i][ZEHN] && inhand[i][KOENIG]); } } while (gedr<2 && !x); for (i=0;i<4;i++) { o[i]=i; } for (i=0;i<4;i++) { for (j=i+1;j<4;j++) { if (p[o[i]]>p[o[j]]) { x=o[i]; o[i]=o[j]; o[j]=x; } } } for (n=3;n<8 && gedr<2;n++) { for (j=0;j<4 && gedr<2;j++) { i=o[j]; if (t[i]==n && i!=trumpf) { if (inhand[i][AS]) { if (!inhand[i][ZEHN]) drueck(i,2,&p[i]); } else drueck(i,2,&p[i]); } } } if (testgrand(bb,b,spieler==ausspl)) { trumpf=4; } if (spitzezaehlt && ((trumpf<4 && inhand[trumpf][SIEBEN] && ((tr+bb>=7 && (bb>1 || !b[0])) || (tr+bb==6 && bb>=4))) || (trumpf==4 && b[0] && b[3] && bb==3 && spieler==ausspl))) { sp=trumpf==4?BUBE:SIEBEN|trumpf<<3; if (cards[30]!=sp && cards[31]!=sp) { spitzeang=1; } } if (iscomp(spieler)) { gespcd[cards[30]]=1; gespcd[cards[31]]=1; } else { for (j=0;j<2;j++) { for (i=0;i<12;i++) { if (cards[30+j]==spcards[i]) { hintcard[j]=i<10?10*spieler+i:20+i; break; } } } for (i=0;i<32;i++) cards[i]=savecards[i]; } } VOID nextgame() { if (numgames) { phase=GEBEN; numgames--; if (!numgames) { printf("%d ",sum[0][alist[0]]); printf("%d ",sum[1][alist[0]]); printf("%d\n",sum[2][alist[0]]); quit=1; } } } VOID save_skat(i) int i; { if (lower(cards[31],cards[30],0)) { swap(&cards[31],&cards[30]); } prot2.skat[i][0]=cards[30]; prot2.skat[i][1]=cards[31]; } int check_bockevents() { int e,m,i,ns,s; e=0; if (bockevents&BOCK_BEI_60) { if (!spgew && stsum==60 && trumpf>=0 && trumpf<=4) e++; } if (bockevents&BOCK_BEI_GRANDHAND) { if (spgew && trumpf==4 && handsp) e++; } m=0; if (bockevents&BOCK_BEI_KONTRA) { if (!spgew && kontrastufe) e++,m=1; } if (!m && bockevents&BOCK_BEI_RE) { if (kontrastufe==2) e++; } for (i=0;i<3;i++) { ns=sum[i][alist[0]]; s=ns<0?-ns:ns; if (ns!=prevsum[i][alist[0]] && ((bockevents&BOCK_BEI_NNN && s%10==s/10%10 && s%10==s/100%10) || (bockevents&BOCK_BEI_N00 && s%100==0))) e++; } m=0; if (bockevents&BOCK_BEI_72) { if (nspwert>=72) e++,m=1; } if (!m && bockevents&BOCK_BEI_96) { if (nspwert>=96) e++; } return e; } VOID update_list() { int i; if (splstp>=360) { for (i=0;i<12;i++) { modsum(splsum,sgewoverl,i,(int *)0,(int *)0,(int *)0,(int *)0); } for (i=12;i0) { init_ramsch(); return; } stich=1; fill_st(); trumpf=4; set_prot(); save_skat(1); prot1=prot2; spwert=0; update_list(); save_list(); if (logging) di_proto(0,1,1); splres=1; nextgame(); phase=WEITER; for (sn=0;sn=10?prot2.skat[1][i-10]:cards[spieler*10+i]; if ((c&7)==BUBE) bb++; if (i<10) { if ((c&7)==SIEBEN) { kannspitze=1; break; } if (c==BUBE) { kannspitze=2; } } } if (kannspitze==2) { kannspitze=bb!=4; } if (!iscomp(spieler) && !ramschspiele) { di_spiel(); } else { remmark(1); di_ansage(); } } VOID karobube() { int s,i,n,k,c; karobubeanz=0; if (trumpf<0 || trumpf>3) return; for (s=0;s<3;s++) { if (s==spieler) continue; n=k=0; for (i=0;i<10;i++) { c=cards[s*10+i]; if ((c&7)==BUBE || c>>3==trumpf) { n++; if ((c&7)1 || iscomp(spieler))) revolutionscr(); else spielphase(); } VOID spielphase() { int sn,c,i; phase=SPIELEN; sptruempfe=0; for (i=0;i<10;i++) { c=cards[spieler*10+i]; if ((c&7)==BUBE || c>>3==trumpf) sptruempfe++; } karobube(); if (ouveang) { for (sn=0;sn>3; w1=c1&7; f2=c2>>3; w2=c2&7; if (trumpf==-1) { if (f1==f2) { if (w1==ZEHN) return w2>BUBE; if (w2==ZEHN) return w1<=BUBE; return w1f2; else return 1; } if (w2==BUBE) return 0; if (f1==f2) return w1>3]=1; else if (c>>3==trumpf) s[c&7]=1; } s[BUBE]=s[NEUN]; s[NEUN]=s[ACHT]; s[ACHT]=s[SIEBEN]; f=1; while (f<4 && b[3-f]==b[3]) f++; if (f==4 && trumpf!=4) { while (f<11 && s[f-4]==b[3]) f++; } f++; if (handsp) f++; if (stsum>=90 || schnang || stsum<=30) f++; if (schnang) f++; if (schwz || schwang || !nullv) f++; if (schwang) f++; if (ouveang) f++; if (spitzeang) f+=spitzezaehlt; if (trumpf==4 && ouveang && oldrules) spwert=(f-1)*36; else spwert=f*rwert[trumpf]; if ((stsum>60 && spwert>=reizw[reizp] && (stsum>=90 || !schnang) && (schwz || !schwang) && (spitzeok || !spitzeang)) || stich==1) { spgew=1; nspwert=spwert; } else { if (spwert0) va[i]=0; strateg[i]=va[i]; } } } if (fscanf(f,"r %d\n",&v)==1) { if (!ramschset) { if (v<0) v=0; else if (v>2) v=2; playramsch=v; } } if (fscanf(f,"p %d\n",&v)==1) { if (!sramschset) { playsramsch=!!v; } } if (fscanf(f,"k %d\n",&v)==1) { if (!kontraset) { if (v<0) v=0; else if (v>2) v=2; playkontra=v; } } } VOID read_opt() { FILE *f; int v,va[3],i; char buf[40]; dlhintseen=1; if (!opt_file) return; dlhintseen=0; f=fopen(opt_file,"r"); if (!f) { firstgame=1; return; } read_opt_srpk(f); if (fscanf(f,"b %d\n",&v)==1) { if (!bockset) { if (v<0) v=0; else if (v>2) v=2; playbock=v; } } if (fscanf(f,"e %d\n",&v)==1) { if (!bockeventsset) { bockevents=v; } } if (fscanf(f,"c %d\n",&v)==1) { if (!resumebockset) { resumebock=!!v; } } if (fscanf(f,"d %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !downupset[i]) { sort1[i]=!!va[i]; } } } if (fscanf(f,"a %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !altseqset[i]) { alternate[i]=!!va[i]; } } } if (fscanf(f,"t %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !tdelayset[i]) { if (va[i]<0) va[i]=7; else if (va[i]>101) va[i]=101; nimmstich[i][0]=va[i]; } } } if (fscanf(f,"l %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !alistset[i]) { if (va[i]<0) va[i]=0; else if (va[i]>2) va[i]=2; alist[i]=va[i]; } } } if (fscanf(f,"m %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !mbuttonset[i]) { if (va[i]<0 || va[i]>5) va[i]=0; mbutton[i]=va[i]; } } } if (fscanf(f,"s %d\n",&v)==1) { if (!spitzezaehltset) { spitzezaehlt=v; } } if (fscanf(f,"r %d\n",&v)==1) { if (!revolutionset) { revolution=!!v; } } if (fscanf(f,"k %d\n",&v)==1) { if (!klopfenset) { klopfen=!!v; } } if (fscanf(f,"s %d\n",&v)==1) { if (!schenkenset) { schenken=!!v; } } if (fscanf(f,"f %d\n",&v)==1) { if (!fastdealset) { fastdeal=!!v; } } if (fscanf(f,"h %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !hintsset[i]) { hints[i]=!!va[i]; } } } if (fscanf(f,"b %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !blattset[i]) { if (va[i]<0 || va[i]>3) va[i]=0; blatt[i]=va[i]; } } } if (fscanf(f,"l %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !langset[i]) { if (va[i]<0 || va[i]>=NUM_LANG) va[i]=0; lang[i]=va[i]; } } } if (fscanf(f,"a %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !abkuerzset[i]) { if (va[i]<0 || va[i]>2) va[i]=1; abkuerz[i]=va[i]; } } } if (fscanf(f,"o %d\n",&v)==1) { if (!oldrulesset) { oldrules=!!v; } } if (fscanf(f,"k %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !keyboardset[i]) { if (va[i]<0 || va[i]>2) va[i]=1; keyboard[i]=va[i]; } } } if (fscanf(f,"b %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !briefmsgset[i]) { briefmsg[i]=!!va[i]; } } } if (fscanf(f,"l %d %d %d\n",&va[0],&va[1],&va[2])==3) { for (i=0;i<3;i++) { if (useoptfile[i] && !trickl2rset[i]) { trickl2r[i]=!!va[i]; } } } if (fscanf(f,"s %d\n",&v)==1) { if (!rskatloserset) { rskatloser=!!v; } } if (fscanf(f,"d %d\n",&v)==1) { dlhintseen=1; } fscanf(f,"l %35s %35s %35s\n",lanip[0],lanip[1],lanip[2]); fscanf(f,"i %d %d\n",&laninvite[0],&laninvite[1]); if (fscanf(f,"h %35s\n",buf)==1) { if (!irc_hostset) { strcpy(irc_hostname,buf); } } fscanf(f,"a %9s %9s\n",usrname[0],usrname[1]); fscanf(f,"a %9s %9s\n",conames[0][0],conames[0][1]); fscanf(f,"a %9s %9s\n",conames[1][0],conames[1][1]); fclose(f); } VOID save_opt() { FILE *f; if (!opt_file) return; f=fopen(opt_file,"w"); if (!f) { fprintf(stderr,"Can't write file %s\n",opt_file); return; } fprintf(f,"s %d %d %d\n",strateg[0],strateg[1],strateg[2]); fprintf(f,"r %d\n",playramsch); fprintf(f,"p %d\n",playsramsch); fprintf(f,"k %d\n",playkontra); fprintf(f,"b %d\n",playbock); fprintf(f,"e %d\n",bockevents); fprintf(f,"c %d\n",resumebock); fprintf(f,"d %d %d %d\n",sort1[0],sort1[1],sort1[2]); fprintf(f,"a %d %d %d\n",alternate[0],alternate[1],alternate[2]); fprintf(f,"t %d %d %d\n",nimmstich[0][0],nimmstich[1][0],nimmstich[2][0]); fprintf(f,"l %d %d %d\n",alist[0],alist[1],alist[2]); fprintf(f,"m %d %d %d\n",mbutton[0],mbutton[1],mbutton[2]); fprintf(f,"s %d\n",spitzezaehlt); fprintf(f,"r %d\n",revolution); fprintf(f,"k %d\n",klopfen); fprintf(f,"s %d\n",schenken); fprintf(f,"f %d\n",fastdeal); fprintf(f,"h %d %d %d\n",hints[0],hints[1],hints[2]); fprintf(f,"b %d %d %d\n",blatt[0],blatt[1],blatt[2]); fprintf(f,"l %d %d %d\n",lang[0],lang[1],lang[2]); fprintf(f,"a %d %d %d\n",abkuerz[0],abkuerz[1],abkuerz[2]); fprintf(f,"o %d\n",oldrules); fprintf(f,"k %d %d %d\n",keyboard[0],keyboard[1],keyboard[2]); fprintf(f,"b %d %d %d\n",briefmsg[0],briefmsg[1],briefmsg[2]); fprintf(f,"l %d %d %d\n",trickl2r[0],trickl2r[1],trickl2r[2]); fprintf(f,"s %d\n",rskatloser); fprintf(f,"d 1\n"); fprintf(f,"l %s %s %s\n",lanip[0],lanip[1],lanip[2]); fprintf(f,"i %d %d\n",laninvite[0],laninvite[1]); fprintf(f,"h %s\n",irc_hostname); fprintf(f,"a %s %s\n",usrname[0],usrname[1]); fprintf(f,"a %s %s\n",conames[0][0],conames[0][1]); fprintf(f,"a %s %s\n",conames[1][0],conames[1][1]); fclose(f); } VOID read_list() { FILE *f; int c,i,j; if (!list_file) return; f=fopen(list_file,"r"); if (!f) return; splstp=0; if (fscanf(f,"%d %d %d\n",&splsum[0][0],&splsum[1][0],&splsum[2][0])!=3) { splsum[0][0]=splsum[1][0]=splsum[2][0]=0; fclose(f); return; } if (fscanf(f,"a %d %d %d\n",&splsum[0][1],&splsum[1][1],&splsum[2][1])!=3) { splsum[0][1]=splsum[1][1]=splsum[2][1]=0; } if (fscanf(f,"t %d %d %d\n",&splsum[0][2],&splsum[1][2],&splsum[2][2])!=3) { splsum[0][2]=splsum[1][2]=splsum[2][2]=0; } read_opt_srpk(f); if (fscanf(f,"b %d %d %d\n",&bockspiele,&bockinc,&ramschspiele)!=3) { bockspiele=bockinc=ramschspiele=0; } if (fscanf(f,"g %d %d %d\n", &sgewoverl[0][0],&sgewoverl[1][0],&sgewoverl[2][0])!=3) { sgewoverl[0][0]=sgewoverl[1][0]=sgewoverl[2][0]=0; } if (fscanf(f,"v %d %d %d\n", &sgewoverl[0][1],&sgewoverl[1][1],&sgewoverl[2][1])!=3) { sgewoverl[0][1]=sgewoverl[1][1]=sgewoverl[2][1]=0; } for (i=0;i<3;i++) { for (j=0;j<3;j++) { sum[i][j]=splsum[i][j]; } for (j=0;j<2;j++) { cgewoverl[i][j]=sgewoverl[i][j]; } } do { if (fscanf(f,"%d\n",&i)==1) { splist[splstp].s=i/10000; splist[splstp].r=(i-splist[splstp].s*10000)/4000; splist[splstp].d=(i-splist[splstp].s*10000-splist[splstp].r*4000)/2000; splist[splstp].e=i%2000>>1; splist[splstp].g=i&1; modsum(sum,cgewoverl,splstp,(int *)0,(int *)0,(int *)0,(int *)0); splstp++; } else if (fscanf(f,"e %d %d %d %d %d\n", &splist[splstp].s,&splist[splstp].r,&splist[splstp].d, &splist[splstp].e,&splist[splstp].g)==5) { modsum(sum,cgewoverl,splstp,(int *)0,(int *)0,(int *)0,(int *)0); splstp++; } else { while ((c=getc(f))!=EOF && c!='\n'); } } while (!feof(f) && splstp<360); fclose(f); } VOID fill_st() { int i,j,s,c,sc; for (s=0;s<3;s++) { if (vmh>=1 && s==ausspl) { sc=stcd[0]; } else if (vmh==2 && s==left(ausspl)) { sc=stcd[1]; } else { sc=-1; } i=stich-1; for (j=0;j<10;j++) { c=cards[10*s+j]; if (c<0 && sc>=0) { c=sc; sc=-1; } if (c>=0) prot2.stiche[i++][s]=c; } } } int maxnimm() { int i,m; m=nimmstich[0][0]; for (i=1;im) m=nimmstich[i][0]; } return m; } VOID next_stich() { int nd; if (maxnimm()<101) { waitt(maxnimm()*100,2); } info_stich(0,stcd[0]); info_stich(1,stcd[1]); info_stich(2,stcd[2]); nimm_stich(); vmh=0; stich++; nd=0; if (stich==11 || (trumpf==-1 && (nullv || (!ndichtw && stich<10 && (nd=null_dicht(spieler,handsp,&prot2.skat[1][0], (int *)0,(int *)0,(int *)0)))))) { if (nd) di_dicht(); else finishgame(); } } VOID finishgame() { int i,s; if (stich<11) { if (trumpf<0 || trumpf>4 || (schenkstufe && stich==1)) fill_st(); else { while (stich!=11) { s=(ausspl+vmh)%3; calc_poss(s); make_best(s); i=possi[playcd]; stcd[vmh]=cards[i]; cards[i]=-1; if (vmh==2) { get_next(); vmh=0; stich++; } else vmh++; } } } calc_result(); set_prot(); prot1=prot2; update_list(); if (playbock) bockinc=check_bockevents(); save_list(); if (logging) di_proto(0,1,1); splres=1; clr_desk(0); phase=RESULT; di_result(bockinc); nextgame(); } VOID do_next() { int sn; if (vmh==2) { get_next(); for (sn=0;sn=101) { nimmstich[sn][1]=1; phase=NIMMSTICH; } } if (phase==NIMMSTICH) return; next_stich(); } else vmh++; } VOID calc_poss(s) int s; { int i,j,k,f1,w1,f2,w2; possc=0; for (i=0;i<10;i++) { if (cards[s*10+i]>=0) { for (j=0;jcards[possi[j]];j++); for (k=possc;k>j;k--) possi[k]=possi[k-1]; possi[j]=s*10+i; possc++; } } if (vmh) { f1=stcd[0]>>3; w1=stcd[0]&7; if (trumpf!=-1 && w1==BUBE) f1=trumpf; i=j=0; do { f2=cards[possi[i]]>>3; w2=cards[possi[i]]&7; if (trumpf!=-1 && w2==BUBE) f2=trumpf; if (f1==f2) possi[j++]=possi[i]; } while (++i4?4:f1]=1; } } VOID c_high(f,h) int f; int *h; { int i,j; h[0]=h[1]=h[2]=h[3]=h[4]=-1; for (i=0;i<4;i++) { for (j=0;j<8;j++) { if (j==BUBE) j++; if (gespcd[i<<3|j]=0;i--) { if (gespcd[i<<3|BUBE]=0) gespcd[high[i]]=2; } c_high(f,shigh); for (i=0;i<32;i++) gespcd[i]=gespsav[i]; } int zweihoechste(ci) int ci; { int i,tr,trdr,cj=ci; calc_high(1,1); if (ci!=high[trumpf]) return 0; for (i=0;i>3==trumpf || (cards[possi[i]]&7)==BUBE) { tr++; } } if (trumpf<4) trdr=7-gespfb[trumpf]; else trdr=0; for (i=0;i<4;i++) if (!gespcd[i<<3|BUBE]) trdr++; return ci!=cj && cj==shigh[trumpf] && trdr-tr<=1; } int ignorieren() { int mi,fb,i,ih,k[8]; mi=right(ausspl); fb=stcd[0]>>3; if ((stcd[0]&7)==BUBE || fb==trumpf || cardw[stcd[0]&7] || hatnfb[mi][fb]==1) return 0; ih=0; for (i=0;i<8;i++) k[i]=0; for (i=0;i>3==fb) { ih++; k[cards[possi[i]]&7]=1; } } k[BUBE]=k[NEUN]; k[NEUN]=k[ACHT]; k[ACHT]=k[SIEBEN]; if (ih>=2) { for (i=AS;i<=NEUN && !k[i];i++) { if (gespcd[fb<<3|i]!=2) return 0; } for (i++;i<=ACHT && !k[i];i++) { if (gespcd[fb<<3|i]!=2) break; } if (k[i]) return 0; } if (stich>7) { for (i=0;i>3==fb && (cards[possi[i]]&7)!=BUBE) { if (!higher(stcd[0],cards[possi[i]])) return 0; } } } return ih<3; } int genugdrin() { return (stcd[0]>>3==cards[possi[0]]>>3 && (cards[possi[0]]&7)!=BUBE) || (trumpf!=4 && cardw[stcd[0]&7]+cardw[stcd[1]&7]>0) || cardw[stcd[0]&7]+cardw[stcd[1]&7]>3+rnd(1); } int gewinnstich(f) int f; { int i,p,s,g,ci,sf,su; s=f?astsum:gstsum; sf=0; if (f) { if (schnang || spitzeang || stich<6 || s>60) return 0; } else { if (s>59) return 0; if (s<30) { su=cardw[prot2.skat[0][0]&7]+cardw[prot2.skat[0][1]&7]+ cardw[stcd[0]&7]+cardw[stcd[1]&7]; for (i=0;i<30;i++) { if (cards[i]>=0) su+=cardw[cards[i]&7]; } if (su+s<60) sf=1; } } p=!higher(stcd[0],stcd[1]); g=!f && (spieler==ausspl)^!p; for (i=0;i59+f) { playcd=i; return 1; } if (sf && s+cardw[ci&7]+cardw[stcd[0]&7]+cardw[stcd[1]&7]>30) { playcd=i; return 1; } } } return 0; } int uebernehmen(p,h,n) int p,h,n; { int i,j,ci,cj,wi,wj,fb,is; is=(ausspl+vmh)%3==spieler; if (is && vmh==1 && !hatnfb[left(spieler)][trumpf] && (stcd[0]>>3==trumpf || (stcd[0]&7)==BUBE || hatnfb[left(spieler)][stcd[0]>>3])) h=0; j=0; calc_inhand((ausspl+vmh)%3); for (i=0;i>3; if (cj==high[fb] && shigh[fb]>=0 && !inhand[shigh[fb]>>3][shigh[fb]&7]) { j=i+1; continue; } fb=wi==2?trumpf:ci>>3; if (ci==high[fb] && shigh[fb]>=0 && !inhand[shigh[fb]>>3][shigh[fb]&7]) continue; } } if (wi==10) wi=12-h*2; if (wj==10) wj=12-h*2; if (wi==2 && wj==2) { if (trumpf==4 && is) { wi=ci>>3; wj=cj>>3; } else { wi=cj>>3; wj=ci>>3; } } else { if (wi==2) wi=5-h*6; if (wj==2) wj=5-h*6; } if (is) { if (!h && zweihoechste(ci)) j=i+1; else { if (n) { if ((wi==4 && ci>>3!=trumpf) || wi==10) wi=-1; if ((wj==4 && cj>>3!=trumpf) || wj==10) wj=-1; } if ((h || !zweihoechste(cj)) && ((wi4 && !hatnfb[left(spieler)][trumpf] && (stcd[0]>>3==trumpf || (wj==10 && !gespcd[(cj&0x18)|AS] && !inhand[cj>>3][AS]) || (stcd[0]&7)==BUBE || hatnfb[left(spieler)][stcd[0]>>3])) j=0; else if (!h && wj==10 && gespcd[(cj&0x18)|AS]>3==trumpf && cj>>3!=trumpf) wi=1; else if (wi==11) wi=aw[ci>>3]; if (wj==2) wj=-2; else if (cj>>3==trumpf && ci>>3!=trumpf) wj=1; else if (wj==11) wj=aw[cj>>3]; if (wi>wj || (vmh==2 && wi==wj && !wi && (ci&7)>(cj&7))) j=i; } playcd=j; } int einstechen() { int ci; if (!cardw[stcd[0]&7] || !uebernehmen(0,0,0)) return 0; ci=cards[possi[playcd]]; if ((ci&7)<=ZEHN || (ci&7)==BUBE) return 0; if (ci>>3==trumpf) return 1; return 0; } int niedrighoch(f) int f; { int i,j,ok,gespsav[32]; for (i=0;i<32;i++) gespsav[i]=gespcd[i]; ok=j=0; do { calc_high(1,0); if (ok) ok=2; for (i=0;i4) return 0; calc_high(1,0); for (i=0;i=0) { c=c<<3|BUBE; for (i=0;i>3==trumpf || (cards[possi[i]]&7)==BUBE) { tr++; } } trdr=7-gespfb[trumpf]; for (i=0;i<4;i++) if (!gespcd[i<<3|BUBE]) trdr++; for (i=0;i>3==trumpf || (cards[possi[i]]&7)==BUBE) { wi=cardw[cards[possi[i]]&7]; if (wi==2 && trdr-tr!=1) wi=-1; if (j<0 || wi=DAME;i--) { if (i==BUBE) continue; if (!gespcd[trumpf<<3|i] && !inhand[trumpf][i]) { for (;i>=KOENIG;i--) { if (i==BUBE) continue; if (inhand[trumpf][i]) { for (k=0;k2 && (trumpf!=4 || trdr-tr)) || (tr>1 && trdr-tr && trdr-tr<=2)) { playcd=k!=possc && (trdr-tr==2 || !cardw[cards[possi[k]]&7])?k:j; return 1; } for (i=0;i6) && (!hatnfb[spieler][j] || stich>7)) { playcd=i; return 1; } } } return 0; } VOID schenke() { int i,j,ci,cj,wi,wj,iw,jw,ih[4],ze[4],ko[4],da[4],ne[4]; if (!vmh && trumpf==4) { for (i=0;i<4;i++) { ih[i]=ze[i]=ko[i]=da[i]=ne[i]=0; } for (i=0;i>3]++; if ((ci&7)==ZEHN) ze[ci>>3]=1; else if ((ci&7)==KOENIG) ko[ci>>3]=1; else if ((ci&7)==DAME) da[ci>>3]=1; else if ((ci&7)==NEUN) ne[ci>>3]=1; } } j=0; for (i=1;i>3; wj=cj>>3; } else { if (!wi && !gespcd[(ci&~7)|AS] && zehnblank(ci) && stich<=6) wi+=4; if (!wj && !gespcd[(cj&~7)|AS] && zehnblank(cj) && stich<=6) wj+=4; } if ((ci&7)==BUBE || ci>>3==trumpf) wi+=5; if ((cj&7)==BUBE || cj>>3==trumpf) wj+=5; if (wi=NEUN && jw>=NEUN && iw>jw) || (!vmh && trumpf==4 && ih[ci>>3]>ih[cj>>3])) )) j=i; } if (!vmh && trumpf==4) { for (i=1;i>3==cj>>3 && ze[ci>>3] && ko[ci>>3] && ih[ci>>3]>2) { if (((wi==4 && !da[ci>>3] && !ne[ci>>3]) || (wi==3 && !ne[ci>>3]) || iw==NEUN) && !wj) j=i; } } } playcd=j; } int zehnblank(ci) int ci; { int i,f,n,z,a,cj; f=ci>>3; n=z=a=0; for (i=0;i>3==f) { n++; if ((cj&7)==ZEHN) z=1; else if ((cj&7)==AS) a=1; } } return z && !a && n==2 && !hatnfb[spieler][f]; } int fabwerfen() { int i,fb,ci,n[4]; fb=stcd[0]>>3; if (!hatnfb[spieler][fb] || (vmh==2 && cardw[stcd[0]&7]+cardw[stcd[1]&7]>4) || (vmh==1 && cardw[stcd[0]&7]>0)) return 0; n[0]=n[1]=n[2]=n[3]=0; for (i=0;i>3!=trumpf) { n[ci>>3]++; } } calc_high(1,0); for (i=0;i>3; if ((ci&7)!=BUBE && fb!=trumpf && cardw[ci&7]<=4 && n[fb]==1 && ci!=high[fb]) { playcd=i; return 1; } } return 0; } VOID abwerfen() { int i,j,ci,cj,wi,wj,mi,wio,wjo,h; int gsp[4],ze[4],as[4],ih[4]; for (i=0;i<4;i++) gsp[i]=ze[i]=as[i]=ih[i]=0; for (i=0;i<32;i++) { if ((i&7)!=BUBE && gespcd[i]==2) gsp[i>>3]++; } for (i=0;i>3]++; if ((ci&7)==ZEHN) ze[ci>>3]=1; else if ((ci&7)==AS) as[ci>>3]=1; } j=0; for (i=1;i>3; wj=cj>>3; } else { if (stich>7) { wi*=2; wj*=2; if (wi==10 || ci>>3==trumpf) wi+=12; if (wj==10 || cj>>3==trumpf) wj+=12; if (hatnfb[spieler][ci>>3]) wi-=7; if (hatnfb[spieler][cj>>3]) wj-=7; } else { if (wi==5 || ci>>3==trumpf) wi+=5; if (wj==5 || cj>>3==trumpf) wj+=5; if (wi<4 && zehnblank(ci) && stich<=7) wi+=wi?2:6; if (wj<4 && zehnblank(cj) && stich<=7) wj+=wj?2:6; if (!vmh) { if (trumpf==4) { if ((ci&7)!=BUBE && hatnfb[spieler][ci>>3]) wi-=30; if ((cj&7)!=BUBE && hatnfb[spieler][cj>>3]) wj-=30; } else { mi=spieler==left(ausspl)?2:1; wio=wi; wjo=wj; if (!hatnfb[spieler][ci>>3]) wi+=8; else if (hatnfb[spieler][ci>>3] && hatnfb[(ausspl+mi)%3][ci>>3]!=1 && ih[ci>>3]+gsp[ci>>3]>4 && !as[ci>>3] && gespcd[(ci&~7)|AS]!=2) { wi+=35; } else if (wi>4) wi+=8; if (!hatnfb[spieler][cj>>3]) wj+=8; else if (hatnfb[spieler][cj>>3] && hatnfb[(ausspl+mi)%3][cj>>3]!=1 && ih[cj>>3]+gsp[cj>>3]>4 && !as[cj>>3] && gespcd[(cj&~7)|AS]!=2) { wj+=35; } else if (wj>4) wj+=8; if (mi==2 && hatnfb[(ausspl+mi)%3][trumpf]!=1) { h=0; if (hatnfb[(ausspl+mi)%3][ci>>3]==1 && wio<=4) wi-=30,h++; if (hatnfb[(ausspl+mi)%3][cj>>3]==1 && wjo<=4) wj-=30,h++; if (h==2) swap(&wi,&wj); } } if (wi==wj && stich<=3 && ci>>3!=cj>>3) { if (ih[ci>>3]>3]) wi--; else if (ih[ci>>3]>ih[cj>>3]) wj--; else if (ih[ci>>3]==2) { if (as[ci>>3]) wi-=spieler==left(ausspl)?1:-1; if (as[cj>>3]) wj-=spieler==left(ausspl)?1:-1; } if (spieler==left(ausspl) || trumpf==4) swap(&wi,&wj); } } else { if (possc==2 && ((stcd[0]&7)==BUBE || stcd[0]>>3==trumpf) && (wio==2 || wjo==2) && (wio>=10 || wjo>=10)) { if (wio>=10) wi=1,wj=2; else wi=2,wj=1; if (((gespcd[BUBE]==2 && (gespcd[trumpf<<3|AS]==2 || wio==11 || wjo==11)) || ci==BUBE || cj==BUBE || gespcd[2<<3|BUBE]!=2 || gespcd[3<<3|BUBE]!=2) && !(gespcd[2<<3|BUBE]==2 && gespcd[3<<3|BUBE]!=2 && vmh==1)) { swap(&wi,&wj); } } else { if ((ci&7)==BUBE) wi+=5; else if (!hatnfb[spieler][ci>>3] && wi>=4) wi+=3; if ((cj&7)==BUBE) wj+=5; else if (!hatnfb[spieler][cj>>3] && wj>=4) wj+=3; if (vmh==1 && spieler!=ausspl) { if (wi>1 && wi<5 && !wj && !cardw[stcd[0]&7] && hatnfb[spieler][stcd[0]>>3]) { wi=1;wj=2; } else if (wj>1 && wj<5 && !wi && !cardw[stcd[0]&7] && hatnfb[spieler][stcd[0]>>3]) { wi=2;wj=1; } } } } } } if (wi(cj&7))) j=i; } playcd=j; } int buttern() { int fb,mi,se; se=left(ausspl); mi=spieler==ausspl?right(ausspl):ausspl; fb=stcd[0]>>3; if ((stcd[0]&7)==BUBE) fb=trumpf; if (stich==9 && spitzeang) return 1; if (!hatnfb[se][fb]) return 0; calc_high(2,0); if (spieler==ausspl) { if ((fb==trumpf && gespcd[trumpf<<3|AS]==2 && gespcd[0<<3|BUBE]==2 && gespcd[1<<3|BUBE]==2 && gespcd[2<<3|BUBE]==2 && gespcd[3<<3|BUBE]==2 && rnd(1)) || ((stcd[0]&7)==BUBE && gespcd[2<<3|BUBE]==2 && gespcd[3<<3|BUBE]!=2) || higher(stcd[0],high[fb]) || (hatnfb[mi][fb]==1 && hatnfb[mi][trumpf]==1) || (trumpf==4 && (stcd[0]&7)!=BUBE && (gespcd[0<<3|BUBE]==2 || gespcd[1<<3|BUBE]==2 || gespcd[2<<3|BUBE]==2 || gespcd[3<<3|BUBE]==2)) || (cardw[stcd[0]&7]>4 && rnd(1))) return 0; if (butternok) return rnd(1); butternok=rnd(1); return 1; } if (higher(stcd[0],high[trumpf]) && higher(stcd[0],high[fb])) return 1; if (higher(stcd[0],high[fb]) && !hatnfb[spieler][fb]) { return 1; } return 0; } int hatas() { int f,i,as; f=stcd[0]>>3; as=0; for (i=0;i4 || hatnfb[spieler][f]) return 0; playcd=as-1; return 1; } int schnippeln(f) int f; { int fb,i,j,k,as,hi; if (gstsum>=44 && gstsum<60) return 0; if (stich>8 && gstsum<=30) return 0; fb=stcd[0]>>3; if ((stcd[0]&7)==BUBE || (stcd[f]&7)==BUBE || fb==trumpf || stcd[f]>>3==trumpf || (f && fb!=stcd[1]>>3) || gespcd[fb<<3|ZEHN]==2 || gespfb[fb]>3) { return 0; } as=0; for (i=0;icards[possi[k]]) k=i; } hi=f?higher(stcd[0],stcd[1])^(spieler==ausspl):cards[possi[j]]>3==trumpf) { if (t!=-1) return 0; t=i; } } if (t==-1) return 0; playcd=t?0:1; return 1; } int restbeimir() { int c,h,i,j,k,s[2]; if (stich==10 || vmh || ausspl!=spieler || trumpf<0 || trumpf>4) return 0; s[0]=left(spieler); s[1]=right(spieler); if (!hatnfb[s[0]][trumpf] || !hatnfb[s[1]][trumpf]) { if (trumpf==4) return 0; h=-1; for (k=0;k<10;k++) { if ((c=cards[spieler*10+k])>=0) { if (c>>3!=trumpf && (c&7)!=BUBE) return 0; if (h<0 || !higher(c,cards[spieler*10+h])) h=k; } } for (j=0;j<2;j++) { for (k=handsp?-1:0;k<10;k++) { if ((c=k<0?prot2.skat[0][j]:cards[s[j]*10+k])>=0 && higher(c,cards[spieler*10+h])) return 0; } } return 1; } for (i=0;i<4;i++) { if (i==trumpf || (hatnfb[s[0]][i] && hatnfb[s[1]][i])) continue; h=SIEBEN+1; for (j=0;j<2;j++) { for (k=handsp?-1:0;k<10;k++) { if ((c=k<0?prot2.skat[0][j]:cards[s[j]*10+k])>=0 && c>>3==i && (c&7)!=BUBE && (c&7)=0 && c>>3==i && (c&7)!=BUBE && (c&7)>h) return 0; } } return 1; } VOID m_bvsp() { if (ueberdoerfer()) return; if (!trumpfausspielen()) schenke(); } VOID m_bmsp() { if (fabwerfen()) return; if (!uebernehmen(0,1,1)) schenke(); } VOID m_bhsp() { if (gewinnstich(1)) return; if (fabwerfen()) return; if (!uebernehmen(!higher(stcd[0],stcd[1]),1,0)) schenke(); } VOID m_bvns() { if (spitzefangen()) return; if (spieler==left(ausspl) && karobubespielen()) return; if (!hochausspielen()) abwerfen(); } VOID m_bmns() { if (spitzefangen()) return; if (karobubespielen()) return; if (spieler==ausspl) { if ((rnd(3) && schnippeln(0)) || (!ignorieren() && uebernehmen(0,1,0))) return; } else { if (einstechen() || hatas()) return; } if (buttern()) schmieren(); else abwerfen(); } VOID m_bhns() { if (gewinnstich(0)) return; if (spitzefangen()) return; if (rnd(1) && karobubespielen()) return; if (rnd(3) && schnippeln(1)) return; if (higher(stcd[0],stcd[1])^(spieler!=ausspl)) { if (!genugdrin() || !uebernehmen(spieler!=ausspl,1,0)) abwerfen(); } else { schmieren(); } } VOID m_bsp() { playcd=0; nichtspitze(); if (!vmh) m_bvsp(); else if (vmh==1) m_bmsp(); else m_bhsp(); } VOID m_bns() { playcd=0; if (!vmh) m_bvns(); else if (vmh==1) m_bmns(); else m_bhns(); } VOID make_best(s) int s; { if (possc==1) playcd=0; else if (trumpf>4) { m_bramsch(); } else if (trumpf>=0) { if (s==spieler) m_bsp(); else m_bns(); } else { if (s==spieler) m_nsp(); else m_nns(s); } } VOID adjfb(s,v) int s,v; { int i,c,n; int fb[5]; fb[0]=fb[1]=fb[2]=fb[3]=fb[4]=0; n=handsp && s!=spieler?12:10; for (i=0;i=0) { if (trumpf!=-1 && (c&7)==BUBE) fb[trumpf]=1; else fb[c>>3]=1; } } for (i=0;i<5;i++) { if (!fb[i]) { if (hatnfb[s][i]!=1) hatnfb[s][i]=v; } } } VOID do_spielen() { int s,i; static int sp,lvmh; if (phase!=SPIELEN) { sp=0; return; } if (trumpf==-1 && stich==1) init_null(); while (phase==SPIELEN) { s=(ausspl+vmh)%3; if (iscomp(s)) sp=0; else { if (sp==s+1 && lvmh==vmh) return; sp=s+1; } lvmh=vmh; if (s==spieler && trumpf!=5) { adjfb(left(spieler),2); adjfb(right(spieler),2); for (i=0;i<5;i++) { if (!hatnfb[left(spieler)][i] || !hatnfb[right(spieler)][i]) { if (hatnfb[left(spieler)][i]==2) hatnfb[left(spieler)][i]=0; if (hatnfb[right(spieler)][i]==2) hatnfb[right(spieler)][i]=0; } } } if (ouveang) { adjfb(spieler,1); } calc_poss(s); if (trumpf==-1 && stich==1 && sp) testnull(s); make_best(s); hintcard[0]=possi[playcd]; if (sp && hints[s]) { show_hint(s,0,1); } if (!ndichtw && restbeimir()) { di_dicht(); return; } if (sp) return; drop_card(possi[playcd],s); do_next(); } } VOID computer() { if (quit) return; if (phase==GEBEN) do_geben(); if (phase==REIZEN) do_reizen(); do_spielen(); } VOID play() { if (!resumebock || !playbock) { bockspiele=bockinc=ramschspiele=0; } else if (playbock!=2) { ramschspiele=0; } phase=GEBEN; do { computer(); computer(); hndl_events(); } while (!quit); } int main(argc,argv) int argc; char *argv[]; { setrnd(&seed[0],savseed=time((time_t *)0)); xinit(theargc=argc,theargv=argv); play(); exitus(0); return 0; } xskat-4.0/skat.h0100644000076400001440000001052310053572736012154 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #ifndef SKAT_H #define SKAT_H #undef EXTERN #ifdef SKAT_C #define EXTERN #else #define EXTERN extern #endif #define AS 0 #define ZEHN 1 #define KOENIG 2 #define DAME 3 #define BUBE 4 #define NEUN 5 #define ACHT 6 #define SIEBEN 7 #define BOCK_BEI_60 1 #define BOCK_BEI_GRANDHAND 2 #define BOCK_BEI_KONTRA 4 #define BOCK_BEI_RE 8 #define BOCK_BEI_NNN 16 #define BOCK_BEI_N00 32 #define BOCK_BEI_72 64 #define BOCK_BEI_96 128 #define BOCK_BEI_LAST 128 enum { GEBEN, REIZEN, HANDSPIEL, DRUECKEN, ANSAGEN, REVOLUTION, SPIELEN, SCHENKEN, NIMMSTICH, SPIELDICHT, WEITER, RESULT }; EXTERN int nullw[] #ifdef SKAT_C = { 23,35,46,59,92 } #endif ; EXTERN int rwert[] #ifdef SKAT_C = { 9,10,11,12,24 } #endif ; EXTERN int reizw[] #ifdef SKAT_C = { 18,20,22,23,24,27,30,33,35,36,40,44,45,46,48,50, 54,55,59,60,63,66,70,72,77,80,81,84,88,90,96,99, 100,108,110,117,120,121,126,130,132,135,140,143, 144,150,153,154,156,160,162,165,168,170,171,176, 180,187,189,190,192,198,200,204,207,209,210,216, 220,228,240,264,999 } #endif ; EXTERN int cardw[] #ifdef SKAT_C = { 11,10,4,3,2,0,0,0 } #endif ; EXTERN int sortw[] #ifdef SKAT_C = { 0,1,2,3 } #endif ; EXTERN int numsp,numgames; EXTERN int strateg[3],stgset[3]; EXTERN int hints[3],hintsset[3],hintcard[2]; EXTERN int blatt[3],blattset[3]; EXTERN int lang[3],langset[3]; EXTERN int maxrw[3],sort1[3],sort2[3],alternate[3],splfirst[3]; EXTERN int downupset[3],altseqset[3],tdelayset[3],alistset[3]; EXTERN int mbutton[3],mbuttonset[3]; EXTERN int keyboard[3],keyboardset[3]; EXTERN int abkuerz[3],abkuerzset[3]; EXTERN int briefmsg[3],briefmsgset[3]; EXTERN int trickl2r[3],trickl2rset[3]; EXTERN int useoptfile[3]; EXTERN int lastmsaho[3],protsort[3],hatnfb[3][5]; EXTERN int splsum[3][3],sum[3][3],prevsum[3][3],alist[3]; EXTERN int sgewoverl[3][2],cgewoverl[3][2]; EXTERN int nimmstich[3][2],playramsch,ramschset; EXTERN int playsramsch,sramschset,sramschstufe; EXTERN int rskatloser,rskatloserset,rskatsum; EXTERN int playkontra,kontraset,kontrastufe; EXTERN int playbock,bockset,bockevents,bockeventsset; EXTERN int bockspiele,ramschspiele,bockinc; EXTERN int resumebock,resumebockset; EXTERN int spitzezaehlt,spitzezaehltset; EXTERN int revolution,revolutionset; EXTERN int klopfen,klopfenset; EXTERN int schenken,schenkenset,schenkstufe; EXTERN int oldrules,oldrulesset; EXTERN int fastdeal,fastdealset; EXTERN int sagte18[3]; EXTERN int cards[32],gespcd[32]; EXTERN int quit,phase,geber,hoerer,sager,spieler; EXTERN int saho,reizp,gedr,vmh,stich,ausspl; EXTERN int possi[10],possc,stcd[3]; EXTERN int trumpf,handsp,stsum,astsum,gstsum,spcards[12],kannspitze; EXTERN int spgew,spwert,schwz,nullv,spitzeok,nspwert; EXTERN int schnang,schwang,ouveang,spitzeang,revolang; EXTERN struct { int s,r,d,e,g; } splist[360]; EXTERN int splstp,splres; EXTERN int gespfb[4],high[5],shigh[5]; EXTERN int inhand[4][8]; EXTERN int playcd,drkcd; EXTERN int mes1,mes2,mes3,mes4; EXTERN int butternok,sptruempfe; EXTERN int predef,logging,unformatted; EXTERN long seed[2],savseed,gamenr,rotateby; EXTERN char *list_file,*game_file,*prot_file,*opt_file,*cards_file; EXTERN int wieder,vorhandwn; EXTERN int karobubeanz; EXTERN int ndichtw; EXTERN int firstgame,dlhintseen; EXTERN int drbut,umdrueck; EXTERN int pkoption; EXTERN char lanip[3][40]; EXTERN int laninvite[2]; EXTERN char irc_hostname[40]; EXTERN int irc_hostset; EXTERN int theargc; EXTERN char **theargv; EXTERN struct { int stichgem,spieler,trumpf,gereizt,gewonn,augen,ehsso,predef,sramsch; int stiche[10][3],anspiel[10],gemacht[10],skat[4][2],verdopp[3]; long savseed,gamenr; int rotateby,spitze,revolution,schenken,handsp; } prot1,prot2; #endif /* SKAT_H */ xskat-4.0/text.c0100644000076400001440000003351210054113605012157 0ustar ggusers /* xskat - a card game for 1 to 3 players. Copyright (C) 2004 Gunter Gerhardt This program is free software; you can redistribute it freely. Use it at your own risk; there is NO WARRANTY. Redistribution of modified versions is permitted provided that the following conditions are met: 1. All copyright & permission notices are preserved. 2.a) Only changes required for packaging or porting are made. or 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix. */ #define TEXT_C #include #include #include #include #include "defs.h" #include "text.h" #define VERSION " X S K A T 4.0 " #define COPYRIGHT "Copyright 2004 © Gunter Gerhardt" #define URL "http://www.xskat.de" static char *ger_text[]={ "Null","Karo","Herz","Pik","Kreuz","Grand","Ramsch", "As","10","König","Dame","Bube","9","8","7", " A"," 10"," K"," D"," B"," 9"," 8"," 7", "Schellen","Rot","Grün","Eicheln", "As","10","König","Ober","Unter","9","8","7", " A"," 10"," K"," O"," U"," 9"," 8"," 7", "Hand gespielt","Schneider angesagt","Schwarz angesagt", "Ouvert gespielt","Ouvert Hand gespielt", "Passe","Ja","Nein","Spieler%d","Computer","links","rechts", "Drücken","spielt ","ouvert Hand","ouvert","Hand","Ouvert", "überlegt","Gereizt bis: %d","Löschen"," spielte ", "Gewonnen"," gewann ","Verloren"," verlor ","%d Augen", "Überreizt !","Gegner nicht Schneider !","Gegner nicht schwarz !", "Eine Jungfrau !","Durchmarsch !", "Niemand","gewinnt","verliert","den Ramsch", "das Nullspiel.","das Spiel schwarz !","mit %d zu %d Augen.", " Hand ? "," Spiel beenden ? "," Spielende ","beendet das Spiel","Aha", " Löschen ? "," Spiel ","Schneider","Schwarz","Spielen"," Hinweis ", "Nur bei Handspielen kann Schneider", "oder schwarz angesagt werden.", "Ouvert schließt schwarz angesagt", "ein (außer bei Null natürlich).", "Du hast höher gereizt als der", "Wert des angesagten Spiels !", "Null:23 Null ouvert:46", "Null Hand:35 Null ouvert Hand:59", "Revolution:92", " Angesagt ist "," Resultat ","Der Spielwert ist","Ende", "Spiele gewonnen/verloren", "Protokoll","Weiter"," Protokoll ", "Im Skat ist:", "Im Skat war:", "Ursprünglicher Skat", "Gereizt bis:", "Gewonnen mit:", "Verloren mit:", "Spielliste"," Spielliste ",VERSION, COPYRIGHT,URL, "Andere Kartenbilder zum Download", "sind unter obiger URL zu finden.", "Verwendung der Kartenbilder", "mit Genehmigung der", "Spielkartenfabrik Altenburg GmbH,", "Marke ASS Altenburger", "Sortieren","Aufwärts","Abwärts","Alternierend","Sequentiell", "Normal", "Gereizt bis:","Gespielt wird:","Letzter Stich:", "Du bist dran !","Vordefiniertes Spiel","Speichern", "Dieses Programm ist freie Software;", "es kann frei verbreitet werden.", "Benutzung auf eigenes Risiko;", "es gibt KEINE GARANTIE.", "Optionen"," Computer ","Spielstärke","--","-","0","+","++", "Name", "Vorschläge"," Varianten ", "Ramsch spielen","Immer", " Ramsch-Varianten ", "Skat geht an","letzten Stich","Verlierer", "Schieberamsch"," Skat aufnehmen ? ","Fertig", "Buben dürfen nicht geschoben werden.", "Unter dürfen nicht geschoben werden.", " Spielwert verdoppelt ","nimmt den Skat nicht auf.","klopft !", "VH schob:","MH schob:","HH schob:", "Kontra sagen","mit Kontra","ab 18","Kontra"," Kontra ! ","Re","von ", "Wiederholen"," Spiel wiederholen ","mit den Karten von","mir", "Vorhand wechselt:","Start","Zurück", " Geschwindigkeit ","Nimm Stich nach:","Sekunden","Maus-Klick", "Abkürzung","Fragen","Nie", "Bock-Runden","+Ramsch","Bock-Runden fortsetzen", " Bock-Ereignisse ","Bock-Ereignis","%d Bock-Ereignisse", "Bock-Spiele:"," Grand Hand ? "," Bock-Spiel ", "Verloren mit 60 Augen","Grand Hand gewonnen", "Erfolgreicher Kontra","Kontra & Re angesagt", "NNN Punkte in Spielliste","N00 Punkte in Spielliste", "Spielwert ist >= +72","Spielwert ist >= +96", " Benutzeroberfläche ","Tastatur", "Menü-Taste","Jede", "Wenig Hinweise", "Stich-Karten von links nach rechts", "Spitze","zählt 2","Spitze verloren !","Spitze !", "Spitze nicht erlaubt !", "Niedrigster Trumpf nicht auf der Hand.", "Grand mit 4.", " Null ist dicht ! "," Rest bei mir ! ","Karten aufdecken ?", "Revolution","Revolution: Karten austauschen !", "Vorhand","Mittelhand","Hinterhand", "Klopfen"," Klopfen ","Spielwert verdoppeln ?", "Schenken"," Schenken ","Spiel verloren geben ?","Geschenk annehmen ?", "Mitspieler lehnt ab.","Gegner geben auf.","Annehmen", "Geben","Schnell","Langsam", " Grafik & Text ", "Blatt","Französisch","Französisch (4 Farben)", "Deutsch","Deutsch (4 Farben)", "Sprache","Deutsch","English", "Alte Regeln", "Ein Maus-Klick oder ESC / F1","bringt dieses Menü zur Anzeige", " Mehrspieler-Modus ", " Lokales Spiel über LAN ", "Eigenen Spieltisch eröffnen", "An anderem Tisch Platz nehmen", "Spieler2 einladen:", "Spieler3 einladen:", "Rechnername oder IP-Adresse", "Spieltisch eröffnen", "Spieltisch:", "Zugriff auf X-Server wird erlaubt!", "Ggf. nach dem Spiel zurücknehmen.", "Siehe: man xhost", "Am Tisch Platz nehmen", "(Schließt dieses Fenster)", " Internet-Spiel über IRC ", "IRC-Verbindung herstellen mit:", "Erweiterte IRC-Konfiguration siehe:", "man xskat", "Verschiedene Versionen", "(Probleme? README.IRC-de oder 'man xskat' ANMERKUNGEN lesen!)", "Nicht auf diesem Kanal !", "Nur ein Spieler sollte /go sagen ! Nochmal.", "Sollte das /go%s sein ?", "Verbunden mit Spieler%d.", "Warten auf Spieler%d.", "\n Zum Spielen mit /join #xskatXYZ auf einen freien Kanal wechseln.", " Wenn alle Mitspieler auf diesem Kanal sind, muß einer /go eingeben,", " bzw. /go2, wenn nur 2 Spieler teilnehmen.", " Zeilen, die nicht mit / beginnen, werden als Nachricht verschickt.\n", " ### XSkat-Zeiten: jeden Fr 13:30 und So 18:00 MEZ/MESZ ###\n", "Offizielle Regeln", "Position","Alternativ","Turnier","Geber", "Unbekanntes Kommando (versuche /help)", "/join kanal - wechsle auf einen anderen Kanal", "/go, /go2 - starte Spiel mit 3 bzw. 2 Spielern", "/quit - beende XSkat", "/nick name, /nick - ändere Namen oder zeige ihn an", "/who - wer ist auf dem aktuellen Kanal ?", "/list, /list text - zeige Kanäle (die xskat/text enthalten)", "/pos n - setze Position auf 1, 2 oder 3", "/bell - schalte Alarmton ein/aus", "/sync - synchronisiere sofort", "/quote command args - für Spezialisten", "/default - aktiviere offizielle Regeln", "/ramsch n, /sramsch b, /skattoloser b, /kontra n, /bock n, /resumebock n,", " /spitze n, /revolution b, /klopfen b, /schenken b, /oldrules b,", " /bockevents n, /alist b, /tlist b, /start n, /s1 n", " - ändere Regeln (n ist eine Zahl, b ist true/false)", "/rules - zeige allen Mitspielern aktuelle Regeln an" }; static char *eng_text[]={ "Null","Diamond","Heart","Spade","Club","Grand","Ramsch", "Ace","10","King","Queen","Jack","9","8","7", " A"," 10"," K"," Q"," J"," 9"," 8"," 7", "Bells","Hearts","Leaves","Acorns", "Ace","10","King","Ober","Unter","9","8","7", " A"," 10"," K"," O"," U"," 9"," 8"," 7", "Played Hand","Schneider announced","Schwarz announced", "Played ouvert","Played ouvert Hand", "Pass","Yes","No","Player%d","Computer","left","right", "Done","plays ","ouvert Hand","ouvert","Hand","Ouvert", "thinks","You have bid: %d","Clear"," played ", "Won"," won ","Lost"," lost ","%d points", "Overbid !","Opponents not Schneider !","Opponents not schwarz !", "One virgin !","Forced march !", "Nobody","wins","loses","the Ramsch", "the Null game.","the game schwarz !","with %d vs %d points.", " Hand ? "," Quit game ? "," Game over ","quits the game","OK", " Clear ? "," Game ","Schneider","Schwarz","Play"," Reminder ", "Only when playing Hand you may", "say Schneider or schwarz.", "Ouvert includes schwarz", "(except when playing Null).", "The value of your game", "is not high enough !", "Null:23 Null ouvert:46", "Null Hand:35 Null ouvert Hand:59", "Revolution:92", " Playing "," Result ","The value of the game is","Quit", "Games won/lost", "Log","Continue"," Log ", "Skat is:", "Skat was:", "Original Skat", "Last bid:", "Won with:", "Lost with:", "Game list"," Game list ",VERSION, COPYRIGHT,URL, "Download other card images", "from the URL given above.", "Card images used", "with permission by", "Spielkartenfabrik Altenburg GmbH,", "Marke ASS Altenburger", "Sort","Up","Down","Alternating","Sequential", "Normal", "Bidding:","Playing:","Last trick:", "It's your turn !"," predefined game ","Save", "This program is free software;", "you can redistribute it freely.", "Use xskat at your own risk;", "there is NO WARRANTY.", "Options"," Computer ","Playing strength","--","-","0","+","++", "Name", "Hints"," Variations ", "Play Ramsch","Always", " Ramsch variations ", "Skat goes to","last trick","loser", "Schieberamsch"," Pick up Skat ? ","Done", "It's not allowed to pass on jacks.", "It's not allowed to pass on unters.", " Game score doubled ","doesn't pick up the Skat.","knocks !", "FH passed:","MH passed:","RH passed:", "Say Kontra","with Kontra","if 18","Kontra"," Kontra ! ","Re","by ", "Replay"," Replay game ","with the cards from","me", "Forehand changes:","Start","Back", " Speed ","Take trick after:","seconds","mouse click", "Shortcut","Ask","Never", "Bockrounds","+Ramsch","Resume Bockrounds", " Bock events ","Bock event","%d Bock events", "Bock games:"," Grand Hand ? "," Bock game ", "Lost with 60 points","Successful Grand Hand", "Successful Kontra","Kontra & Re game", "NNN points in game list","N00 points in game list", "Game value is >= +72","Game value is >= +96", " User interface ","Keyboard", "Menu button","Any", "Few messages", "Trick cards from left to right", "Spitze","counts 2","Lost Spitze !","Spitze !", "Spitze not allowed !", "Lowest trump not in your hand.", "Grand with 4.", " Null is safe ! "," Rest is mine ! ","Show cards ?", "Revolution","Revolution: exchange cards !", "Forehand","Middlehand","Rearhand", "Klopfen"," Klopfen ","Double game value ?", "Schenken"," Schenken ","Give up the game ?","Accept the gift ?", "Partner disagrees.","Opponents give up.","Accept", "Deal","Fast","Slow", " Graphic & Text ", "Cards","French","French (4 colors)", "German","German (4 colors)", "Language","Deutsch","English", "Old rules", "A mouse click or ESC / F1","will bring up this menu", " Multiplayer mode ", " Local game via LAN ", "Open own game table", "Join other table", "Invite Player2:", "Invite Player3:", "Computer name or IP address", "Open game table", "Game table:", "Access to X server will be granted!", "Remove after the game, if need be.", "See: man xhost", "Join game table", "(Will close this window)", " Internet game via IRC ", "Establish IRC connection with:", "Extended IRC configuration see:", "man xskat", "Version mismatch", "(Problems? See README.IRC or 'man xskat' NOTES!)", "Not on this channel !", "Only one player should say /go ! Try again.", "Did you mean /go%s ?", "Connected to Player%d.", "Waiting for Player%d.", "\n Start playing by typing /join #xskatXYZ to switch to a free channel.", " When all players are on this channel, one player has to enter /go,", " or /go2, if there are only 2 players.", " Lines that don't begin with / are sent as messages.\n", " ### XSkat times: every Fri 13:30 and Sun 18:00 MET/MEST ###\n", "Official rules", "Position","Alternative","Tournament","Dealer", "Unknown command (try /help)", "/join channel - switch to another channel", "/go, /go2 - start a game with 3 or 2 players", "/quit - terminate XSkat", "/nick name, /nick - change or display your nickname", "/who - is on the current channel ?", "/list, /list string - show channels (matching xskat/string)", "/pos n - set position to 1, 2 or 3", "/bell - toggle the alarm bell", "/sync - synchronize now", "/quote command args - for specialists", "/default - set the official rules", "/ramsch n, /sramsch b, /skattoloser b, /kontra n, /bock n, /resumebock n,", " /spitze n, /revolution b, /klopfen b, /schenken b, /oldrules b,", " /bockevents n, /alist b, /tlist b, /start n, /s1 n", " - change the rules of the game (n is a number, b is true/false)", "/rules - show the current rules to everyone on your channel" }; static struct { char **arr; char *name[NUM_LANG]; char *langpref[5]; } textdesc[NUM_LANG] = { {ger_text,{"deutsch","german"},{"de","german",0}}, {eng_text,{"englisch","english"},{"en",0}} }; VOID init_text() { int i,j; for (i=0;i #include #include #include #include #include #include #include #include "defs.h" #include "skat.h" #include "ramsch.h" #include "xio.h" #include "irc.h" #include "text.h" #include "xdial.h" #ifndef XK_KP_Tab #define XK_KP_Tab 0xFF89 #endif #ifndef XK_KP_Enter #define XK_KP_Enter 0xFF8D #endif #ifndef XK_KP_Left #define XK_KP_Left 0xFF96 #endif #ifndef XK_KP_Up #define XK_KP_Up 0xFF97 #endif #ifndef XK_KP_Right #define XK_KP_Right 0xFF98 #endif #ifndef XK_KP_Down #define XK_KP_Down 0xFF99 #endif #ifndef XK_3270_BackTab #define XK_3270_BackTab 0xFD05 #endif #ifndef XK_ISO_Left_Tab #define XK_ISO_Left_Tab 0xFE20 #endif #ifndef hpXK_BackTab #define hpXK_BackTab 0x1000FF74 #endif #ifndef hpXK_KP_BackTab #define hpXK_KP_BackTab 0x1000FF75 #endif #ifndef osfXK_BackTab #define osfXK_BackTab 0x1004FF07 #endif #ifndef osfXK_Left #define osfXK_Left 0x1004FF51 #endif #ifndef osfXK_Up #define osfXK_Up 0x1004FF52 #endif #ifndef osfXK_Right #define osfXK_Right 0x1004FF53 #endif #ifndef osfXK_Down #define osfXK_Down 0x1004FF54 #endif #define INIT_DI(d)\ {\ memcpy((VOID *)d[1],(VOID *)d[0],sizeof(d[0]));\ memcpy((VOID *)d[2],(VOID *)d[0],sizeof(d[0]));\ init_di(d[0]);\ init_di(d[1]);\ init_di(d[2]);\ } VOID info_reiz() { int ln,sn; static char txt[NUM_LANG][40]; static tx_typ tt; for (ln=0;ln=2 && tr>=0 && tr<=3? TX_SCHELLEN+tr:TX_NULL+tr+1; } VOID info_spiel() { int bl,ln,sn; static char txt[2][3][NUM_LANG][40]; for (sn=0;sn=0 && trumpf<=3? TX_SCHELLEN+trumpf:TX_NULL+trumpf+1].t[ln]); } } } } VOID info_stich(p,c) int p,c; { int bl,ln,sn; static char txt[2][3][3][NUM_LANG][20]; for (sn=0;sn>3)].t[ln]); strcat(txt[bl][sn][p][ln]," "); strcat(txt[bl][sn][p][ln], textarr[(bl?TX_ASD:TX_AS)+(c&7)].t[ln]); } } } } VOID clear_info() { int sn; for (sn=0;sn=101) sprintf(digeschwindigkeit[sn][3].str->t[ln],"%s", textarr[TX_MAUS_KLICK].t[ln]); else { sprintf(digeschwindigkeit[sn][3].str->t[ln],"%s%d.%d %s", nnullw[dispiel[13].spec&OB_SELECTED?4: (dispiel[10].spec&OB_SELECTED?2:0)+handsp]) { diueberr[6].spec=revolution?OB_CENTERED:OB_HIDDEN; create_di(sn,diueberr); ag=1; } spitzeang=0; if (!ag && trumpf!=-1 && dispiel[11].spec&OB_SELECTED) { bb=0; for (i=0;i<(handsp?10:12);i++) { c=i>=10?prot2.skat[1][i-10]:cards[spieler*10+i]; if (i<10 && c==(trumpf==4?BUBE:SIEBEN|trumpf<<3)) { spitzeang=1; } if ((c&7)==BUBE) bb++; } if (!spitzeang || (bb==4 && trumpf==4)) { dispitze[3].str=&textarr[spitzeang?TX_SPITZE_F3:TX_SPITZE_F2]; create_di(sn,dispitze); ag=1; } } if (!ag) { if (dispiel[13].spec&OB_SELECTED) revolang=ouveang=1; else if (dispiel[10].spec&OB_SELECTED) ouveang=schwang=schnang=1; else if (dispiel[9].spec&OB_SELECTED) schwang=schnang=1; else if (dispiel[8].spec&OB_SELECTED) schnang=1; if (trumpf==-1) schwang=schnang=0; di_ansage(); } } else if (ob==difehler) { remove_di(sn); di_spiel(); } else if (ob==diueberr) { remove_di(sn); di_spiel(); } else if (ob==dispitze) { remove_di(sn); di_spiel(); } else if (ob==diansage) { remove_di(sn); do_angesagt(); } else if (ob==dikontra[sn]) { remove_di(sn); di_ktrnext(sn,bt==3); } else if (ob==direkontra) { remove_di(sn); di_ktrnext(sn,bt==3); } else if (ob==dikonre[sn]) { remove_di(sn); if (ktrnext>=0) { di_konre(ktrnext); ktrnext=-1; } else { do_angesagt(); } } else if (ob==diinput[sn]) { if (bt==3) { inputbuf[sn][0]='_'; inputbuf[sn][1]=0; diinput[sn][3].spec&=~OB_SELECTED; if (actbtn[sn]!=4) { actbtn[sn]=4; draw_di(sn,4); } draw_di(sn,3); draw_di(sn,2); } else { inputbuf[sn][strlen(inputbuf[sn])-1]=0; switch (inputdi[sn]) { case 0: cleanip(sn); save_opt(); di_eigenertisch(sn); break; case 1: cleanip(sn); save_opt(); di_anderertisch(sn); break; case 2: cleanirchost(sn); save_opt(); di_irc(sn); break; case 3: cleanname(sn); set_conames(); save_opt(); di_strateg(sn); break; case 4: cleanname(sn); set_conames(); save_opt(); di_grafik(sn); break; } } } else if (ob==didicht) { remove_di(sn); if (didicht[3].spec&OB_SELECTED || didicht[5].spec&OB_SELECTED) { spielendscr(); if (didicht[5].spec&OB_SELECTED) { abkuerz[sn]=2; save_opt(); } } else if (didicht[4].spec&OB_SELECTED || didicht[6].spec&OB_SELECTED) { ndichtw=1; phase=SPIELEN; if (didicht[6].spec&OB_SELECTED) { abkuerz[sn]=0; save_opt(); } } } else if (ob==diweiter[sn]) { remove_di(sn); di_weiter(0); } else if (ob==diwiederweiter) { remove_di(sn); clr_desk(0); skatopen=0; if (bt==1) di_wieder(sn,0); else phase=GEBEN; } else if (ob==dischieben) { remove_di(sn); if (bt==2) { draw_skat(spieler); put_fbox(spieler,TX_FERTIG); drbut=spieler+1; } else { di_verdoppelt(0,0); } } else if (ob==diklopfen) { remove_di(sn); if (bt==3) { vmh=left(vmh); if (vmh) di_schieben(); else start_ramsch(); } else { di_verdoppelt(0,1); } } else if (ob==dischenken) { remove_di(sn); if (bt==3) { di_nichtschenken(sn); } else { di_geschenkt(); } } else if (ob==digeschenkt || ob==diendeschenken) { remove_di(sn); if (bt==4) { schenkstufe++; if (schnang && schenkstufe==2) schenkstufe++; if (schenkstufe<3) schnang=1; else schwang=1; diwiederschenken[2].str= &textarr[schwang?TX_SCHW_ANGE:TX_SCHN_ANGE]; di_wiederschenken(schenknext,1); } else { finishgame(); } } else if (ob==diwiederschenken) { remove_di(sn); if (bt==4) { di_nichtschenken(sn); } else { if (schenknext!=-1) { di_wiederschenken(schenknext,0); } else { schenknext=sn; sn=left(sn)==spieler?left(spieler):left(sn); if (!iscomp(sn)) schenknext=sn; di_geschenkt(); } } } else if (ob==dinichtschenken) { remove_di(sn); if (schenkstufe==1) schenkstufe=0; phase=SPIELEN; } else if (ob==diverdoppelt) { remove_di(sn); di_verdoppelt(1,0); } else if (ob==dibuben) { remove_di(sn); } else if (ob==diresult) { remove_di(sn); clr_desk(0); if (bt==20) di_ende(sn); else if (bt==22) di_proto(sn,1,0); else if (bt==21) di_wieder(sn,1); else phase=GEBEN; } else if (ob==diwieder) { remove_di(sn); vorhandwn=diwieder[10].spec&OB_SELECTED?1:0; if (bt==11) { di_resultdi(sn); } else { if (diwieder[5].spec&OB_SELECTED) { wieder=1; } else if (diwieder[6].spec&OB_SELECTED) { wieder=2; } else { wieder=3; } phase=GEBEN; } } else if (ob==diproto[sn]) { remove_di(sn); if (bt==49) { protsort[sn]^=1; di_proto(sn,0,0); actbtn[sn]=49; } else if (bt==47) { if ((sn && !irc_play) || !protsort[sn]) di_liste(sn,1); else { di_proto(sn,1,1); if (phase==RESULT) di_resultdi(sn); } } else if (phase==RESULT) di_resultdi(sn); } else if (ob==diliste[sn]) { remove_di(sn); if (bt==62) { splfirst[sn]-=12; di_liste(sn,0); actbtn[sn]=splfirst[sn]?62:65; } else if (bt==63) { alist[sn]=(alist[sn]+1)%3; if (!sn) save_opt(); di_liste(sn,splfirst[sn]+12>=splstp); actbtn[sn]=63; } else if (bt==65) { if (splfirst[sn]+12>=splstp) { di_loesch(sn); } else { if (splfirst[sn]+12=19 && bt<=22) { di_input(sn,TX_NAME,3,conames[1-(bt&1)][(bt-19)/2],9); } else { set_conames(); if (sav && !irc_play) save_opt(); di_varianten(sn); } } else if (ob==divarianten[sn]) { remove_di(sn); sav=(((((((playramsch )*3+playkontra )*3+playbock )*3+spitzezaehlt )*2+revolution )*2+klopfen )*2+schenken )*2+oldrules; for (i=0;i<3;i++) { if (divarianten[sn][3+i].spec&OB_SELECTED) { playramsch=i; } if (divarianten[sn][7+i].spec&OB_SELECTED) { playkontra=i; } if (divarianten[sn][11+i].spec&OB_SELECTED) { playbock=i; } if (divarianten[sn][15+i].spec&OB_SELECTED) { spitzezaehlt=i; } } revolution=!(divarianten[sn][19].spec&OB_SELECTED); klopfen=!(divarianten[sn][22].spec&OB_SELECTED); schenken=!(divarianten[sn][25].spec&OB_SELECTED); oldrules=!(divarianten[sn][28].spec&OB_SELECTED); if (sav!=(((((((playramsch )*3+playkontra )*3+playbock )*3+spitzezaehlt )*2+revolution )*2+klopfen )*2+schenken )*2+oldrules) { save_opt(); } if (playramsch) di_ramschopts(sn); else if (playbock) di_bockevents(sn); else di_geschwindigkeit(sn); } else if (ob==diramschopts[sn]) { remove_di(sn); sav=playsramsch*2+rskatloser; playsramsch=!(diramschopts[sn][3].spec&OB_SELECTED); rskatloser=!(diramschopts[sn][6].spec&OB_SELECTED); if (sav!=playsramsch*2+rskatloser) save_opt(); if (playbock) di_bockevents(sn); else di_geschwindigkeit(sn); } else if (ob==dibockevents[sn]) { remove_di(sn); sav=bockevents*2+resumebock; bockevents=0; for (i=1,j=0;i<=BOCK_BEI_LAST;i*=2,j++) { if (dibockevents[sn][2+j].spec&OB_SELECTED) { bockevents+=i; } } resumebock=!(dibockevents[sn][11].spec&OB_SELECTED); if (sav!=bockevents*2+resumebock) save_opt(); di_geschwindigkeit(sn); } else if (ob==digeschwindigkeit[sn]) { sav=(nimmstich[sn][0]*3+abkuerz[sn])*2+fastdeal; digeschwindigkeit[sn][bt].spec&=~OB_SELECTED; switch (bt) { case 4: nimmstich[sn][0]=0; break; case 5: if (nimmstich[sn][0]==101) nimmstich[sn][0]--; else nimmstich[sn][0]-=10; break; case 6: nimmstich[sn][0]--; break; case 7: nimmstich[sn][0]++; if (irc_play && nimmstich[sn][0]>=101) nimmstich[sn][0]=100; break; case 8: nimmstich[sn][0]+=10; if (irc_play && nimmstich[sn][0]>=101) nimmstich[sn][0]=100; break; case 9: if (irc_play) nimmstich[sn][0]=100; else nimmstich[sn][0]=101; break; } if (nimmstich[sn][0]<0) nimmstich[sn][0]=0; else if (nimmstich[sn][0]>101) nimmstich[sn][0]=101; fastdeal=digeschwindigkeit[sn][11].spec&OB_SELECTED?1:0; abkuerz[sn]=(digeschwindigkeit[sn][14].spec&OB_SELECTED?0: digeschwindigkeit[sn][15].spec&OB_SELECTED?1:2); if (sav!=(nimmstich[sn][0]*3+abkuerz[sn])*2+fastdeal && !irc_play) save_opt(); prverz(sn); if (bt==17) { remove_di(sn); if (!irc_play && numsp==1) di_mehrspieler(sn); else di_eingabe(sn); } else { draw_di(sn,3); draw_di(sn,bt); } } else if (ob==dimehrspieler) { if (bt==2) di_lanspiel(sn); else if (bt==3) di_irc(sn); else if (bt==4) { manpage("xskat"); dimehrspieler[bt].spec&=~OB_SELECTED; draw_di(sn,bt); } else di_eingabe(sn); } else if (ob==dilanspiel) { if (bt==2) di_eigenertisch(sn); else if (bt==3) di_anderertisch(sn); else di_mehrspieler(sn); } else if (ob==dieigenertisch) { sav=laninvite[0]*2+laninvite[1]; laninvite[0]=!(dieigenertisch[4].spec&OB_SELECTED); laninvite[1]=!(dieigenertisch[9].spec&OB_SELECTED); if (sav!=laninvite[0]*2+laninvite[1]) save_opt(); if (bt==13) di_lanspiel(sn); else if (!laninvite[0] && !laninvite[1]) { di_eigenertisch(sn); } else if (bt==6) { di_input(sn,TX_RECHNER_IP,0,lanip[1],35); } else if (bt==11) { di_input(sn,TX_RECHNER_IP,0,lanip[2],35); } else di_warteauf(sn,0,0,0); } else if (ob==dianderertisch) { if (bt==4) { di_input(sn,TX_RECHNER_IP,1,lanip[0],35); } else if (bt==7) { manpage("xhost"); dianderertisch[bt].spec&=~OB_SELECTED; draw_di(sn,bt); } else if (bt==9) { xstoreres(); exitus(0); } else di_lanspiel(sn); } else if (ob==diwarteauf) { di_eigenertisch(sn); } else if (ob==diirc) { if (bt==7) di_mehrspieler(sn); else if (bt==3) { di_input(sn,TX_RECHNER_IP,2,irc_hostname,35); } else if (bt==6) { manpage("xskat"); diirc[bt].spec&=~OB_SELECTED; draw_di(sn,bt); } else { if (!fork()) startirc(1); exitus(0); } } else if (ob==digui[sn]) { remove_di(sn); sav=(((mbutton[sn] )*3+keyboard[sn] )*2+briefmsg[sn] )*2+trickl2r[sn]; for (i=0;i<=5;i++) { if (digui[sn][3+i].spec&OB_SELECTED) { mbutton[sn]=i; } } for (i=0;i<3;i++) { if (digui[sn][10+i].spec&OB_SELECTED) { keyboard[sn]=i; } } briefmsg[sn]=!(digui[sn][14].spec&OB_SELECTED); trickl2r[sn]=!(digui[sn][17].spec&OB_SELECTED); if (sav!=(((mbutton[sn] )*3+keyboard[sn] )*2+briefmsg[sn] )*2+trickl2r[sn] && !irc_play) save_opt(); } } } VOID button_press(sn,bt,ob) int sn,bt; OBJECT *ob; { if (irc_play && ob!=diende[sn] && ob!=diterm[sn] && ob!=diproto[sn] && ob!=diliste[sn] && ob!=diloesch && ob!=dioptions[sn] && ob!=dicopyr[sn] && ob!=dicopyralt[sn] && ob!=digrafik[sn] && ob!=distrateg[sn] && ob!=divarianten[sn] && ob!=diramschopts[sn] && ob!=dibockevents[sn] && ob!=digeschwindigkeit[sn] && ob!=digui[sn]) irc_sendbtev(sn,bt); hndl_btevent(sn,bt); } VOID draw_wedge(w,bp,sn,f,x,y,s) Drawable w; unsigned long bp; int sn,f,x,y,s; { int i,a,b,c; a=s&1?-1:1; b=s&2?-1:1; c=s&4?desk[sn].large?20:13:1; change_gc(sn,f?mkpix[sn]:bp,gc); for (i=0;i<=6;i++) { XDrawPoint(dpy[sn],w,gc[sn],x,y+b*(2*i)); XDrawPoint(dpy[sn],w,gc[sn],x+a*1,y+b*(2*i+1)); } for (i=0;i<=c;i++) { XDrawPoint(dpy[sn],w,gc[sn],x+a*(2*i+2),y); XDrawPoint(dpy[sn],w,gc[sn],x+a*(2*i+1),y+b*1); } change_gc(sn,f?wpix[sn]:bp,gc); for (i=0;i<=6;i++) { XDrawPoint(dpy[sn],w,gc[sn],x,y+b*(2*i+1)); XDrawPoint(dpy[sn],w,gc[sn],x+a*1,y+b*(2*i)); } for (i=0;i<=c;i++) { XDrawPoint(dpy[sn],w,gc[sn],x+a*(2*i+1),y); XDrawPoint(dpy[sn],w,gc[sn],x+a*(2*i+2),y+b*1); } change_gc(sn,fgpix[sn],gc); } VOID draw_actbtn(sn,f) int sn,f; { OBJECT *ob; unsigned long bp; int bt,d,e,w,h; if (f && !keyboard[sn]) actbtn[sn]=0; ob=actdial[sn]; bt=actbtn[sn]; if (bt && ob) { bp=gfx3d[sn] || !(ob[bt].spec&OB_SELECTED)?btpix[sn]:fgpix[sn]; d=gfx3d[sn]?ob[bt].spec&OB_EXIT?2:1:0; e=gfx3d[sn]?ob[bt].spec&OB_EXIT?1:2:2; w=ob[bt].w*charw[sn]; h=ob[bt].h*charh[sn]; draw_wedge(ob[bt].win,bp,sn,f,d,d,0); draw_wedge(ob[bt].win,bp,sn,f,w-e,d,1); draw_wedge(ob[bt].win,bp,sn,f,d,h-e,2); draw_wedge(ob[bt].win,bp,sn,f,w-e,h-e,3); } } VOID draw_selpos(sn,f) int sn,f; { unsigned long bp; int p,s; if (selpos[sn].num) { p=selpos[sn].act; if (selpos[sn].p[p].f&1) { bp=btpix[sn]; s=0; } else if (selpos[sn].p[p].f&2) { bp=bgpix[sn]; s=4; } else { return; } draw_wedge(win[sn],bp,sn,f,selpos[sn].p[p].x1,selpos[sn].p[p].y1,s); draw_wedge(win[sn],bp,sn,f,selpos[sn].p[p].x2,selpos[sn].p[p].y1,s+1); draw_wedge(win[sn],bp,sn,f,selpos[sn].p[p].x1,selpos[sn].p[p].y2,s+2); draw_wedge(win[sn],bp,sn,f,selpos[sn].p[p].x2,selpos[sn].p[p].y2,s+3); draw_wedge(bck[sn],bp,sn,f,selpos[sn].p[p].x1,selpos[sn].p[p].y1,s); draw_wedge(bck[sn],bp,sn,f,selpos[sn].p[p].x2,selpos[sn].p[p].y1,s+1); draw_wedge(bck[sn],bp,sn,f,selpos[sn].p[p].x1,selpos[sn].p[p].y2,s+2); draw_wedge(bck[sn],bp,sn,f,selpos[sn].p[p].x2,selpos[sn].p[p].y2,s+3); } } VOID new_selpos(sn,dir) int sn,dir; { draw_selpos(sn,0); selpos[sn].act=(selpos[sn].act+dir+selpos[sn].num)%selpos[sn].num; draw_selpos(sn,1); } VOID new_actbtn(sn,dir) int sn,dir; { OBJECT *ob; int bt; if (selpos[sn].num) { new_selpos(sn,dir); return; } draw_actbtn(sn,0); ob=actdial[sn]; bt=actbtn[sn]; if (bt && ob) { if (!dir) { if (ob[bt].next!=OB_NONE) { actbtn[sn]+=ob[bt].next; } if (ob==dispiel) { actbtn[sn]=12; } } else { for (;;) { bt+=dir; if (bt==ob[0].spec) bt=1; else if (!bt) bt=ob[0].spec-1; if (ob[bt].spec&(OB_BUTTON|OB_EXIT) && !ob_disabled(ob,bt) && !(ob[bt].spec&OB_HIDDEN) && (!(ob[bt].spec&OB_SELECTED) || ob[bt].next==OB_NONE)) { actbtn[sn]=bt; break; } } } } draw_actbtn(sn,1); } VOID set_selpos(sn) int sn; { int i,j,k,n; static int tc[3],ph[3]; static long gn[3]; if (selpos[sn].num || actdial[sn] || !keyboard[sn]) return; if (selpos[sn].act==-1 || !(selpos[sn].p[selpos[sn].act].f&4) || gn[sn]!=gamenr || ph[sn]!=phase) { selpos[sn].act=0; n=1; } else n=0; if (phase==REIZEN) { if ((saho && sn==sager) || (!saho && sn==hoerer)) { selpos[sn].num=2; for (i=0;i<2;i++) { selpos[sn].p[i].x1=desk[sn].pboxx+i*desk[sn].cardw+4; selpos[sn].p[i].y1=desk[sn].pboxy+1; selpos[sn].p[i].x2=desk[sn].pboxx+(i+1)*desk[sn].cardw-5; selpos[sn].p[i].y2=desk[sn].pboxy+charh[sn]-gfx3d[sn]-1; selpos[sn].p[i].f=1; } } } else if (phase==DRUECKEN) { if (sn==spieler) { if (n) { selpos[sn].act=6; } if (hints[sn] && hintcard[0]!=-1) { selpos[sn].act=0; if (hintcard[0]<30) selpos[sn].act=hintcard[0]-10*sn+1; if (hintcard[1]<30) selpos[sn].act=hintcard[1]-10*sn+1; } selpos[sn].num=11; i=0; selpos[sn].p[i].x1=desk[sn].pboxx+24*desk[sn].f/desk[sn].q+4; selpos[sn].p[i].y1=desk[sn].pboxy+1; selpos[sn].p[i].x2=desk[sn].pboxx+104*desk[sn].f/desk[sn].q-5; selpos[sn].p[i].y2=desk[sn].pboxy+charh[sn]-gfx3d[sn]-1; selpos[sn].p[i].f=1; for (i=1;i<11;i++) { selpos[sn].p[i].x1=desk[sn].playx+(i-1)*desk[sn].cardx; selpos[sn].p[i].y1=desk[sn].playy-2; selpos[sn].p[i].x2=desk[sn].playx+i*desk[sn].cardx-1-desk[sn].large*2; selpos[sn].p[i].y2=desk[sn].playy+desk[sn].cardh+1-desk[sn].large; selpos[sn].p[i].f=2|4; } } } else if (phase==SPIELEN) { if (sn==(ausspl+vmh)%3) { computer(); if (actdial[sn] || keyboard[sn]!=2) return; calc_poss(sn); selpos[sn].num=possc; i=0; for (k=0;k<10;k++) { for (j=0;j=tc[sn]+1) { selpos[sn].act++; } if (j!=-1) { if (selpos[sn].act>j+1) { selpos[sn].act--; } else if (selpos[sn].act==j+1) { selpos[sn].act=j%10*2+10-j+(j/10); } } } selpos[sn].num=20+(j==-1); i=0; selpos[sn].p[i].x1=desk[sn].pboxx+24*desk[sn].f/desk[sn].q+4; selpos[sn].p[i].y1=desk[sn].pboxy+1; selpos[sn].p[i].x2=desk[sn].pboxx+104*desk[sn].f/desk[sn].q-5; selpos[sn].p[i].y2=desk[sn].pboxy+charh[sn]-gfx3d[sn]-1; selpos[sn].p[i].f=1; i++; for (k=0;k<20;k++) { if (k==j) continue; selpos[sn].p[i].x1=desk[sn].playx+k%10*desk[sn].cardx; selpos[sn].p[i].y1=(k>9?desk[sn].skaty:desk[sn].playy)-2; selpos[sn].p[i].x2=desk[sn].playx+(k%10+1)*desk[sn].cardx- 1-desk[sn].large*2; selpos[sn].p[i].y2=(k>9?desk[sn].skaty:desk[sn].playy)+ desk[sn].cardh+1-desk[sn].large; selpos[sn].p[i].f=2|4; i++; } tc[sn]=j; } } draw_selpos(sn,1); gn[sn]=gamenr; ph[sn]=phase; } VOID del_selpos(sn) int sn; { draw_selpos(sn,0); selpos[sn].num=0; } VOID manpage(subj) char *subj; { if (!fork()) { execlp("xterm","xterm","-e","man",subj,NULL); fprintf(stderr,"xterm not found\n"); exitus(0); } } VOID polldisps() { static int tim; Display *d; char dn[2][80]; int i,ok,s[2]; char *argv[100]; if (++tim>20) tim=0; if (tim) return; ok=1; for (i=0;i<2;i++) { if ((s[i]=laninvite[i])) { strcpy(dn[i],lanip[i+1]); if (!strchr(dn[i],':')) { strcat(dn[i],":0"); } if ((d=XOpenDisplay(dn[i]))) { if (!XGetDefault(d,prog_name,"ready")) ok=0; else s[i]=0; XCloseDisplay(d); } else ok=0; } } if (ok) { for (i=0;i<90 && i=' ') || keysym==XK_BackSpace || keysym==XK_Delete)) { buf[1]=0; if (keysym==XK_BackSpace || keysym==XK_Delete) { if (strlen(inputbuf[sn])>1) { inputbuf[sn][strlen(inputbuf[sn])-2]='_'; inputbuf[sn][strlen(inputbuf[sn])-1]=0; } } else if (strlen(inputbuf[sn])-1t[lang[sn]]))) { x=y=0; if (ob[i].spec&(OB_BUTTON|OB_EXIT|OB_CENTERED)) { x=(ob[i].w*charw[sn]-XTextWidth(dfont[sn],str,l))/2; y=(ob[i].h-1)*charh[sn]/2; } else if (ob[i].spec&OB_RIGHT) { x=ob[i].w*charw[sn]-XTextWidth(dfont[sn],str,l); } if (gfx3d[sn]) { if (ob[i].spec&OB_EXIT) x+=2,y+=2; else if (ob[i].spec&OB_BUTTON) x++,y++; } XDrawString(dpy[sn],ob[i].win,gc[sn],x, y+(charh[sn]+dfont[sn]->ascent-dfont[sn]->descent)/2- gfx3d[sn],str,l); if (ob[i].spec&OB_BOLD) { XDrawString(dpy[sn],ob[i].win,gc[sn],x+1, y+(charh[sn]+dfont[sn]->ascent-dfont[sn]->descent)/2- gfx3d[sn],str,l); } if (ob[i].spec&OB_UNDERLINED && l) { XDrawLine(dpy[sn],ob[i].win,gc[sn],x, y+(charh[sn]+dfont[sn]->ascent-dfont[sn]->descent)/2- gfx3d[sn]+1, x+XTextWidth(dfont[sn],str,l), y+(charh[sn]+dfont[sn]->ascent-dfont[sn]->descent)/2- gfx3d[sn]+1); } } if (gfx3d[sn]) { getob_xywhbd(sn,ob,i,&x,&y,&w,&h,&bd); if (!bd && sel) bd=1; if (sel || !ob_disabled(ob,i)) { if (bd) { draw_3d(ob[i].win,None,sn,0,0,w-1,h-1,sel); if (bd==2) draw_3d(ob[i].win,None,sn,1,1,w-2,h-2,sel); } } } else if (sel) { bd=ob[i].spec&(OB_BUTTON|OB_EXIT) && !ob_disabled(ob,i); if (bd) change_gcxor(sn,btpix[sn]^fgpix[sn]^bgpix[sn]); XFillRectangle(dpy[sn],ob[i].win,gcxor[sn],0,0, ob[i].w*charw[sn],ob[i].h*charh[sn]); if (bd) change_gcxor(sn,fgpix[sn]); } } draw_actbtn(sn,1); } VOID draw_di(sn,idx) int sn,idx; { draw_dial(sn,idx,actdial[sn]); } VOID refresh() { int sn,i; XEvent event; for (sn=0;sn99) w=99; clr[w]=0; while (w) clr[--w]=' '; for (s=0;s<3;s++) { if (s!=sn) { prspnam(txt,s,lang[sn]); x=(s==left(sn)?desk[sn].com1x :desk[sn].com2x)+30*desk[sn].f/desk[sn].q; y=(s==left(sn)?desk[sn].com1y :desk[sn].com2y)+130*desk[sn].f/desk[sn].q; v_gtext(sn,x,y,0,clr); if (th<-1) { v_gtext(sn,x,y+charh[sn],0,clr); continue; } if (numsp==1) { if (phase>=SPIELEN && phase<=NIMMSTICH && s==spieler && trumpf!=5) { prspnam(txt,s,lang[sn]); } else { *txt=0; } } if (numsp!=1 || !briefmsg[sn]) { v_gtext(sn,x,y,0,txt); } y+=charh[sn]; if ((phase==SPIELEN || phase==SCHENKEN) && (numsp!=1 || !briefmsg[sn]) && (stich==1 || (s!=th && !briefmsg[sn])) && s==spieler && trumpf!=5) { v_gtext(sn,x,y,0,clr); strcpy(txt,textarr[TX_SPIELT].t[lang[sn]]); strcat(txt,textarr[revolang?TX_REVOLUTION:trumpf_idx(sn,trumpf)]. t[lang[sn]]); v_gtext(sn,x,y,0,txt); y+=charh[sn]; v_gtext(sn,x,y,0,clr); if (ouveang && !revolang) { if (handsp && trumpf==-1) { v_gtext(sn,x,y,0,textarr[TX_OUVE_HAND].t[lang[sn]]); } else { v_gtext(sn,x,y,0,textarr[TX_OUVE].t[lang[sn]]); } } else if (schwang) { v_gtext(sn,x,y,0,textarr[TX_SCHW_ANGE].t[lang[sn]]); } else if (schnang) { v_gtext(sn,x,y,0,textarr[TX_SCHN_ANGE].t[lang[sn]]); } else if (handsp && !revolang) { v_gtext(sn,x,y,0,textarr[TX_HAND].t[lang[sn]]); } } else if (th>=0) { v_gtext(sn,x,y,0,clr); if (s==th) { v_gtext(sn,x,y,0,textarr[TX_UEBERLEGT].t[lang[sn]]); } else if (phase>=REIZEN && phase<=ANSAGEN && !briefmsg[sn]) { v_gtext(sn,x,y,0,textarr[ausspl==s?TX_VORHAND: (ausspl+1)%3==s?TX_MITTELHAND: TX_HINTERHAND].t[lang[sn]]); } v_gtext(sn,x,y+charh[sn],0,clr); } else if (phase>ANSAGEN) { v_gtext(sn,x,y,0,clr); } } } } VOID di_hand() { int ln; static char txt[NUM_LANG][33]; static tx_typ tt; dihand[4].str=&tt; for (ln=0;ln=0) { di_konre(ktrsag); } else { do_angesagt(); } } else if (f) { kontrastufe=1; prot2.verdopp[sn]=2; di_rekontra(sn); } else if (ktrnext>=0 && ktrnext!=sn) { di_kontra(ktrnext); ktrnext=-1; } else { if (numsp==1 && iscomp(spieler) && briefmsg[0] && playkontra==2 && !sagte18[0]) { create_di(0,diansage); } else do_angesagt(); } } VOID di_dicht() { int sn; phase=SPIELDICHT; if (iscomp(spieler)) { for (sn=0;sn=0) finishgame(); else { clr_desk(0); phase=GEBEN; } } return; } num=numsp; for (sn=0;sn=2?TX_UNTER_NICHT:TX_BUBEN_NICHT]; create_di(spieler,dibuben); } VOID di_spiel() { int ln,i,j,a[4]; static char txt[NUM_LANG][33]; static tx_typ tt,tzur; ktrply=-1; dispiel[14].str=&tzur; dispiel[15].str=&tt; for (ln=0;ln=2?TX_SCHELLEN:TX_KARO)+i]; } create_di(spieler,dispiel); a[0]=a[1]=a[2]=a[3]=0; for (i=0;i<10;i++) { if ((cards[10*spieler+i]&7)!=BUBE) a[cards[10*spieler+i]>>3]++; } j=3; for (i=2;i>=0;i--) { if (a[i]>a[j]) j=i; } dispiel[j+2].spec|=OB_SELECTED; actbtn[spieler]=12; } VOID list_fun(sn) int sn; { int i,j,k,s,e,r,d,curr[3][3],cgv[3][2],cp,ln; static char txt[3][13][4][10]; static tx_typ tt[3][13][4]; for (i=0;i<3;i++) { for (j=0;j<3;j++) { curr[i][j]=splsum[i][j]; } for (j=0;j<2;j++) { cgv[i][j]=sgewoverl[i][j]; } for (j=0;j<13;j++) { for (k=0;k<4;k++) { for (ln=0;ln0 && r && !d?-e:e:curr[k][cp]); } if ((cp==1 || (r && !d)) && e>0) { diliste[sn][7+4*j+s].str=OB_NONE; } else if (cp!=2 || r || e>=0) { if (e==0) s=4; for (k=0;k<3;k++) { if (k!=s) diliste[sn][7+4*j+k].str=OB_NONE; } } } for (;j<13;j++) { for (k=0;k<4;k++) { diliste[sn][7+4*j+k].str=OB_NONE; } } for (k=0;k<3;k++) { sprintf(diliste[sn][59+k].str->t[0],"%d/%d",cgv[k][0],cgv[k][1]); } } VOID di_delliste() { if (irc_play) di_liste(irc_pos,1); else if (numsp>1) di_liste(0,1); } VOID di_liste(sn,ini) int sn,ini; { int ln; static char txt[3][10]; static char spt[3][3][40]; static tx_typ tt1[3],tt2,tt3,tt4[3]; for (ln=0;ln",alist[sn]+1); set_names(diliste[sn],2); if (ini) splfirst[sn]=((splstp>0?splstp-1:0)/12)*12; diliste[sn][59].str=&tt4[0]; diliste[sn][60].str=&tt4[1]; diliste[sn][61].str=&tt4[2]; diliste[sn][62].str=&tt2; diliste[sn][62].spec=splfirst[sn]>=12?OB_EXIT:OB_HIDDEN; diliste[sn][63].str=&tt1[sn]; diliste[sn][63].spec=irc_play?OB_DISABLED|OB_EXIT:OB_EXIT; diliste[sn][65].str=splfirst[sn]+12>=splstp?&textarr[TX_LOESCHEN]:&tt3; diliste[sn][65].spec=splfirst[sn]+120) fputc(' ',f); } while (*txt) { if (unformatted) { if (spec&OB_BOLD) fprintf(f,"%c",ger_toupper(*txt)); else if (spec&OB_UNDERLINED && *txt==' ') fputc('_',f); else fputc(*txt,f); } else { if (spec&OB_BOLD) fprintf(f,"%c\b%c",*txt,*txt); else if (spec&OB_UNDERLINED) fprintf(f,"_\b%c",*txt); else fputc(*txt,f); } txt++; i--; } if (fil) while (i-->0) fputc(' ',f); } VOID prot_fun(sn,f) int sn; FILE *f; { int ln,tr,e,i,j,s,stiche[10][3]; static char txt[3][10][3][NUM_LANG][20]; static tx_typ tt[3][10][3]; tr=trumpf; trumpf=prot1.trumpf; for (s=0;s<3;s++) { for (i=0;i<10;i++) stiche[i][s]=prot1.stiche[i][s]; for (i=(protsort[sn]?0:prot1.stichgem);i<9;i++) { for (j=i+1;j<10;j++) { if (lower(stiche[i][s],stiche[j][s],trumpf==-1)) { swap(&stiche[i][s],&stiche[j][s]); } } } } trumpf=tr; for (i=0;i<10;i++) { for (s=0;s<3;s++) { if (protsort[sn]) { e=prot1.trumpf!=-1 && (stiche[i][s]>>3==prot1.trumpf || (stiche[i][s]&7)==BUBE) ?OB_BOLD:OB_NONE; } else { if (i && prot1.stichgem<=i) { e=prot1.gewonn && prot1.stichgem?OB_NONE:OB_HIDDEN; } else { e=prot1.anspiel[i]==s?OB_UNDERLINED:OB_NONE; if (prot1.gemacht[i]==s) e|=OB_BOLD; } } diproto[sn][8+3*i+s].spec=e; diproto[sn][8+3*i+s].str=&tt[sn][i][s]; for (ln=0;ln=2?TX_SCHELLEN:TX_KARO)+ (stiche[i][s]>>3)].t[ln]); strcat(txt[sn][i][s][ln], textarr[(blatt[sn]>=2?TX_AD:TX_A)+ (stiche[i][s]&7)].t[ln]); } } else { if (e==OB_UNDERLINED) strcpy(txt[sn][i][s][ln]," "); else txt[sn][i][s][ln][0]=0; strcat(txt[sn][i][s][ln], textarr[prot1.schenken? prot1.spieler==s?TX_AKZEPTIERT:TX_SCHENKEN:TX_PASSE]. t[ln]); if (e==OB_UNDERLINED) strcat(txt[sn][i][s][ln]," "); } } } if (f && diproto[sn][8+3*i].spec!=OB_HIDDEN) { fprintf(f," "); for (s=0;s<3;s++) { pformat(f,diproto[sn][8+3*i+s].spec,txt[sn][i][s][lang[sn]],1); } fprintf(f,"\n"); } } } VOID im_skat(sn,ln,s,i) int sn,ln; char *s; int i; { strcpy(s,textarr[(blatt[sn]>=2?TX_SCHELLEN:TX_KARO)+(prot1.skat[i][0]>>3)]. t[ln]); strcat(s,textarr[(blatt[sn]>=2?TX_AD:TX_A)+(prot1.skat[i][0]&7)].t[ln]); strcat(s,","); strcat(s,textarr[(blatt[sn]>=2?TX_SCHELLEN:TX_KARO)+(prot1.skat[i][1]>>3)]. t[ln]); strcat(s,textarr[(blatt[sn]>=2?TX_AD:TX_A)+(prot1.skat[i][1]&7)].t[ln]); } VOID di_proto(sn,ini,log) int sn,ini,log; { static char txt[3][NUM_LANG][40],aug[3][NUM_LANG][20]; static char imski[3][NUM_LANG][40],imskw[3][NUM_LANG][40]; static char vhschob[3][NUM_LANG][40],mhschob[3][NUM_LANG][40]; static char bis[3][10]; static tx_typ ttxt[3],taug[3]; static tx_typ timski[3],timskw[3]; static tx_typ tvhschob[3],tmhschob[3]; static tx_typ tbis[3],tzur,tvor; char *hd="----------------------------------------\n"; char *tl="========================================\n"; char hdbuf[100],spn[12]; int ln,s,p,u1,u2,u3; FILE *f; if (!prot_file) log=0; if (log) { f=strcmp(prot_file,"-")?fopen(prot_file,"a"):stdout; if (!f) { fprintf(stderr,"Can't write file %s\n",prot_file); return; } for (s=0;s<3;s++) { if (prot1.verdopp[s]==2) { strcpy(spn," "); strcat(spn,spnames[s][0][lang[0]]); strcat(spn," "); p=OB_CENTERED|OB_UNDERLINED; } else { strcpy(spn,spnames[s][0][lang[0]]); p=OB_CENTERED; } pformat(f,p,spn,1); } fputc('\n',f); for (s=0;s<3;s++) { if (prot1.verdopp[s]==2 && spnames[s][1][0]) { strcpy(spn," "); strcat(spn,spnames[s][1][lang[0]]); strcat(spn," "); p=OB_CENTERED|OB_UNDERLINED; } else { strcpy(spn,spnames[s][1][lang[0]]); p=OB_CENTERED; } pformat(f,p,spn,1); } fprintf(f,"\n%s",hd); } else f=0; if (ini) protsort[sn]=0; set_names(diproto[sn],2); for (p=0;p<2;p++) { for (s=0;s<3;s++) { diproto[sn][2+p*3+s].spec=prot1.verdopp[s]==2? OB_CENTERED|OB_UNDERLINED:OB_CENTERED; } } diproto[sn][44].str=&ttxt[sn]; for (ln=0;ln0?" R":""); hdbuf[strlen(hdbuf)]=' '; } fputs(hdbuf,f); protsort[sn]=1; prot_fun(sn,f); fputs(hd,f); fprintf(f,"%s %s\n",textarr[TX_IM_SKAT_IST].t[lang[sn]], imski[sn][lang[sn]]); if (prot1.stichgem || prot1.schenken) { if (prot1.trumpf!=5) { fprintf(f,"%s %s\n",textarr[TX_IM_SKAT_WAR].t[lang[sn]], imskw[sn][lang[sn]]); if (prot1.gereizt) { fprintf(f,"%s %s\n",textarr[TX_GEREIZT_BIS].t[lang[sn]], bis[sn]); } } else if (prot1.sramsch) { fprintf(f,"%s %s\n",textarr[TX_IM_SKAT_WAR].t[lang[sn]], imskw[sn][lang[sn]]); pformat(f,u1,textarr[TX_VH_SCHOB].t[lang[sn]],0); fprintf(f," %s\n",vhschob[sn][lang[sn]]); pformat(f,u2,textarr[TX_MH_SCHOB].t[lang[sn]],0); fprintf(f," %s\n",mhschob[sn][lang[sn]]); pformat(f,u3,textarr[TX_HH_SCHOB].t[lang[sn]],0); fprintf(f," %s\n",imski[sn][lang[sn]]); } fprintf(f,"%s\n",txt[sn][lang[sn]]); if (diproto[sn][40].str!=&textarr[TX_IM_SKAT_WAR] && prot1.trumpf!=5) { fprintf(f,"%s\n",diproto[sn][40].str->t[lang[sn]]); } if (prot1.trumpf!=5 || prot1.augen!=0 || prot1.gewonn) { fprintf(f,"%s",diproto[sn][45].str->t[lang[sn]]); if (diproto[sn][46].str!=OB_NONE) { fprintf(f," %s",diproto[sn][46].str->t[lang[sn]]); } fputc('\n',f); } } fputs(tl,f); if (f!=stdout) fclose(f); } else { diproto[sn][47].str= &textarr[(!sn || irc_play) && protsort[sn]?TX_SPEICHERN:TX_SPIELLISTE]; create_di(sn,diproto[sn]); actbtn[sn]=48; } } VOID di_resultdi(sn) int sn; { create_di(sn,diresult); diresult[12].spec|=spieler==0?OB_SELECTED:OB_NONE; diresult[13].spec|=spieler==1?OB_SELECTED:OB_NONE; diresult[14].spec|=spieler==2?OB_SELECTED:OB_NONE; if (spgew && (alist[sn]==1 || (trumpf==5 && stsum!=120))) { diresult[12].spec^=OB_SELECTED; diresult[13].spec^=OB_SELECTED; diresult[14].spec^=OB_SELECTED; } if (trumpf==5 && spwert==0) { diresult[12].spec=diresult[13].spec=diresult[14].spec&=~OB_SELECTED; } } VOID di_result(be) int be; { int ln,sn,i,x,y,sx,sy; static int ini,smlh; static char sa[NUM_LANG][30],sw[NUM_LANG][40],sg[NUM_LANG][40]; static char su[3][3][10],txt[NUM_LANG][30],spt[3][40]; static tx_typ tsa,tsw,tsg,tsu[3][3],ttxt,tsp[3]; sx=sy=0; for (sn=0;sn1 || trumpf==5) { y=desk[sn].playy; sy=y+desk[sn].cardh-charh[sn]; } else { y=desk[sn].y+3; sy=y; if (spieler==left(sn)) { x=desk[sn].playx; sx=x+2*desk[sn].cardw+charw[sn]; } } putcard(sn,prot2.skat[i][0],x,y); putcard(sn,prot2.skat[i][1],x+desk[sn].cardx,y); } } diresult[2].str= (trumpf==5? (mes1?&textarr[TX_JUNGFRAU]: mes2?&textarr[TX_DURCHMARSCH]: OB_NONE) : (mes1?&textarr[TX_UEBERREIZT]: mes2?&textarr[TX_SCHNEIDERFREI]: mes3?&textarr[TX_NICHT_SCHWARZ]: mes4?&textarr[TX_SPITZE_VERLOREN]: OB_NONE)); diresult[3].str=&tsg; diresult[4].str=&tsa; diresult[5].str=&tsw; diresult[16].str=&tsp[0]; diresult[17].str=&tsp[1]; diresult[18].str=&tsp[2]; diresult[19].str=be?&ttxt:OB_NONE; for (ln=0;ln1) sprintf(txt[ln],textarr[TX_N_BOCK_EREIGNISSE].t[ln],be); else strcpy(txt[ln],textarr[TX_BOCK_EREIGNIS].t[ln]); } for (i=0;i<3;i++) { sprintf(diresult[16+i].str->t[0],"%d/%d",cgewoverl[i][0],cgewoverl[i][1]); } for (sn=0;sn1) { set_names(dismlres[sn],5); dismlres[sn][1].str=diresult[2].str; dismlres[sn][2].str=diresult[3].str; dismlres[sn][3].str=diresult[4].str; dismlres[sn][4].str=diresult[5].str; dismlres[sn][11].str=diresult[12].str; dismlres[sn][12].str=diresult[13].str; dismlres[sn][13].str=diresult[14].str; dismlres[sn][14].str=diresult[16].str; dismlres[sn][15].str=diresult[17].str; dismlres[sn][16].str=diresult[18].str; dismlres[sn][17].str=diresult[19].str; if (!ini) { smlh=dismlres[sn][0].h; ini=1; } if (be) { dismlres[sn][17].spec&=~OB_HIDDEN; dismlres[sn][0].h=smlh+1; } else { dismlres[sn][17].spec|=OB_HIDDEN; dismlres[sn][0].h=smlh; } di_delres(sn); resdial[sn]=dismlres[sn]; if (actdial[sn]) remove_di(sn); create_dial(sn,(desk[sn].w-resdial[sn][0].w*charw[sn])/2, 5,3,resdial[sn]); dismlres[sn][11].spec|=spieler==0?OB_SELECTED:OB_NONE; dismlres[sn][12].spec|=spieler==1?OB_SELECTED:OB_NONE; dismlres[sn][13].spec|=spieler==2?OB_SELECTED:OB_NONE; if (spgew && (alist[sn]==1 || (trumpf==5 && stsum!=120))) { dismlres[sn][11].spec^=OB_SELECTED; dismlres[sn][12].spec^=OB_SELECTED; dismlres[sn][13].spec^=OB_SELECTED; } if (trumpf==5 && spwert==0) { dismlres[sn][11].spec=dismlres[sn][12].spec=dismlres[sn][13].spec&= ~OB_SELECTED; } phase=GEBEN; } else { if (sx && sy) { if ((trumpf==5 && sn==ausspl) || handsp) { if (sx>desk[sn].w/2) { sx-=(strlen(textarr[TX_IM_SKAT_IST].t[lang[sn]])+0)* charw[sn]; } v_gtextnc(sn,0,0,sx,sy,0,textarr[TX_IM_SKAT_IST].t[lang[sn]]); } else { if (sx>desk[sn].w/2) { sx-=(strlen(textarr[TX_URSPRUENG_SKAT].t[lang[sn]])+0)* charw[sn]; } v_gtextnc(sn,0,0,sx,sy,0,textarr[TX_URSPRUENG_SKAT].t[lang[sn]]); } } set_names(diresult,6); di_resultdi(sn); } } } VOID di_delres(sn) int sn; { if (resdial[sn]) { remove_dial(sn,resdial[sn]); resdial[sn]=0; } } VOID di_options(sn) int sn; { int i,f,ln; static char txt[3][NUM_LANG][20]; static tx_typ tt[3]; f=sn<0; if (f) { sn=0; } else { dioptions[sn][23].spec=OB_HIDDEN; dioptions[sn][24].spec=OB_HIDDEN; } if (!sn) firstgame=0; for (i=0;i<3;i++) { if (dioptions[sn][14+i].str!=OB_NONE) { dioptions[sn][14+i].str=&stichstr[blatt[sn]>=2][sn][i]; } } if (dioptions[sn][12].str!=&textarr[TX_GESPIELT_WIRD]) { dioptions[sn][12].str=&spielstr[blatt[sn]>=2][sn]; } dioptions[sn][10].str=bockspiele?&tt[sn]:OB_NONE; for (ln=0;ln1) { digrafik[sn][10].spec= digrafik[sn][11].spec= digrafik[sn][12].spec=OB_HIDDEN; } create_diopt(sn,digrafik[sn]); digrafik[sn][3+blatt[sn]].spec|=OB_SELECTED; digrafik[sn][8+lang[sn]].spec|=OB_SELECTED; } VOID di_strateg(sn) int sn; { static tx_typ tt[3][4]; int i,dis,ln; char buf[40]; dis=irc_play || numsp>2?OB_DISABLED:OB_NONE; for (i=0;i<5;i++) { distrateg[sn][i+4].spec|=dis; } dis=irc_play || numsp>1?OB_HIDDEN:OB_NONE; for (i=0;i<5;i++) { distrateg[sn][i+10].spec|=dis; } dis=irc_play || numsp>1?OB_HIDDEN:OB_NONE; distrateg[sn][3].spec=distrateg[sn][9].spec=dis; ln=lang[sn]; sprintf(buf,"%s %s",conames[0][0],conames[0][1]); extractnamln(3,buf,ln); if (!spnames[3][0][ln][0]) { strcpy(conames[0][0],textarr[TX_COMPUTER].t[ln]); strcpy(conames[0][1],textarr[TX_LINKS].t[ln]); } else { strcpy(conames[0][0],spnames[3][0][ln]); strcpy(conames[0][1],spnames[3][1][ln]); } sprintf(buf,"%s %s",conames[1][0],conames[1][1]); extractnamln(3,buf,ln); if (!spnames[3][0][ln][0]) { strcpy(conames[1][0],textarr[TX_COMPUTER].t[ln]); strcpy(conames[1][1],textarr[TX_RECHTS].t[ln]); } else { strcpy(conames[1][0],spnames[3][0][ln]); strcpy(conames[1][1],spnames[3][1][ln]); } tt[sn][0].t[ln]=conames[0][0]; tt[sn][1].t[ln]=conames[1][0]; tt[sn][2].t[ln]=conames[0][1]; tt[sn][3].t[ln]=conames[1][1]; distrateg[sn][19].str=&tt[sn][0]; distrateg[sn][20].str=&tt[sn][1]; distrateg[sn][21].str=&tt[sn][2]; distrateg[sn][22].str=&tt[sn][3]; dis=irc_play || numsp>1?OB_HIDDEN:OB_NONE; for (i=0;i<5;i++) { distrateg[sn][18+i].spec|=dis; } create_diopt(sn,distrateg[sn]); distrateg[sn][strateg[0]+8].spec|=OB_SELECTED; distrateg[sn][strateg[1]+14].spec|=OB_SELECTED; distrateg[sn][hints[sn]+16].spec|=OB_SELECTED; } VOID di_varianten(sn) int sn; { divarianten[sn][0].next=irc_play?OB_DISABLED:OB_NONE; create_diopt(sn,divarianten[sn]); divarianten[sn][3+playramsch].spec|=OB_SELECTED; divarianten[sn][7+playkontra].spec|=OB_SELECTED; divarianten[sn][11+playbock].spec|=OB_SELECTED; divarianten[sn][15+spitzezaehlt].spec|=OB_SELECTED; divarianten[sn][19+revolution].spec|=OB_SELECTED; divarianten[sn][22+klopfen].spec|=OB_SELECTED; divarianten[sn][25+schenken].spec|=OB_SELECTED; divarianten[sn][28+oldrules].spec|=OB_SELECTED; } VOID di_ramschopts(sn) int sn; { diramschopts[sn][0].next=irc_play?OB_DISABLED:OB_NONE; create_diopt(sn,diramschopts[sn]); diramschopts[sn][3+playsramsch].spec|=OB_SELECTED; diramschopts[sn][6+rskatloser].spec|=OB_SELECTED; } VOID di_bockevents(sn) int sn; { int i,j; dibockevents[sn][0].next=irc_play?OB_DISABLED:OB_NONE; create_diopt(sn,dibockevents[sn]); for (i=1,j=0;i<=BOCK_BEI_LAST;i*=2,j++) { if (bockevents&i) { dibockevents[sn][2+j].spec|=OB_SELECTED; } } dibockevents[sn][11+resumebock].spec|=OB_SELECTED; } VOID di_geschwindigkeit(sn) int sn; { static char txt[3][NUM_LANG][20]; static tx_typ tt[3],tkl[3],tgr[3]; int i,dis,ln; digeschwindigkeit[sn][3].str=&tt[sn]; for (ln=0;ln=101?OB_DISABLED|OB_EXIT:OB_EXIT; for (i=0;i<3;i++) { for (ln=0;ln35) { buf[35]=0; len=35; } strcat(buf,"_"); inputdi[sn]=di; inputbuf[sn]=buf; inputlen[sn]=len; sprintf(txt[sn]," %s ",textarr[ti].t[lang[sn]]); for (ln=0;ln