public void StartNewQuest()
 {
     Party        = new Party();
     questState   = QuestState.New;
     CurrentQuest = _questGenerator.GenerateQuest(Difficulty);
     QuestTimer   = CurrentQuest.MaxDuration;
     QuestEventManager.SendQuestStarted(CurrentQuest);
 }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        var testPart = new Part();

        var testBody = new Body();
        // testBody.Slots[0].AssignedPart = testPart;


        var testParty = new Party();

        testParty.Bodies.Add(testBody);
        var qg = new QuestGenerator();

        var test = qg.GenerateQuest(10);

        Debug.Log(test.Description);
        var result = test.GetResult(testParty);

        Debug.Log(result.Gold.ToString());
    }
Ejemplo n.º 3
0
        private void OnQuestEventTimerComplete()
        {
            m_QuestEventTimeTracker.OnTimerCompleted -= OnQuestEventTimerComplete;

            QuestEventData eventData  = m_QuestEventDataList[m_CurrentQuestEventData];
            bool           spawnQuest = UnityEngine.Random.Range(0, 101) < eventData.chance;

            if (spawnQuest)
            {
                for (int i = 0; i < eventData.questCount; i++)
                {
                    QuestInstance   quest   = QuestGenerator.GenerateQuest(1, m_QuestMakeupRandom.GetRandomValue());
                    FactionInstance faction = ServiceLocator.AllegianceService.Factions.GetRandom();
                    ServiceLocator.QuestService.RegisterQuest(quest, faction);
                }
                m_CurrentQuestEventData = -1;
            }

            StartNextQuestEvent();
        }
Ejemplo n.º 4
0
        public static void InitializeServices(GameSetupData data)
        {
            //Factions and heroes
            for (int i = 0; i < data.factionCount; i++)
            {
                FactionInstance faction = FactionGenerator.GenerateFaction();
                foreach (HeroType heroType in Enum.GetValues(typeof(HeroType)))
                {
                    HeroInstance hero = HeroGenerator.GenerateHero(1, heroType);
                    ServiceLocator.AllegianceService.SetHeroAllegiance(hero, faction);
                }

                /*for (int h = 0; h < Random.Range(data.heroesPerFactionMin, data.heroesPerFactionMax + 1); h++) {
                 *      HeroInstance hero = HeroGenerator.GenerateHero(1);
                 *      ServiceLocator.AllegianceService.SetHeroAllegiance(hero, faction);
                 * }*/

                for (int q = 0; q < data.startQuests; q++)
                {
                    QuestInstance quest = QuestGenerator.GenerateQuest(1, QuestMakeupType.SOLO);
                    ServiceLocator.QuestService.RegisterQuest(quest, faction);
                }
            }
        }