@@ -216,7 +216,6 @@ function shapingKeys($array){
216216 if ($ value ->battle_high_score !== 0 ){
217217 // not implemented → played
218218 // echo "[new] " . $value->title . " / " . $value->difficulty_str . "<br>";
219- $ newNormalRating = OngekiUtility::RateValueFromTitle ($ value ->title , $ value ->difficulty , $ value ->technical_high_score , $ value ->lampForRating , $ value ->genre , $ value ->artist );
220219 $ progress [$ music ][$ difficulty ]["new " ] = $ value ;
221220 $ progress [$ music ][$ difficulty ]["difference " ]['battle_high_score ' ] = "+ " . number_format ($ value ->battle_high_score );
222221 $ progress [$ music ][$ difficulty ]["difference " ]['technical_high_score ' ] = "+ " . number_format ($ value ->technical_high_score );
@@ -304,34 +303,8 @@ function shapingKeys($array){
304303 }
305304
306305 // Rating計算はできるだけ少なくしたいので先に計算しておく。
307- // ViewUserRatingController.php から引用。
308- // WARNING: レーティング処理を変えたら変更元も変更する!
309306 if ($ isPremium ) {
310- $ oldLampForRating = "" ;
311- if ($ old [$ music ][$ difficulty ]->technical_high_score == 1010000 ){
312- if ($ old [$ music ][$ difficulty ]->full_bell == 1 ) {
313- $ oldLampForRating = "FB/AB+ " ;
314- } else {
315- $ oldLampForRating = "AB+ " ;
316- }
317- } elseif ($ old [$ music ][$ difficulty ]->all_break == 1 ) {
318- if ($ old [$ music ][$ difficulty ]->full_bell == 1 ) {
319- $ oldLampForRating = "FB/AB " ;
320- } else {
321- $ oldLampForRating = "AB " ;
322- }
323- } elseif ($ old [$ music ][$ difficulty ]->full_combo == 1 ) {
324- if ($ old [$ music ][$ difficulty ]->full_bell == 1 ) {
325- $ oldLampForRating = "FB/FC " ;
326- } else {
327- $ oldLampForRating = "FC " ;
328- }
329- } else {
330- if ($ old [$ music ][$ difficulty ]->full_bell == 1 ) {
331- $ oldLampForRating = "FB " ;
332- }
333- }
334-
307+ $ oldLampForRating = OngekiUtility::getLampForRating ($ old [$ music ][$ difficulty ]->technical_high_score , $ old [$ music ][$ difficulty ]->full_bell == 1 , $ old [$ music ][$ difficulty ]->full_combo == 1 , $ old [$ music ][$ difficulty ]->all_break == 1 );
335308 $ newNormalRating = OngekiUtility::RateValueFromTitle ($ value ->title , $ value ->difficulty , $ value ->technical_high_score , $ value ->lampForRating , $ value ->genre , $ value ->artist );
336309 $ oldNormalRating = OngekiUtility::RateValueFromTitle ($ value ->title , $ old [$ music ][$ difficulty ]->difficulty , $ old [$ music ][$ difficulty ]->technical_high_score , $ oldLampForRating , $ value ->genre , $ value ->artist );
337310 $ progress [$ music ][$ difficulty ]["difference " ]['normal_rating ' ] = ($ newNormalRating - $ oldNormalRating ) != 0 ? "+ " . sprintf ("%.3f " ,($ newNormalRating - $ oldNormalRating )) : "" ;
0 commit comments