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:
SHOUTING_PIRATE
2025-04-28 17:25:10 +01:00
parent 11297a3078
commit ab6878fa69
56 changed files with 69508 additions and 5065 deletions

View File

@@ -23,6 +23,8 @@ public class BattleController : MonoBehaviour
public int playerHealth;
public int enemyHealth;
public int manaRefillAmount = 1;
private int currentPlayerMaxMana, currentEnemyMaxMana;
// Start is called once before the first execution of Update after the MonoBehaviour is created
@@ -97,12 +99,16 @@ public class BattleController : MonoBehaviour
case TurnOrder.playerActive:
UIController.instance.endTurnBtn.SetActive(true);
UIController.instance.drawCardBtn.SetActive(true);
if(currentPlayerMaxMana < maxMana)
if (currentPlayerMaxMana < maxMana)
{
currentPlayerMaxMana++;
currentPlayerMaxMana += manaRefillAmount; // Use manaRefillAmount for refill
if (currentPlayerMaxMana > maxMana)
{
currentPlayerMaxMana = maxMana; // Ensure it doesn't exceed maxMana
}
}
FillPlayerMana();
DeckController.instance.DrawMultipleCards(cardsToDrawPerTurn);
//DeckController.instance.DrawMultipleCards(cardsToDrawPerTurn);
break;
case TurnOrder.playerCardAttacks:
CardPointsController.instance.PlayerAttack();
@@ -110,9 +116,13 @@ public class BattleController : MonoBehaviour
case TurnOrder.enemyActive:
//Debug.Log("Skipping enemy actions");
//AdvanceTurn();
if(currentEnemyMaxMana < maxMana)
if (currentEnemyMaxMana < maxMana)
{
currentEnemyMaxMana++;
currentEnemyMaxMana += manaRefillAmount; // Use manaRefillAmount for refill
if (currentEnemyMaxMana > maxMana)
{
currentEnemyMaxMana = maxMana; // Ensure it doesn't exceed maxMana
}
}
FillEnemyMana();
EnemyController.instance.StartAction();