floor를 intdiv로 변경
This commit is contained in:
+22
-21
@@ -4,7 +4,7 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$v = new Validator($_GET + $_POST);
|
||||
$v = new Validator($_POST + $_GET);
|
||||
$v
|
||||
->rule('required', [
|
||||
'name',
|
||||
@@ -34,7 +34,7 @@ $v
|
||||
->rule('min', 'character', 0)
|
||||
->rule('max', 'character', 11);
|
||||
|
||||
if(!$v->validate()){
|
||||
if (!$v->validate()) {
|
||||
MessageBox($v->errorStr());
|
||||
echo "<script>history.go(-1);</script>";
|
||||
exit(1);
|
||||
@@ -59,7 +59,7 @@ $rootDB = RootDB::db();
|
||||
//회원 테이블에서 정보확인
|
||||
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name` FROM MEMBER WHERE no=%i', $userID);
|
||||
|
||||
if(!$member) {
|
||||
if (!$member) {
|
||||
MessageBox("잘못된 접근입니다!!!");
|
||||
echo "<script>history.go(-1);</script>";
|
||||
exit(1);
|
||||
@@ -73,42 +73,42 @@ $gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE noc<2');
|
||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%i', $name);
|
||||
|
||||
if($oldGeneral) {
|
||||
if ($oldGeneral) {
|
||||
echo("<script>
|
||||
window.alert('이미 등록하셨습니다!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if($oldName) {
|
||||
if ($oldName) {
|
||||
echo("<script>
|
||||
window.alert('이미 있는 장수입니다. 다른 이름으로 등록해 주세요!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if($admin['maxgeneral'] <= $gencount) {
|
||||
if ($admin['maxgeneral'] <= $gencount) {
|
||||
echo("<script>
|
||||
window.alert('더이상 등록할 수 없습니다!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if(mb_strlen($name) < 1) {
|
||||
if (mb_strlen($name) < 1) {
|
||||
echo("<script>
|
||||
window.alert('이름이 짧습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if(mb_strlen($name) > 6) {
|
||||
if (mb_strlen($name) > 6) {
|
||||
echo("<script>
|
||||
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if($leader + $power + $intel > 150) {
|
||||
if ($leader + $power + $intel > 150) {
|
||||
echo("<script>
|
||||
window.alert('능력치가 150을 넘어섰습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
@@ -118,8 +118,7 @@ if($leader + $power + $intel > 150) {
|
||||
|
||||
$genius = Util::randBool(0.01);
|
||||
// 현재 1%
|
||||
if($genius && $admin['genius'] > 0) {
|
||||
|
||||
if ($genius && $admin['genius'] > 0) {
|
||||
$db->update('game', [
|
||||
'genius'=>$db->sqleval('genius-1')
|
||||
], true);
|
||||
@@ -129,15 +128,15 @@ if($genius && $admin['genius'] > 0) {
|
||||
|
||||
// 공백지에서만 태어나게
|
||||
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 and nation=0 order by rand() limit 0,1");
|
||||
if(!$city) {
|
||||
if (!$city) {
|
||||
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 order by rand() limit 0,1");
|
||||
}
|
||||
|
||||
$pleader = 0;
|
||||
$ppower = 0;
|
||||
$pintel = 0;
|
||||
for($statBonusCnt = 3 + mt_rand(0, 2); $statBonusCnt > 0; $statBonusCnt--){
|
||||
switch(Util::choiceRandomUsingWeight(array($leader, $power, $intel))){
|
||||
for ($statBonusCnt = 3 + mt_rand(0, 2); $statBonusCnt > 0; $statBonusCnt--) {
|
||||
switch (Util::choiceRandomUsingWeight(array($leader, $power, $intel))) {
|
||||
case 0:
|
||||
$pleader++;
|
||||
break;
|
||||
@@ -156,7 +155,7 @@ $intel = $intel + $pintel;
|
||||
|
||||
$age = 20 + ($pleader + $ppower + $pintel) * 2 - (mt_rand(0, 1));
|
||||
// 아직 남았고 천재등록상태이면 특기 부여
|
||||
if($genius) {
|
||||
if ($genius) {
|
||||
$specage2 = $age;
|
||||
$special2 = getSpecial2($leader, $power, $intel);
|
||||
} else {
|
||||
@@ -167,7 +166,7 @@ if($genius) {
|
||||
$specage = round((80 - $age)/12) + $age;
|
||||
$special = 0;
|
||||
|
||||
if($admin['scenario'] > 0) {
|
||||
if ($admin['scenario'] > 0) {
|
||||
$specage2 = $age + 3;
|
||||
$specage = $age + 3;
|
||||
}
|
||||
@@ -175,12 +174,12 @@ if($admin['scenario'] > 0) {
|
||||
$turntime = getRandTurn($admin['turnterm']);
|
||||
|
||||
$lastconnect = date('Y-m-d H:i:s');
|
||||
if($lastconnect >= $turntime) {
|
||||
if ($lastconnect >= $turntime) {
|
||||
$turntime = addTurn($turntime, $admin['turnterm']);
|
||||
}
|
||||
|
||||
//특회 전콘
|
||||
if($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic == 1) {
|
||||
if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic == 1) {
|
||||
$face = $member['picture'];
|
||||
$imgsvr = $member['imgsvr'];
|
||||
} else {
|
||||
@@ -189,7 +188,9 @@ if($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
|
||||
}
|
||||
|
||||
//성격 랜덤시
|
||||
if($character == 11) $character = rand()%10;
|
||||
if ($character == 11) {
|
||||
$character = rand()%10;
|
||||
}
|
||||
//상성 랜덤
|
||||
$affinity = rand()%150 + 1;
|
||||
|
||||
@@ -234,7 +235,7 @@ $me = [
|
||||
'no'=>$generalID
|
||||
];
|
||||
|
||||
if($genius) {
|
||||
if ($genius) {
|
||||
$log[0] = "<C>●</>{$admin['month']}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 기재가 천하에 이름을 알립니다.";
|
||||
$log[1] = "<C>●</>{$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
|
||||
|
||||
@@ -250,7 +251,7 @@ $mylog[] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주
|
||||
$mylog[] = "<C>●</>부디 즐거운 삼모전 되시길 바랍니다 ^^";
|
||||
$mylog[] = "<C>●</>통솔 <C>$pleader</> 무력 <C>$ppower</> 지력 <C>$pintel</> 의 보너스를 받으셨습니다.";
|
||||
$mylog[] = "<C>●</>연령은 <C>$age</>세로 시작합니다.";
|
||||
if($genius) {
|
||||
if ($genius) {
|
||||
$mylog[] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!";
|
||||
pushGeneralHistory($me, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user