/// <summary> /// Gets the final point score. /// /// Note: if the reach bou is not 0, the topest player will get it. /// if more than 1 player has the same topest score, let the one who is the nearest EKaze.Ton be topest. /// </summary> public static List <PlayerTenbouChangeInfo> GetPointScore(List <Player> playerList, ref int reachBou) { List <Player> playerList_Sort = new List <Player>(playerList); playerList_Sort.Sort(SortPlayer); // topest player int topestPlayerIndex = 0; //马: 20-10 (20,10,-10,-20) int ShunMa = 10; int BackTenbou = GameSettings.Back_Tenbou; float Base = 1000f; int TopBonus = Math.FloorToInt((BackTenbou - GameSettings.Init_Tenbou) / Base * playerList.Count); //20pt if (reachBou > 0) { playerList_Sort[topestPlayerIndex].increaseTenbou(reachBou * GameSettings.Reach_Cost); reachBou = 0; } // calculate points List <PlayerTenbouChangeInfo> resultPointList = new List <PlayerTenbouChangeInfo>(); int totalPoint = 0; int bonus = 0; Player player; for (int i = 0; i < playerList_Sort.Count; i++) { player = playerList_Sort[i]; bonus = (i == topestPlayerIndex)? TopBonus : 0; PlayerTenbouChangeInfo ptci = new PlayerTenbouChangeInfo(); ptci.playerKaze = player.JiKaze; ptci.current = player.Tenbou; ptci.changed = Math.FloorToInt((player.Tenbou - BackTenbou) / Base + ((2 - i) * ShunMa) + bonus); resultPointList.Add(ptci); totalPoint += ptci.changed; } // adjust if (totalPoint != 0) { resultPointList[topestPlayerIndex].changed -= totalPoint; } return(resultPointList); }
void Show_Internel() { lab_reachbou.text = "x" + currentAgari.reachBou.ToString(); var tenbouInfos = currentAgari.tenbouChangeInfoList; EKaze nextKaze = currentAgari.manKaze; for (int i = 0; i < playerTenbouList.Count; i++) { PlayerTenbouChangeInfo info = tenbouInfos.Find(ptci => ptci.playerKaze == nextKaze); playerTenbouList[i].SetPointInfo(info.playerKaze, info.current, info.changed); nextKaze = nextKaze.Next(); } }
void Show_Internel() { lab_msg.text = GetRyuuKyokuReasonString(); PlayRyuuKyokuVoice(); bool showTenpai = ryuuKyokuReason == ERyuuKyokuReason.NoTsumoHai; var tenbouInfos = currentAgari.tenbouChangeInfoList; EKaze nextKaze = currentAgari.manKaze; for (int i = 0; i < playerTenbouList.Count; i++) { PlayerTenbouChangeInfo info = tenbouInfos.Find(ptci => ptci.playerKaze == nextKaze); playerTenbouList[i].SetInfo(info.playerKaze, info.current, info.changed, info.isTenpai, showTenpai); nextKaze = nextKaze.Next(); } }
IEnumerator ShowTenbouInfo() { yield return(new WaitForSeconds(1f)); lab_reachbou.text = "x" + currentAgari.reachBou.ToString(); SetTenbouInfo(true); var tenbouInfos = currentAgari.tenbouChangeInfoList; EKaze nextKaze = currentAgari.manKaze; for (int i = 0; i < playerTenbouList.Count; i++) { PlayerTenbouChangeInfo info = tenbouInfos.Find(ptci => ptci.playerKaze == nextKaze); playerTenbouList[i].SetInfo(info.playerKaze, info.current, info.changed); nextKaze = nextKaze.Next(); } }