Elin Modding Docs Doc
Loading...
Searching...
No Matches
Party.cs
1using System;
2using System.Collections.Generic;
3using Newtonsoft.Json;
4using UnityEngine;
5
6// Token: 0x020004E4 RID: 1252
7public class Party : EClass
8{
9 // Token: 0x17000ADA RID: 2778
10 // (get) Token: 0x06002122 RID: 8482 RVA: 0x000B3B55 File Offset: 0x000B1D55
11 public List<Chara> members
12 {
13 get
14 {
15 if (this._members != null)
16 {
17 return this._members;
18 }
19 return this.SetMembers();
20 }
21 }
22
23 // Token: 0x17000ADB RID: 2779
24 // (get) Token: 0x06002123 RID: 8483 RVA: 0x000B3B6C File Offset: 0x000B1D6C
25 // (set) Token: 0x06002124 RID: 8484 RVA: 0x000B3B7F File Offset: 0x000B1D7F
26 public Chara leader
27 {
28 get
29 {
30 return this.refLeader.GetAndCache(this.uidLeader);
31 }
32 set
33 {
34 this.refLeader.Set(ref this.uidLeader, value);
35 }
36 }
37
38 // Token: 0x06002125 RID: 8485 RVA: 0x000B3B94 File Offset: 0x000B1D94
39 public List<Chara> SetMembers()
40 {
41 this._members = new List<Chara>();
42 foreach (int uid in this.uidMembers)
43 {
44 this.members.Add(RefChara.Get(uid));
45 }
46 return this._members;
47 }
48
49 // Token: 0x06002126 RID: 8486 RVA: 0x000B3C04 File Offset: 0x000B1E04
50 public void AddMemeber(Chara c)
51 {
52 if (c.party == this)
53 {
54 return;
55 }
56 if (!c.IsGlobal)
57 {
58 Debug.LogError("exception: " + ((c != null) ? c.ToString() : null) + " is not global chara");
59 }
60 this.members.Add(c);
61 this.uidMembers.Add(c.uid);
62 c.party = this;
63 c.isSale = false;
64 c.SetBool(18, false);
65 if (c.homeBranch != null)
66 {
67 c.RefreshWorkElements(c.homeBranch.elements);
68 c.homeBranch.policies.Validate();
69 if (c.homeBranch.owner.map != null)
70 {
71 c.homeBranch.owner.map.props.sales.Remove(c);
72 }
73 }
74 WidgetRoster.SetDirty();
75 }
76
77 // Token: 0x06002127 RID: 8487 RVA: 0x000B3CDC File Offset: 0x000B1EDC
78 public void RemoveMember(Chara c)
79 {
80 if (c.host != null)
81 {
82 ActRide.Unride(c.host, c.host.parasite == c);
83 }
84 this.members.Remove(c);
85 this.uidMembers.Remove(c.uid);
86 c.party = null;
87 c.SetDirtySpeed();
88 c.RefreshWorkElements(null);
89 WidgetRoster.SetDirty();
90 }
91
92 // Token: 0x06002128 RID: 8488 RVA: 0x000B3D42 File Offset: 0x000B1F42
93 public void SetLeader(Chara c)
94 {
95 this.leader = c;
96 }
97
98 // Token: 0x06002129 RID: 8489 RVA: 0x000B3D4B File Offset: 0x000B1F4B
99 public Element GetPartySkill(int ele)
100 {
101 return this.GetBestSkill(ele);
102 }
103
104 // Token: 0x0600212A RID: 8490 RVA: 0x000B3D54 File Offset: 0x000B1F54
105 public void ModExpPartySkill(int ele, int a)
106 {
107 }
108
109 // Token: 0x0600212B RID: 8491 RVA: 0x000B3D58 File Offset: 0x000B1F58
110 public Element GetBestSkill(int ele)
111 {
112 Element element = Element.Create(ele, 0);
113 foreach (Chara chara in this.members)
114 {
115 if (chara.IsAliveInCurrentZone && chara.Evalue(ele) > element.Value)
116 {
117 element = chara.elements.GetElement(ele);
118 }
119 }
120 return element;
121 }
122
123 // Token: 0x0600212C RID: 8492 RVA: 0x000B3DD4 File Offset: 0x000B1FD4
124 public bool IsCriticallyWounded(bool includePc = false)
125 {
126 foreach (Chara chara in this.members)
127 {
128 if ((!includePc || !chara.IsPC) && chara.IsCriticallyWounded(false))
129 {
130 return true;
131 }
132 }
133 return false;
134 }
135
136 // Token: 0x0600212D RID: 8493 RVA: 0x000B3E3C File Offset: 0x000B203C
137 public int EValue(int ele)
138 {
139 int num = 0;
140 foreach (Chara chara in this.members)
141 {
142 if (chara.Evalue(ele) > num)
143 {
144 num = chara.Evalue(ele);
145 }
146 }
147 return num;
148 }
149
150 // Token: 0x0600212E RID: 8494 RVA: 0x000B3EA0 File Offset: 0x000B20A0
151 public bool HasElement(int ele)
152 {
153 using (List<Chara>.Enumerator enumerator = this.members.GetEnumerator())
154 {
155 while (enumerator.MoveNext())
156 {
157 if (enumerator.Current.HasElement(ele, 1))
158 {
159 return true;
160 }
161 }
162 }
163 return false;
164 }
165
166 // Token: 0x0600212F RID: 8495 RVA: 0x000B3EFC File Offset: 0x000B20FC
167 public int Count()
168 {
169 int num = 0;
170 using (List<Chara>.Enumerator enumerator = this.members.GetEnumerator())
171 {
172 while (enumerator.MoveNext())
173 {
174 if (!enumerator.Current.isDead)
175 {
176 num++;
177 }
178 }
179 }
180 return num;
181 }
182
183 // Token: 0x0400111A RID: 4378
184 [JsonProperty]
185 public int uidLeader;
186
187 // Token: 0x0400111B RID: 4379
188 [JsonProperty]
189 public List<int> uidMembers = new List<int>();
190
191 // Token: 0x0400111C RID: 4380
192 public List<Chara> _members;
193
194 // Token: 0x0400111D RID: 4381
195 public RefChara refLeader = new RefChara();
196}
Definition Chara.cs:12
Definition Party.cs:8