Add boosters to card sorting

This commit is contained in:
Michal Pikulski
2025-12-19 16:02:47 +01:00
parent f0905f92d3
commit a9df9487f1
3 changed files with 7 additions and 5 deletions

View File

@@ -939,7 +939,7 @@ GameObject:
- component: {fileID: 818930088}
m_Layer: 5
m_Name: MainCanvas
m_TagString: Untagged
m_TagString: MainCanvas
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0

View File

@@ -66,11 +66,12 @@ namespace Minigames.CardSorting.Controllers
/// <summary>
/// Calculate booster pack reward based on performance.
/// Formula: Number of correctly sorted cards divided by 10, rounded down.
/// </summary>
public int CalculateBoosterReward()
{
// Simple: 1 booster per correct sort (or use settings multiplier)
return correctSorts * settings.BoosterPacksPerCorrectItem;
// Award 1 booster pack per 10 correctly sorted cards
return (correctSorts / 10) + 1;
}
/// <summary>

View File

@@ -325,10 +325,11 @@ namespace Minigames.CardSorting.Core
private IEnumerator EndGameSequence()
{
// Calculate rewards
// Calculate rewards based on correctly sorted cards
int boosterReward = Score.CalculateBoosterReward();
int sortedCards = Score.CorrectSorts;
Logging.Debug($"[SortingGameManager] Game ended! Score: {Score.TotalScore}, Boosters: {boosterReward}");
Logging.Debug($"[SortingGameManager] Game ended! Score: {Score.TotalScore}, Cards sorted: {sortedCards}, Boosters: {boosterReward}");
// Show booster pack reward UI and wait for completion
if (boosterReward > 0)