Esempio n. 1
0
        public static void Main(string[] args)
        {
            // changes here
            DnDContext context = new DnDContext();

            Console.WindowHeight = 50;
            Console.BufferHeight = 50;
            Console.WindowWidth  = 160;
            Console.BufferWidth  = 160;
            Utility.StartGame();
            HeroSelection.Show(context);
        }
Esempio n. 2
0
    private void OnEnable()
    {
        if (HeroSelection.HS == null)
        {
            HeroSelection.HS = this;
        }
        else
        {
            if (HeroSelection.HS != this)
            {
                Destroy(HeroSelection.HS.gameObject);
                HeroSelection.HS = this;
            }
        }

        DontDestroyOnLoad(this.gameObject);
    }
Esempio n. 3
0
    // End hero selection and reorder heroselect
    // FIXME: bad name
    // FIXME: why is this even here?
    public void EndSection()
    {
        int heroCount = 0;

        Destroyer.Dialog();

        // Count number of selected heroes
        Game game = Game.Get();

        foreach (Quest.Hero h in game.quest.heroes)
        {
            if (h.heroData != null)
            {
                heroCount++;
                // Create variable to value 1 for each selected Hero
                game.quest.vars.SetValue("#" + h.heroData.sectionName, 1);
            }
        }

        // Check for validity
        if (heroCount < game.quest.qd.quest.minHero)
        {
            return;
        }

        foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.HEROSELECT))
        {
            Object.Destroy(go);
        }
        heroSelection = null;

        // Reorder heros so that selected heroes are first
        for (int i = 0; i < game.quest.heroes.Count - 1; i++)
        {
            int j = i;

            while (game.quest.heroes[i].heroData == null && j < game.quest.heroes.Count)
            {
                game.quest.heroes[i].heroData = game.quest.heroes[j].heroData;
                game.quest.heroes[j].heroData = null;
                j++;
            }
        }

        // Set quest flag based on hero count
        game.quest.vars.SetValue("#heroes", heroCount);

        game.quest.heroesSelected = true;

        UpdateImages();
        UpdateStatus();

        // Clear off heros if not required
        if (!game.gameType.DisplayHeroes())
        {
            Clean();
            new InvestigatorItems();
        }
        else
        {
            // Pick class
        }

        // Draw morale if required
        if (game.gameType is D2EGameType)
        {
            new ClassSelectionScreen();
        }
        else
        {
            new InvestigatorItems();
        }
    }
Esempio n. 4
0
    // End hero selection and reorder heroselect
    // FIXME: bad name
    // FIXME: why is this even here?
    public void EndSection()
    {
        int heroCount = 0;

        Destroyer.Dialog();

        // Count number of selected heroes
        Game game = Game.Get();

        foreach (Quest.Hero h in game.quest.heroes)
        {
            if (h.heroData != null)
            {
                heroCount++;
            }
        }

        // Check for validity
        if (heroCount < 2)
        {
            return;
        }

        foreach (GameObject go in GameObject.FindGameObjectsWithTag("heroselect"))
        {
            Object.Destroy(go);
        }
        heroSelection = null;

        // Reorder heros so that selected heroes are first
        for (int i = 0; i < game.quest.heroes.Count - 1; i++)
        {
            int j = i;

            while (game.quest.heroes[i].heroData == null && j < game.quest.heroes.Count)
            {
                game.quest.heroes[i].heroData = game.quest.heroes[j].heroData;
                game.quest.heroes[j].heroData = null;
                j++;
            }
        }

        // Set quest flag based on hero count
        game.quest.vars.SetValue("#heroes", heroCount);

        game.quest.heroesSelected = true;

        UpdateImages();
        UpdateStatus();

        // Clear off heros if not required
        if (!game.gameType.DisplayHeroes())
        {
            Clean();
        }

        // Draw morale if required
        if (game.gameType.DisplayMorale())
        {
            game.moraleDisplay = new MoraleDisplay();
            game.QuestStartEvent();
        }
        else
        {
            new InvestigatorItems();
        }

        List <string> music = new List <string>();

        foreach (AudioData ad in game.cd.audio.Values)
        {
            if (ad.ContainsTrait("quest"))
            {
                music.Add(ad.file);
            }
        }
        game.audioControl.Music(music);
    }