Add boosters to card sorting
This commit is contained in:
@@ -939,7 +939,7 @@ GameObject:
|
|||||||
- component: {fileID: 818930088}
|
- component: {fileID: 818930088}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: MainCanvas
|
m_Name: MainCanvas
|
||||||
m_TagString: Untagged
|
m_TagString: MainCanvas
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
|
|||||||
@@ -66,11 +66,12 @@ namespace Minigames.CardSorting.Controllers
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate booster pack reward based on performance.
|
/// Calculate booster pack reward based on performance.
|
||||||
|
/// Formula: Number of correctly sorted cards divided by 10, rounded down.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CalculateBoosterReward()
|
public int CalculateBoosterReward()
|
||||||
{
|
{
|
||||||
// Simple: 1 booster per correct sort (or use settings multiplier)
|
// Award 1 booster pack per 10 correctly sorted cards
|
||||||
return correctSorts * settings.BoosterPacksPerCorrectItem;
|
return (correctSorts / 10) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -325,10 +325,11 @@ namespace Minigames.CardSorting.Core
|
|||||||
|
|
||||||
private IEnumerator EndGameSequence()
|
private IEnumerator EndGameSequence()
|
||||||
{
|
{
|
||||||
// Calculate rewards
|
// Calculate rewards based on correctly sorted cards
|
||||||
int boosterReward = Score.CalculateBoosterReward();
|
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
|
// Show booster pack reward UI and wait for completion
|
||||||
if (boosterReward > 0)
|
if (boosterReward > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user