protected override async Task ProtectedAfterRollingAsync() { SingleInfo !.Score += _model !.Cup !.DiceList.Sum(Items => Items.Value); if (SaveRoot !.IsFaceOff == true) { if (PlayerList.Any(Items => Items.IsFaceOff == true && Items.Score == 0)) { WhoTurn = await PlayerList !.CalculateWhoTurnAsync(); await StartNewTurnAsync(); return; } await ExtendedFaceOffAsync(); return; } SingleInfo.NumberOfRolls++; if (SingleInfo.Score > 21) { await UIPlatform.ShowMessageAsync($"{SingleInfo.NickName} is out for going over 21"); await EndTurnAsync(); return; } await ContinueTurnAsync(); //if they get 21, they are responsible for ending turn. }
internal int Chance(bool assign = false) { if (assign) { Scoreboard["Chance"] = DiceList.Sum(x => x.DiceValue); } return(DiceList.Sum(x => x.DiceValue)); }
protected override async Task ProtectedAfterRollingAsync() { CountdownVMData.ShowHints = false; //you have to choose it everytime. int DiceValue = _model !.Cup !.DiceList.Sum(items => items.Value); if (DiceValue == 12) { await UIPlatform.ShowMessageAsync($"{SingleInfo!.NickName} has to start over again for rolling a 12"); await StartOverAsync(SingleInfo); return; } if (DiceValue == 11) { CountdownPlayerItem thisPlayer; if (WhoTurn == 1) { thisPlayer = PlayerList ![2];
public override async Task EndTurnAsync() { SingleInfo !.Score = _model.Cup !.DiceList.Sum(Items => Items.Value); if (_wasAuto == true && Test !.NoAnimations == false) { await Delay !.DelaySeconds(1); //if auto is done, needs to see what happened. } if (WhoTurn == WhoStarts) { SaveRoot !.MaxRolls = SaveRoot.RollNumber - 1; } WhoTurn = await PlayerList !.CalculateWhoTurnAsync(); //i think if (WhoTurn == WhoStarts) { await GameOverAsync(); return; } await StartNewTurnAsync(); }