public void Buy() { // Exit if the quest was already completed if (quest.Completed) { quest.Completed = false; return; } // Progress the buy tomatoes task by 3 tomatoes, therefore completing it. Because the choice was to buy or steal, the get tomatoes task is now also complete, and therefore the quest handler.ProgressTask("Bob Wants Tomatoes", "Get Tomatoes for Bob", 3); handler.ProgressTask("Bob Wants Tomatoes", "Buy Tomatoes", 3); // Color the quest text to show completion questName.color = mainTaskName.color = smallerTask1Name.color = new Color(55 / 255f, 205 / 255f, 55 / 255f); }
public void TurnInQuest() { if (inventory.GetStock("Flower") >= handler.GetTask(questName, "Pick flower").MaxProgress) { handler.ProgressTask(questName, "Pick flower", handler.GetTask(questName, "Pick flower").MaxProgress); inventory.RemoveItem("Flower", (int)handler.GetTask(questName, "Pick flower").MaxProgress); } }