Finalised AI scripts and added in some limitations to mana and hand size, removed auto draw at the end of each turn, as well as reducing mana top-up each round to 1
This commit is contained in:
@@ -19,6 +19,8 @@ public class DeckController : MonoBehaviour
|
||||
|
||||
public float waitBetweenDrawingCards = .25f;
|
||||
|
||||
public int maxHandSize = 7;
|
||||
|
||||
private List<CardScriptableObject> activeCards = new List<CardScriptableObject>();
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
@@ -73,14 +75,23 @@ public class DeckController : MonoBehaviour
|
||||
|
||||
public void DrawCardForMana()
|
||||
{
|
||||
if (BattleController.instance.playerMana >= drawCardCost)
|
||||
if (BattleController.instance.playerMana >= drawCardCost && HandController.instance.heldCards.Count < maxHandSize)
|
||||
{
|
||||
DrawCardToHand();
|
||||
BattleController.instance.SpendPlayerMana(drawCardCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIController.instance.ShowManaWarning();
|
||||
if(BattleController.instance.playerMana < drawCardCost)
|
||||
{
|
||||
UIController.instance.ShowManaWarning();
|
||||
}
|
||||
else if (HandController.instance.heldCards.Count >= maxHandSize)
|
||||
{
|
||||
UIController.instance.ShowHandSizeWarning();
|
||||
}
|
||||
|
||||
//UIController.instance.ShowManaWarning();
|
||||
UIController.instance.drawCardBtn.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user