Added NPCs to game, fixed explore and collect quest, added quest remove, fixed quest update, v1.4.0
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user