mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Updated house edge for lambchop
This commit is contained in:
@@ -29,7 +29,7 @@ public class LambchopCommand : ICommand
|
|||||||
MaxInvocations = 3,
|
MaxInvocations = 3,
|
||||||
Window = TimeSpan.FromSeconds(15)
|
Window = TimeSpan.FromSeconds(15)
|
||||||
};
|
};
|
||||||
private static double _houseEdge = 0.015; // house edge hack?
|
private static double _houseEdge = 0.05; // house edge hack?
|
||||||
|
|
||||||
// game assets
|
// game assets
|
||||||
private const string HAIRSPACE = " ";
|
private const string HAIRSPACE = " ";
|
||||||
@@ -188,20 +188,18 @@ public class LambchopCommand : ICommand
|
|||||||
// i++;
|
// i++;
|
||||||
//continue;
|
//continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// death by wolf
|
||||||
// death by wolf
|
await UpdateGameAsync();
|
||||||
await UpdateGameAsync();
|
hazards[i] = WOLF; // add wolf
|
||||||
hazards[i] = WOLF; // add wolf
|
await UpdateGameAsync();
|
||||||
await UpdateGameAsync();
|
tiles[i] = BLOOD; // blood
|
||||||
tiles[i] = BLOOD; // blood
|
await UpdateGameAsync();
|
||||||
await UpdateGameAsync();
|
tiles[i] = SKULL; // skull
|
||||||
tiles[i] = SKULL; // skull
|
await UpdateGameAsync();
|
||||||
await UpdateGameAsync();
|
break;
|
||||||
break;
|
//i++;
|
||||||
//i++;
|
//continue;
|
||||||
//continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (i == (targetTile - 1) && win) // trigger win animation
|
if (i == (targetTile - 1) && win) // trigger win animation
|
||||||
{
|
{
|
||||||
@@ -232,19 +230,17 @@ public class LambchopCommand : ICommand
|
|||||||
//i++;
|
//i++;
|
||||||
//continue;
|
//continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
// win in the forrest, medal
|
||||||
|
hazards[i] = MEDAL; // add medal
|
||||||
|
if (deathTile != -1 && deathTile < tiles.Count)
|
||||||
{
|
{
|
||||||
// win in the forrest, medal
|
tiles[deathTile] = RED_TILE; // add deathTile indicator
|
||||||
hazards[i] = MEDAL; // add medal
|
|
||||||
if (deathTile != -1 && deathTile < tiles.Count)
|
|
||||||
{
|
|
||||||
tiles[deathTile] = RED_TILE; // add deathTile indicator
|
|
||||||
}
|
|
||||||
await UpdateGameAsync();
|
|
||||||
break;
|
|
||||||
//i++;
|
|
||||||
//continue;
|
|
||||||
}
|
}
|
||||||
|
await UpdateGameAsync();
|
||||||
|
break;
|
||||||
|
//i++;
|
||||||
|
//continue;
|
||||||
}
|
}
|
||||||
if (Money.GetRandomDouble(gambler) <= 0.15)
|
if (Money.GetRandomDouble(gambler) <= 0.15)
|
||||||
{
|
{
|
||||||
@@ -328,22 +324,18 @@ public class LambchopCommand : ICommand
|
|||||||
{
|
{
|
||||||
return -1; // No death tile (player succeeds)
|
return -1; // No death tile (player succeeds)
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
// Player fails - calculate where the death tile appears
|
||||||
|
double riggingFactor = Money.GetRandomDouble(gambler);
|
||||||
|
if (_houseEdge > 0 && riggingFactor < _houseEdge * 2) // shitty hack because I made the decision to clamp houseEdge to max 50%
|
||||||
{
|
{
|
||||||
// Player fails - calculate where the death tile appears
|
// More rigging means death tile is more likely near the end
|
||||||
double riggingFactor = Money.GetRandomDouble(gambler);
|
int minDeathTile = Math.Max(0, FIELD_LENGTH - 3);
|
||||||
if (_houseEdge > 0 && riggingFactor < _houseEdge * 2) // shitty hack because I made the decision to clamp houseEdge to max 50%
|
return Money.GetRandomNumber(gambler, minDeathTile, FIELD_LENGTH); // return 15 means dying on the last tile xd
|
||||||
{
|
|
||||||
// More rigging means death tile is more likely near the end
|
|
||||||
int minDeathTile = Math.Max(0, FIELD_LENGTH - 3);
|
|
||||||
return Money.GetRandomNumber(gambler, minDeathTile, FIELD_LENGTH); // return 15 means dying on the last tile xd
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Player fail, random tile in the path becomes death tile
|
|
||||||
return Money.GetRandomNumber(gambler,0, FIELD_LENGTH);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Player fail, random tile in the path becomes death tile
|
||||||
|
return Money.GetRandomNumber(gambler,0, FIELD_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tiles 1 - 15
|
// Tiles 1 - 15
|
||||||
@@ -370,16 +362,14 @@ public class LambchopCommand : ICommand
|
|||||||
// extra rigged fail, choose tile just before target tile
|
// extra rigged fail, choose tile just before target tile
|
||||||
return targetTile > 1 ? targetTile - 1 : 1;
|
return targetTile > 1 ? targetTile - 1 : 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// rigging failed, normal tile return
|
||||||
// rigging failed, normal tile return
|
return Money.GetRandomNumber(gambler,-1, targetTile);
|
||||||
return Money.GetRandomNumber(gambler,-1, targetTile);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return fairDeathTile;
|
return fairDeathTile;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Player would fail in fair game
|
// Player would fail in fair game
|
||||||
double riggingFactor = Money.GetRandomDouble(gambler);
|
double riggingFactor = Money.GetRandomDouble(gambler);
|
||||||
|
|||||||
Reference in New Issue
Block a user