void buttonPush(int setOrUpdate) { if (buttonsLeftToPush == 0) { buttonsLeftToPush = setOrUpdate; return; } buttonsLeftToPush--; if (buttonsLeftToPush == 0) { state = stateOfQuestManager.COMPLETED; } //updateUI(); }
void killAllQuest(int setOrUpdate) { if (setOrUpdate != 0) { amountOfEnemiesLeftToKill = setOrUpdate; return; } amountOfEnemiesLeftToKill--; if (amountOfEnemiesLeftToKill == 0) { state = stateOfQuestManager.COMPLETED; } //updateUI(); }
public void forceQuestUpdate() //This should never be used unless the game is being loaded { if (listOfQuests.Peek().winCondition == 3) { listOfQuests.Dequeue(); nextLevel(); } else { listOfQuests.Dequeue(); state = checkIfWon() ? stateOfQuestManager.WIN : stateOfQuestManager.START; amountOfQuestsCompleted++; amountOfEnemiesLeftToKill = 0; destination = new Vector3(0, 00, 0); buttonsLeftToPush = 0; } }
// Update is called once per frame void Update() { switch (state) { case stateOfQuestManager.START: setQuest(listOfQuests.Peek().winCondition); updateUI(); state = stateOfQuestManager.INPROGRESS; break; case stateOfQuestManager.INPROGRESS: ; // :( break; case stateOfQuestManager.COMPLETED: questComplete(); break; case stateOfQuestManager.WIN: toEndScene.singleton.callNext(); break; } }
//Quest manager needs to have the quests //Needs to show current quest //Needs to be able to go to the next quest //Data needed //The Quest //Description of it //Quests will be loaded from a file later on // Start is called before the first frame update void Start() { state = stateOfQuestManager.START; switch (level) { case 0: listOfQuests = new Queue <questStructure>(); string hello = "Kill the enemy"; string hello2 = "Use left mouse button to\nattack the enemy\nmove around with WASD"; listOfQuests.Enqueue(new questStructure(hello, hello2, 0, 1)); hello = "Go to destination"; hello2 = "Move to the left"; listOfQuests.Enqueue(new questStructure(hello, hello2, 1, 1)); hello = "Kill the enemies"; hello2 = "You can use rightMouse to use a\ncharged attack"; listOfQuests.Enqueue(new questStructure(hello, hello2, 0, 2)); hello = "Go to destination"; hello2 = "Move to the right"; listOfQuests.Enqueue(new questStructure(hello, hello2, 1, 1)); hello = "Push the two buttons"; hello2 = "Use Q to push the two buttons at the top"; listOfQuests.Enqueue(new questStructure(hello, hello2, 2, 2, 2)); listOfQuests.Enqueue(new questStructure(hello, hello2, 3, 0)); break; case 1: listOfQuests = new Queue <questStructure>(); string hello3 = "Activate three generators\nSearch the level"; string hello4 = "Press Q to activate\nwhen near"; listOfQuests.Enqueue(new questStructure(hello3, hello4, 2, 0, 3)); break; } }
void questComplete() { listOfQuests.Dequeue(); state = checkIfWon() ? stateOfQuestManager.WIN : stateOfQuestManager.START; amountOfQuestsCompleted++; }