private static void ShowPos(List <string> _params) { EntityPlayerLocal player = GameManager.Instance.World.GetLocalPlayers()[0]; Vector3i pos = Vectors.ToInt(player.GetPosition()); Vector3i c1 = ZChunk.TL1(pos.x, pos.z); Vector3i c4 = ZChunk.TL4(pos); Printer.FPrint("Pos {0} -> {1}. C4={2}", pos, c1, c4); }
public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt) { Printer.Print("SingleChunked Effect1", place.position, place.ipos, opt.OptionItem.item); Vector3i where = Vectors.ToInt(player.GetPosition()); int y0 = Geo3D.Surface(where).y; Vector3i nw4 = ZChunk.TL4(place.ipos); Bounds b4 = ZChunk.Bounds4(nw4, y0); Zombiome.Routines.Start(Regen(player, b4, y0), name + "-SingleChunked"); }
public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt) { Printer.Log(46, "SingleChunked Effect1", place.position, place.ipos, opt.OptionItem.item); Vector3i where = Vectors.ToInt(player.GetPosition()); int y0 = Geo3D.Surface(where).y; Vector3i nw4 = ZChunk.TL4(place.ipos); Zombiome.Routines.Start(Regen(player, nw4, y0), name + "-SingleChunked0"); Zombiome.Routines.Start(Regen(player, nw4 + new Vector3i(1, 0, 0), y0), name + "-SingleChunked1"); Zombiome.Routines.Start(Regen(player, nw4 + new Vector3i(0, 0, 1), y0), name + "-SingleChunked2"); Zombiome.Routines.Start(Regen(player, nw4 + new Vector3i(1, 0, 1), y0), name + "-SingleChunked3"); }
public override IEnumerator<Vector3> Get(Vector3 position) { int maxsize = 10; Vector3i zchunk = ZChunk.TL4(position); bool D0 = false; int L0 = ZChunk.Len(zchunk + ZChunk.adjacents[0], maxsize); bool D1 = false; int L1 = ZChunk.Len(zchunk + ZChunk.adjacents[1], maxsize); bool D2 = false; int L2 = ZChunk.Len(zchunk + ZChunk.adjacents[2], maxsize); bool D3 = false; int L3 = ZChunk.Len(zchunk + ZChunk.adjacents[3], maxsize); for (int step=0; step<maxsize; step++) { if (! D0 && step > L0) D0 = true; if (! D0) yield return ZChunk.Position(Zombiome.worldSeed, zchunk + ZChunk.adjacents[0], step); if (! D1 && step > L1) D1 = true; if (! D1) yield return ZChunk.Position(Zombiome.worldSeed, zchunk + ZChunk.adjacents[1], step); if (! D2 && step > L2) D2 = true; if (! D2) yield return ZChunk.Position(Zombiome.worldSeed, zchunk + ZChunk.adjacents[2], step); if (! D3 && step > L3) D3 = true; if (! D3) yield return ZChunk.Position(Zombiome.worldSeed, zchunk + ZChunk.adjacents[3], step); if (D0 && D1 && D2 && D3) break; } }
public static Zone[] GetFour(Vector3 position) { Vector3i cp = ZChunk.TL4(position, ZoneSize); Zone[] zones = new Zone[4]; for (int adj = 0; adj < 4; adj++) { // foreach (Vector3i offset in ZChunk.adjacents) { Vector3i zca = cp + ZChunk.adjacents[adj]; int _index = zca.x + nZone * zca.z; if (!AllZones.ContainsKey(_index)) { Zone created = new Zone(zca.x, zca.z); Printer.Log(62, "GetFour returned", created); AllZones[_index] = created; } zones[adj] = AllZones[_index]; Printer.Log(62, "Zone Get dict _index", _index); Printer.Log(62, "Zone Get in dict", AllZones[_index]); } return(zones); }
public override Bounds Bounds(Vector3 position) { Vector3i zchunk = ZChunk.TL4(position); return ZChunk.Bounds4(zchunk, (int) Math.Floor(position.y)); }