Exemplo n.º 1
0
    // once a day send out heros to go do their quest.


    void setQuestsForActiveHeros()
    {
        locationsToVist.Clear();
        // loop through all buildings. // only need to do this once.
        foreach (GameObject building in buildings.built_Buildings)
        {
            Building built = building.GetComponent <Building> ();
            if (built.hero_can_vist)
            {
                locationsToVist.Add(building);                   // this builds the buildings in town to vist every day.
            }
        }


        Debug.Log("test quest hero set");
        // (string value in pets)
        foreach (Hero hero in Heros)          // look at each hero, ask questMaster script if it has a quest i should send this guy on.
        {
            locationsToVist_withQuest.Clear();
            locationsToVist_withQuest.AddRange(locationsToVist);

            Debug.Log(hero.heroName);
            Quest quest = quests.questForHero(hero);
            if (quest != null)
            {
                locationsToVist_withQuest.Add(quest.cityGate);
                hero.PlacesToGoToday(locationsToVist_withQuest, true);                  // right... only passed the gate.
                hero.quest = quest;
            }
            else
            {
                hero.PlacesToGoToday(locationsToVist, false);
            }
        }
        locationsToVist.Clear();
        locationsToVist_withQuest.Clear();
    }