public void Goto(string plotName) { APlot plot = TerrainLogic.Find(plotName); ActionLogic.SetOccupied(location [0], location [1], false); RenewLocation(plot.indx, plot.indz); mission = new AMission("移动至" + " " + location [0].ToString() + "," + location [1].ToString(), 0); ActionLogic.SetOccupied(location [0], location [1], true); flesh.SendMessage("CharacterGoto", location); }
public static void ReadMap() { for (int i = 0; i < MAPSIZE * MAPSIZE; i++) { int x = i / MAPSIZE; int z = i % MAPSIZE; Color c = ResourceReader.hometownMap.GetPixel(x, z); byte height = (byte)((c.r * 256 + 1) / 2); byte type = (byte)((c.g * 256 + 25) / 50); byte cover = (byte)((c.b * 256 + 10) / 20); plots [x, z] = new APlot(x, z, height, 0, type, cover); //临时代码:初始可见区域 if (Mathf.Abs(x - MAPSIZE / 2) + Mathf.Abs(z - MAPSIZE / 2) <= 4) { plots [x, z].vision = 2; } } }