2 using System.Collections.Generic;
\r
4 using System.Runtime.InteropServices;
\r
10 internal class CAct演奏DrumsチップファイアD : CActivity
\r
14 public CAct演奏DrumsチップファイアD()
\r
16 base.b活性化してない = true;
\r
22 public void Start( Eレーン lane )
\r
24 this.Start( lane, false, false, false, 0 );
\r
26 public void Start( Eレーン lane, bool bフィルイン )
\r
28 this.Start( lane, bフィルイン, false, false, 0 );
\r
30 public void Start( Eレーン lane, bool bフィルイン, bool b大波 )
\r
32 this.Start( lane, bフィルイン, b大波, false, 0 );
\r
34 public void Start( Eレーン lane, bool bフィルイン, bool b大波, bool b細波 )
\r
36 this.Start( lane, bフィルイン, b大波, b細波, 0 );
\r
38 public void Start( Eレーン lane, bool bフィルイン, bool b大波, bool b細波, int _nJudgeLinePosY_delta_Drums )
\r
40 nJudgeLinePosY_delta_Drums = _nJudgeLinePosY_delta_Drums;
\r
41 if( this.tx火花 != null )
\r
43 for ( int j = 0; j < FIRE_MAX; j++ )
\r
45 if ( this.st火花[ j ].b使用中 && this.st火花[ j ].nLane == (int) lane ) // yyagi 負荷軽減のつもり・・・だが、あまり効果なさげ
\r
47 this.st火花[ j ].ct進行.t停止();
\r
48 this.st火花[ j ].b使用中 = false;
\r
51 float n回転初期値 = CDTXMania.app.Random.Next( 360 );
\r
52 for ( int i = 0; i < 8; i++ )
\r
54 for( int j = 0; j < FIRE_MAX; j++ )
\r
56 if( !this.st火花[ j ].b使用中 )
\r
58 this.st火花[ j ].b使用中 = true;
\r
59 this.st火花[ j ].nLane = (int) lane;
\r
60 // this.st火花[ j ].ct進行 = new CCounter( 0, 35, 6, CDTXMania.app.Timer );
\r
61 this.st火花[ j ].ct進行 = new CCounter( 0, 70, 3, CDTXMania.app.Timer );
\r
62 this.st火花[ j ].f回転単位 = C変換.DegreeToRadian( (float) ( n回転初期値 + ( i * 90f ) ) );
\r
63 this.st火花[ j ].f回転方向 = ( i < 4 ) ? 1f : -2f;
\r
64 this.st火花[ j ].fサイズ = ( i < 4 ) ? 1f : 0.5f;
\r
70 if ( bフィルイン && ( this.tx青い星 != null ) )
\r
72 for ( int i = 0; i < 0x10; i++ )
\r
74 for ( int j = 0; j < STAR_MAX; j++ )
\r
76 if ( !this.st青い星[ j ].b使用中 )
\r
78 this.st青い星[ j ].b使用中 = true;
\r
79 int n回転初期値 = CDTXMania.app.Random.Next( 360 );
\r
80 double num7 = 0.9 + ( ( (double) CDTXMania.app.Random.Next( 40 ) ) / 100.0 );
\r
81 this.st青い星[ j ].nLane = (int) lane;
\r
82 this.st青い星[ j ].ct進行 = new CCounter( 0, 100, 7, CDTXMania.app.Timer );
\r
83 this.st青い星[ j ].fX =
\r
84 (int) ( this.nレーンの中央X座標[ (int) lane ] * ( CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ? 1.0 : 0.75 ) ) +
\r
85 ( ( CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ) ? (float) ( 54 * 3 ) : (float) ( 619 + 12 + 40 ) );
\r
86 this.st青い星[ j ].fY = CDTXMania.app.ConfigIni.bReverse.Drums ?
\r
87 (float) (119 + 4) - nJudgeLinePosY_delta_Drums : (float) (942 + 14) + nJudgeLinePosY_delta_Drums;
\r
88 this.st青い星[ j ].f加速度X = (float) ( num7 * Math.Cos( ( Math.PI * 2 * n回転初期値 ) / 360.0 ) );
\r
89 this.st青い星[ j ].f加速度Y = (float) ( num7 * ( Math.Sin( ( Math.PI * 2 * n回転初期値 ) / 360.0 ) - 0.2 ) );
\r
90 this.st青い星[ j ].f加速度の加速度X = 0.995f;
\r
91 this.st青い星[ j ].f加速度の加速度Y = 0.995f;
\r
92 this.st青い星[ j ].f重力加速度 = 0.00355f;
\r
93 this.st青い星[ j ].f半径 = (float) ( 0.5 + ( ( (double) CDTXMania.app.Random.Next( 30 ) ) / 100.0 ) );
\r
99 if( b大波 && ( this.tx大波 != null ) )
\r
101 for( int i = 0; i < 4; i++ )
\r
103 for( int j = 0; j < BIGWAVE_MAX; j++ )
\r
105 if( !this.st大波[ j ].b使用中 )
\r
107 this.st大波[ j ].b使用中 = true;
\r
108 this.st大波[ j ].nLane = (int) lane;
\r
109 this.st大波[ j ].f半径 = ( (float) ( ( 20 - CDTXMania.app.Random.Next( 40 ) ) + 100 ) ) / 100f;
\r
110 this.st大波[ j ].n進行速度ms = 10;
\r
111 this.st大波[ j ].ct進行 = new CCounter( 0, 100, this.st大波[ j ].n進行速度ms, CDTXMania.app.Timer );
\r
112 this.st大波[ j ].ct進行.n現在の値 = i * 10;
\r
113 this.st大波[ j ].f角度X = C変換.DegreeToRadian( (float) ( ( ( (double) ( CDTXMania.app.Random.Next( 100 ) * 50 ) ) / 100.0 ) + 30.0 ) );
\r
114 this.st大波[ j ].f角度Y = C変換.DegreeToRadian( this.b大波Balance ? ( this.fY波の最小仰角[ (int) lane ] + CDTXMania.app.Random.Next( 30 ) ) : ( this.fY波の最大仰角[ (int) lane ] - CDTXMania.app.Random.Next( 30 ) ) );
\r
115 this.st大波[ j ].f回転単位 = C変換.DegreeToRadian( (float) 0f );
\r
116 this.st大波[ j ].f回転方向 = 1f;
\r
117 this.b大波Balance = !this.b大波Balance;
\r
123 if( b細波 && ( this.tx細波 != null ) )
\r
125 for( int i = 0; i < 1; i++ )
\r
127 for( int j = 0; j < BIGWAVE_MAX; j++ )
\r
129 if( !this.st細波[ j ].b使用中 )
\r
131 this.st細波[ j ].b使用中 = true;
\r
132 this.st細波[ j ].nLane = (int) lane;
\r
133 this.st細波[ j ].f半径 = ( (float) ( ( 20 - CDTXMania.app.Random.Next( 40 ) ) + 100 ) ) / 100f;
\r
134 this.st細波[ j ].n進行速度ms = 8;
\r
135 this.st細波[ j ].ct進行 = new CCounter( 0, 100, this.st細波[ j ].n進行速度ms, CDTXMania.app.Timer );
\r
136 this.st細波[ j ].ct進行.n現在の値 = 0;
\r
137 this.st細波[ j ].f角度X = C変換.DegreeToRadian( (float) ( ( ( (double) ( CDTXMania.app.Random.Next( 100 ) * 50 ) ) / 100.0 ) + 30.0 ) );
\r
138 this.st細波[ j ].f角度Y = C変換.DegreeToRadian( this.b細波Balance ? ( this.fY波の最小仰角[ (int) lane ] + CDTXMania.app.Random.Next( 30 ) ) : ( this.fY波の最大仰角[ (int) lane ] - CDTXMania.app.Random.Next( 30 ) ) );
\r
139 this.b細波Balance = !this.b細波Balance;
\r
150 public override void On活性化()
\r
152 for( int i = 0; i < FIRE_MAX; i++ )
\r
154 this.st火花[ i ] = new ST火花();
\r
155 this.st火花[ i ].b使用中 = false;
\r
156 this.st火花[ i ].ct進行 = new CCounter();
\r
158 for( int i = 0; i < STAR_MAX; i++ )
\r
160 this.st青い星[ i ] = new ST青い星();
\r
161 this.st青い星[ i ].b使用中 = false;
\r
162 this.st青い星[ i ].ct進行 = new CCounter();
\r
164 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
166 this.st大波[ i ] = new ST大波();
\r
167 this.st大波[ i ].b使用中 = false;
\r
168 this.st大波[ i ].ct進行 = new CCounter();
\r
169 this.st細波[ i ] = new ST細波();
\r
170 this.st細波[ i ].b使用中 = false;
\r
171 this.st細波[ i ].ct進行 = new CCounter();
\r
175 public override void On非活性化()
\r
177 for( int i = 0; i <FIRE_MAX; i++ )
\r
179 this.st火花[ i ].ct進行 = null;
\r
181 for( int i = 0; i < STAR_MAX; i++ )
\r
183 this.st青い星[ i ].ct進行 = null;
\r
185 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
187 this.st大波[ i ].ct進行 = null;
\r
188 this.st細波[ i ].ct進行 = null;
\r
192 public override void OnManagedリソースの作成()
\r
194 if( !base.b活性化してない )
\r
196 this.tx火花 = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip fire.png" ) );
\r
197 if( this.tx火花 != null )
\r
199 this.tx火花.b加算合成 = true;
\r
201 this.tx青い星 = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip star.png" ) );
\r
202 if( this.tx青い星 != null )
\r
204 this.tx青い星.b加算合成 = true;
\r
206 this.tx大波 = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip wave.png" ) );
\r
207 if( this.tx大波 != null )
\r
209 this.tx大波.b加算合成 = true;
\r
211 this.tx細波 = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip wave2.png" ) );
\r
212 if( this.tx細波 != null )
\r
214 this.tx細波.b加算合成 = true;
\r
216 base.OnManagedリソースの作成();
\r
219 public override void OnManagedリソースの解放()
\r
221 if( !base.b活性化してない )
\r
223 TextureFactory.tテクスチャの解放( ref this.tx火花 );
\r
224 TextureFactory.tテクスチャの解放( ref this.tx青い星 );
\r
225 TextureFactory.tテクスチャの解放( ref this.tx大波 );
\r
226 TextureFactory.tテクスチャの解放( ref this.tx細波 );
\r
227 base.OnManagedリソースの解放();
\r
230 public override int On進行描画()
\r
232 if( !base.b活性化してない )
\r
234 for( int i = 0; i < FIRE_MAX; i++ )
\r
236 if( this.st火花[ i ].b使用中 )
\r
238 this.st火花[ i ].ct進行.t進行();
\r
239 if( this.st火花[ i ].ct進行.b終了値に達した )
\r
241 this.st火花[ i ].ct進行.t停止();
\r
242 this.st火花[ i ].b使用中 = false;
\r
244 Matrix identity = Matrix.Identity;
\r
245 // float num2 = ( (float) this.st火花[ i ].ct進行.n現在の値 * 2 ) / 70f;
\r
246 float num2 = ( (float) this.st火花[ i ].ct進行.n現在の値 ) / 70f;
\r
247 float num3 = this.st火花[ i ].f回転単位 + ( this.st火花[ i ].f回転方向 * C変換.DegreeToRadian( (float) ( 60f * num2 ) ) );
\r
248 // float num4 = ( (float) ( 0.2 + ( 0.8 * Math.Cos( ( ( (double) this.st火花[ i ].ct進行.n現在の値 ) * 2 / 50.0 ) * Math.PI / 2 ) ) ) ) * this.st火花[ i ].fサイズ;
\r
249 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
250 identity *= Matrix.Scaling( 0.2f + num4, 0.2f + this.st火花[ i ].fサイズ, 1f );
\r
251 identity *= Matrix.RotationZ( num3 + ( (float) Math.PI / 2 ) );
\r
252 float num5 = ( (float) ( 0.8 * Math.Sin( num2 * Math.PI / 2 ) ) ) * this.st火花[ i ].fサイズ;
\r
253 identity *= Matrix.Translation(
\r
254 ( (int)(this.nレーンの中央X座標[ this.st火花[ i ].nLane ] * ((CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left)? 1.0 : 0.75))
\r
256 ( (CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left)? (float)(54 * 3) : (float)(619 + 12 + 40) ) +
\r
257 ( ( (float) Math.Cos( (double) num3 ) ) * num5 ) ) - SampleFramework.GameWindowSize.Width / 2,
\r
258 -( ( ( CDTXMania.app.ConfigIni.bReverse.Drums ?
\r
259 ( 119 + 4 ) - nJudgeLinePosY_delta_Drums : ( 942 + 14 ) + nJudgeLinePosY_delta_Drums )
\r
260 + ( ( (float) Math.Sin( (double) num3 ) ) * num5 ) ) - SampleFramework.GameWindowSize.Height / 2 ),
\r
263 if( this.tx火花 != null )
\r
265 this.tx火花.t3D描画( CDTXMania.app.Device, identity );
\r
269 for ( int i = 0; i < STAR_MAX; i++ )
\r
271 if ( this.st青い星[ i ].b使用中 )
\r
273 this.st青い星[ i ].n前回のValue = this.st青い星[ i ].ct進行.n現在の値;
\r
274 this.st青い星[ i ].ct進行.t進行();
\r
275 if ( this.st青い星[ i ].ct進行.b終了値に達した )
\r
277 this.st青い星[ i ].ct進行.t停止();
\r
278 this.st青い星[ i ].b使用中 = false;
\r
280 for ( int n = this.st青い星[ i ].n前回のValue; n < this.st青い星[ i ].ct進行.n現在の値; n++ )
\r
282 this.st青い星[ i ].fX += this.st青い星[ i ].f加速度X;
\r
283 this.st青い星[ i ].fY -= this.st青い星[ i ].f加速度Y;
\r
284 this.st青い星[ i ].f加速度X *= this.st青い星[ i ].f加速度の加速度X;
\r
285 this.st青い星[ i ].f加速度Y *= this.st青い星[ i ].f加速度の加速度Y;
\r
286 this.st青い星[ i ].f加速度Y -= this.st青い星[ i ].f重力加速度;
\r
288 Matrix mat = Matrix.Identity;
\r
289 float x = (float) ( this.st青い星[ i ].f半径 * Math.Cos( ( Math.PI / 2 * this.st青い星[ i ].ct進行.n現在の値 ) / 100.0 ) );
\r
290 mat *= Matrix.Scaling( x, x, 1f );
\r
291 mat *= Matrix.Translation(
\r
292 this.st青い星[ i ].fX - SampleFramework.GameWindowSize.Width / 2,
\r
293 -( this.st青い星[ i ].fY * Scale.Y - SampleFramework.GameWindowSize.Height / 2 ),
\r
296 if ( this.tx青い星 != null )
\r
298 this.tx青い星.t3D描画( CDTXMania.app.Device, mat );
\r
302 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
304 if( this.st大波[ i ].b使用中 )
\r
306 this.st大波[ i ].ct進行.t進行();
\r
307 if( this.st大波[ i ].ct進行.b終了値に達した )
\r
309 this.st大波[ i ].ct進行.t停止();
\r
310 this.st大波[ i ].b使用中 = false;
\r
312 if( this.st大波[ i ].ct進行.n現在の値 >= 0 )
\r
314 Matrix matrix3 = Matrix.Identity;
\r
315 float num10 = ( (float) this.st大波[ i ].ct進行.n現在の値 ) / 100f;
\r
316 float angle = this.st大波[ i ].f回転単位 + ( this.st大波[ i ].f回転方向 * C変換.DegreeToRadian( (float) ( 60f * num10 ) ) );
\r
320 num12 = 2.5f * num10;
\r
322 else if( num10 < 0.8f )
\r
324 num12 = (float) ( 1.0 + ( 10.1 * ( 1.0 - Math.Cos( ( Math.PI / 2 * ( num10 - 0.4 ) ) * 2.5 ) ) ) );
\r
328 num12 = 11.1f + ( 12.5f * ( num10 - 0.8f ) );
\r
331 if( num10 < 0.75f )
\r
337 num13 = (int) ( ( 55f * ( 1f - num10 ) ) / 0.25f );
\r
339 matrix3 *= Matrix.Scaling( num12 * this.st大波[ i ].f半径, num12 * this.st大波[ i ].f半径, 1f );
\r
340 matrix3 *= Matrix.RotationZ( angle );
\r
341 matrix3 *= Matrix.RotationX( this.st大波[ i ].f角度X );
\r
342 matrix3 *= Matrix.RotationY( this.st大波[ i ].f角度Y );
\r
343 matrix3 *= Matrix.Translation(
\r
344 (int)(this.nレーンの中央X座標[ this.st大波[ i ].nLane ] * ( CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left? 1.0 : 0.75)) +
\r
345 ( ( CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ) ? (float) ( 54 * 3 ) : (float) ( 619 + 12 + 40 ) )
\r
346 - SampleFramework.GameWindowSize.Width / 2,
\r
347 -( ( CDTXMania.app.ConfigIni.bReverse.Drums ?
\r
348 (119 + 4) - nJudgeLinePosY_delta_Drums : (942 + 14) + nJudgeLinePosY_delta_Drums )
\r
349 - SampleFramework.GameWindowSize.Height / 2 ),
\r
351 if( this.tx大波 != null )
\r
353 this.tx大波.n透明度 = num13;
\r
354 this.tx大波.t3D描画( CDTXMania.app.Device, matrix3 );
\r
359 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
361 if( this.st細波[ i ].b使用中 )
\r
363 this.st細波[ i ].ct進行.t進行();
\r
364 if( this.st細波[ i ].ct進行.b終了値に達した )
\r
366 this.st細波[ i ].ct進行.t停止();
\r
367 this.st細波[ i ].b使用中 = false;
\r
369 if( this.st細波[ i ].ct進行.n現在の値 >= 0 )
\r
371 Matrix matrix4 = Matrix.Identity;
\r
372 float num15 = ( (float) this.st細波[ i ].ct進行.n現在の値 ) / 100f;
\r
373 float num16 = 14f * num15;
\r
374 int num17 = ( num15 < 0.5f ) ? 155 : ( (int) ( ( 155f * ( 1f - num15 ) ) / 1f ) );
\r
375 matrix4 *= Matrix.Scaling(
\r
376 num16 * this.st細波[ i ].f半径,
\r
377 num16 * this.st細波[ i ].f半径,
\r
380 matrix4 *= Matrix.RotationX( this.st細波[ i ].f角度X );
\r
381 matrix4 *= Matrix.RotationY( this.st細波[ i ].f角度Y );
\r
382 matrix4 *= Matrix.Translation(
\r
383 (int)( this.nレーンの中央X座標[ this.st細波[ i ].nLane ] * (CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left? 1.0 : 0.75 ) ) +
\r
384 ( ( CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ) ? (float) ( 54 * 3 ) : (float) ( 619 + 12 + 40 ) )
\r
385 -SampleFramework.GameWindowSize.Width / 2,
\r
386 -( ( CDTXMania.app.ConfigIni.bReverse.Drums ?
\r
387 (119 + 4) - nJudgeLinePosY_delta_Drums : (942 + 14) + nJudgeLinePosY_delta_Drums )
\r
388 - SampleFramework.GameWindowSize.Height / 2 ),
\r
391 if (this.tx細波 != null)
\r
393 this.tx細波.n透明度 = num17;
\r
394 this.tx細波.t3D描画( CDTXMania.app.Device, matrix4 );
\r
406 #region [ private ]
\r
407 //-----------------
\r
408 [StructLayout( LayoutKind.Sequential )]
\r
409 private struct ST火花
\r
413 public CCounter ct進行;
\r
414 public float f回転単位;
\r
415 public float f回転方向;
\r
418 [StructLayout( LayoutKind.Sequential )]
\r
419 private struct ST細波
\r
423 public CCounter ct進行;
\r
427 public int n進行速度ms;
\r
429 [StructLayout( LayoutKind.Sequential )]
\r
430 private struct ST青い星
\r
434 public CCounter ct進行;
\r
435 public int n前回のValue;
\r
438 public float f加速度X;
\r
439 public float f加速度Y;
\r
440 public float f加速度の加速度X;
\r
441 public float f加速度の加速度Y;
\r
442 public float f重力加速度;
\r
445 [StructLayout( LayoutKind.Sequential )]
\r
446 private struct ST大波
\r
450 public CCounter ct進行;
\r
454 public int n進行速度ms;
\r
455 public float f回転単位;
\r
456 public float f回転方向;
\r
459 private const int BIGWAVE_MAX = 20;
\r
460 private bool b細波Balance;
\r
461 private bool b大波Balance;
\r
462 private const int FIRE_MAX = 8 * 8;
\r
463 private readonly float[] fY波の最小仰角 = new float[] { -130f, -126f, -120f, -118f, -110f, -108f, -103f, -97f };
\r
464 private readonly float[] fY波の最大仰角 = new float[] { 70f, 72f, 77f, 84f, 89f, 91f, 99f, 107f };
\r
465 private readonly int[] nレーンの中央X座標 = new int[] { 54 * 3 - 54 * 3, 92 * 3 - 54 * 3, 126 * 3 - 54 * 3, 167 * 3 - 54 * 3,
\r
466 208 * 3 - 54 * 3, 242 * 3 - 54 * 3, 276 * 3 - 54 * 3, 313 * 3 - 54 * 3 };
\r
467 private const int STAR_MAX = 0x100;
\r
468 private ST火花[] st火花 = new ST火花[ FIRE_MAX ];
\r
469 private ST大波[] st大波 = new ST大波[ BIGWAVE_MAX ];
\r
470 private ST細波[] st細波 = new ST細波[ BIGWAVE_MAX ];
\r
471 private ST青い星[] st青い星 = new ST青い星[ STAR_MAX ];
\r
472 private CTexture tx火花;
\r
473 private CTexture tx細波;
\r
474 private CTexture tx青い星;
\r
475 private CTexture tx大波;
\r
476 private int nJudgeLinePosY_delta_Drums;
\r
477 //-----------------
\r