source: OniSplit/Xml/ParticleXml.cs@ 1178

Last change on this file since 1178 was 1114, checked in by iritscen, 5 years ago

Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File size: 15.9 KB
Line 
1using System;
2using Oni.Particles;
3
4namespace Oni.Xml
5{
6 internal class ParticleXml
7 {
8 protected static readonly ParticleFlags1[] optionFlags1 = new[]
9 {
10 ParticleFlags1.Decorative,
11 ParticleFlags1.CollideWithWalls,
12 ParticleFlags1.CollideWithChars,
13 };
14
15 protected static readonly ParticleFlags2[] optionFlags2 = new[]
16 {
17 ParticleFlags2.InitiallyHidden,
18 ParticleFlags2.DrawAsSky,
19 ParticleFlags2.DontAttractThroughWalls,
20 ParticleFlags2.ExpireOnCutscene,
21 ParticleFlags2.DieOnCutscene,
22 ParticleFlags2.LockPositionToLink,
23 };
24
25 protected static readonly ParticleFlags1[] appearanceFlags1 = new ParticleFlags1[]
26 {
27 };
28
29 protected static readonly ParticleFlags1[] appearanceExFlags1 = new[]
30 {
31 ParticleFlags1.ScaleToVelocity,
32 ParticleFlags1.UseSeparateYScale,
33 };
34
35 protected static readonly ParticleFlags2[] appearanceFlags2 = new[]
36 {
37 ParticleFlags2.Invisible,
38 ParticleFlags2.IsContrailEmitter
39 };
40
41 protected static readonly ParticleFlags2[] appearanceExFlags2 = new[]
42 {
43 ParticleFlags2.Invisible,
44 ParticleFlags2.UseSpecialTint,
45 ParticleFlags2.FadeOutOnEdge,
46 ParticleFlags2.OneSidedEdgeFade,
47 ParticleFlags2.LensFlare,
48 ParticleFlags2.DecalFullBrightness
49 };
50
51 protected class EventActionParameterInfo
52 {
53 public static readonly EventActionParameterInfo[] EmptyActionParameterInfos = new EventActionParameterInfo[0];
54 public string Name;
55 public StorageType Type;
56
57 public EventActionParameterInfo(string name, StorageType type)
58 {
59 this.Name = name;
60 this.Type = type;
61 }
62 }
63
64 protected class EventActionInfo
65 {
66 public int OutCount;
67 public EventActionParameterInfo[] Parameters;
68
69 public EventActionInfo(int outCount, params EventActionParameterInfo[] parmeters)
70 {
71 this.OutCount = outCount;
72 this.Parameters = parmeters;
73 }
74 }
75
76 protected static readonly EventActionInfo[] eventActionInfoTable = new EventActionInfo[]
77 {
78 new EventActionInfo(1,
79 new EventActionParameterInfo("Target", StorageType.Float),
80 new EventActionParameterInfo("Rate", StorageType.Float)),
81 new EventActionInfo(2,
82 new EventActionParameterInfo("Target", StorageType.Float),
83 new EventActionParameterInfo("Velocity", StorageType.Float),
84 new EventActionParameterInfo("Acceleration", StorageType.Float)),
85 new EventActionInfo(1,
86 new EventActionParameterInfo("Target", StorageType.Float),
87 new EventActionParameterInfo("Min", StorageType.Float),
88 new EventActionParameterInfo("Max", StorageType.Float),
89 new EventActionParameterInfo("Rate", StorageType.Float)),
90 new EventActionInfo(2,
91 new EventActionParameterInfo("Target", StorageType.Float),
92 new EventActionParameterInfo("State", StorageType.PingPongState),
93 new EventActionParameterInfo("Min", StorageType.Float),
94 new EventActionParameterInfo("Max", StorageType.Float),
95 new EventActionParameterInfo("Rate", StorageType.Float)),
96 new EventActionInfo(1,
97 new EventActionParameterInfo("Target", StorageType.Float),
98 new EventActionParameterInfo("Min", StorageType.Float),
99 new EventActionParameterInfo("Max", StorageType.Float),
100 new EventActionParameterInfo("Rate", StorageType.Float)),
101 new EventActionInfo(1,
102 new EventActionParameterInfo("Target", StorageType.Float),
103 new EventActionParameterInfo("Rate", StorageType.Float),
104 new EventActionParameterInfo("Value", StorageType.Float)),
105 new EventActionInfo(1,
106 new EventActionParameterInfo("Target", StorageType.Color),
107 new EventActionParameterInfo("Color0", StorageType.Color),
108 new EventActionParameterInfo("Color1", StorageType.Color),
109 new EventActionParameterInfo("Amount", StorageType.Float)),
110 null,
111 new EventActionInfo(0,
112 new EventActionParameterInfo("TimeToDie", StorageType.Float)),
113 new EventActionInfo(0,
114 new EventActionParameterInfo("Action", StorageType.ActionIndex),
115 new EventActionParameterInfo("Lifetime", StorageType.Float)),
116 new EventActionInfo(0,
117 new EventActionParameterInfo("Action", StorageType.ActionIndex),
118 new EventActionParameterInfo("Lifetime", StorageType.Float)),
119 new EventActionInfo(0),
120 new EventActionInfo(0,
121 new EventActionParameterInfo("Time", StorageType.Float)),
122 new EventActionInfo(0,
123 new EventActionParameterInfo("Emitter", StorageType.Emitter)),
124 new EventActionInfo(0,
125 new EventActionParameterInfo("Emitter", StorageType.Emitter)),
126 new EventActionInfo(0,
127 new EventActionParameterInfo("Emitter", StorageType.Emitter),
128 new EventActionParameterInfo("Particles", StorageType.Float)),
129 new EventActionInfo(0,
130 new EventActionParameterInfo("Emitter", StorageType.Emitter)),
131 new EventActionInfo(0,
132 new EventActionParameterInfo("Emitter", StorageType.Emitter)),
133 new EventActionInfo(0,
134 new EventActionParameterInfo("Emitter", StorageType.Emitter)),
135 null,
136 new EventActionInfo(0,
137 new EventActionParameterInfo("Sound", StorageType.AmbientSoundName)),
138 new EventActionInfo(0),
139 new EventActionInfo(0),
140 new EventActionInfo(0,
141 new EventActionParameterInfo("Sound", StorageType.ImpulseSoundName)),
142 null,
143 null,
144 new EventActionInfo(0,
145 new EventActionParameterInfo("Damage", StorageType.Float),
146 new EventActionParameterInfo("StunDamage", StorageType.Float),
147 new EventActionParameterInfo("KnockBack", StorageType.Float),
148 new EventActionParameterInfo("DamageType", StorageType.DamageType),
149 new EventActionParameterInfo("SelfImmune", StorageType.Boolean),
150 new EventActionParameterInfo("CanHitMultiple", StorageType.Boolean)),
151 new EventActionInfo(0,
152 new EventActionParameterInfo("Damage", StorageType.Float),
153 new EventActionParameterInfo("StunDamage", StorageType.Float),
154 new EventActionParameterInfo("KnockBack", StorageType.Float),
155 new EventActionParameterInfo("Radius", StorageType.Float),
156 new EventActionParameterInfo("FallOff", StorageType.BlastFalloff),
157 new EventActionParameterInfo("DamageType", StorageType.DamageType),
158 new EventActionParameterInfo("SelfImmune", StorageType.Boolean),
159 new EventActionParameterInfo("DamageEnvironment", StorageType.Boolean)),
160 new EventActionInfo(0),
161 new EventActionInfo(0,
162 new EventActionParameterInfo("Damage", StorageType.Float)),
163 new EventActionInfo(0,
164 new EventActionParameterInfo("BlastVelocity", StorageType.Float),
165 new EventActionParameterInfo("Radius", StorageType.Float)),
166 new EventActionInfo(0),
167 null,
168 new EventActionInfo(0,
169 new EventActionParameterInfo("Space", StorageType.CoordFrame),
170 new EventActionParameterInfo("Rate", StorageType.Float),
171 new EventActionParameterInfo("RotateVelocity", StorageType.Boolean)),
172 new EventActionInfo(0,
173 new EventActionParameterInfo("Space", StorageType.CoordFrame),
174 new EventActionParameterInfo("Rate", StorageType.Float),
175 new EventActionParameterInfo("RotateVelocity", StorageType.Boolean)),
176 new EventActionInfo(0,
177 new EventActionParameterInfo("Space", StorageType.CoordFrame),
178 new EventActionParameterInfo("Rate", StorageType.Float),
179 new EventActionParameterInfo("RotateVelocity", StorageType.Boolean)),
180 null,
181 new EventActionInfo(0,
182 new EventActionParameterInfo("DelayTime", StorageType.Float)),
183 new EventActionInfo(0,
184 new EventActionParameterInfo("Gravity", StorageType.Float),
185 new EventActionParameterInfo("MaxG", StorageType.Float),
186 new EventActionParameterInfo("HorizontalOnly", StorageType.Boolean)),
187 new EventActionInfo(0,
188 new EventActionParameterInfo("TurnSpeed", StorageType.Float),
189 new EventActionParameterInfo("PredictPosition", StorageType.Boolean),
190 new EventActionParameterInfo("HorizontalOnly", StorageType.Boolean)),
191 new EventActionInfo(0,
192 new EventActionParameterInfo("AccelRate", StorageType.Float),
193 new EventActionParameterInfo("MaxAccel", StorageType.Float),
194 new EventActionParameterInfo("DesiredDistance", StorageType.Float)),
195 null,
196 null,
197 null,
198 null,
199 null,
200 null,
201 new EventActionInfo(0),
202 new EventActionInfo(0,
203 new EventActionParameterInfo("Fraction", StorageType.Float)),
204 new EventActionInfo(1,
205 new EventActionParameterInfo("Theta", StorageType.Float),
206 new EventActionParameterInfo("Radius", StorageType.Float),
207 new EventActionParameterInfo("RotateSpeed", StorageType.Float)),
208 new EventActionInfo(0,
209 new EventActionParameterInfo("Resistance", StorageType.Float),
210 new EventActionParameterInfo("MinimumVelocity", StorageType.Float)),
211 new EventActionInfo(0,
212 new EventActionParameterInfo("Acceleration", StorageType.Float),
213 new EventActionParameterInfo("MaxSpeed", StorageType.Float),
214 new EventActionParameterInfo("SidewaysDecay", StorageType.Float),
215 new EventActionParameterInfo("DirX", StorageType.Float),
216 new EventActionParameterInfo("DirY", StorageType.Float),
217 new EventActionParameterInfo("DirZ", StorageType.Float),
218 new EventActionParameterInfo("Space", StorageType.CoordFrame)),
219 new EventActionInfo(0,
220 new EventActionParameterInfo("Speed", StorageType.Float),
221 new EventActionParameterInfo("Space", StorageType.CoordFrame),
222 new EventActionParameterInfo("NoSideways", StorageType.Boolean)),
223 new EventActionInfo(0,
224 new EventActionParameterInfo("Theta", StorageType.Float),
225 new EventActionParameterInfo("Radius", StorageType.Float),
226 new EventActionParameterInfo("Rotate_speed", StorageType.Float)),
227 new EventActionInfo(0,
228 new EventActionParameterInfo("Direction", StorageType.Direction),
229 new EventActionParameterInfo("Value", StorageType.Float)),
230 new EventActionInfo(0,
231 new EventActionParameterInfo("Effect", StorageType.ImpactName),
232 new EventActionParameterInfo("WallOffset", StorageType.Float),
233 new EventActionParameterInfo("Orientation", StorageType.CollisionOrient),
234 new EventActionParameterInfo("Attach", StorageType.Boolean)),
235 new EventActionInfo(0),
236 new EventActionInfo(0,
237 new EventActionParameterInfo("ElasticDirect", StorageType.Float),
238 new EventActionParameterInfo("ElasticGlancing", StorageType.Float)),
239 new EventActionInfo(0),
240 new EventActionInfo(0),
241 new EventActionInfo(0,
242 new EventActionParameterInfo("ImpactType", StorageType.ImpactName),
243 new EventActionParameterInfo("ImpactModifier", StorageType.ImpactModifier)),
244 null,
245 new EventActionInfo(0),
246 new EventActionInfo(0),
247 new EventActionInfo(0,
248 new EventActionParameterInfo("Tick", StorageType.Float)),
249 new EventActionInfo(0),
250 null,
251 null,
252 null,
253 null,
254 new EventActionInfo(1,
255 new EventActionParameterInfo("Target", StorageType.Float),
256 new EventActionParameterInfo("Value", StorageType.Float)),
257 new EventActionInfo(0),
258 new EventActionInfo(0,
259 new EventActionParameterInfo("Action", StorageType.ActionIndex),
260 new EventActionParameterInfo("Var", StorageType.Float),
261 new EventActionParameterInfo("Threshold", StorageType.Float)),
262 new EventActionInfo(0,
263 new EventActionParameterInfo("Action", StorageType.ActionIndex),
264 new EventActionParameterInfo("Var", StorageType.Float),
265 new EventActionParameterInfo("Threshold", StorageType.Float)),
266 new EventActionInfo(0,
267 new EventActionParameterInfo("Action", StorageType.ActionIndex)),
268 new EventActionInfo(0,
269 new EventActionParameterInfo("Action", StorageType.ActionIndex)),
270 null,
271 new EventActionInfo(0,
272 new EventActionParameterInfo("Emitter", StorageType.Emitter),
273 new EventActionParameterInfo("FuseTime", StorageType.Float)),
274 new EventActionInfo(0),
275 new EventActionInfo(5,
276 new EventActionParameterInfo("AxisX", StorageType.Float),
277 new EventActionParameterInfo("AxisY", StorageType.Float),
278 new EventActionParameterInfo("AxisZ", StorageType.Float),
279 new EventActionParameterInfo("CurrentAngle", StorageType.Float),
280 new EventActionParameterInfo("TimeUntilCheck", StorageType.Float),
281 new EventActionParameterInfo("SenseDistance", StorageType.Float),
282 new EventActionParameterInfo("TurningSpeed", StorageType.Float),
283 new EventActionParameterInfo("TurningDecay", StorageType.Float)),
284 new EventActionInfo(1,
285 new EventActionParameterInfo("SwirlAngle", StorageType.Float),
286 new EventActionParameterInfo("SwirlBaseRate", StorageType.Float),
287 new EventActionParameterInfo("SwirlDeltaRate", StorageType.Float),
288 new EventActionParameterInfo("SwirlSpeed", StorageType.Float)),
289 new EventActionInfo(0,
290 new EventActionParameterInfo("Height", StorageType.Float)),
291 new EventActionInfo(0,
292 new EventActionParameterInfo("Speed", StorageType.Float)),
293 new EventActionInfo(1,
294 new EventActionParameterInfo("Variable", StorageType.Float),
295 new EventActionParameterInfo("BaseValue", StorageType.Float),
296 new EventActionParameterInfo("DeltaValue", StorageType.Float),
297 new EventActionParameterInfo("MinValue", StorageType.Float),
298 new EventActionParameterInfo("MaxValue", StorageType.Float)),
299 new EventActionInfo(0),
300 new EventActionInfo(0),
301 new EventActionInfo(0),
302 null,
303 null,
304 null,
305 };
306 }
307}
Note: See TracBrowser for help on using the repository browser.