m |
m |
||
| Line 1: | Line 1: | ||
| − | + | ==== What is a Mulligan? ==== | |
| − | + | A mulligan allows players to return their initial hand of cards and draw a new set. This mechanism is essential for maintaining balance and fairness, ensuring that players have a chance to start with usable cards.<br> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
<center><img src="https://www.shadowera.com/landing/img/blog-separator-2.png" ></center><br> | <center><img src="https://www.shadowera.com/landing/img/blog-separator-2.png" ></center><br> | ||
| − | == Code Summary and Detailed Code == | + | ==== Code Summary and Detailed Code ==== |
{| class="wikitable" code-table" | {| class="wikitable" code-table" | ||
|- | |- | ||
| Line 27: | Line 20: | ||
| style="vertical-align: top;" | | | style="vertical-align: top;" | | ||
* Mulligan | * Mulligan | ||
| + | * Hand | ||
| + | * Draw | ||
| + | * Discard | ||
| + | * Shuffle | ||
|- | |- | ||
! colspan="2" | <center>SUMMARY OF THE MULLIGAN PROCESS:</center> | ! colspan="2" | <center>SUMMARY OF THE MULLIGAN PROCESS:</center> | ||
|- | |- | ||
|colspan="2" | | |colspan="2" | | ||
| + | # `GameManager.mpGameOptions.mulligans`:<br>Checks whether the mulligan feature is enabled in the game's settings. | ||
# `GameManager.RecordMove(MoveTypeEnum.mulligan, null)` :<br>Records the action of performing a mulligan in the game history. | # `GameManager.RecordMove(MoveTypeEnum.mulligan, null)` :<br>Records the action of performing a mulligan in the game history. | ||
# `PlayerController.Mulligan(null)` :<br>Called when the player initiates a mulligan. It can either skip the mulligan or proceed based on the game state. | # `PlayerController.Mulligan(null)` :<br>Called when the player initiates a mulligan. It can either skip the mulligan or proceed based on the game state. | ||
| Line 41: | Line 39: | ||
# `GameModel.Draw(int side)` :<br>Called during the `mulliganDraw` state to draw new cards for the specified player side. It handles the card drawing mechanics. | # `GameModel.Draw(int side)` :<br>Called during the `mulliganDraw` state to draw new cards for the specified player side. It handles the card drawing mechanics. | ||
# `GameModel.CurSide()` :<br>Retrieves the current player side, ensuring the appropriate player is drawing cards during the mulligan process. | # `GameModel.CurSide()` :<br>Retrieves the current player side, ensuring the appropriate player is drawing cards during the mulligan process. | ||
| + | # `GameModel.GetHand(int index)` :<br>Retrieves a specific card from the player's hand, essential for evaluating what cards are available during the mulligan. | ||
| + | # `GameModel.CurrentResources` :<br>Retrieves the current resources available to the player, important for determining if the cards in hand are playable. | ||
|- | |- | ||
! colspan="2" | <center>DETAILED CODE</center> | ! colspan="2" | <center>DETAILED CODE</center> | ||
| Line 50: | Line 50: | ||
public enum MoveTypeEnum | public enum MoveTypeEnum | ||
{ | { | ||
| − | mulligan, | + | mulligan, // Represents the mulligan action |
// other move types... | // other move types... | ||
} | } | ||
| Line 57: | Line 57: | ||
public void Mulligan() | public void Mulligan() | ||
{ | { | ||
| + | // Check if no card is clicked and graveyard/deck lists are not showing | ||
if (clickedCard == null && !GraveyardListDisplay.isShowingGraveYard && !DeckListDisplay.isShowingDeck) | if (clickedCard == null && !GraveyardListDisplay.isShowingGraveYard && !DeckListDisplay.isShowingDeck) | ||
{ | { | ||
| − | GameManager.PressedGUIButton(); | + | GameManager.PressedGUIButton(); // Log button press |
| − | GameManager.RecordMove(GameManager.MoveTypeEnum.mulligan, null); | + | GameManager.RecordMove(GameManager.MoveTypeEnum.mulligan, null); // Record the mulligan move |
| − | GameController.Mulligan(null); | + | GameController.Mulligan(null); // Call the Mulligan function in GameController with no specific card |
| − | gameplay.ShowButton(gameplay.buttonBR2Red, "Mulligan"); | + | gameplay.ShowButton(gameplay.buttonBR2Red, "Mulligan"); // Show the Mulligan button |
| + | // If the player confirms the mulligan by pressing the button | ||
if (gameplay.button2Pressed) | if (gameplay.button2Pressed) | ||
{ | { | ||
| − | GameManager.PressedGUIButton(); | + | GameManager.PressedGUIButton(); // Log button press |
| − | GameManager.RecordMove(GameManager.MoveTypeEnum.mulligan, GameModel.GetHero()); | + | GameManager.RecordMove(GameManager.MoveTypeEnum.mulligan, GameModel.GetHero()); // Record the move with the hero |
| − | GameController.Mulligan(GameModel.GetHero()); | + | GameController.Mulligan(GameModel.GetHero()); // Call the Mulligan function with the selected hero |
} | } | ||
} | } | ||
| Line 76: | Line 78: | ||
public void Mulligan(ShadowEraCard card) | public void Mulligan(ShadowEraCard card) | ||
{ | { | ||
| − | if (card == null) | + | if (card == null) // If no specific card is selected |
{ | { | ||
DebugLogger.Log("GameController Mulligan Skipped - curSide " + GameModel.CurSide() + " turnCounter " + GameModel.turnCounter); | DebugLogger.Log("GameController Mulligan Skipped - curSide " + GameModel.CurSide() + " turnCounter " + GameModel.turnCounter); | ||
| − | GameModel.SetCurSide(1 - GameModel.CurSide()); | + | GameModel.SetCurSide(1 - GameModel.CurSide()); // Change the current side |
| − | GameModel.turnCounter++; | + | GameModel.turnCounter++; // Increment the turn counter |
} | } | ||
| − | else | + | else // If a specific card is selected |
{ | { | ||
DebugLogger.Log("GameController Mulligan - curSide " + GameModel.CurSide() + " turnCounter " + GameModel.turnCounter); | DebugLogger.Log("GameController Mulligan - curSide " + GameModel.CurSide() + " turnCounter " + GameModel.turnCounter); | ||
GameModel.DiscardCard(card); // Discard the selected card | GameModel.DiscardCard(card); // Discard the selected card | ||
GameModel.ShuffleDeck(); // Shuffle the deck after discarding | GameModel.ShuffleDeck(); // Shuffle the deck after discarding | ||
| − | GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw); // Transition to mulligan draw state | + | GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw); // Transition to the mulligan draw state |
} | } | ||
} | } | ||
| Line 97: | Line 99: | ||
} | } | ||
| + | // DiscardCard function to handle removing a specified card from the player's hand | ||
public void DiscardCard(ShadowEraCard card) | public void DiscardCard(ShadowEraCard card) | ||
{ | { | ||
| − | + | ||
} | } | ||
| + | // Logic to shuffle the player's deck | ||
public void ShuffleDeck() | public void ShuffleDeck() | ||
{ | { | ||
| − | + | ||
} | } | ||
| + | // Logic to change the game state | ||
public void GameStateActivate(GameState.GameStateType newState) | public void GameStateActivate(GameState.GameStateType newState) | ||
{ | { | ||
| − | + | ||
} | } | ||
| Line 115: | Line 120: | ||
public void Update(float deltaTime) | public void Update(float deltaTime) | ||
{ | { | ||
| − | switch (GameModel.CurGameState()) | + | switch (GameModel.CurGameState()) // Check the current game state |
{ | { | ||
case GameState.GameStateType.mulligan: | case GameState.GameStateType.mulligan: | ||
| Line 123: | Line 128: | ||
if (stateTime == deltaTime) | if (stateTime == deltaTime) | ||
{ | { | ||
| − | for (int i = 0; i < 5; i++) | + | for (int i = 0; i < 5; i++) // Draw 5 new cards for the player |
{ | { | ||
| − | GameModel.Draw(GameModel.CurSide()); | + | GameModel.Draw(GameModel.CurSide()); |
} | } | ||
} | } | ||
| Line 137: | Line 142: | ||
pre, | pre, | ||
draw, | draw, | ||
| − | mulligan, | + | mulligan, // Mulligan state |
| − | mulliganDraw, | + | mulliganDraw, // State when drawing new cards after a mulligan |
sacrifice, | sacrifice, | ||
action, | action, | ||
// other states... | // other states... | ||
| + | } | ||
| + | |||
| + | // AIController.cs (if applicable for automated actions) | ||
| + | public void HandleMulligan() // Located in AIController.cs | ||
| + | { | ||
| + | // Logic to automatically decide on a mulligan based on AI criteria | ||
} | } | ||
</syntaxhighlight></small> | </syntaxhighlight></small> | ||
|} | |} | ||
| + | <center><img src="https://www.shadowera.com/landing/img/blog-separator-2.png" ></center><br> | ||
| + | |||
| + | ==== A Hidden Mulligan ==== | ||
| + | While the game's code incorporates a mulligan feature, it is not directly accessible in the game options. Players cannot see or adjust this option, suggesting that the developers may have chosen to obscure it, either for gameplay reasons or because it is not yet ready for public use.<br> | ||
| + | <br> | ||
| + | '''Logical Inconsistencies'''<br> | ||
| + | The logic behind the mulligan mechanic in Shadow Era presents several inconsistencies:<br> | ||
| + | Discarding and Drawing: The code allows a player to discard a single card and then draw 5 new cards. This mechanism creates a starting hand that can reach 10 cards, which contradicts the expected balance in a card game. Having so many cards right from the start can favor unbalanced strategies, diminishing the impact of chance and strategy in the game.<br><br> | ||
| + | |||
| + | '''Lack of Clarity on Discarded Cards''':<br> | ||
| + | The code does not specify what happens to discarded cards. Are they returned to the deck or set aside? This ambiguity regarding the management of discarded cards adds to the overall uncertainty of the mechanic.<br><br> | ||
| + | The mulligan mechanic in Shadow Era '''appears to be an unfinished feature''' that requires adjustments to ensure balance and clarity in gameplay. Hidden from players and accompanied by questionable logic, this functionality raises concerns about its integration and effectiveness.<br><br> | ||
| + | |||
| + | For both players and developers, it is essential to reconsider this option to enhance and coherently integrate it into the overall gaming experience. | ||
<center><img src="https://www.shadowera.com/landing/img/blog-separator-2.png" ></center><br> | <center><img src="https://www.shadowera.com/landing/img/blog-separator-2.png" ></center><br> | ||
<br><br> | <br><br> | ||
[[Category:Shuffle]] | [[Category:Shuffle]] | ||
A mulligan allows players to return their initial hand of cards and draw a new set. This mechanism is essential for maintaining balance and fairness, ensuring that players have a chance to start with usable cards.

| |
|
|---|---|
|
|
| | |
| |
| | |
| This code is a collection of all the functions involved in the shuffle mechanic, though it doesn't exist as a single block in any one file. | |
// GameManager.cs public enum MoveTypeEnum { mulligan, // Represents the mulligan action // other move types... } // PlayerController.cs public void Mulligan() { // Check if no card is clicked and graveyard/deck lists are not showing if (clickedCard == null && !GraveyardListDisplay.isShowingGraveYard && !DeckListDisplay.isShowingDeck) { GameManager.PressedGUIButton(); // Log button press GameManager.RecordMove(GameManager.MoveTypeEnum.mulligan, null); // Record the mulligan move GameController.Mulligan(null); // Call the Mulligan function in GameController with no specific card gameplay.ShowButton(gameplay.buttonBR2Red, "Mulligan"); // Show the Mulligan button // If the player confirms the mulligan by pressing the button if (gameplay.button2Pressed) { GameManager.PressedGUIButton(); // Log button press GameManager.RecordMove(GameManager.MoveTypeEnum.mulligan, GameModel.GetHero()); // Record the move with the hero GameController.Mulligan(GameModel.GetHero()); // Call the Mulligan function with the selected hero } } } // GameController.cs public void Mulligan(ShadowEraCard card) { if (card == null) // If no specific card is selected { DebugLogger.Log("GameController Mulligan Skipped - curSide " + GameModel.CurSide() + " turnCounter " + GameModel.turnCounter); GameModel.SetCurSide(1 - GameModel.CurSide()); // Change the current side GameModel.turnCounter++; // Increment the turn counter } else // If a specific card is selected { DebugLogger.Log("GameController Mulligan - curSide " + GameModel.CurSide() + " turnCounter " + GameModel.turnCounter); GameModel.DiscardCard(card); // Discard the selected card GameModel.ShuffleDeck(); // Shuffle the deck after discarding GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw); // Transition to the mulligan draw state } } // GameModel.cs public int HandCount() { // Returns the number of cards in the player's hand } // DiscardCard function to handle removing a specified card from the player's hand public void DiscardCard(ShadowEraCard card) { } // Logic to shuffle the player's deck public void ShuffleDeck() { } // Logic to change the game state public void GameStateActivate(GameState.GameStateType newState) { } // Gameplay.cs public void Update(float deltaTime) { switch (GameModel.CurGameState()) // Check the current game state { case GameState.GameStateType.mulligan: // Handle actions specific to the mulligan state break; case GameState.GameStateType.mulliganDraw: if (stateTime == deltaTime) { for (int i = 0; i < 5; i++) // Draw 5 new cards for the player { GameModel.Draw(GameModel.CurSide()); } } break; } } // GameState.cs public enum GameStateType { pre, draw, mulligan, // Mulligan state mulliganDraw, // State when drawing new cards after a mulligan sacrifice, action, // other states... } // AIController.cs (if applicable for automated actions) public void HandleMulligan() // Located in AIController.cs { // Logic to automatically decide on a mulligan based on AI criteria } | |

While the game's code incorporates a mulligan feature, it is not directly accessible in the game options. Players cannot see or adjust this option, suggesting that the developers may have chosen to obscure it, either for gameplay reasons or because it is not yet ready for public use.
Logical Inconsistencies
The logic behind the mulligan mechanic in Shadow Era presents several inconsistencies:
Discarding and Drawing: The code allows a player to discard a single card and then draw 5 new cards. This mechanism creates a starting hand that can reach 10 cards, which contradicts the expected balance in a card game. Having so many cards right from the start can favor unbalanced strategies, diminishing the impact of chance and strategy in the game.
Lack of Clarity on Discarded Cards:
The code does not specify what happens to discarded cards. Are they returned to the deck or set aside? This ambiguity regarding the management of discarded cards adds to the overall uncertainty of the mechanic.
The mulligan mechanic in Shadow Era appears to be an unfinished feature that requires adjustments to ensure balance and clarity in gameplay. Hidden from players and accompanied by questionable logic, this functionality raises concerns about its integration and effectiveness.
For both players and developers, it is essential to reconsider this option to enhance and coherently integrate it into the overall gaming experience.
