public OnBoardDragon(Vector2Int targetPosition, Board board, CardDragon cardDragon)
    {
        DragonGenerator = GameObject.Find("DragonGenerator").GetComponent <DragonGenerator>();

        Board            = board;
        DestructibleType = DRAGON;

        BoardY   = targetPosition.y;
        BoardX   = targetPosition.x;
        ProjectY = BoardY;
        ProjectX = BoardX;


        Health    = cardDragon.MaxHealth;
        MaxHealth = cardDragon.MaxHealth;
        Speed     = cardDragon.Speed;
        Attack    = cardDragon.Attack;
        Range     = cardDragon.Range;
        Name      = cardDragon.Name;
        Type      = cardDragon.Type;
        Race      = cardDragon.Race;
        Owner     = cardDragon.Owner;

        SpeedRemained = 0;
        CanAttack     = false;
        CanRetaliate  = true;
        Alive         = true;

        Board.Destructables[BoardY, BoardX] = this;
    }
示例#2
0
    void StartGame()
    {
        if (PlayerInfoScene.Instance.PhotonPresent != 0)
        {
            Players[0].Race = chosenElements[0];
            Players[1].Race = chosenElements[1];
        }

        int other     = 3 - PlayerInfoScene.Instance.playerId;
        int otherRace = Players[other - 1].Race;

        DragonGenerator dragonGenerator = GameObject.Find("DragonGenerator").GetComponent <DragonGenerator>();
        GameObject      otherQueen      = GameObject.Find("Opponent");

        dragonGenerator.ApplyRaceToQueen(otherQueen, otherRace);

        for (int i = 0; i < NR_CARD_DRAGONS_START; i++)
        {
            GiveCardDragon(0);
            GiveCardDragon(1);
            Debug.Log($"Given {i+1} card");
        }
        //Debug.Log("Direct mesajul");

        for (int i = 0; i < NR_CARD_SPELLS_START; i++)
        {
            Debug.Log($"Given {i + 1} spell");
            GiveCardSpell(0);
            GiveCardSpell(1);
            Debug.Log($"Given {i + 1} spell");
        }
        //Debug.Log("Direct mesajul");
        Players[0].ResetTurn(GoldBonus, MaxManaBonus, MaxFoodBonus);
        turn = 1;
        UpdateTurnText(0);
        UpdateResources();
        UpdateAllStats();

        if (PlayMusic && PlayerInfoScene.Instance.PlayMusic)
        {
            GetComponent <AudioSource>().Play();
        }
    }