Example #1
0
 private void NextLevel()
 {
     isStageFinished = true;
     // Replay same level for testing purposes
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
     isStageFinished = false;
     stages          = STAGES.stage1;
 }
 public void OnLevelWasLoaded()
 {
     if (Application.loadedLevelName.ToLower() == "battlefield" && Game.game.currentState == Game.GameStates.InGame &&
         !completed && Game.game.currentQuest.name == "Quest2")
     {
         runningTutorial             = true;
         Game.game.currentState      = Game.GameStates.InTutorial;
         Game.game.quickChestEnabled = true;
         stage = STAGES.WAITING_TO_OPEN_QUICK_CHEST;
         Hud.getHud().inventoryCanBeOpen = false;
     }
 }
 public override void tryToTrigger()
 {
     if (Game.game.gameStats.level > 1 && BasicEnemy.sEnemies.Count <= 0 && !runningTutorial)
     {
         Game.game.currentState             = Game.GameStates.InTutorial;
         runningTutorial                    = true;
         Game.game.pauseButtonEnabled       = true;
         Game.game.allowEnemySpawn          = false;
         Game.game.enabledInventoryTabMask |= 1 << (int)Game.TabInventory.STATS;
         Game.game.currentWindowTab         = Game.TabInventory.STATS;
         currentStage = STAGES.WAITING_TO_OPEN_INVENTORY;
     }
 }
    public override void TUpdate()
    {
        if (!runningTutorial)
        {
            return;
        }

        lastTime    = currentTime;
        currentTime = Time.realtimeSinceStartup;
        deltaTime   = currentTime - lastTime;
        deltaTime   = Mathf.Min(deltaTime, Time.maximumDeltaTime);

        switch (stage)
        {
        case STAGES.WAITING_TO_OPEN_QUICK_CHEST:
        {
            if (Hud.getHud().quickPotionState == Hud.QUICKPOTION_STATE.INPLACE)
            {
                stage = STAGES.WAITING_TO_CONSUME_BERSERK_POTION;
                Hud.getHud().quickPotionsCanBeToogled = false;
                nPotions = Hud.getHud().quickInventoryTotalPotions();
            }
        }
        break;

        case STAGES.WAITING_TO_CONSUME_BERSERK_POTION:
        {
            if (nPotions > Hud.getHud().quickInventoryTotalPotions())
            {
                stage = STAGES.WAITING_TO_READ_ICON_MESSAGE;
            }
        }
        break;

        case STAGES.WAITING_TO_READ_ICON_MESSAGE:
        {
            if (Input.GetMouseButtonDown(0))
            {
                runningTutorial = false;
                Hud.getHud().quickPotionsCanBeToogled = true;
                Hud.getHud().inventoryCanBeOpen       = true;
                Game.game.currentState = Game.GameStates.InGame;
                completed = true;
            }
        }
        break;
        }
    }
Example #5
0
    private IEnumerator MoveFunc(Vector3 newPos, GameObject obj, float speed)
    {
        while (true)
        {
            obj.transform.position = Vector3.MoveTowards(obj.transform.position, newPos, speed * Time.deltaTime);

            if (obj.transform.position == newPos)
            {
                if (Camera.main.transform.position == newPos)
                {
                    stages          = STAGES.stage2;
                    isStageFinished = false;
                    gateStage2.SetActive(true);
                }
                yield break;
            }

            yield return(null);
        }
    }
Example #6
0
    void CheckStageFinished()
    {
        if (stages == STAGES.stage1)
        {
            stage1Count--;
            if (stage1Count <= 0)
            {
                Destroy(gateStage1.gameObject);
                stages          = STAGES.bridge;
                isStageFinished = true;

                StartCoroutine(MoveThroughBridge());
            }
        }
        else if (stages == STAGES.stage2)
        {
            stage2Count--;
            if (stage2Count <= 0)
            {
                NextLevel();
            }
        }
    }
    public override void TUpdate()
    {
        base.TUpdate();

        if (!runningTutorial)
        {
            return;
        }

        lastTime    = currentTime;
        currentTime = Time.realtimeSinceStartup;
        deltaTime   = currentTime - lastTime;
        deltaTime   = Mathf.Min(deltaTime, Time.maximumDeltaTime);

        switch (currentStage)
        {
        case STAGES.WAITING_TO_OPEN_INVENTORY:
        {
            if (Hud.getHud() && Hud.getHud().inventoryVisible)
            {
                currentStage = STAGES.WAITING_FOR_UPDATE_STATS;
            }
        }
        break;

        case STAGES.WAITING_FOR_UPDATE_STATS:
        {
            if (Game.game.gameStats.pointsLeft == 0)
            {
                Game.game.enabledInventoryTabMask |= 1 << (int)Game.TabInventory.SKILL_AND_POTIONS;
                currentStage = STAGES.WAITING_FOR_SELECT_SKILLS;
            }
        }
        break;

        case STAGES.WAITING_FOR_SELECT_SKILLS:
        {
            if (Game.game.currentWindowTab == Game.TabInventory.SKILL_AND_POTIONS)
            {
                Game.game.unlockedSkills[0] = true;
                currentStage = STAGES.WAITING_FOR_DROP_SKILL;
            }
        }
        break;

        case STAGES.WAITING_FOR_DROP_SKILL:
        {
            if (Game.game.currentSkills[0] != -1 ||
                Game.game.currentSkills[1] != -1 ||
                Game.game.currentSkills[2] != -1 ||
                Game.game.currentSkills[3] != -1)
            {
                currentStage = STAGES.WAITING_TO_CLOSE_INVENTORY;
            }
        }
        break;

        case STAGES.WAITING_TO_CLOSE_INVENTORY:
        {
            if (!Hud.getHud().inventoryVisible)
            {
                completed       = true;
                runningTutorial = false;
            }
        }
        break;

        default:
            break;
        }
    }
Example #8
0
 void Start()
 {
     stages = STAGES.stage1;
     gateStage2.SetActive(false);
     Invoke(nameof(IgnoreColliders), 1);
 }