亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? scoring.c

?? 一個網絡和單機的麻將游戲源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Header: /home/jcb/newmj/RCS/scoring.c,v 11.8 2003/04/13 18:49:51 jcb Rel $ * scoring.c  * This file contains the routines to handle the scoring * of hands. *//****************** COPYRIGHT STATEMENT ********************** * This file is Copyright (c) 2000 by J. C. Bradfield.       * * Distribution and use is governed by the LICENCE file that * * accompanies this file.                                    * * The moral rights of the author are asserted.              * *                                                           * ***************** DISCLAIMER OF WARRANTY ******************** * This code is not warranted fit for any purpose. See the   * * LICENCE file for further information.                     * *                                                           * *************************************************************/static const char rcs_id[] = "$Header: /home/jcb/newmj/RCS/scoring.c,v 11.8 2003/04/13 18:49:51 jcb Rel $";#include "tiles.h"#include "player.h"#include "controller.h"#include "scoring.h"#include "sysdep.h"int no_special_scores = 0; /* disable scoring of flowers and seasons *//* score_of_tileset: takes a TileSetP, and returns a score. *   It needs to know the wind of this player, and the prevailing wind.   It puts the left text, score and right text in the following ptrs; they   are valid until the next call */static char *tsltext,*tsrtext; static int tsscore;static int score_of_tileset(Game *g, TileSetP tp, TileWind own, TileWind prevailing) {  static char buf[100];  static char tmp[50] ;  int n,d;  buf[0] = 0;  tmp[0] = 0;  if ( tp->type == Empty ) {    /* I don't think this should happen */    warn("score_of_tileset: called on Empty tileset");    tsltext = NULL; tsrtext = NULL;    return 0;  }  d = is_major(tp->tile) ? 2 : 1;  n = 0;  switch ( tp->type ) {  case Chow:  case ClosedChow:    n = 0; break;  case Pung:    n = 2*d;    strcat(tmp,"open pung of ");    strcat(tmp, (d==2) ? "majors" : "minors");    break;  case ClosedPung:    n = 4*d;    strcat(tmp,"closed pung of ");    strcat(tmp, (d==2) ? "majors" : "minors");    break;  case Kong:    n = 8*d;    /* if we are using Millington's kong rules, we should distinguish       claimed and annexed kongs here */    if ( game_get_option_value(g,GOKongHas3Types,NULL) ) {      if ( tp->annexed )	strcat(tmp,"annexed kong of ");      else	strcat(tmp,"claimed kong of ");    } else {      strcat(tmp,"open kong of ");    }    strcat(tmp, (d==2) ? "majors" : "minors");    break;  case ClosedKong:    n = 16*d;    strcat(tmp,"closed kong of ");    strcat(tmp, (d==2) ? "majors" : "minors");    break;  case Pair:  case ClosedPair:    n = 0;    if ( is_dragon(tp->tile) ) {      n = 2;      strcat(tmp,"pair of dragons");    } else if ( is_wind(tp->tile)		&& (TileWind)value_of(tp->tile) == own ) {      if ( own == prevailing ) {	n = 4;	strcat(tmp,"pair of own and prevailing wind");      } else {	n = 2;	strcat(tmp,"pair of own wind");      }    } else if ( is_wind(tp->tile)		&& (TileWind)value_of(tp->tile) == prevailing ) {      n = 2;      strcat(tmp,"pair of prevailing wind");    }    break;  case Empty: break; /* to suppress warning */  }  tsltext = tileset_string(tp);  tsscore = n;  tsrtext = tmp;  return n;}/* score_of_hand: score the given seat in the given game.   In addition, set the danger flags to indicate if the player   achieved any of the dangerous hands. */Score score_of_hand(Game *g, seats s) {  Score tot;  /* there are three buffers in which scoring info is built up:     a points buffer, a doubles buffer, and a limit buffer */  static char buf[2048], dblsbuf[1024], limsbuf[1024];  char tbuf[100];  PlayerP p;  int limit, nolimit;  int winner;  int i,doubles,centilims;  MJSpecialHandFlags mjspecflags;  Tile eyestile; int claimedpair;  int numchows,numpairs,numpungs,numkongs,allclosed,noscore,allhonours,    allmajors,allterminals,dragonsets,windsets,dragonpairs,windpairs,    numclosedpks,allgreen,allbamboo,allcharacter,allcircle,    allbamboohonour,allcharacterhonour,allcirclehonour;    p = g->players[s];  assert(g->state == MahJonging);  limit = (int)game_get_option_value(g,GOScoreLimit,NULL);  nolimit = (int)game_get_option_value(g,GONoLimit,NULL);  mjspecflags = 0;  if ( game_get_option_value(g,GOSevenPairs,NULL) )    mjspecflags |= MJSevenPairs;  buf[0] = 0;  tot.explanation = buf;  tot.value = 0;  dblsbuf[0] = 0;  limsbuf[0] = 0;  doubles = 0;  centilims = 0;  /* This macro takes three args: text for left,     score, and text for right. It then looks at the score     and adds appropriate bits to the relevant buffers and     scoring info */#define doscore(ltext,score,rtext) \  { int pts, dbls, clims; \    pts = (score) % 10000; \    dbls = ((score) / 10000) % 100; \    clims = ((score) / 1000000); \    if ( (!clims || nolimit) && pts ) { \      tot.value += pts; sprintf(tbuf,"%-12s %2d (%s)\n",ltext,pts,rtext); \      strcat(buf,tbuf); \    } \    if ( (!clims || nolimit) && dbls ) { \      doubles += dbls; sprintf(tbuf,"%-12s  %1d dbl (%s)\n",ltext,dbls,rtext); \      strcat(dblsbuf,tbuf); \    } \    if ( clims && !(nolimit && (pts || dbls)) ) { \      if ( clims > centilims ) centilims = clims; \      if ( clims == 100 ) { \        sprintf(tbuf,"%-10s %4d (%s)\n","Limit Hand",limit,rtext); \      } else { \        sprintf(tbuf,"%4g Limit %4d (%s)\n",clims*1.0/100,clims*limit/100,rtext); \      } \      strcat(limsbuf,tbuf); \    } \  }  /* and a couple of defines for hard-coded scores */#define DBLS *10000#define LIMIT 100000000  /* variables for detecting special hands */  numchows = 0;  numkongs = 0;  numpairs = 0;  numpungs = 0;  allclosed = 1;  noscore = 1;  allterminals = 1;  allhonours = 1;  allmajors = 1;  windsets = 0;  dragonsets = 0;  windpairs = 0;  dragonpairs = 0;  allgreen = 1;  allbamboo = 1;  allcharacter = 1;  allcircle = 1;  allbamboohonour = 1;  allcharacterhonour = 1;  allcirclehonour = 1;  numclosedpks = 0; /* closed pungs/kongs */  eyestile = HiddenTile; claimedpair = 0;  /* Basic points */  winner = 0;  if ( s == g->player ) {    doscore("basic",(int)game_get_option_value(g,GOMahJongScore,NULL),	    "going Mah Jong");    winner = 1;  }  if ( winner ) {     presetdflags(p,s);    psetdflags(p,s,DangerEnd);  }  /* Now, get the points for the tilesets */  /* Also, stash information for doubles */  for ( i = 0; i < MAX_TILESETS; i++ ) {    TileSetP t = (TileSetP) &p->tilesets[i];    if ( t->type == Empty ) continue;    score_of_tileset(g,t,p->wind,g->round);    if ( tsscore ) {      noscore = 0;      doscore(tsltext,tsscore,tsrtext);    }        if ( t->type == Chow )      numchows++,allclosed=0,allterminals=allhonours=allmajors=0;    if ( t->type == ClosedChow )      numchows++,allterminals=allhonours=allmajors=0;    if ( t->type == Pung ) allclosed=0,numpungs++;    if ( t->type == ClosedPung ) numpungs++,numclosedpks++;    if ( t->type == Kong ) {      numkongs++ ;      /* in Millington's rules, a claimed kong counts as a closed	 kong for doubling purposes */      if ( game_get_option_value(g,GOKongHas3Types,NULL)	&& ! t->annexed ) {	numclosedpks++;      } else {	allclosed=0;      }    }    if ( t->type == ClosedKong ) numkongs++,numclosedpks++;    if ( t->type == Pair ) {      numpairs++;      allclosed=0;      claimedpair = 1 ;      eyestile = t->tile; /* this fails for seven pairs, but we don't care */    }    if ( t->type == ClosedPair ) {      numpairs++;      eyestile = t->tile; /* this fails for seven pairs, but we don't care */    }    if ( num_tiles_in_set(t) >= 3 ) {      dragonsets += is_dragon(t->tile);      windsets += is_wind(t->tile);    } else {      dragonpairs += is_dragon(t->tile);      windpairs += is_wind(t->tile);    }    switch ( suit_of(t->tile) ) {    case BambooSuit:      allcharacter = allcharacterhonour = 0;      allcircle = allcirclehonour = 0;      switch ( t->type ) {      case Chow:      case ClosedChow:	if ( !is_green(t->tile) 	  || !is_green(t->tile+1)	  || !is_green(t->tile+2) ) allgreen = 0;	break;      default:	if ( !is_green(t->tile) ) allgreen = 0;      }      break;    case CharacterSuit:      allbamboo = allbamboohonour = 0;      allcircle = allcirclehonour = 0;      allgreen = 0;      break;    case CircleSuit:      allbamboo = allbamboohonour = 0;      allcharacter = allcharacterhonour = 0;      allgreen = 0;      break;    case DragonSuit:      allbamboo = allcharacter = allcircle = 0;      if ( !is_green(t->tile) ) allgreen = 0;      break;    case WindSuit:      allbamboo = allcharacter = allcircle = 0;      allgreen = 0;      break;    default:      warn("Strange suit seen in hand");    }    if ( !is_honour(t->tile) ) allhonours = 0;    if ( !is_terminal(t->tile) ) allterminals = 0;    if ( !is_major(t->tile) ) allmajors = 0;  }  /* now go through the concealed tiles, in case we're playing some     weird game where losers are allowed to score for pure and concealed     hands. Seems a pity to duplicate all this code, but there we are */  /* There's another reason to go through the concealed tiles: the     existence of special hands, where the concealed tiles are     a declared set */  for ( i = 0; i < p->num_concealed; i++ ) {    Tile ti = p->concealed[i];    switch ( suit_of(ti) ) {    case BambooSuit:      allcharacter = allcharacterhonour = 0;      allcircle = allcirclehonour = 0;      if ( !is_green(ti) ) allgreen = 0;      break;    case CharacterSuit:      allbamboo = allbamboohonour = 0;      allcircle = allcirclehonour = 0;      allgreen = 0;      break;    case CircleSuit:      allbamboo = allbamboohonour = 0;      allcharacter = allcharacterhonour = 0;      allgreen = 0;      break;    case DragonSuit:      allbamboo = allcharacter = allcircle = 0;      if ( !is_green(ti) ) allgreen = 0;      break;    case WindSuit:      allbamboo = allcharacter = allcircle = 0;      allgreen = 0;      break;    default:      warn("Strange suit seen in hand");    }    if ( !is_honour(ti) ) allhonours = 0;    if ( !is_terminal(ti) ) allterminals = 0;    if ( !is_major(ti) ) allmajors = 0;  }  /* if we have seven pairs, give the base points */  if ( numpairs == 7 ) {    doscore("basic points",(int)game_get_option_value(g,GOSevenPairsVal,NULL),"seven pairs");    noscore = 0;  }  /* Now points for flowers and seasons (which don't count     to stop a noscore hand) */  if ( p->num_specials > 0 && ! no_special_scores ) {    char s[16];    sprintf(s,"%d special%s",p->num_specials,p->num_specials > 1 ? "s" : "");    doscore(s,4*p->num_specials,"flowers and seasons");  }  /* odds and sods */  if ( winner       && g->whence == FromWall ) {    doscore("extra",2,"winning from wall");  }  /* fishing the eyes: if we claimed a pair to go out, then     the tile had better match the discard.     Otherwise, the tiles of the (necessarily closed) pair     had better match the tile drawn from the wall.     We don't give this for seven pairs (or other multi pair hands).  */  if ( winner && eyestile == g->tile       && numpairs == 1       && ( claimedpair 	    || g->whence == FromWall || g->whence == FromLoose ) ) {    doscore("extra",is_major(eyestile) ? 4 : 2,"fishing the eyes");  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人aaaa免费全部观看| 亚洲尤物在线视频观看| 成人毛片视频在线观看| 国产精品美女久久久久久2018| 成人免费高清在线观看| 一级女性全黄久久生活片免费| 91精品国产乱码久久蜜臀| 韩国av一区二区三区在线观看| 国产精品国产馆在线真实露脸 | 亚洲色图欧美激情| 在线日韩av片| 国模无码大尺度一区二区三区| 日韩一区日韩二区| 欧美一区二区在线不卡| 本田岬高潮一区二区三区| 日韩电影在线观看电影| 国产日韩成人精品| 欧美日韩在线精品一区二区三区激情| 精品一区免费av| 亚洲精品欧美激情| 久久美女艺术照精彩视频福利播放| 91福利社在线观看| 麻豆国产91在线播放| 亚洲激情五月婷婷| 久久久国际精品| 56国语精品自产拍在线观看| 91在线看国产| 日本成人在线电影网| 国产精品天美传媒| 欧美色精品在线视频| 成人av网站免费| 午夜精品一区二区三区电影天堂 | 欧美肥胖老妇做爰| 在线这里只有精品| 91视频免费观看| 99国产精品久久久久久久久久 | 国内精品伊人久久久久av一坑| 亚洲成a天堂v人片| 亚洲综合免费观看高清完整版在线| 国产精品亲子伦对白| 中文字幕精品一区二区三区精品 | 综合欧美亚洲日本| 国产精品乱人伦中文| 国产精品你懂的在线欣赏| 久久久午夜精品理论片中文字幕| 精品三级av在线| 久久久亚洲午夜电影| 国产日韩欧美制服另类| 国产精品无遮挡| 成人免费在线播放视频| 亚洲蜜臀av乱码久久精品| 亚洲黄一区二区三区| 樱花影视一区二区| 天堂va蜜桃一区二区三区漫画版| 日韩主播视频在线| 美国三级日本三级久久99| 捆绑变态av一区二区三区| 国产一区二区91| 成人深夜在线观看| 色婷婷精品久久二区二区蜜臂av| 日本高清免费不卡视频| 在线播放国产精品二区一二区四区| 7777精品伊人久久久大香线蕉的| 欧美电影免费观看高清完整版| 久久久久国产精品厨房| 亚洲欧美一区二区三区极速播放| 亚洲国产欧美日韩另类综合 | 欧美日韩精品电影| 欧美成人在线直播| 中文字幕高清一区| 亚洲一区二区在线播放相泽 | 日韩电影一区二区三区四区| 激情久久五月天| 色哟哟精品一区| 欧美一级国产精品| 国产精品女主播av| 日韩精品一区第一页| 成人国产精品免费观看视频| 欧美三片在线视频观看| 久久女同精品一区二区| 亚洲色图都市小说| 捆绑调教一区二区三区| 色综合视频一区二区三区高清| 欧美一区二区三区四区在线观看| 久久久国产一区二区三区四区小说 | 国产成人一区在线| 在线免费观看成人短视频| 精品国产一区二区三区不卡 | 欧美一级淫片007| 国产精品福利电影一区二区三区四区 | 337p日本欧洲亚洲大胆精品| 亚洲欧美日韩成人高清在线一区| 视频在线观看一区二区三区| 成人国产在线观看| 日韩欧美精品在线| 一区二区三区国产精品| 国产精品一区二区三区网站| 欧美日韩国产精选| 成人免费一区二区三区视频| 久久精品av麻豆的观看方式| 欧美综合天天夜夜久久| 国产欧美日韩另类视频免费观看| 天堂成人国产精品一区| 91在线视频观看| 国产日韩精品视频一区| 免费高清在线一区| 欧洲精品一区二区三区在线观看| 久久精品亚洲一区二区三区浴池| 石原莉奈一区二区三区在线观看| 99麻豆久久久国产精品免费优播| 欧美成人午夜电影| 亚洲mv大片欧洲mv大片精品| 99精品久久只有精品| 久久精子c满五个校花| 日韩精品一级二级| 在线免费精品视频| 中文字幕一区二区三区色视频| 国产一区二区伦理| 日韩一区二区免费在线电影| 亚洲成人自拍偷拍| 99久久精品免费精品国产| 国产午夜亚洲精品午夜鲁丝片| 秋霞午夜鲁丝一区二区老狼| 色噜噜狠狠成人中文综合| 中文字幕一区二区日韩精品绯色| 国产麻豆精品theporn| 欧美一区二区三区播放老司机| 午夜影院在线观看欧美| 日本韩国欧美国产| 一区二区三区高清| 色噜噜夜夜夜综合网| 亚洲欧美日韩一区二区| 91免费精品国自产拍在线不卡| 国产精品国产精品国产专区不片| 国产成人在线免费观看| 欧美激情在线一区二区三区| 国产精品正在播放| 久久嫩草精品久久久精品| 国产另类ts人妖一区二区| 亚洲精品一区二区三区四区高清| 麻豆久久久久久久| 欧美变态口味重另类| 国产美女娇喘av呻吟久久| 久久婷婷久久一区二区三区| 国产精品一线二线三线精华| 久久久久久亚洲综合影院红桃 | 欧美日韩电影在线播放| 日韩激情一二三区| 欧美一区二区三区系列电影| 激情av综合网| 中文字幕电影一区| 91色九色蝌蚪| 手机精品视频在线观看| 日韩精品专区在线影院观看| 国产成人免费视频一区| 国产精品国产三级国产普通话三级 | 中文字幕一区二区三区色视频| 色香色香欲天天天影视综合网| 亚洲五码中文字幕| 日韩午夜在线影院| 国产99久久久国产精品潘金 | 99久久综合狠狠综合久久| 亚洲人成网站色在线观看 | 中文字幕精品在线不卡| 色狠狠色狠狠综合| 视频一区二区三区入口| 精品av综合导航| 91美女视频网站| 日韩专区一卡二卡| 中文字幕欧美区| 欧美老年两性高潮| 国产精品自在欧美一区| 亚洲免费av高清| 欧美v亚洲v综合ⅴ国产v| 99精品热视频| 久久99久久久久久久久久久| 国产精品成人一区二区三区夜夜夜 | 日韩成人精品在线| 中文字幕免费不卡在线| 欧美乱熟臀69xxxxxx| 国产成人8x视频一区二区| 亚洲啪啪综合av一区二区三区| 日韩欧美在线一区二区三区| 99热在这里有精品免费| 麻豆成人av在线| 亚洲综合久久av| 国产片一区二区| 欧美一区二区人人喊爽| 91浏览器打开| 国产一二精品视频| 亚洲国产精品一区二区久久| 国产女同性恋一区二区| 欧美高清一级片在线| 99久久伊人网影院| 久久国产精品区| 亚洲成人精品一区| 椎名由奈av一区二区三区| 精品日韩欧美一区二区| 欧美在线短视频| 91亚洲精华国产精华精华液|