// List<WorldPos> GeneratePillars(WorldPos startpoint,int size){ // int pillar_num = Random.Range (15, 30); // // List<WorldPos> base_position = new List<WorldPos>(); // for (int i=0; i<pillar_num; i++) { // WorldPos w = new WorldPos( // Random.Range(0,size), // (int)Random.Range(0,size*0.7f), // Random.Range(0,size) // ); // w.extra = (int)Random.Range(3,6); // base_position.Add(w); // } // // List<WorldPos> points = new List<WorldPos> (); // // for (int i=0; i<base_position.Count; i++) { // WorldPos base_point = base_position[i]; // // for(int h=0;h<base_point.y;h++){ // for(int x=0;x<base_point.extra;x++) // for(int z=0;z<base_point.extra;z++){ // points.Add( // new WorldPos( // startpoint.x+base_point.x+x, // startpoint.y+h, // startpoint.z+base_point.z+z // ) // ); // } // } // } // // return points; // } public void SpecialBlockEff(WorldPos position, BlockSpecial.Specal_type blocktype, BlockSpecial.Owner owner) { List <WorldPos> points = new List <WorldPos> (); int range = 8; for (int x = -range / 2; x < range / 2; x++) { for (int y = -range / 2; y < range / 2; y++) { for (int z = -range / 2; z < range / 2; z++) { if (!(GetBlock(position.x + x, position.y + y, position.z + z) is BlockAir)) { points.Add( new WorldPos( position.x + x, position.y + y, position.z + z ) ); } } } } SetSpecalBlockS(points, blocktype, owner); }
public void SendSetSpecBlock(WorldPos position, BlockSpecial.Specal_type type) { Dictionary <string, string> data = new Dictionary <string, string>(); data["id"] = "" + socket.sid; data["p_x"] = "" + position.x; data["p_y"] = "" + position.y; data["p_z"] = "" + position.z; data["type"] = type.ToString(); socket.Emit("set_specblock", new JSONObject(data)); }
public void SpecialBlockEff_mod(WorldPos position, BlockSpecial.Specal_type blocktype, BlockSpecial.Owner owner) { for (int i = 0; i < 10; i++) { float r_x = Random.Range(-10, 10); float r_y = Random.Range(-10, 10); float r_z = Random.Range(-10, 10); Instantiate(specialDelivery, new Vector3(position.x + r_x, position.y + r_y, position.z + r_z), specialDelivery.transform.rotation); } }
public void SetSpecalBlockS(List <WorldPos> coordList, BlockSpecial.Specal_type btype, BlockSpecial.Owner owner) { for (int i = 0; i < coordList.Count; i++) { System.Random r = new System.Random(); Color c = new Color((float)r.NextDouble(), (float)r.NextDouble(), (float)r.NextDouble()); // BlockSpecial a=new BlockSpecial(btype); SetBlock( coordList[i].x, coordList[i].y, coordList[i].z, new BlockSpecial(btype, owner)); } }
public void GetAitem(BlockSpecial.Specal_type type) { switch (type) { case BlockSpecial.Specal_type.Bound: Bump_item++; break; case BlockSpecial.Specal_type.Suck: Suck_item++; break; case BlockSpecial.Specal_type.Teleport: Teleport_item++; break; } }