This commit is contained in:
2026-09-19 10:29:15 +02:00
2 changed files with 131 additions and 87 deletions
+77 -75
View File
@@ -173,13 +173,9 @@ namespace Casino
{
decimal multiplikator = 0m;
// Wichtig:
// Bei jeder neuen Drehung wieder bei 0 anfangen.
highestWin = 0;
// -----------------------------------------------------
// ==========================================
// WAAGERECHT
// -----------------------------------------------------
// ==========================================
for (int row = 0; row < 3; row++)
{
@@ -193,9 +189,10 @@ namespace Casino
);
}
// -----------------------------------------------------
// ==========================================
// SENKRECHT
// -----------------------------------------------------
// ==========================================
for (int col = 0; col < 6; col++)
{
@@ -206,9 +203,10 @@ namespace Casino
);
}
// -----------------------------------------------------
// ==========================================
// X-MUSTER
// -----------------------------------------------------
// ==========================================
bool x1 =
board[0, 0] == board[1, 1] &&
@@ -218,9 +216,12 @@ namespace Casino
board[0, 5] == board[1, 4] &&
board[1, 4] == board[2, 3];
if (x1 &&
bool xMuster =
x1 &&
x2 &&
board[0, 0] == board[0, 5])
board[0, 0] == board[0, 5];
if (xMuster)
{
multiplikator += X_MUSTER;
@@ -228,9 +229,10 @@ namespace Casino
highestWin = Math.Max(highestWin, 7);
}
// -----------------------------------------------------
// ==========================================
// RAND
// -----------------------------------------------------
// ==========================================
int randId = board[0, 0];
@@ -260,14 +262,12 @@ namespace Casino
highestWin = Math.Max(highestWin, 8);
}
// -----------------------------------------------------
// X + RAND
// -----------------------------------------------------
if (randGleich &&
x1 &&
x2 &&
board[0, 0] == board[0, 5])
// ==========================================
// X + RAND
// ==========================================
if (randGleich && xMuster)
{
multiplikator += X_UND_RAND;
@@ -275,18 +275,20 @@ namespace Casino
highestWin = Math.Max(highestWin, 9);
}
// -----------------------------------------------------
// ==========================================
// FULLBOARD
// -----------------------------------------------------
// ==========================================
int first = board[0, 0];
bool fullBoard = true;
for (int r = 0; r < 3; r++)
for (int row = 0; row < 3; row++)
{
for (int c = 0; c < 6; c++)
for (int col = 0; col < 6; col++)
{
if (board[r, c] != first)
if (board[row, col] != first)
{
fullBoard = false;
break;
@@ -305,15 +307,21 @@ namespace Casino
highestWin = 12;
}
// -----------------------------------------------------
// SOUND ABSPIELEN
// -----------------------------------------------------
if (multiplikator != 0)
// ==========================================
// SOUND
// ==========================================
if (multiplikator > 0)
{
PlayWinSound();
}
// ==========================================
// AUSZAHLUNG
// ==========================================
return einsatz * multiplikator;
}
@@ -324,66 +332,60 @@ namespace Casino
private decimal CheckLine(params int[] werte)
{
if (werte.Length < 3)
return 0m;
decimal gewinn = 0m;
// Größte zusammenhängende Reihe
int maxGleiche = 1;
int start = 0;
// Aktuelle Reihe
int aktuelleGleiche = 1;
// Wir laufen von links nach rechts
for (int i = 1; i < werte.Length; i++)
while (start < werte.Length)
{
if (werte[i] == werte[i - 1])
int gleiche = 1;
while (start + gleiche < werte.Length &&
werte[start + gleiche] == werte[start])
{
aktuelleGleiche++;
}
else
{
aktuelleGleiche = 1;
gleiche++;
}
if (aktuelleGleiche > maxGleiche)
// Nur den höchsten passenden Gewinn dieser Reihe geben
if (gleiche >= 6)
{
maxGleiche = aktuelleGleiche;
gewinn += SECHS;
if (8 > bestSoundId)
bestSoundId = 8;
highestWin++;
}
}
else if (gleiche >= 5)
{
gewinn += FUENF;
// -----------------------------------------------------
// GEWINN BESTIMMEN
// -----------------------------------------------------
if (7 > bestSoundId)
bestSoundId = 7;
if (maxGleiche >= 3)
{
gewinn += DREI;
highestWin++;
}
else if (gleiche >= 4)
{
gewinn += VIER;
// Sound für mindestens 3
highestWin = Math.Max(highestWin, 3);
}
if (6 > bestSoundId)
bestSoundId = 6;
if (maxGleiche >= 4)
{
gewinn += VIER;
highestWin++;
}
else if (gleiche >= 3)
{
gewinn += DREI;
// Sound für mindestens 4
highestWin = Math.Max(highestWin, 4);
}
if (5 > bestSoundId)
bestSoundId = 5;
}
if (maxGleiche >= 5)
{
gewinn += FUENF;
// Sound für mindestens 5
highestWin = Math.Max(highestWin, 5);
}
if (maxGleiche >= 6)
{
gewinn += SECHS;
// Sound für 6
highestWin = Math.Max(highestWin, 6);
start += gleiche;
}
return gewinn;