Skip to content

Instantly share code, notes, and snippets.

@5l
Created January 10, 2016 11:34
Show Gist options
  • Save 5l/1d55a54c9921c37a0a92 to your computer and use it in GitHub Desktop.
Save 5l/1d55a54c9921c37a0a92 to your computer and use it in GitHub Desktop.
CGSSの必要経験値予想
<?php
$maxLevel = 350; # 計算する最大PLv
$needExp = 30; # 初期必要経験値
$stamina = 40; # 初期スタミナ
$friend = 40; # 初期同僚数
$staminaInterval = 1; # 初期最大スタミナ上昇間隔
$staminaLimit = 0;
$totalExp = 0;
$temp = 0;
$needPlay = 0;
for($Plv = 1; $Plv <= $maxLevel; $Plv++){
if(($Plv % 10) == 1 || $Plv == 1){
e("Plv スタミナ 同僚 必要経験値 累計経験値 最低演奏回数");
}
e("lv{$Plv} {$stamina} {$friend}人 {$needExp} {$totalExp} {$needPlay}曲");
# スタミナ計算
if(!$staminaLimit){
$stamina++;
$staminaLimit = $staminaInterval;
}else{
$staminaLimit--;
}
if(($stamina % 10) == 0 && $temp != $stamina){
$temp = $stamina;
$staminaInterval++;
if(($staminaInterval % 5) == 0){
$staminaInterval += 4;
}
$staminaLimit = $staminaInterval;
}
# 同僚数計算
if(($Plv % 10) == 0 || $Plv == 5){
$friend++;
}
# 必要経験値の計算
$totalExp += $needExp;
if(($Plv % 50) == 49){
$needExp += 500;
if($Plv == 49){
$needExp -= 10;
}
}
$needExp += 20;
# 必要プレイ曲数の計算
$needPlay = ceil($totalExp / 63);
}
function e($str){
echo mb_convert_encoding($str . PHP_EOL, "SJIS", "auto");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment