Skip to content

Commit

Permalink
Merge pull request #799 from project-primera/develop
Browse files Browse the repository at this point in the history
Release 0.15.0
  • Loading branch information
slime-hatena committed Mar 21, 2024
2 parents 34ffd47 + eba236d commit 67b1cf7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ function getIndex(int $id, int $music, string $difficulty){
$prev->damage = 0;

foreach ($score as $key => $value) {
if($value->technical_high_score === 0 && $value->battle_high_score === 0 && (float)$value->over_damage_high_score === (float)0){
unset($score[$key]);
continue;
}

$technical[] = (int)($value->technical_high_score);
$battle[] = (int)($value->battle_high_score);
$damage[] = (float)$value->over_damage_high_score;
Expand Down
19 changes: 16 additions & 3 deletions OngekiScoreLog/app/Http/Controllers/ViewUserRatingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,27 @@ private function editMusicStdClass(\stdClass $stdClass, int $totalMusicCount){
// レート値上昇推定スコア計算
$stdClass->extraLevel = OngekiUtility::ExtraLevelFromTitle($stdClass->title, $stdClass->difficulty, $stdClass->genre, $stdClass->artist);
$stdClass->extraLevelStr = sprintf("%.1f", $stdClass->extraLevel);

$stdClass->targetMusicRateMusic = OngekiUtility::ExpectedScoreFromExtraLevel($stdClass->extraLevel, $stdClass->rawRatingValue + 0.01);
if($stdClass->targetMusicRateMusic !== false){
$stdClass->targetMusicRateMusic = number_format($stdClass->technical_high_score - $stdClass->targetMusicRateMusic);
}

// この曲のレート値が0.xのしきい値になるために必要なスコア 例) 15.25→15.30
$targetRating = ceil(($stdClass->rawRatingValue + 0.01) * 10) / 10;
$stdClass->targetMusicRateBorder = OngekiUtility::ExpectedScoreFromExtraLevel($stdClass->extraLevel, $targetRating);
if($stdClass->targetMusicRateBorder !== false){
$stdClass->targetMusicRateBorder = number_format($stdClass->technical_high_score - $stdClass->targetMusicRateBorder);
}

$stdClass->targetMusicRateUser = OngekiUtility::ExpectedScoreFromExtraLevel($stdClass->extraLevel, $stdClass->rawRatingValue + sprintf("%.2f", $totalMusicCount / 100));
if($stdClass->targetMusicRateUser !== false){
$stdClass->targetMusicRateUser = number_format($stdClass->technical_high_score - $stdClass->targetMusicRateUser);
}

// レート値が理論値 / 推定値なら文字装飾
if (OngekiUtility::IsEstimatedRateValueFromTitle($stdClass->title, $stdClass->difficulty, $stdClass->genre, $stdClass->artist)) {
$stdClass->extraLevelStr = "<i><span class='estimated-rating'>" . $stdClass->extraLevelStr . "?</span></i>";
$stdClass->ratingValue = "<i><span class='estimated-rating'>" . $stdClass->ratingValue . "</span></i>";
}else if($stdClass->technical_high_score >= 1007500){
$stdClass->ratingValue = "<i><span class='max-rating'>" . $stdClass->ratingValue . "</span></i>";
Expand Down Expand Up @@ -102,6 +112,7 @@ function getIndex($id){
$notExistMusic->ratingValue = "-";
$notExistMusic->rawRatingValue = 0;
$notExistMusic->targetMusicRateMusic = "";
$notExistMusic->targetMusicRateBorder = "";
$notExistMusic->targetMusicRateUser = "";
$notExistMusic->updated_at = date("Y/m/d");

Expand Down Expand Up @@ -191,14 +202,16 @@ function getIndex($id){
try {
$recentScore[$i]['ratingValue'] = sprintf("%.2f", OngekiUtility::RateValueFromTitle($recentScore[$i]['title'], $recentScore[$i]['difficulty'], $recentScore[$i]['technical_score'], $recentScore[$i]['genre'], $recentScore[$i]['artist']));
$recentScore[$i]['rawRatingValue'] = $recentScore[$i]['ratingValue'];
$recentScore[$i]['song_id'] = OngekiUtility::GetIDFromTitle($recentScore[$i]['title'], $recentScore[$i]['genre'], $recentScore[$i]['artist']);
$recentScore[$i]['difficulty_str'] = $this->difficultyToStr[$recentScore[$i]['difficulty']];
$recentScore[$i]['level_str'] = sprintf("%.1f", OngekiUtility::ExtraLevelFromTitle($recentScore[$i]['title'], $recentScore[$i]['difficulty'], $recentScore[$i]['genre'], $recentScore[$i]['artist']));

if (OngekiUtility::IsEstimatedRateValueFromTitle($recentScore[$i]['title'], $recentScore[$i]['difficulty'], $recentScore[$i]['genre'], $recentScore[$i]['artist'])) {
$recentScore[$i]['ratingValue'] = "<i><span class='estimated-rating'>" . $recentScore[$i]['ratingValue'] . "</span></i>";
$recentScore[$i]['level_str'] = "<i><span class='estimated-rating'>" . $recentScore[$i]['level_str'] . "?</span></i>";
}else if($recentScore[$i]['technical_score'] >= 1007500){
$recentScore[$i]['ratingValue'] = "<i><span class='max-rating'>" . $recentScore[$i]['ratingValue'] . "</span></i>";
}
$recentScore[$i]['song_id'] = OngekiUtility::GetIDFromTitle($recentScore[$i]['title'], $recentScore[$i]['genre'], $recentScore[$i]['artist']);
$recentScore[$i]['difficulty_str'] = $this->difficultyToStr[$recentScore[$i]['difficulty']];
$recentScore[$i]['level_str'] = sprintf("%.1f", OngekiUtility::ExtraLevelFromTitle($recentScore[$i]['title'], $recentScore[$i]['difficulty'], $recentScore[$i]['genre'], $recentScore[$i]['artist']));

$statistics->recentRatingTotal += $recentScore[$i]['rawRatingValue'];
if($statistics->recentRatingTop < $recentScore[$i]['rawRatingValue']){
Expand Down
8 changes: 8 additions & 0 deletions OngekiScoreLog/app/Services/OngekiUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ public function RateValueFromTitle(string $title, $difficulty, int $technicalSco
if(!array_key_exists($title, $this::$MusicList)){
throw new \OutOfBoundsException("title: " . $title . " / artist:" . $artist . " / difficulty:" . $difficulty);
}

$difficulty = "lunatic_extra_level";
if(!array_key_exists($difficulty, $this::$MusicList[$title])){
// なんか存在しない難易度の定数値取ろうとしてる
// 既に入ってる曲に後からlunatic追加されると起きがち
return 0;
}

return $this->RateValue($this::$MusicList[$title][$difficulty], $technicalScore);
}

Expand Down
12 changes: 6 additions & 6 deletions OngekiScoreLog/resources/assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ p{
padding-bottom: 2em;

.title.is-4{
margin-bottom: 0.3em;
margin-bottom: 0.3em;
}
}

Expand Down Expand Up @@ -109,7 +109,7 @@ td.table-tag{
.tag{
&.full-bell{
background-color: #c1b400;
color: #fff;
color: #fff;
}

&.full-combo{
Expand Down Expand Up @@ -163,11 +163,11 @@ div.column{

.estimated-rating{
font-style: italic;
color: #aaa;
color: #c5c5c5;
}

.max-rating{
font-weight: bold;
font-weight: bold;
color: #a00;
}

Expand All @@ -179,7 +179,7 @@ div.column{
$separation: #ccc;

@function lamp-gradient($isFB, $isFC, $isAB){
@return linear-gradient(90deg,
@return linear-gradient(90deg,
if($isFB == true, $fb, $none) 32%, $separation 32%, $separation 35%, if($isFC == true, $fc, $none) 35%, if($isFC == true, $fc, $none) 65%, $separation 65%, $separation 68%, if($isAB == true, $ab, $none) 68%);
}

Expand Down Expand Up @@ -257,4 +257,4 @@ div.column{

#bookmarklet{
height: 30em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<th><abbr title="Technical Score">TS</abbr></th>
<th>Rate</th>
<th><abbr title="この曲のレート値が0.01上昇するために必要なスコアです">+0.01</abbr></th>
<th><abbr title="この曲のレート値が0.x0のしきい値になるために必要なスコアです 例) 15.25→15.30">→0.x0</abbr></th>
<th><abbr title="1曲のみでユーザーのレート値が0.01上昇するために必要なスコアです">+{{sprintf("%.2f", $statistics->totalRatingCount / 100)}}</abbr></th>
</tr>
</thead>
Expand All @@ -20,6 +21,7 @@
<th><abbr title="Technical Score">TS</abbr></th>
<th>Rate</th>
<th><abbr title="この曲のレート値が0.01上昇するために必要なスコアです">+0.01</abbr></th>
<th><abbr title="この曲のレート値が0.x0のしきい値になるために必要なスコアです 例) 15.25→15.30">→0.x0</abbr></th>
<th><abbr title="1曲のみでユーザーのレート値が0.01上昇するために必要なスコアです">+{{sprintf("%.2f", $statistics->totalRatingCount / 100)}}</abbr></th>
</tr>
</tfoot>
Expand All @@ -32,10 +34,11 @@
<td class="sort_title">{{$array[$i]->title}}</td>
@endif
<td>{{substr($array[$i]->difficulty_str, 0, 3)}}</td>
<td>{{$array[$i]->extraLevelStr}}</td>
<td>{!!$array[$i]->extraLevelStr!!}</td>
<td>{{number_format($array[$i]->technical_high_score)}}</td>
<td>{!!$array[$i]->ratingValue!!}</td>
<td>{{$array[$i]->targetMusicRateMusic}}</td>
<td>{{$array[$i]->targetMusicRateBorder}}</td>
<td>{{$array[$i]->targetMusicRateUser}}</td>
</tr>
@endfor
Expand Down Expand Up @@ -78,7 +81,7 @@
<td class="sort_title">{{$array[$i]->title}}</td>
@endif
<td>{{substr($array[$i]->difficulty_str, 0, 3)}}</td>
<td>{{$array[$i]->extraLevelStr}}</td>
<td>{!!$array[$i]->extraLevelStr!!}</td>
<td>{{number_format($array[$i]->technical_high_score)}}</td>
<td>{!!$array[$i]->ratingValue!!}</td>
<td>{{sprintf("%.2f", $array[$i]->minDifferenceRate)}}</td>
Expand All @@ -88,4 +91,4 @@
@endfor
</tbody>
</table>
</div>
</div>
18 changes: 10 additions & 8 deletions OngekiScoreLog/resources/views/user_rating.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@
</table>
</div>
<p>
<span class="subtitle is-5">到達可能レーティング: {{sprintf("%.4f",floor($statistics->maxRatingTotal / $statistics->totalRatingCount * 10000) / 10000)}}</span><br>
現在のスコアデータのうち、最大レート({{$statistics->potentialRatingTop}})の曲でリーセント枠を全て埋めたときの値です。
@foreach ($messages as $message)
<p>
<span style="color: #dd3333">{{$message}}</span>
</p>
@endforeach
<span class="subtitle is-5">到達可能レーティング: {{sprintf("%.4f",floor($statistics->maxRatingTotal / $statistics->totalRatingCount * 10000) / 10000)}}</span>
</p>
現在のスコアデータのうち、最大レート({{$statistics->potentialRatingTop}})の曲でリーセント枠を全て埋めたときの値です。<br>
なお、枠にAAA以下の曲が含まれる場合、計算が正確でない場合があります。
</p>
@foreach ($messages as $message)
<p>
<span style="color: #dd3333">{{$message}}</span>
</p>
@endforeach
</article>

<article id="rating_new" class="box">
Expand Down Expand Up @@ -141,7 +143,7 @@
<td class="sort_title">{{$recentScore[$i]['title']}}</td>
@endif
<td>{{substr($recentScore[$i]['difficulty_str'], 0, 3)}}</td>
<td>{{$recentScore[$i]['level_str']}}</td>
<td>{!!$recentScore[$i]['level_str']!!}</td>
<td>{{number_format($recentScore[$i]['technical_score'])}}</td>
<td>{!!$recentScore[$i]['ratingValue']!!}</td>
<td>{{sprintf("%.2f", $recentScore[$i]['rawRatingValue'] - $statistics->totalRatingTop)}}</td>
Expand Down

0 comments on commit 67b1cf7

Please sign in to comment.