2 using System.Collections.Generic;
\r
4 using System.Runtime.InteropServices;
\r
10 internal class CAct演奏DrumsチップファイアD : CActivity
\r
12 public CAct演奏DrumsチップファイアD()
\r
16 [StructLayout(LayoutKind.Sequential)]
\r
21 public CCounter ct進行;
\r
27 [StructLayout(LayoutKind.Sequential)]
\r
32 public CCounter ct進行;
\r
39 [StructLayout(LayoutKind.Sequential)]
\r
44 public CCounter ct進行;
\r
45 public int n前回のValue;
\r
50 public float f加速度の加速度X;
\r
51 public float f加速度の加速度Y;
\r
52 public float f重力加速度;
\r
56 [StructLayout(LayoutKind.Sequential)]
\r
61 public CCounter ct進行;
\r
70 const int BIGWAVE_MAX = 20;
\r
73 const int FIRE_MAX = 8 * 8;
\r
74 readonly float[] fY波の最小仰角 = new float[] { -130f, -126f, -120f, -118f, -110f, -108f, -103f, -97f };
\r
75 readonly float[] fY波の最大仰角 = new float[] { 70f, 72f, 77f, 84f, 89f, 91f, 99f, 107f };
\r
76 readonly int[] nレーンの中央X座標 = new int[]
\r
78 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.LC) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.LC)/2,
\r
79 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.HH) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.HH)/2,
\r
80 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.SD) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.SD)/2,
\r
81 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.BD) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.BD)/2,
\r
82 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.HT) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.HT)/2,
\r
83 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.LT) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.LT)/2,
\r
84 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.FT) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.FT)/2,
\r
85 CDTXMania.Instance.ConfigIni.GetLaneX(ELane.CY) + CDTXMania.Instance.ConfigIni.GetLaneW(ELane.CY)/2,
\r
87 const int STAR_MAX = 0x100;
\r
88 ST火花[] st火花 = new ST火花[FIRE_MAX];
\r
89 ST大波[] st大波 = new ST大波[BIGWAVE_MAX];
\r
90 ST細波[] st細波 = new ST細波[BIGWAVE_MAX];
\r
91 ST青い星[] st青い星 = new ST青い星[STAR_MAX];
\r
98 public void Start(ELane lane, bool bフィルイン = false, bool b大波 = false, bool b細波 = false)
\r
100 if (CDTXMania.Instance.ConfigIni.bDrums有効 && CDTXMania.Instance.DTX.bチップがある.Drums)
\r
102 if (this.tx火花 != null)
\r
104 for (int j = 0; j < FIRE_MAX; j++)
\r
106 // yyagi 負荷軽減のつもり・・・だが、あまり効果なさげ
\r
107 if (this.st火花[j].b使用中 && this.st火花[j].nLane == (int)lane)
\r
109 this.st火花[j].ct進行.t停止();
\r
110 this.st火花[j].b使用中 = false;
\r
113 float n回転初期値 = CDTXMania.Instance.Random.Next(360);
\r
114 for (int i = 0; i < 8; i++)
\r
116 for (int j = 0; j < FIRE_MAX; j++)
\r
118 if (!this.st火花[j].b使用中)
\r
120 this.st火花[j].b使用中 = true;
\r
121 this.st火花[j].nLane = (int)lane;
\r
122 this.st火花[j].ct進行 = new CCounter(0, 70, 3, CDTXMania.Instance.Timer);
\r
123 this.st火花[j].f回転単位 = C変換.DegreeToRadian((float)(n回転初期値 + (i * 90f)));
\r
124 this.st火花[j].f回転方向 = (i < 4) ? 1f : -2f;
\r
125 this.st火花[j].fサイズ = (i < 4) ? 1f : 0.5f;
\r
131 if (bフィルイン && (this.tx青い星 != null))
\r
133 for (int i = 0; i < 0x10; i++)
\r
135 for (int j = 0; j < STAR_MAX; j++)
\r
137 if (!this.st青い星[j].b使用中)
\r
139 this.st青い星[j].b使用中 = true;
\r
140 int n回転初期値 = CDTXMania.Instance.Random.Next(360);
\r
141 double num7 = 0.9 + (((double)CDTXMania.Instance.Random.Next(40)) / 100.0);
\r
142 this.st青い星[j].nLane = (int)lane;
\r
143 this.st青い星[j].ct進行 = new CCounter(0, 100, 7, CDTXMania.Instance.Timer);
\r
144 this.st青い星[j].fX = this.nレーンの中央X座標[(int)lane];
\r
145 this.st青い星[j].fY = -posY;
\r
146 this.st青い星[j].f加速度X = (float)(num7 * Math.Cos((Math.PI * 2 * n回転初期値) / 360.0));
\r
147 this.st青い星[j].f加速度Y = (float)(num7 * (Math.Sin((Math.PI * 2 * n回転初期値) / 360.0) - 0.2));
\r
148 this.st青い星[j].f加速度の加速度X = 0.995f;
\r
149 this.st青い星[j].f加速度の加速度Y = 0.995f;
\r
150 this.st青い星[j].f重力加速度 = 0.00355f;
\r
151 this.st青い星[j].f半径 = (float)(0.5 + (((double)CDTXMania.Instance.Random.Next(30)) / 100.0));
\r
157 if (b大波 && (this.tx大波 != null))
\r
159 for (int i = 0; i < 4; i++)
\r
161 for (int j = 0; j < BIGWAVE_MAX; j++)
\r
163 if (!this.st大波[j].b使用中)
\r
165 this.st大波[j].b使用中 = true;
\r
166 this.st大波[j].nLane = (int)lane;
\r
167 this.st大波[j].f半径 = ((float)((20 - CDTXMania.Instance.Random.Next(40)) + 100)) / 100f;
\r
168 this.st大波[j].n進行速度ms = 10;
\r
169 this.st大波[j].ct進行 = new CCounter(0, 100, this.st大波[j].n進行速度ms, CDTXMania.Instance.Timer);
\r
170 this.st大波[j].ct進行.n現在の値 = i * 10;
\r
171 this.st大波[j].f角度X = C変換.DegreeToRadian((float)((((double)(CDTXMania.Instance.Random.Next(100) * 50)) / 100.0) + 30.0));
\r
172 this.st大波[j].f角度Y = C変換.DegreeToRadian(this.b大波Balance ? (this.fY波の最小仰角[(int)lane] + CDTXMania.Instance.Random.Next(30)) : (this.fY波の最大仰角[(int)lane] - CDTXMania.Instance.Random.Next(30)));
\r
173 this.st大波[j].f回転単位 = C変換.DegreeToRadian((float)0f);
\r
174 this.st大波[j].f回転方向 = 1f;
\r
175 this.b大波Balance = !this.b大波Balance;
\r
181 if (b細波 && (this.tx細波 != null))
\r
183 for (int i = 0; i < 1; i++)
\r
185 for (int j = 0; j < BIGWAVE_MAX; j++)
\r
187 if (!this.st細波[j].b使用中)
\r
189 this.st細波[j].b使用中 = true;
\r
190 this.st細波[j].nLane = (int)lane;
\r
191 this.st細波[j].f半径 = ((float)((20 - CDTXMania.Instance.Random.Next(40)) + 100)) / 100f;
\r
192 this.st細波[j].n進行速度ms = 8;
\r
193 this.st細波[j].ct進行 = new CCounter(0, 100, this.st細波[j].n進行速度ms, CDTXMania.Instance.Timer);
\r
194 this.st細波[j].ct進行.n現在の値 = 0;
\r
195 this.st細波[j].f角度X = C変換.DegreeToRadian((float)((((double)(CDTXMania.Instance.Random.Next(100) * 50)) / 100.0) + 30.0));
\r
196 this.st細波[j].f角度Y = C変換.DegreeToRadian(this.b細波Balance ? (this.fY波の最小仰角[(int)lane] + CDTXMania.Instance.Random.Next(30)) : (this.fY波の最大仰角[(int)lane] - CDTXMania.Instance.Random.Next(30)));
\r
197 this.b細波Balance = !this.b細波Balance;
\r
206 public override void On活性化()
\r
210 for (int i = 0; i < FIRE_MAX; i++)
\r
212 this.st火花[i] = new ST火花();
\r
213 this.st火花[i].b使用中 = false;
\r
214 this.st火花[i].ct進行 = new CCounter();
\r
216 for (int i = 0; i < STAR_MAX; i++)
\r
218 this.st青い星[i] = new ST青い星();
\r
219 this.st青い星[i].b使用中 = false;
\r
220 this.st青い星[i].ct進行 = new CCounter();
\r
222 for (int i = 0; i < BIGWAVE_MAX; i++)
\r
224 this.st大波[i] = new ST大波();
\r
225 this.st大波[i].b使用中 = false;
\r
226 this.st大波[i].ct進行 = new CCounter();
\r
227 this.st細波[i] = new ST細波();
\r
228 this.st細波[i].b使用中 = false;
\r
229 this.st細波[i].ct進行 = new CCounter();
\r
232 posY = C演奏判定ライン座標共通.n判定ラインY座標(EPart.Drums, false, true);
\r
233 int offsety = CDTXMania.Instance.Coordinates.ImgJudgeLine.H / 2;
\r
240 public override void On非活性化()
\r
244 for (int i = 0; i < FIRE_MAX; i++)
\r
246 this.st火花[i].ct進行 = null;
\r
248 for (int i = 0; i < STAR_MAX; i++)
\r
250 this.st青い星[i].ct進行 = null;
\r
252 for (int i = 0; i < BIGWAVE_MAX; i++)
\r
254 this.st大波[i].ct進行 = null;
\r
255 this.st細波[i].ct進行 = null;
\r
261 public override void OnManagedリソースの作成()
\r
265 this.tx火花 = TextureFactory.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenPlayDrums chip fire.png"));
\r
266 if (this.tx火花 != null)
\r
268 this.tx火花.b加算合成 = true;
\r
270 this.tx青い星 = TextureFactory.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenPlayDrums chip star.png"));
\r
271 if (this.tx青い星 != null)
\r
273 this.tx青い星.b加算合成 = true;
\r
275 this.tx大波 = TextureFactory.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenPlayDrums chip wave.png"));
\r
276 if (this.tx大波 != null)
\r
278 this.tx大波.b加算合成 = true;
\r
280 this.tx細波 = TextureFactory.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenPlayDrums chip wave2.png"));
\r
281 if (this.tx細波 != null)
\r
283 this.tx細波.b加算合成 = true;
\r
285 base.OnManagedリソースの作成();
\r
289 public override void OnManagedリソースの解放()
\r
293 TextureFactory.tテクスチャの解放(ref this.tx火花);
\r
294 TextureFactory.tテクスチャの解放(ref this.tx青い星);
\r
295 TextureFactory.tテクスチャの解放(ref this.tx大波);
\r
296 TextureFactory.tテクスチャの解放(ref this.tx細波);
\r
297 base.OnManagedリソースの解放();
\r
301 public override int On進行描画()
\r
303 if (b活性化してる && CDTXMania.Instance.ConfigIni.bDrums有効 && CDTXMania.Instance.DTX.bチップがある.Drums)
\r
305 for (int i = 0; i < FIRE_MAX; i++)
\r
307 if (this.st火花[i].b使用中)
\r
309 this.st火花[i].ct進行.t進行();
\r
310 if (this.st火花[i].ct進行.b終了値に達した)
\r
312 this.st火花[i].ct進行.t停止();
\r
313 this.st火花[i].b使用中 = false;
\r
315 Matrix identity = Matrix.Identity;
\r
316 float num2 = ((float)this.st火花[i].ct進行.n現在の値) / 70f;
\r
317 float num3 = this.st火花[i].f回転単位 + (this.st火花[i].f回転方向 * C変換.DegreeToRadian((float)(60f * num2)));
\r
318 float num4 = ((float)(0.2 + (0.8 * Math.Cos((((double)this.st火花[i].ct進行.n現在の値) / 50.0) * Math.PI / 2)))) * this.st火花[i].fサイズ;
\r
319 identity *= Matrix.Scaling(0.2f + num4, 0.2f + this.st火花[i].fサイズ, 1f);
\r
320 identity *= Matrix.RotationZ(num3 + ((float)Math.PI / 2));
\r
321 float num5 = ((float)(0.8 * Math.Sin(num2 * Math.PI / 2))) * this.st火花[i].fサイズ;
\r
323 float dx = (this.nレーンの中央X座標[this.st火花[i].nLane] + (((float)Math.Cos((double)num3)) * num5) - SampleFramework.GameWindowSize.Width / 2);
\r
324 float dy = -(posY + (((float)Math.Sin((double)num3)) * num5) - SampleFramework.GameWindowSize.Height / 2f);
\r
325 identity *= Matrix.Translation(dx, dy, 0f);
\r
326 if (this.tx火花 != null)
\r
328 this.tx火花.t3D描画(CDTXMania.Instance.Device, identity);
\r
332 for (int i = 0; i < STAR_MAX; i++)
\r
334 if (this.st青い星[i].b使用中)
\r
336 this.st青い星[i].n前回のValue = this.st青い星[i].ct進行.n現在の値;
\r
337 this.st青い星[i].ct進行.t進行();
\r
338 if (this.st青い星[i].ct進行.b終了値に達した)
\r
340 this.st青い星[i].ct進行.t停止();
\r
341 this.st青い星[i].b使用中 = false;
\r
343 for (int n = this.st青い星[i].n前回のValue; n < this.st青い星[i].ct進行.n現在の値; n++)
\r
345 this.st青い星[i].fX += this.st青い星[i].f加速度X;
\r
346 this.st青い星[i].fY -= this.st青い星[i].f加速度Y;
\r
347 this.st青い星[i].f加速度X *= this.st青い星[i].f加速度の加速度X;
\r
348 this.st青い星[i].f加速度Y *= this.st青い星[i].f加速度の加速度Y;
\r
349 this.st青い星[i].f加速度Y -= this.st青い星[i].f重力加速度;
\r
351 Matrix mat = Matrix.Identity;
\r
352 float x = (float)(this.st青い星[i].f半径 * Math.Cos((Math.PI / 2 * this.st青い星[i].ct進行.n現在の値) / 100.0));
\r
353 mat *= Matrix.Scaling(x, x, 1f);
\r
354 mat *= Matrix.Translation(
\r
355 this.st青い星[i].fX - SampleFramework.GameWindowSize.Width / 2,
\r
356 -(this.st青い星[i].fY - SampleFramework.GameWindowSize.Height / 2),
\r
359 if (this.tx青い星 != null)
\r
361 this.tx青い星.t3D描画(CDTXMania.Instance.Device, mat);
\r
365 for (int i = 0; i < BIGWAVE_MAX; i++)
\r
367 if (this.st大波[i].b使用中)
\r
369 this.st大波[i].ct進行.t進行();
\r
370 if (this.st大波[i].ct進行.b終了値に達した)
\r
372 this.st大波[i].ct進行.t停止();
\r
373 this.st大波[i].b使用中 = false;
\r
375 if (this.st大波[i].ct進行.n現在の値 >= 0)
\r
377 Matrix matrix3 = Matrix.Identity;
\r
378 float num10 = ((float)this.st大波[i].ct進行.n現在の値) / 100f;
\r
379 float angle = this.st大波[i].f回転単位 + (this.st大波[i].f回転方向 * C変換.DegreeToRadian((float)(60f * num10)));
\r
383 num12 = 2.5f * num10;
\r
385 else if (num10 < 0.8f)
\r
387 num12 = (float)(1.0 + (10.1 * (1.0 - Math.Cos((Math.PI / 2 * (num10 - 0.4)) * 2.5))));
\r
391 num12 = 11.1f + (12.5f * (num10 - 0.8f));
\r
400 num13 = (int)((55f * (1f - num10)) / 0.25f);
\r
402 matrix3 *= Matrix.Scaling(num12 * this.st大波[i].f半径, num12 * this.st大波[i].f半径, 1f);
\r
403 matrix3 *= Matrix.RotationZ(angle);
\r
404 matrix3 *= Matrix.RotationX(this.st大波[i].f角度X);
\r
405 matrix3 *= Matrix.RotationY(this.st大波[i].f角度Y);
\r
407 float dx = this.nレーンの中央X座標[this.st大波[i].nLane] - SampleFramework.GameWindowSize.Width / 2;
\r
408 float dy = -(posY - SampleFramework.GameWindowSize.Height / 2);
\r
409 matrix3 *= Matrix.Translation(dx, dy, 0f);
\r
410 if (this.tx大波 != null)
\r
412 this.tx大波.n透明度 = num13;
\r
413 this.tx大波.t3D描画(CDTXMania.Instance.Device, matrix3);
\r
418 for (int i = 0; i < BIGWAVE_MAX; i++)
\r
420 if (this.st細波[i].b使用中)
\r
422 this.st細波[i].ct進行.t進行();
\r
423 if (this.st細波[i].ct進行.b終了値に達した)
\r
425 this.st細波[i].ct進行.t停止();
\r
426 this.st細波[i].b使用中 = false;
\r
428 if (this.st細波[i].ct進行.n現在の値 >= 0)
\r
430 Matrix matrix4 = Matrix.Identity;
\r
431 float num15 = ((float)this.st細波[i].ct進行.n現在の値) / 100f;
\r
432 float num16 = 14f * num15;
\r
433 int num17 = (num15 < 0.5f) ? 155 : ((int)((155f * (1f - num15)) / 1f));
\r
434 matrix4 *= Matrix.Scaling(
\r
435 num16 * this.st細波[i].f半径,
\r
436 num16 * this.st細波[i].f半径,
\r
439 matrix4 *= Matrix.RotationX(this.st細波[i].f角度X);
\r
440 matrix4 *= Matrix.RotationY(this.st細波[i].f角度Y);
\r
442 float dx = this.nレーンの中央X座標[this.st細波[i].nLane] - SampleFramework.GameWindowSize.Width / 2;
\r
443 float dy = -(posY - SampleFramework.GameWindowSize.Height / 2);
\r
444 matrix4 *= Matrix.Translation(dx, dy, 0f);
\r
445 if (this.tx細波 != null)
\r
447 this.tx細波.n透明度 = num17;
\r
448 this.tx細波.t3D描画(CDTXMania.Instance.Device, matrix4);
\r