From 3986ff5dda0fc23cd50111c879a845f9ac6e445a Mon Sep 17 00:00:00 2001 From: sars Date: Sun, 10 Apr 2022 01:26:48 -0700 Subject: [PATCH] =?UTF-8?q?=EB=B2=A0=ED=8C=85=EC=9E=A5=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EA=B4=80=EB=A0=A8=20=EC=8A=A4=ED=83=AF=20=EC=B6=9C=EB=A0=A5?= =?UTF-8?q?=EC=8B=9C=ED=82=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/b_betting.php | 68 ++++++++++++++++++++++-------------------- hwe/func_converter.php | 9 ++++++ 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/hwe/b_betting.php b/hwe/b_betting.php index bbf065df..44ab71da 100644 --- a/hwe/b_betting.php +++ b/hwe/b_betting.php @@ -38,25 +38,25 @@ if ($con >= 2) { switch ($admin['tnmt_type']) { default: throw new \RuntimeException('Invalid tnmt_type'); - case 0: + case convertTournamentType('전력전'): $tnmt_type = "전력전"; $tp = "total"; $tp2 = "종합"; $tp3 = "total"; break; - case 1: + case convertTournamentType('통솔전'): $tnmt_type = "통솔전"; $tp = "leadership"; $tp2 = "통솔"; $tp3 = "leadership"; break; - case 2: + case convertTournamentType('일기토'): $tnmt_type = "일기토"; $tp = "strength"; $tp2 = "무력"; $tp3 = "strength"; break; - case 3: + case convertTournamentType('설전'): $tnmt_type = "설전"; $tp = "intel"; $tp2 = "지력"; @@ -273,7 +273,7 @@ if ($str3) { for ($i = 0; $i < 8; $i++) { $cent[$i] = ""; } - $generalList = $db->query('SELECT npc,name,win from tournament where grp>=20 order by grp, grp_no LIMIT 16'); + $generalList = $db->query('SELECT npc,name,win,leadership,strength,intel,leadership+strength+intel as total from tournament where grp>=20 order by grp, grp_no LIMIT 16'); while (count($generalList) < 16) { $generalList[] = [ 'name' => '-', @@ -293,6 +293,7 @@ if ($str3) { $line[$i] = ""; } $gen[$i] = $general['name']; + $stat[$i] = $general[$tp]; } for ($i = 0; $i < 8; $i++) { $cent[$i] = $cent[$i] . "┻" . ""; @@ -300,40 +301,43 @@ if ($str3) { $line[$i * 2 + 1] = $line[$i * 2 + 1] . "━━┓" . ""; echo "{$line[$i * 2]}{$cent[$i]}{$line[$i * 2 + 1]}"; } - echo " - - "; - - for ($i = 0; $i < 16; $i++) { - echo "{$gen[$i]}"; - } - - $bet = []; - $gold = []; - - for ($i = 0; $i < 16; $i++) { - if ($globalBet[$i] == 0) { - $bet[$i] = "∞"; - } else { - $bet[$i] = round($globalBetTotal / $globalBet[$i], 2); - } - } - - for ($i = 0; $i < 16; $i++) { - if (!is_numeric($bet[$i])) { - $gold[$i] = 0; - } else { - $gold[$i] = Util::round($myBet[$i] * $bet[$i]); - } - } ?> - + + + + + + + + + + + "; diff --git a/hwe/func_converter.php b/hwe/func_converter.php index ad93a95a..23abc958 100644 --- a/hwe/func_converter.php +++ b/hwe/func_converter.php @@ -64,6 +64,15 @@ function getNationLevel(int $level) { ][$level]; } +function convertTournamentType(string $type){ + return[ + '전력전'=>0, + '통솔전'=>1, + '일기토'=>2, + '설전'=>3, + ][$type]??-1; +} + function getGenChar(?string $type) { if($type === null){ return '-';