Slots gefixt
This commit is contained in:
+101
-46
@@ -173,7 +173,10 @@ namespace Casino
|
||||
{
|
||||
decimal multiplikator = 0m;
|
||||
|
||||
// Waagerecht
|
||||
// ==========================================
|
||||
// WAAGERECHT
|
||||
// ==========================================
|
||||
|
||||
for (int row = 0; row < 3; row++)
|
||||
{
|
||||
multiplikator += CheckLine(
|
||||
@@ -185,7 +188,11 @@ namespace Casino
|
||||
board[row, 5]);
|
||||
}
|
||||
|
||||
// Senkrecht
|
||||
|
||||
// ==========================================
|
||||
// SENKRECHT
|
||||
// ==========================================
|
||||
|
||||
for (int col = 0; col < 6; col++)
|
||||
{
|
||||
multiplikator += CheckLine(
|
||||
@@ -194,7 +201,11 @@ namespace Casino
|
||||
board[2, col]);
|
||||
}
|
||||
|
||||
// X Muster
|
||||
|
||||
// ==========================================
|
||||
// X-MUSTER
|
||||
// ==========================================
|
||||
|
||||
bool x1 =
|
||||
board[0, 0] == board[1, 1] &&
|
||||
board[1, 1] == board[2, 2];
|
||||
@@ -203,14 +214,22 @@ namespace Casino
|
||||
board[0, 5] == board[1, 4] &&
|
||||
board[1, 4] == board[2, 3];
|
||||
|
||||
if (x1 && x2 &&
|
||||
board[0, 0] == board[0, 5])
|
||||
bool xMuster =
|
||||
x1 &&
|
||||
x2 &&
|
||||
board[0, 0] == board[0, 5];
|
||||
|
||||
if (xMuster)
|
||||
{
|
||||
multiplikator += X_MUSTER;
|
||||
highestWin++;
|
||||
}
|
||||
|
||||
// Rand
|
||||
|
||||
// ==========================================
|
||||
// RAND
|
||||
// ==========================================
|
||||
|
||||
int randId = board[0, 0];
|
||||
|
||||
bool randGleich =
|
||||
@@ -220,12 +239,14 @@ namespace Casino
|
||||
board[0, 3] == randId &&
|
||||
board[0, 4] == randId &&
|
||||
board[0, 5] == randId &&
|
||||
|
||||
board[2, 0] == randId &&
|
||||
board[2, 1] == randId &&
|
||||
board[2, 2] == randId &&
|
||||
board[2, 3] == randId &&
|
||||
board[2, 4] == randId &&
|
||||
board[2, 5] == randId &&
|
||||
|
||||
board[1, 0] == randId &&
|
||||
board[1, 5] == randId;
|
||||
|
||||
@@ -235,31 +256,39 @@ namespace Casino
|
||||
highestWin++;
|
||||
}
|
||||
|
||||
// X + Rand Bonus
|
||||
if (
|
||||
randGleich &&
|
||||
x1 && x2 &&
|
||||
board[0, 0] == board[0, 5]
|
||||
)
|
||||
|
||||
// ==========================================
|
||||
// X + RAND
|
||||
// ==========================================
|
||||
|
||||
if (randGleich && xMuster)
|
||||
{
|
||||
multiplikator += X_UND_RAND;
|
||||
highestWin++;
|
||||
}
|
||||
|
||||
// Fullboard
|
||||
|
||||
// ==========================================
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fullBoard)
|
||||
break;
|
||||
}
|
||||
|
||||
if (fullBoard)
|
||||
@@ -268,7 +297,20 @@ namespace Casino
|
||||
highestWin = 12;
|
||||
}
|
||||
|
||||
if (multiplikator != 0) PlayWinSound();
|
||||
|
||||
// ==========================================
|
||||
// SOUND
|
||||
// ==========================================
|
||||
|
||||
if (multiplikator > 0)
|
||||
{
|
||||
PlayWinSound();
|
||||
}
|
||||
|
||||
|
||||
// ==========================================
|
||||
// AUSZAHLUNG
|
||||
// ==========================================
|
||||
|
||||
return einsatz * multiplikator;
|
||||
}
|
||||
@@ -276,49 +318,62 @@ namespace Casino
|
||||
// Lenard Gerdes
|
||||
private decimal CheckLine(params int[] werte)
|
||||
{
|
||||
decimal gewinn = 0;
|
||||
if (werte.Length < 3)
|
||||
return 0m;
|
||||
|
||||
int laenge = werte.Length;
|
||||
decimal gewinn = 0m;
|
||||
|
||||
for (int start = 0; start < laenge; start++)
|
||||
int start = 0;
|
||||
|
||||
while (start < werte.Length)
|
||||
{
|
||||
int gleiche = 1;
|
||||
|
||||
for (int next = start + 1; next < laenge; next++)
|
||||
while (start + gleiche < werte.Length &&
|
||||
werte[start + gleiche] == werte[start])
|
||||
{
|
||||
if (werte[next] == werte[start])
|
||||
gleiche++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (gleiche >= 3)
|
||||
{
|
||||
gewinn += DREI;
|
||||
if (5 > bestSoundId) bestSoundId = 5;
|
||||
}
|
||||
|
||||
if (gleiche >= 4)
|
||||
{
|
||||
gewinn += VIER;
|
||||
highestWin++;
|
||||
if (6 > bestSoundId) bestSoundId = 6;
|
||||
}
|
||||
|
||||
if (gleiche >= 5)
|
||||
{
|
||||
gewinn += FUENF;
|
||||
highestWin++;
|
||||
if (7 > bestSoundId) bestSoundId = 7;
|
||||
gleiche++;
|
||||
}
|
||||
|
||||
// Nur den höchsten passenden Gewinn dieser Reihe geben
|
||||
if (gleiche >= 6)
|
||||
{
|
||||
gewinn += SECHS;
|
||||
|
||||
if (8 > bestSoundId)
|
||||
bestSoundId = 8;
|
||||
|
||||
highestWin++;
|
||||
if (8 > bestSoundId) bestSoundId = 8;
|
||||
}
|
||||
else if (gleiche >= 5)
|
||||
{
|
||||
gewinn += FUENF;
|
||||
|
||||
if (7 > bestSoundId)
|
||||
bestSoundId = 7;
|
||||
|
||||
highestWin++;
|
||||
}
|
||||
else if (gleiche >= 4)
|
||||
{
|
||||
gewinn += VIER;
|
||||
|
||||
if (6 > bestSoundId)
|
||||
bestSoundId = 6;
|
||||
|
||||
highestWin++;
|
||||
}
|
||||
else if (gleiche >= 3)
|
||||
{
|
||||
gewinn += DREI;
|
||||
|
||||
if (5 > bestSoundId)
|
||||
bestSoundId = 5;
|
||||
}
|
||||
|
||||
start += gleiche;
|
||||
}
|
||||
|
||||
return gewinn;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user