// added by usc at 2014/02/27 private CurBettingInfo GetCurBettingInfo(BumperCarInfo bumperCarInfo) { CurBettingInfo curBettingInfo = new CurBettingInfo(); int[] aAreaScore = new int[BumperCarDefine.AREA_COUNT]; int[] aAreaMultiple = { 40, 30, 20, 10, 5, 5, 5, 5 }; for (int i = 0; i < BumperCarDefine.AREA_COUNT; i++) { aAreaScore[i] = bumperCarInfo.m_lAllJettonScore[i + 1] * aAreaMultiple[i]; } int nMinArea = 1; int nMinScore = aAreaScore[0]; int nMaxArea = 1; int nMaxScore = aAreaScore[0]; for (int i = 1; i < BumperCarDefine.AREA_COUNT; i++) { if (aAreaScore[i] > nMaxScore) { nMaxArea = i + 1; nMaxScore = aAreaScore[i]; } if (aAreaScore[i] < nMinScore) { nMinArea = i + 1; nMinScore = aAreaScore[i]; } } curBettingInfo.nMinArea = nMinArea; curBettingInfo.nMinScore = nMinScore; curBettingInfo.nMaxArea = nMaxArea; curBettingInfo.nMaxScore = nMaxScore; return(curBettingInfo); }
// added by usc at 2014/02/27 private CurBettingInfo GetCurBettingInfo(DiceInfo diceInfo) { CurBettingInfo curBettingInfo = new CurBettingInfo(); int[] aAreaScore = { 0, 0, 0, 0 }; for (int i = 0; i < 4; i++) { aAreaScore[i] = diceInfo.m_lPlayerBetAll[i]; } int nMinArea = 0; int nMinScore = aAreaScore[0]; int nMaxScore = aAreaScore[0]; for (int i = 1; i < 4; i++) { if (aAreaScore[i] > nMaxScore) { nMaxScore = aAreaScore[i]; } if (aAreaScore[i] < nMinScore) { nMinArea = i; nMinScore = aAreaScore[i]; } } curBettingInfo.nMinArea = nMinArea; curBettingInfo.nMinScore = nMinScore; curBettingInfo.nMaxScore = nMaxScore; return(curBettingInfo); }
public override void NotifyGameTimer(GameTimer gameTimer) { if (gameTimer.timerId != TimerID.Custom || gameTimer.autoInfo == null) { return; } int[] bettingScores = new int[] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 10000, 10000, 10000, 10000, 10000 /*, * 100000*/}; // added by usc at 2014/02/27 BumperCarInfo bumperCarInfo = (BumperCarInfo)_GameTable.GetTableInfo(); int[] aAreaMultiple = { 40, 30, 20, 10, 5, 5, 5, 5 }; CurBettingInfo curBettingInfo = GetCurBettingInfo(bumperCarInfo); int nBettingArea = curBettingInfo.nMinArea; int nMinScore = curBettingInfo.nMinScore; int nMaxArea = curBettingInfo.nMaxArea; int nMaxScore = curBettingInfo.nMaxScore; int nScore = 0; if (nMaxScore <= 1000 * aAreaMultiple[nMaxArea - 1]) { if (nMaxScore == 0) { nScore = (int)(Math.Pow(10, (double)(_random.Next() % 2) + 2)); } else { nScore = bettingScores[_random.Next() % bettingScores.Length]; } nBettingArea = _random.Next() % BumperCarDefine.AREA_COUNT + 1; } else { int nReaptCnt = 0; while (true) { nReaptCnt++; nScore = bettingScores[_random.Next() % bettingScores.Length]; if (nMinScore + nScore * aAreaMultiple[nBettingArea - 1] <= nMaxScore + nMaxScore * _random.Next(25, 75) / 100) { break; } if (nReaptCnt > 20) { break; } } } BettingInfo bettingInfo = new BettingInfo(); bettingInfo._Area = nBettingArea; bettingInfo._Score = nScore; bettingInfo._UserIndex = _GameTable.GetPlayerIndex(gameTimer.autoInfo); Action(NotifyType.Request_Betting, bettingInfo, gameTimer.autoInfo); }
public override void NotifyGameTimer(GameTimer gameTimer) { if (gameTimer.timerId != TimerID.Custom || gameTimer.autoInfo == null) { return; } int[] bettingScores = new int[] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 10000, 10000, 10000, 10000, 10000, /*100000 , 100000, * 500000*/}; // added by usc at 2014/02/26 DiceInfo diceInfo = (DiceInfo)_GameTable.GetTableInfo(); CurBettingInfo curBettingInfo = GetCurBettingInfo(diceInfo); int nBettingArea = curBettingInfo.nMinArea; int nMinScore = curBettingInfo.nMinScore; int nMaxScore = curBettingInfo.nMaxScore; int nScore = 0; if (nMaxScore <= 1000) { if (nMaxScore == 0) { nScore = (int)(Math.Pow(10, (double)(_random.Next() % 2) + 2)); } else { nScore = bettingScores[_random.Next() % bettingScores.Length]; } nBettingArea = _random.Next() % 4; } else { int nReaptCnt = 0; while (true) { nReaptCnt++; nScore = bettingScores[_random.Next() % bettingScores.Length]; if (nMinScore + nScore <= nMaxScore + nMaxScore * _random.Next(25, 75) / 100) { break; } if (nReaptCnt > 20) { break; } } } // added by usc at 2014/03/19 if (nMinScore + nScore > 50000) { return; } BettingInfo bettingInfo = new BettingInfo(); bettingInfo._Area = nBettingArea; bettingInfo._Score = nScore; bettingInfo._UserIndex = _GameTable.GetPlayerIndex(gameTimer.autoInfo); Action(NotifyType.Request_Betting, bettingInfo, gameTimer.autoInfo); }