Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/DTXManiaプロジェクト/コード/ステージ/08.結果/CActResultRank.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 238 - (show annotations) (download)
Thu Jan 16 08:08:18 2014 UTC (10 years, 2 months ago) by ron1120
File size: 21146 byte(s)
#31082 エクセレント、フルコンボ表示の実装。
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Drawing;
5 using System.IO;
6 using SlimDX;
7 using FDK;
8
9 namespace DTXMania
10 {
11 internal class CActResultRank : CActivity
12 {
13
14 // コンストラクタ
15
16 public CActResultRank()
17 {
18 base.b活性化してない = true;
19 }
20
21 // メソッド
22
23 public void tアニメを完了させる()
24 {
25 this.ctランク表示.n現在の値 = this.ctランク表示.n終了値;
26 this.ct表示用.n現在の値 = this.ct表示用.n終了値;
27 }
28
29 // CActivity 実装
30
31 public override void On活性化()
32 {
33
34 #region [ 本体位置 ]
35
36 int nX = 138;
37 int nY = 8;
38
39 int nX = 850;
40 int nY = 420;
41
42 this.n本体0X = 0;
43 this.n本体0Y = 0;
44
45 this.n本体1X = 0;
46 this.n本体1Y = 0;
47
48 this.n本体2X = 0;
49 this.n本体2Y = 0;
50
51 if (CDTXMania.ConfigIni.bDrums有効)
52 {
53 this.n本体0X = nX;
54 this.n本体0Y = nY;
55 }
56 else if (CDTXMania.ConfigIni.bGuitar有効)
57 {
58 if (CDTXMania.DTX.bチップがある.Guitar)
59 {
60 if (CDTXMania.ConfigIni.bIsSwappedGuitarBass)
61 {
62 this.n本体1X = nX;
63 this.n本体1Y = nY;
64 }
65 else
66 {
67 this.n本体1X = nX;
68 this.n本体1Y = nY;
69 }
70 }
71
72 if (CDTXMania.DTX.bチップがある.Bass)
73 {
74 if (CDTXMania.ConfigIni.bIsSwappedGuitarBass)
75 {
76 this.n本体2X = nX;
77 this.n本体2Y = nY;
78 }
79 else
80 {
81 this.n本体2X = nX;
82 this.n本体2Y = nY;
83 }
84 }
85
86 }
87 #endregion
88
89 this.sdDTXで指定されたフルコンボ音 = null;
90 this.bフルコンボ音再生済み = false;
91 this.bエクセレント音再生済み = false;
92 base.On活性化();
93 }
94 public override void On非活性化()
95 {
96 if( this.ctランク表示 != null )
97 {
98 this.ctランク表示 = null;
99 }
100 if (this.ct表示用 != null)
101 {
102 this.ct表示用 = null;
103 }
104 if (this.sdDTXで指定されたフルコンボ音 != null)
105 {
106 CDTXMania.Sound管理.tサウンドを破棄する(this.sdDTXで指定されたフルコンボ音);
107 this.sdDTXで指定されたフルコンボ音 = null;
108 }
109 base.On非活性化();
110 }
111 public override void OnManagedリソスの作成()
112 {
113 if( !base.b活性化してない )
114 {
115
116 this.txFullCombo = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenResult fullcombo.png"));
117 this.txExcellent = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenResult Excellent.png"));
118
119 if (CDTXMania.ConfigIni.bDrums有効)
120 {
121 switch (CDTXMania.stage結果.nランク値.Drums)
122 {
123 case 0:
124 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankSS.png"));
125 break;
126
127 case 1:
128 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankS.png"));
129 break;
130
131 case 2:
132 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankA.png"));
133 break;
134
135 case 3:
136 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankB.png"));
137 break;
138
139 case 4:
140 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankC.png"));
141 break;
142
143 case 5:
144 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankD.png"));
145 break;
146
147 case 6:
148 case 99: // #23534 2010.10.28 yyagi: 演奏チップが0個のときは、rankEと見なす
149 this.txランク文字0P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankE.png"));
150 break;
151
152 default:
153 this.txランク文字0P = null;
154 break;
155 }
156 }
157 else if( CDTXMania.ConfigIni.bGuitar有効 )
158 {
159 switch( CDTXMania.stage結果.nランク値.Guitar )
160 {
161 case 0:
162 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankSS.png"));
163 break;
164
165 case 1:
166 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankS.png"));
167 break;
168
169 case 2:
170 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankA.png"));
171 break;
172
173 case 3:
174 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankB.png"));
175 break;
176
177 case 4:
178 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankC.png"));
179 break;
180
181 case 5:
182 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankD.png"));
183 break;
184
185 case 6:
186 case 99: // #23534 2010.10.28 yyagi: 演奏チップが0個のときは、rankEと見なす
187 this.txランク文字1P = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\8_rankE.png" ) );
188 if( CDTXMania.ConfigIni.bギタが全部オトプレイである )
189 this.txランク文字1P = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\8_rankSS.png" ) );
190 break;
191
192 default:
193 this.txランク文字1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankE.png"));
194 break;
195 }
196 switch (CDTXMania.stage結果.nランク値.Bass)
197 {
198 case 0:
199 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankSS.png"));
200 break;
201
202 case 1:
203 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankS.png"));
204 break;
205
206 case 2:
207 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankA.png"));
208 break;
209
210 case 3:
211 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankB.png"));
212 break;
213
214 case 4:
215 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankC.png"));
216 break;
217
218 case 5:
219 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankD.png"));
220 break;
221
222 case 6:
223 case 99: // #23534 2010.10.28 yyagi: 演奏チップが0個のときは、rankEと見なす
224 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankE.png"));
225 if (CDTXMania.ConfigIni.bスが全部オトプレイである)
226 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankSS.png"));
227 break;
228
229 default:
230 this.txランク文字2P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankE.png"));
231 break;
232 }
233 }
234 base.OnManagedリソスの作成();
235 }
236 }
237 public override void OnManagedリソスの解放()
238 {
239 if( !base.b活性化してない )
240 {
241 CDTXMania.tテクスチャの解放(ref this.txFullCombo);
242 CDTXMania.tテクスチャの解放(ref this.txExcellent);
243 CDTXMania.tテクスチャの解放(ref this.txランク文字0P);
244 CDTXMania.tテクスチャの解放(ref this.txランク文字1P);
245 CDTXMania.tテクスチャの解放( ref this.txランク文字2P );
246 base.OnManagedリソスの解放();
247 }
248 }
249 public override int On進行描画()
250 {
251 if( base.b活性化してない )
252 {
253 return 0;
254 }
255 if( base.b初めての進行描画 )
256 {
257 this.ctランク表示 = new CCounter(0, 0x3e8, 2, CDTXMania.Timer);
258 this.ct表示用 = new CCounter(0, 1000, 3, CDTXMania.Timer);
259 base.b初めての進行描画 = false;
260 }
261 this.ctランク表示.t進行();
262 this.ct表示用.t進行();
263 if (this.ctランク表示.n現在の値 >= 500)
264 {
265 double num2 = ( (double) ( this.ctランク表示.n現在の値 - 500 ) ) / 500.0;
266 if (this.txランク文字0P != null && this.n本体0Y != 0)
267 {
268 this.txランク文字0P.t2D描画(CDTXMania.app.Device, this.n本体0X, this.n本体0Y, new Rectangle(0, 0, (int)((double)txランク文字0P.sz画像サイズ.Width * num2), this.txランク文字0P.sz画像サイズ.Height));
269 }
270 if (this.txランク文字1P != null && this.n本体1Y != 0)
271 {
272 this.txランク文字1P.t2D描画(CDTXMania.app.Device, this.n本体1X, this.n本体1Y, new Rectangle(0, 0, (int)((double)txランク文字1P.sz画像サイズ.Width * num2), this.txランク文字1P.sz画像サイズ.Height));
273 }
274 if ( this.txランク文字2P != null && this.n本体2Y != 0 )
275 {
276 this.txランク文字2P.t2D描画(CDTXMania.app.Device, this.n本体2X, this.n本体2Y, new Rectangle(0, 0, (int)((double)txランク文字2P.sz画像サイズ.Width * num2), this.txランク文字2P.sz画像サイズ.Height));
277 }
278 }
279
280 #region [ フルコンボ ]
281 if (this.ct表示用.n現在の値 >= 900)
282 {
283
284 for (int j = 0; j < 3; j++)
285 {
286
287 if (j == 0)
288 {
289 this.n本体X = this.n本体0X;
290 this.n本体Y = this.n本体0Y;
291 }
292 else if (j == 1)
293 {
294 this.n本体X = this.n本体1X;
295 this.n本体Y = this.n本体1Y;
296 }
297 else
298 {
299 this.n本体X = this.n本体2X;
300 this.n本体Y = this.n本体2Y;
301 }
302
303 int num14 = 82 + this.n本体X;
304 int num15 = 152 + this.n本体Y;
305
306 if ( this.n本体X != 0 )
307 {
308 if (CDTXMania.stage結果.st演奏記録[j].nPerfect == CDTXMania.stage結果.st演奏記録[j].n全チップ数)
309 {
310 if (this.ct表示用.b終了値に達した)
311 {
312 if (this.txExcellent != null)
313 {
314 this.txExcellent.t2D描画(CDTXMania.app.Device, num14, num15);
315 }
316 if (!this.bエクセレント音再生済み)
317 {
318 if (((CDTXMania.DTX.SOUND_FULLCOMBO != null) && (CDTXMania.DTX.SOUND_FULLCOMBO.Length > 0)) && File.Exists(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO))
319 {
320 try
321 {
322 if (this.sdDTXで指定されたフルコンボ音 != null)
323 {
324 CDTXMania.Sound管理.tサウンドを破棄する(this.sdDTXで指定されたフルコンボ音);
325 this.sdDTXで指定されたフルコンボ音 = null;
326 }
327 this.sdDTXで指定されたフルコンボ音 = CDTXMania.Sound管理.tサウンドを生成する(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO);
328 if (this.sdDTXで指定されたフルコンボ音 != null)
329 {
330 this.sdDTXで指定されたフルコンボ音.t再生を開始する();
331 }
332 }
333 catch
334 {
335 }
336 }
337 else
338 {
339 CDTXMania.Skin.soundエクセレント音.t再生する();
340 }
341 this.bエクセレント音再生済み = true;
342 }
343 }
344 else
345 {
346 double num12 = ((double)(this.ct表示用.n現在の値 - 900)) / 100.0;
347 float num13 = (float)(1.1 - 0.1);
348 if (this.txExcellent != null)
349 {
350 this.txExcellent.vc拡大縮小倍率 = new Vector3(num13, num13, 1f);
351 this.txExcellent.n透明度 = (int)(255.0 * num12);
352 this.txExcellent.t2D描画(CDTXMania.app.Device, num14, num15);
353 }
354 }
355 }
356 else if (CDTXMania.stage結果.st演奏記録[j].bフルコンボである && CDTXMania.stage結果.st演奏記録[j].nPerfect != CDTXMania.stage結果.st演奏記録[j].n全チップ数)
357 {
358 if (this.ct表示用.b終了値に達した)
359 {
360 if (this.txFullCombo != null)
361 {
362 this.txFullCombo.t2D描画(CDTXMania.app.Device, num14, num15);
363 }
364 if (!this.bフルコンボ音再生済み)
365 {
366 if (((CDTXMania.DTX.SOUND_FULLCOMBO != null) && (CDTXMania.DTX.SOUND_FULLCOMBO.Length > 0)) && File.Exists(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO))
367 {
368 try
369 {
370 if (this.sdDTXで指定されたフルコンボ音 != null)
371 {
372 CDTXMania.Sound管理.tサウンドを破棄する(this.sdDTXで指定されたフルコンボ音);
373 this.sdDTXで指定されたフルコンボ音 = null;
374 }
375 this.sdDTXで指定されたフルコンボ音 = CDTXMania.Sound管理.tサウンドを生成する(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO);
376 if (this.sdDTXで指定されたフルコンボ音 != null)
377 {
378 this.sdDTXで指定されたフルコンボ音.t再生を開始する();
379 }
380 }
381 catch
382 {
383 }
384 }
385 else
386 {
387 CDTXMania.Skin.soundフルコンボ音.t再生する();
388 }
389 this.bフルコンボ音再生済み = true;
390 }
391 }
392 else
393 {
394 double num12 = ((double)(this.ct表示用.n現在の値 - 900)) / 100.0;
395 float num13 = (float)(1.1 - 0.1);
396 if (this.txFullCombo != null)
397 {
398 this.txFullCombo.vc拡大縮小倍率 = new Vector3(num13, num13, 1f);
399 this.txFullCombo.n透明度 = (int)(255.0 * num12);
400 if (CDTXMania.ConfigIni.eNamePlate.Drums >= Eタイプ.C)
401 {
402 num14 = 650;
403 num15 = 526;
404 }
405 else
406 {
407 num14 = this.n本体X + ((int)((this.txFullCombo.sz画像サイズ.Width * (1f - num13)) / 2f));
408 num15 = this.n本体Y + ((int)((this.txFullCombo.sz画像サイズ.Height * (1f - num13)) / 2f));
409 }
410 this.txFullCombo.t2D描画(CDTXMania.app.Device, num14, num15);
411 }
412 }
413 }
414 }
415
416 }
417
418 }
419 #endregion
420
421 if( !this.ctランク表示.b終了値に達した )
422 {
423 return 0;
424 }
425 return 1;
426 }
427
428
429 // その他
430
431 #region [ private ]
432 //-----------------
433 private bool bフルコンボ音再生済み;
434 private bool bエクセレント音再生済み;
435 private CCounter ctランク表示;
436 private CCounter ct表示用;
437 private int n本体X;
438 private int n本体Y;
439 private int n本体0X;
440 private int n本体0Y;
441 private int n本体1X;
442 private int n本体1Y;
443 private int n本体2X;
444 private int n本体2Y;
445 private CTexture txランク文字0P;
446 private CTexture txランク文字1P;
447 private CTexture txランク文字2P;
448 private CSound sdDTXで指定されたフルコンボ音;
449 private CTexture txExcellent;
450 private CTexture txFullCombo;
451 //-----------------
452 #endregion
453 }
454 }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26