示例#1
0
    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();
        }
    }
示例#2
0
 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);
     }
 }
示例#3
0
    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);
    }
示例#4
0
 private void Update()
 {
     if (turnSystem.GetBattleStatus() == BattleStatus.EnemyMove && !alreadyWent)
     {
         usedCard = PickRndCard(getStats.normalskills);
         ClearLists();
         EnemyMove();
     }
     else if (turnSystem.GetBattleStatus() == BattleStatus.EnemyCombat && !alreadyWent)
     {
         ClearLists();
         EnemyCombat();
     }
 }
示例#5
0
    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();
        }
    }
示例#6
0
 public void DrawCard()
 {
     if (turnSystem.GetBattleStatus() == BattleStatus.PlayerCombat)
     {
         //turnSystem.NextTurn();
         if (lastIndex != maxCardCount)
         {
             InstantiateCard(lastIndex);
             lastIndex++;
         }
     }
 }
示例#7
0
 public void DrawCard()
 {
     if (turnSystem.GetBattleStatus() == BattleStatus.Combat && turnSystem.currentTurn == Player.GetComponent <GetStats>())
     {
         //turnSystem.NextTurn();
         if (lastIndex != maxCardCount)
         {
             InstantiateCard(lastIndex);
             lastIndex++;
         }
     }
 }