From 97be8740e24477945f6d679cc08362d9278f49af Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 12 Mar 2018 23:23:10 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=ED=83=AF=20=EB=B3=B4=EB=84=88?= =?UTF-8?q?=EC=8A=A4=EA=B0=80=20=ED=98=84=EC=9E=AC=20=EC=8A=A4=ED=83=AF?= =?UTF-8?q?=EC=97=90=20=EB=B9=84=EB=A1=80=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/join_post.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/che_close/join_post.php b/che_close/join_post.php index 793c8bf..f811aad 100644 --- a/che_close/join_post.php +++ b/che_close/join_post.php @@ -141,14 +141,24 @@ if($id_num) { } $city = $city[city]; - $total = 3 + rand() % 3; - $pleader = rand() % 100; - $ppower = rand() % 100; - $pintel = rand() % 100; - $rate = $pleader + $ppower + $pintel; - $pleader = floor($pleader / $rate * $total + 0.5); - $ppower = floor($ppower / $rate * $total + 0.5); - $pintel = floor($pintel / $rate * $total + 0.5); + + $pleader = 0; + $ppower = 0; + $pintel = 0; + for($statBonusCnt = 3 + rand() % 3; $statBonusCnt > 0; $statBonusCnt--){ + switch(ChooseRandomItem(array($leader, $power, $intel))){ + case 0: + $pleader++; + break; + case 1: + $ppower++; + break; + case 2: + $pintel++; + break; + } + $statBonus[]++; + } $leader = $leader + $pleader; $power = $power + $ppower;