Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Zone_SnowGrave.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
3public class Zone_SnowGrave : Zone
4{
5 public override float PrespawnRate => 1f;
6
7 public override void OnGenerateMap()
8 {
9 base.OnGenerateMap();
11 }
12
13 public static void GenerateGrave()
14 {
15 List<Dictionary<string, string>> list = new ExcelData("Data/Raw/monument", 1).BuildList();
16 list.RemoveAt(0);
17 list.Shuffle();
18 int num = 200;
19 string[] array = new string[7] { "1035", "1036", "1046", "1047", "1048", "1049", "1050" };
20 MapBounds mapBounds = new MapBounds
21 {
22 x = 50,
23 z = 50,
24 maxX = num - 1,
25 maxZ = num - 1,
26 Size = num
27 };
28 Point point = null;
29 Point point2 = new Point();
30 Point p = new Point(125, 125);
31 for (int i = 0; i < list.Count; i++)
32 {
33 Dictionary<string, string> dictionary = list[i];
34 Thing thing = ThingGen.Create(array.RandomItem());
35 for (int j = 0; j < 1000; j++)
36 {
37 bool flag = true;
38 point = mapBounds.GetRandomSurface();
39 if (point.HasBlock || point.HasObj || point.Distance(p) < 5)
40 {
41 continue;
42 }
43 for (int k = point.z - 1; k < point.z + 2; k++)
44 {
45 for (int l = point.x - 1; l < point.x + 2; l++)
46 {
47 point2.Set(l, k);
48 if (point2.Installed != null)
49 {
50 flag = false;
51 break;
52 }
53 }
54 if (!flag)
55 {
56 break;
57 }
58 }
59 if (flag)
60 {
61 break;
62 }
63 }
64 EClass._zone.AddCard(thing, point).Install();
65 thing.c_note = BackerContent.ConvertName(dictionary["Name"]);
66 thing.c_idBacker = dictionary["id"].ToInt();
67 thing.isModified = true;
68 }
69 string[] array2 = new string[3] { "1058", "1059", "1064" };
70 for (int m = 0; m < 500; m++)
71 {
73 card.dir = EClass.rnd(2);
74 card.Install();
75 }
76 }
77}
static string ConvertName(string s)
Definition: Card.cs:11
Card Install()
Definition: Card.cs:3448
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
static Zone _zone
Definition: EClass.cs:20
List< Dictionary< string, string > > BuildList(string sheetName="_default")
Definition: ExcelData.cs:92
Point GetRandomSurface(int x, int z, int radius, bool walkable=true, bool allowWater=false)
Definition: MapBounds.cs:182
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:303
Point Set(int _x, int _z)
Definition: Point.cs:479
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:953
bool HasBlock
Definition: Point.cs:141
int x
Definition: Spatial.cs:94
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
override void OnGenerateMap()
static void GenerateGrave()
override float PrespawnRate
Definition: Zone.cs:12
Card AddThing(string id, int x, int z)
Definition: Zone.cs:1883
MapBounds bounds
Definition: Zone.cs:46
Card AddCard(Card t, Point point)
Definition: Zone.cs:1893