Skip to content

Commit

Permalink
Fixed random chance on level data
Browse files Browse the repository at this point in the history
  • Loading branch information
Greenfoot5 committed Nov 30, 2024
1 parent b5aad5d commit e6047b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tower Defence/Assets/Levels/Maps/Upgrade/LD_Upgrade.asset
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ MonoBehaviour:
selectionChoices: 4
hiddenMode: 2
hiddenChoices: 2
hiddenChance: 0.25
hiddenChance: 0.2
selectionCostFormula: 0.17*x^2+19*x+41
health:
useConstant: 0
Expand Down
2 changes: 1 addition & 1 deletion Tower Defence/Assets/UI/Shop/GenerateShopSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private bool ShouldHide(int selectionIndex)
{
HiddenMode.Disabled => false,
HiddenMode.Count => _levelData.selectionChoices - (selectionIndex + 1) < _levelData.hiddenChoices,
HiddenMode.Chance => Shop.random.Next() > _levelData.hiddenChance,
HiddenMode.Chance => Shop.random.Next() < _levelData.hiddenChance,
_ => throw new Exception("Invalid hidden mode")
};
}
Expand Down
1 change: 0 additions & 1 deletion Tower Defence/Assets/UI/Shop/Shop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ [SerializeField] [Tooltip("The generic turret button prefab")]

public static Squirrel3 random;
[Tooltip("The previous state of the random before the current selection")]
[HideInInspector]
public static Tuple<int, int> oldState;

/// <summary>
Expand Down

0 comments on commit e6047b0

Please sign in to comment.