private void Update() { if (turnSystem.GetBattleStatus() == BattleStatus.Move && !alreadyWent && turnSystem.currentTurn == getStats) { foundCard = false; ClearLists(); possibleCards.AddRange(getStats.normalskills); do { usedCard = PickRndCard(possibleCards.ToArray()); possibleCards.Remove(usedCard); if (getStats.character.currentMana >= usedCard.manaCost) { foundCard = true; } } while (!foundCard); EnemyMove(); } else if (turnSystem.GetBattleStatus() == BattleStatus.Combat && !alreadyWent && turnSystem.currentTurn == getStats) { ClearLists(); EnemyCombat(); } }
private void Update() { if (isSelected && turnSystem.GetBattleStatus() == BattleStatus.Combat && turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { gridGenerator.DestroyTiles(DestroyOption.rangeTiles, true, true); gridGenerator.GenerateSkillTiles(getCardInfo.card.ranges, getCardInfo.card.targetType, cardSystem.Player, TypesofValue.relative, true); } }
public bool cast(Card card, EditedGridGenerator _gridGenerator, GameObject user, BattleStatus battleStatus, GetStats turn) { targets = 0; gridGenerator = _gridGenerator; if (turnSystem.GetBattleStatus() != battleStatus && turnSystem.currentTurn != turn && turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { if (turnSystem.currentTurn == player.GetComponent <GetStats>()) { gridGenerator.DestroyTiles(DestroyOption.selectedTiles, true, true); Debug.Log("Its not the right stage to play a card"); } return(false); } if (user.GetComponent <GetStats>().character.currentMana >= card.manaCost) { foreach (GameObject tile in gridGenerator.selectedTiles) { foreach (GameObject tile1 in gridGenerator.rangeTiles) { //Debug.Log($"{tile.transform.position.x} == {tile1.transform.position.x} && {tile.transform.position.z} == {tile1.transform.position.z} "); if (tile.transform.position.x == tile1.transform.position.x && tile.transform.position.z == tile1.transform.position.z) { parametersObjects.Add(user); parametersObjects.Add(tile); skillInfo.SetCardID(card); user.GetComponent <GetStats>().lastcastedSkill = card; this.SendMessage(card.skill.ToString(), parametersObjects); targets++; if (targets >= card.maxAmountOfTargets) { return(true); } } } } if (targets == 0) { if (turnSystem.GetBattleStatus() != BattleStatus.Move && turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { Debug.Log("Select valid targets"); gridGenerator.DestroyTiles(DestroyOption.all, true, true); } return(false); } } else { if (turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { Debug.Log("You dont have enough mana for this ability"); } return(false); } return(false); }
private void Update() { if (turnSystem.GetBattleStatus() == BattleStatus.EnemyMove && !alreadyWent) { usedCard = PickRndCard(getStats.normalskills); ClearLists(); EnemyMove(); } else if (turnSystem.GetBattleStatus() == BattleStatus.EnemyCombat && !alreadyWent) { ClearLists(); EnemyCombat(); } }
void Update() { Rotate(); if (turnSystem.GetBattleStatus() == BattleStatus.PlayerMove) { if (!tracked) { gridGenerator.GenerateSkillTiles(getStats.character.movementCard.ranges, getStats.character.movementCard.targetType, this.gameObject, TypesofValue.relative, true); tracked = true; } checkRayCast(); } }
public void DrawCard() { if (turnSystem.GetBattleStatus() == BattleStatus.PlayerCombat) { //turnSystem.NextTurn(); if (lastIndex != maxCardCount) { InstantiateCard(lastIndex); lastIndex++; } } }
public void DrawCard() { if (turnSystem.GetBattleStatus() == BattleStatus.Combat && turnSystem.currentTurn == Player.GetComponent <GetStats>()) { //turnSystem.NextTurn(); if (lastIndex != maxCardCount) { InstantiateCard(lastIndex); lastIndex++; } } }