Exemplo n.º 1
0
    // Investigators have finished
    override public void HeroActivated()
    {
        Game game = Game.Get();

        // Mark all Investigators as finished
        for (int i = 0; i < game.quest.heroes.Count; i++)
        {
            game.quest.heroes[i].activated = true;
        }
        game.quest.phase = Quest.MoMPhase.mythos;
        game.stageUI.Update();
        game.monsterCanvas.UpdateList();

        game.quest.eManager.EventTriggerType("Mythos", false);
        // This will cause the next phase if nothing was added
        game.quest.eManager.TriggerEvent();

        // Display the transition dialog for investigator phase
        ChangePhaseWindow.DisplayTransitionWindow(Quest.MoMPhase.mythos);

        return;
    }
Exemplo n.º 2
0
    // Check if there are events that are required at the end of the round
    public override bool CheckNewRound()
    {
        Game game = Game.Get();

        // Return if there is an event open
        if (game.quest.eManager.currentEvent != null)
        {
            return(false);
        }

        // Return if there is an event queued
        if (game.quest.eManager.eventStack.Count > 0)
        {
            return(false);
        }

        if (game.quest.phase == Quest.MoMPhase.investigator)
        {
            return(false);
        }

        if (game.quest.phase == Quest.MoMPhase.mythos)
        {
            if (game.quest.monsters.Count > 0)
            {
                if (ActivateMonster())
                {
                    // no monster can be activated (activation conditions may prevent existing monster from doing anything), switch to horror phase
                    game.quest.phase = Quest.MoMPhase.horror;
                    game.stageUI.Update();
                    return(false);
                }
                // this is a recursive call, so we don't want to bring back monsters, if we have reached the end of activations
                else if (game.quest.phase != Quest.MoMPhase.horror)
                {
                    // going through monster activation: switch to phase monsters
                    game.quest.phase = Quest.MoMPhase.monsters;
                    game.stageUI.Update();
                    return(game.quest.eManager.currentEvent != null);
                }
            }
            else
            {
                game.quest.phase = Quest.MoMPhase.horror;
                game.stageUI.Update();
                EndRound();
                return(game.quest.eManager.currentEvent != null);
            }
        }

        if (game.quest.phase == Quest.MoMPhase.monsters)
        {
            game.quest.phase = Quest.MoMPhase.horror;
            game.stageUI.Update();
            return(false);
        }

        // we need this test to make sure user can do the horro test, as a random event would switch the game to investigator phase
        if (!endRoundRequested && game.quest.phase == Quest.MoMPhase.horror && game.quest.monsters.Count > 0)
        {
            return(false);
        }

        // Finishing the round

        // reset the endRound Request
        endRoundRequested = false;

        // Clear all investigator activated
        foreach (Quest.Hero h in game.quest.heroes)
        {
            h.activated = false;
        }

        //  Clear monster activations
        foreach (Quest.Monster m in game.quest.monsters)
        {
            m.activated         = false;
            m.minionStarted     = false;
            m.masterStarted     = false;
            m.currentActivation = null;
        }

        // Advance to next round
        int round = Mathf.RoundToInt(game.quest.vars.GetValue("#round")) + 1;

        game.quest.vars.SetValue("#round", round);

        game.quest.log.Add(new Quest.LogEntry(new StringKey("val", "PHASE_INVESTIGATOR").Translate()));

        game.quest.phase = Quest.MoMPhase.investigator;
        game.stageUI.Update();
        game.monsterCanvas.UpdateList();

        game.audioControl.PlayTrait("newround");

        // Start of round events
        game.quest.eManager.EventTriggerType("StartRound");
        SaveManager.Save(0);

        // Display the transition dialog for investigator phase
        ChangePhaseWindow.DisplayTransitionWindow(Quest.MoMPhase.investigator);

        return(true);
    }