private void NPCPathFinding() { if (player.acceptedQuest.isActive && player.acceptedQuest.questType == Quest.Type.Exploring && gameSystem.location == player.acceptedQuest.questLocation.ToString()) { UnityEngine.Debug.Log("Follow the NPC to the Destination!"); if (!isPathFinding) { PathFinding(); gameSystem.Alert("Going to destination..."); } } else { gameSystem.Alert("You are on the wrong map!"); } if (player.acceptedQuest.isActive && player.acceptedQuest.questType == Quest.Type.Exploring && gameSystem.location == player.acceptedQuest.questLocation.ToString()) { if (Vector3.Distance(transform.position, goal.transform.position) < 3.0f) { player.acceptedQuest.Progress(); isPathFinding = false; agent.enabled = false; } } }
// Update is called once per frame void Update() { if (isDead == false) { if (player.HP <= 0) { player.DeadAnimation(); isDead = true; gameSystem.PauseCharacter(); StartCoroutine(WaitandRestart()); } else { //camera AdaptiveRotation(); Zoom(); //character Rotation(); Movement(); MovementAnimation(); Attack(); Healing(); if (Input.GetKeyDown(KeyCode.F1)) { if (player.acceptedQuest.isActive && player.acceptedQuest.questType == Quest.Type.Exploring && gameSystem.location == player.acceptedQuest.questLocation.ToString()) { UnityEngine.Debug.Log("Path Finding"); if (!player.isPathFinding) { PathFinding(); gameSystem.Alert("Going to destination..."); } } else { gameSystem.Alert("No Destination Available!"); } } if (player.acceptedQuest.isActive && player.acceptedQuest.questType == Quest.Type.Exploring && gameSystem.location == player.acceptedQuest.questLocation.ToString()) { if (Vector3.Distance(transform.position, goal.transform.position) < 3.0f) { player.acceptedQuest.Progress(); player.isPathFinding = false; agent.enabled = false; } } } } }
public void AcceptQuest() { questHUD.SetActive(false); if (!player.acceptedQuest.isActive) { quest.isActive = true; player.acceptedQuest = quest; availableQuests.Remove(quest); if (player.acceptedQuest.questType == Quest.Type.Exploring) { gameSystem.Alert("Quest has been accepted! Go to " + player.acceptedQuest.questLocation + " and press F1 to navigate!"); } else { gameSystem.Alert(quest.questTitle + " has been accepted Go to " + player.acceptedQuest.questLocation + "to do it!"); } } else { gameSystem.Alert("Please finish your current quest!"); } gameSystem.Save(); }
public void CheckProgress() { if (player.acceptedQuest.isActive && player.acceptedQuest.questLocation.ToString() == gameSystem.location) { player.acceptedQuest.Progress(); gameSystem.Alert(player.acceptedQuest.questTitle + ": " + player.acceptedQuest.current + "/" + player.acceptedQuest.goal + "!"); } if (player.acceptedActivity.isActive && player.acceptedActivity.activityLocation.ToString() == gameSystem.location) { player.acceptedActivity.Progress(); gameSystem.Alert(player.acceptedActivity.activityTitle + ": " + player.acceptedActivity.current + "/" + player.acceptedActivity.goal + "!"); } }