Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (monsterDetected != null && monsterDetected.GetState() == 0)
        {
            MatchController.instance.activatingCard = true;
            MatchController.instance.playerController.AddMonsterToDestroy(monsterDetected.idSpawn);
            monsterDetected.goToCementery = false;
            trapController.ShowCard();

            trapActive = true;
        }
        if (trapActive)
        {
            timer += Time.deltaTime;
            if (timer >= 2)
            {
                if (MatchController.instance.GetPlayerNumber() != trapController.playerOwner)
                {
                    Dealer.instance.AddCardToHand(monsterDetected.idCard);
                }
                MatchController.instance.playerController.DestroyMonsters();
                trapController.DestroyTrap();
            }
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (monsterDetected != null && monsterDetected.GetState() == 0)
        {
            MatchController.instance.activatingCard = true;
            MatchController.instance.playerController.AddMonsterToDestroy(monsterDetected.idSpawn);
            trapController.ShowCard();

            trapActive = true;
        }
        if (trapActive)
        {
            timer += Time.deltaTime;
            if (timer >= 2)
            {
                MatchController.instance.playerController.DestroyMonsters();
                trapController.DestroyTrap();
            }
        }
    }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        if (monsterDetected != null && monsterDetected.GetState() == 0)
        {
            MatchController.instance.activatingCard = true;

            trapController.ShowCard();

            trapActive = true;
        }
        if (trapActive)
        {
            timer += Time.deltaTime;
            if (timer >= 2)
            {
                monsterDetected.accuracy = 50;
                trapController.DestroyTrap();
            }
        }
    }
Esempio n. 4
0
    // Update is called once per frame
    void Update()
    {
        if (monsterDetected != null && monsterDetected.GetState() == 0)
        {
            MatchController.instance.activatingCard = true;

            trapController.ShowCard();

            trapActive = true;
        }
        if (trapActive)
        {
            timer += Time.deltaTime;
            if (timer >= 2)
            {
                MatchController.instance.playerController.HitMonster(-1, MatchController.instance.GetIndexMonsterInGameListWithSpawn(monsterDetected.idSpawn), trapDamage);
                trapController.DestroyTrap();
            }
        }
    }
Esempio n. 5
0
    // Update is called once per frame
    void Update()
    {
        if (idSpawnMonsterFrozen == -1)
        {
            if (monsterDetected != null && monsterDetected.GetState() == 0)
            {
                MatchController.instance.activatingCard = true;

                trapController.ShowCard();
                monsterDetected.frozen = true;
                trapActive             = true;
            }

            if (trapActive)
            {
                timer += Time.deltaTime;
                if (timer >= 2)
                {
                    TrampaDeHielo instance = Instantiate(MatchController.instance.playerController.cards[trapController.idCard].prefabCard, new Vector3(200, 200, 200), Quaternion.identity).GetComponent <TrampaDeHielo>();
                    instance.SetFrozenMonster(monsterDetected.idSpawn, MatchController.instance.GetTurnNumber());
                    trapController.DestroyTrap();
                }
            }
        }
        else
        {
            if (MatchController.instance.GetTurnNumber() > turnActiveTrap + 1)
            {
                if (MatchController.instance.GetIndexMonsterInGameListWithSpawn(idSpawnMonsterFrozen) != -1)
                {
                    MatchController.instance.monstersInGame[MatchController.instance.GetIndexMonsterInGameListWithSpawn(idSpawnMonsterFrozen)].frozen = false;
                }
                trapController.goToCementery = false;
                trapController.DestroyTrap();
            }
        }
    }