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.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.Timer );
\r
61 this.st火花[ j ].ct進行 = new CCounter( 0, 70, 3, CDTXMania.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.Random.Next( 360 );
\r
80 double num7 = 0.9 + ( ( (double) CDTXMania.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.Timer );
\r
83 this.st青い星[ j ].fX =
\r
84 (int) ( this.nレーンの中央X座標[ (int) lane ] * ( CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ? 1.0 : 0.75 ) ) +
\r
85 ( ( CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ) ? (float) ( 54 * 3 ) : (float) ( 619 + 12 + 40 ) );
\r
86 this.st青い星[ j ].fY = CDTXMania.ConfigIni.bReverse.Drums ? ( (float) 55 - nJudgeLinePosY_delta_Drums ) : ( (float) 425 + nJudgeLinePosY_delta_Drums );
\r
87 this.st青い星[ j ].f加速度X = (float) ( num7 * Math.Cos( ( Math.PI * 2 * n回転初期値 ) / 360.0 ) );
\r
88 this.st青い星[ j ].f加速度Y = (float) ( num7 * ( Math.Sin( ( Math.PI * 2 * n回転初期値 ) / 360.0 ) - 0.2 ) );
\r
89 this.st青い星[ j ].f加速度の加速度X = 0.995f;
\r
90 this.st青い星[ j ].f加速度の加速度Y = 0.995f;
\r
91 this.st青い星[ j ].f重力加速度 = 0.00355f;
\r
92 this.st青い星[ j ].f半径 = (float) ( 0.5 + ( ( (double) CDTXMania.Random.Next( 30 ) ) / 100.0 ) );
\r
98 if( b大波 && ( this.tx大波 != null ) )
\r
100 for( int i = 0; i < 4; i++ )
\r
102 for( int j = 0; j < BIGWAVE_MAX; j++ )
\r
104 if( !this.st大波[ j ].b使用中 )
\r
106 this.st大波[ j ].b使用中 = true;
\r
107 this.st大波[ j ].nLane = (int) lane;
\r
108 this.st大波[ j ].f半径 = ( (float) ( ( 20 - CDTXMania.Random.Next( 40 ) ) + 100 ) ) / 100f;
\r
109 this.st大波[ j ].n進行速度ms = 10;
\r
110 this.st大波[ j ].ct進行 = new CCounter( 0, 100, this.st大波[ j ].n進行速度ms, CDTXMania.Timer );
\r
111 this.st大波[ j ].ct進行.n現在の値 = i * 10;
\r
112 this.st大波[ j ].f角度X = C変換.DegreeToRadian( (float) ( ( ( (double) ( CDTXMania.Random.Next( 100 ) * 50 ) ) / 100.0 ) + 30.0 ) );
\r
113 this.st大波[ j ].f角度Y = C変換.DegreeToRadian( this.b大波Balance ? ( this.fY波の最小仰角[ (int) lane ] + CDTXMania.Random.Next( 30 ) ) : ( this.fY波の最大仰角[ (int) lane ] - CDTXMania.Random.Next( 30 ) ) );
\r
114 this.st大波[ j ].f回転単位 = C変換.DegreeToRadian( (float) 0f );
\r
115 this.st大波[ j ].f回転方向 = 1f;
\r
116 this.b大波Balance = !this.b大波Balance;
\r
122 if( b細波 && ( this.tx細波 != null ) )
\r
124 for( int i = 0; i < 1; i++ )
\r
126 for( int j = 0; j < BIGWAVE_MAX; j++ )
\r
128 if( !this.st細波[ j ].b使用中 )
\r
130 this.st細波[ j ].b使用中 = true;
\r
131 this.st細波[ j ].nLane = (int) lane;
\r
132 this.st細波[ j ].f半径 = ( (float) ( ( 20 - CDTXMania.Random.Next( 40 ) ) + 100 ) ) / 100f;
\r
133 this.st細波[ j ].n進行速度ms = 8;
\r
134 this.st細波[ j ].ct進行 = new CCounter( 0, 100, this.st細波[ j ].n進行速度ms, CDTXMania.Timer );
\r
135 this.st細波[ j ].ct進行.n現在の値 = 0;
\r
136 this.st細波[ j ].f角度X = C変換.DegreeToRadian( (float) ( ( ( (double) ( CDTXMania.Random.Next( 100 ) * 50 ) ) / 100.0 ) + 30.0 ) );
\r
137 this.st細波[ j ].f角度Y = C変換.DegreeToRadian( this.b細波Balance ? ( this.fY波の最小仰角[ (int) lane ] + CDTXMania.Random.Next( 30 ) ) : ( this.fY波の最大仰角[ (int) lane ] - CDTXMania.Random.Next( 30 ) ) );
\r
138 this.b細波Balance = !this.b細波Balance;
\r
149 public override void On活性化()
\r
151 for( int i = 0; i < FIRE_MAX; i++ )
\r
153 this.st火花[ i ] = new ST火花();
\r
154 this.st火花[ i ].b使用中 = false;
\r
155 this.st火花[ i ].ct進行 = new CCounter();
\r
157 for( int i = 0; i < STAR_MAX; i++ )
\r
159 this.st青い星[ i ] = new ST青い星();
\r
160 this.st青い星[ i ].b使用中 = false;
\r
161 this.st青い星[ i ].ct進行 = new CCounter();
\r
163 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
165 this.st大波[ i ] = new ST大波();
\r
166 this.st大波[ i ].b使用中 = false;
\r
167 this.st大波[ i ].ct進行 = new CCounter();
\r
168 this.st細波[ i ] = new ST細波();
\r
169 this.st細波[ i ].b使用中 = false;
\r
170 this.st細波[ i ].ct進行 = new CCounter();
\r
174 public override void On非活性化()
\r
176 for( int i = 0; i <FIRE_MAX; i++ )
\r
178 this.st火花[ i ].ct進行 = null;
\r
180 for( int i = 0; i < STAR_MAX; i++ )
\r
182 this.st青い星[ i ].ct進行 = null;
\r
184 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
186 this.st大波[ i ].ct進行 = null;
\r
187 this.st細波[ i ].ct進行 = null;
\r
191 public override void OnManagedリソースの作成()
\r
193 if( !base.b活性化してない )
\r
195 this.tx火花 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip fire.png" ) );
\r
196 if( this.tx火花 != null )
\r
198 this.tx火花.b加算合成 = true;
\r
200 this.tx青い星 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip star.png" ) );
\r
201 if( this.tx青い星 != null )
\r
203 this.tx青い星.b加算合成 = true;
\r
205 this.tx大波 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip wave.png" ) );
\r
206 if( this.tx大波 != null )
\r
208 this.tx大波.b加算合成 = true;
\r
210 this.tx細波 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlayDrums chip wave2.png" ) );
\r
211 if( this.tx細波 != null )
\r
213 this.tx細波.b加算合成 = true;
\r
215 base.OnManagedリソースの作成();
\r
218 public override void OnManagedリソースの解放()
\r
220 if( !base.b活性化してない )
\r
222 CDTXMania.tテクスチャの解放( ref this.tx火花 );
\r
223 CDTXMania.tテクスチャの解放( ref this.tx青い星 );
\r
224 CDTXMania.tテクスチャの解放( ref this.tx大波 );
\r
225 CDTXMania.tテクスチャの解放( ref this.tx細波 );
\r
226 base.OnManagedリソースの解放();
\r
229 public override int On進行描画()
\r
231 if( !base.b活性化してない )
\r
233 for( int i = 0; i < FIRE_MAX; i++ )
\r
235 if( this.st火花[ i ].b使用中 )
\r
237 this.st火花[ i ].ct進行.t進行();
\r
238 if( this.st火花[ i ].ct進行.b終了値に達した )
\r
240 this.st火花[ i ].ct進行.t停止();
\r
241 this.st火花[ i ].b使用中 = false;
\r
243 Matrix identity = Matrix.Identity;
\r
244 // float num2 = ( (float) this.st火花[ i ].ct進行.n現在の値 * 2 ) / 70f;
\r
245 float num2 = ( (float) this.st火花[ i ].ct進行.n現在の値 ) / 70f;
\r
246 float num3 = this.st火花[ i ].f回転単位 + ( this.st火花[ i ].f回転方向 * C変換.DegreeToRadian( (float) ( 60f * num2 ) ) );
\r
247 // 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
248 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
249 identity *= Matrix.Scaling( 0.2f + num4, 0.2f + this.st火花[ i ].fサイズ, 1f );
\r
250 identity *= Matrix.RotationZ( num3 + ( (float) Math.PI / 2 ) );
\r
251 float num5 = ( (float) ( 0.8 * Math.Sin( num2 * Math.PI / 2 ) ) ) * this.st火花[ i ].fサイズ;
\r
252 identity *= Matrix.Translation(
\r
253 ( (int)(this.nレーンの中央X座標[ this.st火花[ i ].nLane ] * ((CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left)? 1.0 : 0.75))
\r
255 ( (CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left)? (float)(54 * 3) : (float)(619 + 12 + 40) ) +
\r
256 ( ( (float) Math.Cos( (double) num3 ) ) * num5 ) ) - SampleFramework.GameWindowSize.Width / 2,
\r
257 -( ( ( CDTXMania.ConfigIni.bReverse.Drums ? 55f * Scale.Y - nJudgeLinePosY_delta_Drums : 425f * Scale.Y + nJudgeLinePosY_delta_Drums ) + ( ( (float) Math.Sin( (double) num3 ) ) * num5 ) ) - SampleFramework.GameWindowSize.Height / 2 ),
\r
260 if( this.tx火花 != null )
\r
262 this.tx火花.t3D描画( CDTXMania.app.Device, identity );
\r
266 for ( int i = 0; i < STAR_MAX; i++ )
\r
268 if ( this.st青い星[ i ].b使用中 )
\r
270 this.st青い星[ i ].n前回のValue = this.st青い星[ i ].ct進行.n現在の値;
\r
271 this.st青い星[ i ].ct進行.t進行();
\r
272 if ( this.st青い星[ i ].ct進行.b終了値に達した )
\r
274 this.st青い星[ i ].ct進行.t停止();
\r
275 this.st青い星[ i ].b使用中 = false;
\r
277 for ( int n = this.st青い星[ i ].n前回のValue; n < this.st青い星[ i ].ct進行.n現在の値; n++ )
\r
279 this.st青い星[ i ].fX += this.st青い星[ i ].f加速度X;
\r
280 this.st青い星[ i ].fY -= this.st青い星[ i ].f加速度Y;
\r
281 this.st青い星[ i ].f加速度X *= this.st青い星[ i ].f加速度の加速度X;
\r
282 this.st青い星[ i ].f加速度Y *= this.st青い星[ i ].f加速度の加速度Y;
\r
283 this.st青い星[ i ].f加速度Y -= this.st青い星[ i ].f重力加速度;
\r
285 Matrix mat = Matrix.Identity;
\r
286 float x = (float) ( this.st青い星[ i ].f半径 * Math.Cos( ( Math.PI / 2 * this.st青い星[ i ].ct進行.n現在の値 ) / 100.0 ) );
\r
287 mat *= Matrix.Scaling( x, x, 1f );
\r
288 mat *= Matrix.Translation(
\r
289 this.st青い星[ i ].fX - SampleFramework.GameWindowSize.Width / 2,
\r
290 -( this.st青い星[ i ].fY * Scale.Y - SampleFramework.GameWindowSize.Height / 2 ),
\r
293 if ( this.tx青い星 != null )
\r
295 this.tx青い星.t3D描画( CDTXMania.app.Device, mat );
\r
299 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
301 if( this.st大波[ i ].b使用中 )
\r
303 this.st大波[ i ].ct進行.t進行();
\r
304 if( this.st大波[ i ].ct進行.b終了値に達した )
\r
306 this.st大波[ i ].ct進行.t停止();
\r
307 this.st大波[ i ].b使用中 = false;
\r
309 if( this.st大波[ i ].ct進行.n現在の値 >= 0 )
\r
311 Matrix matrix3 = Matrix.Identity;
\r
312 float num10 = ( (float) this.st大波[ i ].ct進行.n現在の値 ) / 100f;
\r
313 float angle = this.st大波[ i ].f回転単位 + ( this.st大波[ i ].f回転方向 * C変換.DegreeToRadian( (float) ( 60f * num10 ) ) );
\r
317 num12 = 2.5f * num10;
\r
319 else if( num10 < 0.8f )
\r
321 num12 = (float) ( 1.0 + ( 10.1 * ( 1.0 - Math.Cos( ( Math.PI / 2 * ( num10 - 0.4 ) ) * 2.5 ) ) ) );
\r
325 num12 = 11.1f + ( 12.5f * ( num10 - 0.8f ) );
\r
328 if( num10 < 0.75f )
\r
334 num13 = (int) ( ( 55f * ( 1f - num10 ) ) / 0.25f );
\r
336 matrix3 *= Matrix.Scaling( num12 * this.st大波[ i ].f半径, num12 * this.st大波[ i ].f半径, 1f );
\r
337 matrix3 *= Matrix.RotationZ( angle );
\r
338 matrix3 *= Matrix.RotationX( this.st大波[ i ].f角度X );
\r
339 matrix3 *= Matrix.RotationY( this.st大波[ i ].f角度Y );
\r
340 matrix3 *= Matrix.Translation(
\r
341 (int)(this.nレーンの中央X座標[ this.st大波[ i ].nLane ] * ( CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left? 1.0 : 0.75)) +
\r
342 ( ( CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ) ? (float) ( 54 * 3 ) : (float) ( 619 + 12 + 40 ) )
\r
343 - SampleFramework.GameWindowSize.Width / 2,
\r
344 -( ( CDTXMania.ConfigIni.bReverse.Drums ? 55f * Scale.Y - nJudgeLinePosY_delta_Drums : 425f * Scale.Y + nJudgeLinePosY_delta_Drums ) - SampleFramework.GameWindowSize.Height / 2 ),
\r
346 if( this.tx大波 != null )
\r
348 this.tx大波.n透明度 = num13;
\r
349 this.tx大波.t3D描画( CDTXMania.app.Device, matrix3 );
\r
354 for( int i = 0; i < BIGWAVE_MAX; i++ )
\r
356 if( this.st細波[ i ].b使用中 )
\r
358 this.st細波[ i ].ct進行.t進行();
\r
359 if( this.st細波[ i ].ct進行.b終了値に達した )
\r
361 this.st細波[ i ].ct進行.t停止();
\r
362 this.st細波[ i ].b使用中 = false;
\r
364 if( this.st細波[ i ].ct進行.n現在の値 >= 0 )
\r
366 Matrix matrix4 = Matrix.Identity;
\r
367 float num15 = ( (float) this.st細波[ i ].ct進行.n現在の値 ) / 100f;
\r
368 float num16 = 14f * num15;
\r
369 int num17 = ( num15 < 0.5f ) ? 155 : ( (int) ( ( 155f * ( 1f - num15 ) ) / 1f ) );
\r
370 matrix4 *= Matrix.Scaling(
\r
371 num16 * this.st細波[ i ].f半径,
\r
372 num16 * this.st細波[ i ].f半径,
\r
375 matrix4 *= Matrix.RotationX( this.st細波[ i ].f角度X );
\r
376 matrix4 *= Matrix.RotationY( this.st細波[ i ].f角度Y );
\r
377 matrix4 *= Matrix.Translation(
\r
378 (int)( this.nレーンの中央X座標[ this.st細波[ i ].nLane ] * (CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left? 1.0 : 0.75 ) ) +
\r
379 ( ( CDTXMania.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Left ) ? (float) ( 54 * 3 ) : (float) ( 619 + 12 + 40 ) )
\r
380 -SampleFramework.GameWindowSize.Width / 2,
\r
381 -( ( CDTXMania.ConfigIni.bReverse.Drums ? 55f * Scale.Y - nJudgeLinePosY_delta_Drums : 425f * Scale.Y + nJudgeLinePosY_delta_Drums ) - SampleFramework.GameWindowSize.Height / 2 ),
\r
384 if (this.tx細波 != null)
\r
386 this.tx細波.n透明度 = num17;
\r
387 this.tx細波.t3D描画( CDTXMania.app.Device, matrix4 );
\r
399 #region [ private ]
\r
400 //-----------------
\r
401 [StructLayout( LayoutKind.Sequential )]
\r
402 private struct ST火花
\r
406 public CCounter ct進行;
\r
407 public float f回転単位;
\r
408 public float f回転方向;
\r
411 [StructLayout( LayoutKind.Sequential )]
\r
412 private struct ST細波
\r
416 public CCounter ct進行;
\r
420 public int n進行速度ms;
\r
422 [StructLayout( LayoutKind.Sequential )]
\r
423 private struct ST青い星
\r
427 public CCounter ct進行;
\r
428 public int n前回のValue;
\r
431 public float f加速度X;
\r
432 public float f加速度Y;
\r
433 public float f加速度の加速度X;
\r
434 public float f加速度の加速度Y;
\r
435 public float f重力加速度;
\r
438 [StructLayout( LayoutKind.Sequential )]
\r
439 private struct ST大波
\r
443 public CCounter ct進行;
\r
447 public int n進行速度ms;
\r
448 public float f回転単位;
\r
449 public float f回転方向;
\r
452 private const int BIGWAVE_MAX = 20;
\r
453 private bool b細波Balance;
\r
454 private bool b大波Balance;
\r
455 private const int FIRE_MAX = 8 * 8;
\r
456 private readonly float[] fY波の最小仰角 = new float[] { -130f, -126f, -120f, -118f, -110f, -108f, -103f, -97f };
\r
457 private readonly float[] fY波の最大仰角 = new float[] { 70f, 72f, 77f, 84f, 89f, 91f, 99f, 107f };
\r
458 private readonly int[] nレーンの中央X座標 = new int[] { 54 * 3 - 54 * 3, 92 * 3 - 54 * 3, 126 * 3 - 54 * 3, 167 * 3 - 54 * 3,
\r
459 208 * 3 - 54 * 3, 242 * 3 - 54 * 3, 276 * 3 - 54 * 3, 313 * 3 - 54 * 3 };
\r
460 private const int STAR_MAX = 0x100;
\r
461 private ST火花[] st火花 = new ST火花[ FIRE_MAX ];
\r
462 private ST大波[] st大波 = new ST大波[ BIGWAVE_MAX ];
\r
463 private ST細波[] st細波 = new ST細波[ BIGWAVE_MAX ];
\r
464 private ST青い星[] st青い星 = new ST青い星[ STAR_MAX ];
\r
465 private CTexture tx火花;
\r
466 private CTexture tx細波;
\r
467 private CTexture tx青い星;
\r
468 private CTexture tx大波;
\r
469 private int nJudgeLinePosY_delta_Drums;
\r
470 //-----------------
\r