コード例 #1
0
    public void UpdateMonsterQuest(string monsterName)
    {
        MonsterQuest quest = null;

        if ((quest = HasMonsterQuest(monsterName)) != null)
        {
            Debug.Log("in");
            quest.amount -= 1;
            if (quest.amount <= 0)
            {
                //Quest complete
                GetComponent <SkillManager> ().IncreaseLevelExperience(quest.experience);
                monsterQuests.Remove(quest);
            }
        }
    }
コード例 #2
0
ファイル: QuestManager.cs プロジェクト: sck4512/Portfolio
    void Awake()
    {
        MonsterQuests = new List <Quest>();
        MonsterQuest radishQuest = new MonsterQuest(MonsterQuest.Type.Radish);

        MonsterQuests.Add(radishQuest);
        MonsterQuest mushroomQuest = new MonsterQuest(MonsterQuest.Type.Mushroom);

        MonsterQuests.Add(mushroomQuest);
        MonsterQuest diamondQuest = new MonsterQuest(MonsterQuest.Type.Diamond);

        MonsterQuests.Add(diamondQuest);
        MonsterQuest bearAndWitchQuest = new MonsterQuest(MonsterQuest.Type.BearAndWitch);

        MonsterQuests.Add(bearAndWitchQuest);
        MonsterQuest bossRadishQuest = new MonsterQuest(MonsterQuest.Type.BossRadish);

        MonsterQuests.Add(bossRadishQuest);


        var data = LoadMonsterQuestData();

        if (data == null)
        {
            return;
        }

        //최대 퀘스트 갯수가 5, 보스 추가되어서 5
        if (data.CurQuestIndex == 5)
        {
            return;
        }

        CurQuestIndex = data.CurQuestIndex;
        MonsterQuests[CurQuestIndex].IsCommissioned = data.IsCommissioned;
        if (MonsterQuests[CurQuestIndex].IsCommissioned)
        {
            MonsterQuests[CurQuestIndex].CommisionQuest();
            for (int i = 0; i < data.CurKillCount; i++)
            {
                ((MonsterQuest)MonsterQuests[CurQuestIndex]).KillMonster();
            }
        }
    }
コード例 #3
0
 public void MonsterQuestOptional(MonsterQuest quest)
 {
     hasQuest     = true;
     monsterQuest = quest;
 }
コード例 #4
0
 public void AddMonsterQuest(MonsterQuest quest)
 {
     monsterQuests.Add(quest);
 }