Elin Modding Docs Doc
Loading...
Searching...
No Matches
ZoneEventMusic.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5
6// Token: 0x0200074B RID: 1867
8{
9 // Token: 0x170010A7 RID: 4263
10 // (get) Token: 0x0600362F RID: 13871 RVA: 0x001260E6 File Offset: 0x001242E6
11 public QuestMusic questMusic
12 {
13 get
14 {
15 return base.quest as QuestMusic;
16 }
17 }
18
19 // Token: 0x170010A8 RID: 4264
20 // (get) Token: 0x06003630 RID: 13872 RVA: 0x001260F4 File Offset: 0x001242F4
21 public override string TextWidgetDate
22 {
23 get
24 {
25 return "eventMusic".lang((this.TimeLimit - this.minElapsed <= 30) ? "end_soon".lang() : "", this.questMusic.score.ToString() ?? "", this.questMusic.destScore.ToString() ?? "", null, null);
26 }
27 }
28
29 // Token: 0x170010A9 RID: 4265
30 // (get) Token: 0x06003631 RID: 13873 RVA: 0x00126161 File Offset: 0x00124361
31 public override int TimeLimit
32 {
33 get
34 {
35 return 180;
36 }
37 }
38
39 // Token: 0x06003632 RID: 13874 RVA: 0x00126168 File Offset: 0x00124368
40 public override void OnVisit()
41 {
42 if (EClass.game.isLoading)
43 {
44 return;
45 }
46 if (EClass.debug.enable && Input.GetKey(KeyCode.LeftShift))
47 {
48 return;
49 }
50 int difficulty = this.questMusic.difficulty;
51 int maxLv = difficulty * 5 + 2;
52 if (difficulty > 2)
53 {
54 maxLv += (difficulty - 2) * 10;
55 }
56 GenBounds genBounds = GenBounds.Create(EClass._zone);
57 genBounds.marginPartial = 1;
58 genBounds.FuncCheckEmpty = ((Cell cell) => cell.sourceFloor.id == 76);
59 int i;
60 Action<PartialMap, GenBounds> <>9__2;
61 int k;
62 for (i = 0; i < 25; i = k + 1)
63 {
64 GenBounds genBounds2 = genBounds;
65 MapPiece.Type type = MapPiece.Type.Concert;
66 float ruin = 0f;
67 string tags = "";
68 Action<PartialMap, GenBounds> onCreate;
69 if ((onCreate = <>9__2) == null)
70 {
71 Chara c3;
72 onCreate = (<>9__2 = delegate(PartialMap p, GenBounds b)
73 {
74 int num = 1 + i * 3;
75 if (num > maxLv)
76 {
77 num = EClass.rnd(maxLv);
78 }
79 List<Point> list = b.ListEmptyPoint();
80 int num2 = 0;
81 while (num2 < EClass.rndHalf(list.Count) && list.Count != 0)
82 {
83 Point point = list.RandomItem<Point>();
84 Chara c3 = CharaGen.CreateFromFilter("c_neutral", num, 5);
85 this.Spawn(c3, point);
86 list.Remove(point);
87 num2++;
88 }
89 });
90 }
91 genBounds2.TryAddMapPiece(type, ruin, tags, onCreate);
92 k = i;
93 }
94 foreach (SourceChara.Row row in from c in EClass.sources.charas.rows
95 where c.tag.Contains("party")
96 select c)
97 {
98 if (row.LV < maxLv * 2)
99 {
100 Point randomPoint = EClass._map.bounds.GetRandomPoint();
101 if (!randomPoint.HasChara && !randomPoint.HasBlock)
102 {
103 bool flag = true;
104 using (List<Chara>.Enumerator enumerator2 = EClass.pc.party.members.GetEnumerator())
105 {
106 while (enumerator2.MoveNext())
107 {
108 if (enumerator2.Current.id == row.id)
109 {
110 flag = false;
111 }
112 }
113 }
114 if (flag)
115 {
116 Chara c3 = CharaGen.Create(row.id, -1);
117 this.Spawn(c3, randomPoint);
118 }
119 }
120 }
121 }
122 for (int j = 0; j < 50; j++)
123 {
124 Point randomPoint2 = EClass._map.bounds.GetRandomPoint();
125 if (!randomPoint2.HasChara && !randomPoint2.HasBlock)
126 {
127 Chara c2 = CharaGen.CreateFromFilter("c_neutral", maxLv / 2, -1);
128 this.Spawn(c2, randomPoint2);
129 }
130 }
131 foreach (Thing thing in EClass._map.things)
132 {
133 thing.isNPCProperty = true;
134 }
135 }
136
137 // Token: 0x06003633 RID: 13875 RVA: 0x00126420 File Offset: 0x00124620
138 public void Spawn(Chara c, Point p)
139 {
140 EClass._zone.AddCard(c, p);
141 if (c.hostility < Hostility.Neutral)
142 {
143 c.c_originalHostility = (c.hostility = Hostility.Neutral);
144 }
145 }
146
147 // Token: 0x06003634 RID: 13876 RVA: 0x00126454 File Offset: 0x00124654
148 public override ZoneInstance.Status OnReachTimeLimit()
149 {
150 Msg.Say("party_end", this.questMusic.score.ToString() ?? "", null, null, null);
151 Msg.Say("party_end2", this.questMusic.sumMoney.ToString() ?? "", null, null, null);
152 if (this.questMusic.score < this.questMusic.destScore)
153 {
154 return ZoneInstance.Status.Fail;
155 }
156 return ZoneInstance.Status.Success;
157 }
158}
Definition Cell.cs:10
Definition Chara.cs:12
Definition Msg.cs:7
Definition Point.cs:11
Definition Thing.cs:10