public bool Teleport(Tuple<int, int> location, World world) { if (!world.MovePlayerToken(BlockX, BlockY, location.Item1, location.Item2)) return false; return TryMove(location.Item1, location.Item2, world, true); }
public bool Respawn(World world) { //Get the hell outta dodge int retreatCount = 0; while (RetreatWorldDepth()) retreatCount++; //Get out of the cave you're in. Also remove that cave if... you know. if (world.HasCave(inCaveLocation.Item1, inCaveLocation.Item2)) world.RemoveCave(inCaveLocation.Item1, inCaveLocation.Item2); inCaveLocation = Tuple.Create(-1, -1); Tuple<int, int> spawn = world.GetASpawn(); //You only need to move the player token if they were still in the world when they respawned if (retreatCount == 0 && !world.MovePlayerToken(BlockX, BlockY, spawn.Item1, spawn.Item2)) return false; return TryMove(spawn.Item1, spawn.Item2, world, true); }