Added NPCs to game, fixed explore and collect quest, added quest remove, fixed quest update, v1.4.0

This commit is contained in:
Nicola Sovic
2022-07-14 23:48:37 +02:00
parent 3f8d9c0551
commit 59e34ef728
10 changed files with 199 additions and 62 deletions

View File

@@ -9,17 +9,17 @@ namespace Assets.Scripts
public ExploreQuest(GameObject display) : base(display)
{
Vector3 playerPos = GameObject.Find("Player").GetComponent<Player>().transform.position;
float coordX = getRandomNumber(20) - 10;
float coordZ = getRandomNumber(20) - 10;
float coordX = getRandomNumber(1000) - 500;
float coordZ = getRandomNumber(1000) - 500;
coordinates = new Vector3(playerPos.x + coordX, 0, playerPos.z + coordZ);
questname = "Travel to " + coordinates.x + "/" + coordinates.z + "(X/Z)";
questname = "Travel to " + Mathf.Floor(coordinates.x) + "/" + Mathf.Floor(coordinates.z) + "(X/Z)";
}
override
public void update(object obj, int amount)
{
Vector3 player = ((GameObject)obj).transform.position;
if (player.x - 5 >= coordinates.x && player.x + 5 <= coordinates.x && player.z - 5 >= coordinates.z && player.z + 5 <= coordinates.z)
if (player.x >= coordinates.x - 1 && player.x <= coordinates.x + 1 && player.z >= coordinates.z - 1 && player.z <= coordinates.z + 1)
{
isFinished = true;
}