Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7864fe1e0f | ||
|
|
fe08fe0e2e | ||
|
|
87775a9471 | ||
|
|
8089457aa8 | ||
|
|
e443f92ddb | ||
|
|
cb65666600 | ||
|
|
6ed174e5dc | ||
|
|
dd7f0ef3bf | ||
|
|
ec8e43a2a9 | ||
|
|
a83b6b55cd | ||
|
|
d43f15e096 | ||
|
|
e09fdefa68 | ||
|
|
2b483749bc | ||
|
|
048d71920c | ||
|
|
47366086d5 | ||
|
|
f9a73be82b | ||
|
|
e7918469e5 | ||
|
|
687559a1a3 | ||
|
|
398c11e607 | ||
|
|
191544d28b | ||
|
|
647c2439e3 | ||
|
|
da2a6f347a |
@@ -83,7 +83,6 @@ return [
|
|||||||
'hwe/j_board_article_add.php',
|
'hwe/j_board_article_add.php',
|
||||||
'hwe/j_board_comment_add.php',
|
'hwe/j_board_comment_add.php',
|
||||||
'hwe/j_board_get_articles.php',
|
'hwe/j_board_get_articles.php',
|
||||||
'hwe/j_die_immediately.php',
|
|
||||||
'hwe/j_diplomacy_destroy_letter.php',
|
'hwe/j_diplomacy_destroy_letter.php',
|
||||||
'hwe/j_diplomacy_get_letter.php',
|
'hwe/j_diplomacy_get_letter.php',
|
||||||
'hwe/j_diplomacy_respond_letter.php',
|
'hwe/j_diplomacy_respond_letter.php',
|
||||||
|
|||||||
+8
-8
@@ -23,8 +23,8 @@ $generalID = $session->generalID;
|
|||||||
|
|
||||||
$me = $db->queryFirstRow('SELECT no,tournament,con,turntime from general where owner=%i', $userID);
|
$me = $db->queryFirstRow('SELECT no,tournament,con,turntime from general where owner=%i', $userID);
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'develcost']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'turnterm', 'develcost']);
|
||||||
|
$turnTerm = $admin['turnterm'];
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
printLimitMsg($me['turntime']);
|
printLimitMsg($me['turntime']);
|
||||||
@@ -99,7 +99,7 @@ $str2 = getTournamentTime();
|
|||||||
if ($str2) {
|
if ($str2) {
|
||||||
$str2 = ', ' . $str2;
|
$str2 = ', ' . $str2;
|
||||||
}
|
}
|
||||||
$str3 = getTournamentTermText();
|
$str3 = getTournamentTermText($turnTerm);
|
||||||
if ($str3) {
|
if ($str3) {
|
||||||
$str3 = ', ' . $str3;
|
$str3 = ', ' . $str3;
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ if ($str3) {
|
|||||||
</table>
|
</table>
|
||||||
<table align=center width=1120 class='tb_layout bg0'>
|
<table align=center width=1120 class='tb_layout bg0'>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=16><input type=button value='갱신' onclick='location.reload()'></td>
|
<td colspan=16><button type="button" class="btn btn-secondary" onclick='location.reload()'>갱신</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=16 align=center>
|
<td colspan=16 align=center>
|
||||||
@@ -441,13 +441,13 @@ if ($str3) {
|
|||||||
|
|
||||||
if ($admin['tournament'] == 6) {
|
if ($admin['tournament'] == 6) {
|
||||||
echo "
|
echo "
|
||||||
<tr align=center>";
|
<tr align=center style='height:2.5em;'>";
|
||||||
|
|
||||||
foreach (range(0, 15) as $i) {
|
foreach (range(0, 15) as $i) {
|
||||||
$key = $keyMap[$i] ?? -1;
|
$key = $keyMap[$i] ?? -1;
|
||||||
echo "
|
echo "
|
||||||
<td>
|
<td>
|
||||||
<select size=1 id='target_{$key}' style=color:white;background-color:black;>
|
<select size=1 id='target_{$key}' style='color:white;background-color:black;padding:0.2rem 0.1rem;'>
|
||||||
<option style=color:white; value=10>금10</option>
|
<option style=color:white; value=10>금10</option>
|
||||||
<option style=color:white; value=20>금20</option>
|
<option style=color:white; value=20>금20</option>
|
||||||
<option style=color:white; value=50>금50</option>
|
<option style=color:white; value=50>금50</option>
|
||||||
@@ -461,12 +461,12 @@ if ($str3) {
|
|||||||
|
|
||||||
echo "
|
echo "
|
||||||
</tr>
|
</tr>
|
||||||
<tr align=center>";
|
<tr align=center style='height:2.2em;'>";
|
||||||
|
|
||||||
foreach (range(0, 15) as $i) {
|
foreach (range(0, 15) as $i) {
|
||||||
$key = $keyMap[$i] ?? -1;
|
$key = $keyMap[$i] ?? -1;
|
||||||
echo "
|
echo "
|
||||||
<td><input type=button class='submitBtn' data-target='{$key}' value=베팅! style=width:100%;color:white;background-color:black;></td>";
|
<td><input type=button class='submitBtn' data-target='{$key}' value=베팅! style='width:100%;color:white;padding:0.2rem 0.1rem;background-color:black;'></td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ $userID = Session::getUserID();
|
|||||||
$userGrade = Session::getUserGrade();
|
$userGrade = Session::getUserGrade();
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
increaseRefresh("현재도시", 1);
|
increaseRefresh("현재도시", 1);
|
||||||
|
|
||||||
|
$lastExecute = substr($gameStor->turntime, 5, 14);
|
||||||
|
|
||||||
$me = $db->queryFirstRow('SELECT no,nation,officer_level,city from general where owner=%i', $userID);
|
$me = $db->queryFirstRow('SELECT no,nation,officer_level,city from general where owner=%i', $userID);
|
||||||
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']) ?? [
|
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']) ?? [
|
||||||
'nation' => 0,
|
'nation' => 0,
|
||||||
@@ -446,7 +448,7 @@ $templates = new \League\Plates\Engine('templates');
|
|||||||
<table align=center width=1000 class='tb_layout bg2'>
|
<table align=center width=1000 class='tb_layout bg2'>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=11 align=center style='color:<?= newColor($cityNation['color']) ?>; background:<?= $cityNation['color'] ?>'>【 <?= CityConst::$regionMap[$city['region']] ?> | <?= CityConst::$levelMap[$city['level']] ?> 】 <?= $city['name'] ?></td>
|
<td colspan=11 align=center style='color:<?= newColor($cityNation['color']) ?>; background:<?= $cityNation['color'] ?>'>【 <?= CityConst::$regionMap[$city['region']] ?> | <?= CityConst::$levelMap[$city['level']] ?> 】 <?= $city['name'] ?></td>
|
||||||
<td style='color:<?= newColor($cityNation['color']) ?>; background:<?= $cityNation['color'] ?>' class='center'><?= date('m-d H:i:s') ?></td>
|
<td style='color:<?= newColor($cityNation['color']) ?>; background:<?= $cityNation['color'] ?>' class='center'><?= $lastExecute ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center width=48 class=bg1>주민</td>
|
<td align=center width=48 class=bg1>주민</td>
|
||||||
|
|||||||
+18
-8
@@ -5,8 +5,9 @@ namespace sammo;
|
|||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
$showDieImmediatelyBtn = false;
|
$showDieOnPrestartBtn = false;
|
||||||
$availableDieImmediately = false;
|
$showBuildNationCandidateBtn = false;
|
||||||
|
$availableDieOnPrestart = false;
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
@@ -31,12 +32,16 @@ if ($myset > 0) {
|
|||||||
$targetTime = addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2);
|
$targetTime = addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2);
|
||||||
if ($gameStor->turntime <= $gameStor->opentime) {
|
if ($gameStor->turntime <= $gameStor->opentime) {
|
||||||
//서버 가오픈시 할 수 있는 행동
|
//서버 가오픈시 할 수 있는 행동
|
||||||
if ($me->getNPCType() == 0) {
|
if ($me->getNPCType() == 0 && $me->getNationID() == 0) {
|
||||||
$showDieImmediatelyBtn = true;
|
$showDieOnPrestartBtn = true;
|
||||||
if ($targetTime <= TimeUtil::now()) {
|
if ($targetTime <= TimeUtil::now()) {
|
||||||
$availableDieImmediately = true;
|
$availableDieOnPrestart = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($me->getNationID() == 0){
|
||||||
|
$showBuildNationCandidateBtn = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$use_treatment = $me->getAuxVar('use_treatment') ?? 10;
|
$use_treatment = $me->getAuxVar('use_treatment') ?? 10;
|
||||||
@@ -51,7 +56,7 @@ $use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn') ?? 1;
|
|||||||
<meta name="viewport" content="width=500" />
|
<meta name="viewport" content="width=500" />
|
||||||
<title><?= UniqueConst::$serverName ?>: 내정보</title>
|
<title><?= UniqueConst::$serverName ?>: 내정보</title>
|
||||||
<?= WebUtil::printStaticValues([
|
<?= WebUtil::printStaticValues([
|
||||||
'availableDieImmediately' => $availableDieImmediately,
|
'availableDieOnPrestart' => $availableDieOnPrestart,
|
||||||
'staticValues' => [
|
'staticValues' => [
|
||||||
'items' => Util::mapWithKey(fn (string $key, BaseItem $item) => [
|
'items' => Util::mapWithKey(fn (string $key, BaseItem $item) => [
|
||||||
'name' => $item->getName(),
|
'name' => $item->getName(),
|
||||||
@@ -122,9 +127,14 @@ $use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn') ?? 1;
|
|||||||
<!--빙의 해제용 삭턴 조절<br>
|
<!--빙의 해제용 삭턴 조절<br>
|
||||||
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?= GameConst::$basecolor2 ?>;color:white;width:160px;height:30px;font-size:14px;>빙의 해체 요청</button></a>-->
|
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?= GameConst::$basecolor2 ?>;color:white;width:160px;height:30px;font-size:14px;>빙의 해체 요청</button></a>-->
|
||||||
|
|
||||||
<?php if ($showDieImmediatelyBtn) : ?>
|
<?php if ($showDieOnPrestartBtn) : ?>
|
||||||
가오픈 기간 내 장수 삭제 (<?= substr($targetTime, 0, 19) ?> 부터)<br>
|
가오픈 기간 내 장수 삭제 (<?= substr($targetTime, 0, 19) ?> 부터)<br>
|
||||||
<a href="c_die_immediately.php" id='die_immediately'><button type="button" style=background-color:<?= GameConst::$basecolor2 ?>;color:white;width:160px;height:30px;font-size:14px;>장수 삭제</button></a><br><br>
|
<button type="button" id='dieOnPrestart' style=background-color:<?= GameConst::$basecolor2 ?>;color:white;width:160px;height:30px;font-size:14px;>장수 삭제</button><br><br>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($showBuildNationCandidateBtn) : ?>
|
||||||
|
서버 개시 이전 거병(2턴부터 건국 가능)<br>
|
||||||
|
<button type="button" id='buildNationCandidate' style=background-color:<?= GameConst::$basecolor2 ?>;color:white;width:160px;height:30px;font-size:14px;>사전 거병</button><br><br>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($gameStor->npcmode == 2 && $me->getNPCType() == 0) : ?>
|
<?php if ($gameStor->npcmode == 2 && $me->getNPCType() == 0) : ?>
|
||||||
|
|||||||
+33
-80
@@ -17,7 +17,8 @@ TurnExecutionHelper::executeAllCommand();
|
|||||||
$me = $db->queryFirstRow('select no,tournament,con,turntime from general where owner=%i', $userID);
|
$me = $db->queryFirstRow('select no,tournament,con,turntime from general where owner=%i', $userID);
|
||||||
$generalID = $session->generalID;
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_msg', 'tnmt_type', 'develcost', 'tnmt_trig']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'turnterm', 'tnmt_msg', 'tnmt_type', 'develcost', 'tnmt_trig']);
|
||||||
|
$turnTerm = $admin['turnterm'];
|
||||||
|
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
@@ -120,80 +121,26 @@ $globalBetTotal = array_sum($globalBet);
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table align=center class='tb_layout bg0'>
|
<table align=center class='tb_layout bg0'>
|
||||||
<?php
|
<?php if ($session->userGrade >= 5) : ?>
|
||||||
if ($session->userGrade >= 5) {
|
|
||||||
$sel = [];
|
|
||||||
echo "
|
|
||||||
<form method=post action=c_tournament.php>
|
<form method=post action=c_tournament.php>
|
||||||
<tr><td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td></tr>
|
<tr>
|
||||||
<tr><td colspan=8>
|
<td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td>
|
||||||
<input type=button value='갱신' onclick='location.reload()'>";
|
</tr>
|
||||||
|
<tr>
|
||||||
switch ($admin['tnmt_trig']) {
|
<td colspan=8>
|
||||||
case 0:
|
<button type="button" class="btn btn-secondary" onclick='location.reload()'>갱신</button>
|
||||||
$sel[0] = "selected";
|
<?php if ($admin['tournament'] == 0) : ?>
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$sel[1] = "selected";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$sel[2] = "selected";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$sel[3] = "selected";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$sel[4] = "selected";
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$sel[5] = "selected";
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
$sel[6] = "selected";
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
$sel[7] = "selected";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($admin['tournament'] == 0) {
|
|
||||||
?>
|
|
||||||
<select name=auto size=1 style=color:white;background-color:black;>
|
<select name=auto size=1 style=color:white;background-color:black;>
|
||||||
<option style=color:white; value=0>수동진행</option>
|
<option style=color:white; value=0 <?= !$admin['tnmt_trig'] ? 'selected' : '' ?>>수동진행</option>
|
||||||
<option style=color:white; value=1>12분 05일</option>
|
<option style=color:white; value=1 <?= $admin['tnmt_trig'] ? 'selected' : '' ?>>자동진행</option>
|
||||||
<option style=color:white; value=2>07분 10시</option>
|
|
||||||
<option style=color:white; value=3>03분 04시</option>
|
|
||||||
<option style=color:white; value=4>01분 82분</option>
|
|
||||||
<option style=color:white; value=5>30초 41분</option>
|
|
||||||
<option style=color:white; value=6>15초 21분</option>
|
|
||||||
<option style=color:white; value=7>05초 07분</option>
|
|
||||||
</select>
|
|
||||||
<select name=type size=1 style=color:white;background-color:black;>
|
|
||||||
<option style=color:white; value=0>전력전</option>
|
|
||||||
<option style=color:white; value=1>통솔전</option>
|
|
||||||
<option style=color:white; value=2>일기토</option>
|
|
||||||
<option style=color:white; value=3>설전</option>
|
|
||||||
</select>
|
|
||||||
<input type=submit name=btn value='개최'>
|
|
||||||
<select name=trig size=1 style=color:white;background-color:black;>
|
|
||||||
<option style=color:white; value=0 <?= $sel[0] ?? '' ?>>수동진행</option>
|
|
||||||
<option style=color:white; value=1 <?= $sel[1] ?? '' ?>>12분 05일</option>
|
|
||||||
<option style=color:white; value=2 <?= $sel[2] ?? '' ?>>07분 10시</option>
|
|
||||||
<option style=color:white; value=3 <?= $sel[3] ?? '' ?>>03분 04시</option>
|
|
||||||
<option style=color:white; value=4 <?= $sel[4] ?? '' ?>>01분 82분</option>
|
|
||||||
<option style=color:white; value=5 <?= $sel[5] ?? '' ?>>30초 41분</option>
|
|
||||||
<option style=color:white; value=6 <?= $sel[6] ?? '' ?>>15초 21분</option>
|
|
||||||
<option style=color:white; value=7 <?= $sel[7] ?? '' ?>>05초 07분</option>
|
|
||||||
</select>
|
</select>
|
||||||
<input type=submit name=btn value='자동개최설정'>
|
<input type=submit name=btn value='자동개최설정'>
|
||||||
<input type=submit name=btn value='포상'>
|
<?php else : ?>
|
||||||
<input type=submit name=btn value='회수'>
|
<input type=submit name=btn value='중단' onclick='return confirm("진짜 중단하시겠습니까?")'>
|
||||||
<?php
|
<?php endif; ?>
|
||||||
} else {
|
|
||||||
echo "<input type=submit name=btn value='중단' onclick='return confirm(\"진짜 중단하시겠습니까?\")'>";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($admin['tournament']) {
|
|
||||||
|
<?php switch ($admin['tournament']) {
|
||||||
case 1:
|
case 1:
|
||||||
echo "<input type=submit name=btn value='랜덤투입'>";
|
echo "<input type=submit name=btn value='랜덤투입'>";
|
||||||
echo "<input type=submit name=btn value='랜덤전부투입'>";
|
echo "<input type=submit name=btn value='랜덤전부투입'>";
|
||||||
@@ -225,23 +172,29 @@ $globalBetTotal = array_sum($globalBet);
|
|||||||
case 10:
|
case 10:
|
||||||
echo "<input type=submit name=btn value='결승'>";
|
echo "<input type=submit name=btn value='결승'>";
|
||||||
break;
|
break;
|
||||||
}
|
} ?>
|
||||||
|
|
||||||
echo "
|
</td>
|
||||||
</td></tr>
|
</tr>
|
||||||
</form>";
|
</form>
|
||||||
} elseif ($me['no'] > 0 && $me['tournament'] == 0 && $admin['tournament'] == 1) {
|
<?php elseif ($me['no'] > 0 && $me['tournament'] == 0 && $admin['tournament'] == 1) : ?>
|
||||||
echo "<form method=post action=c_tournament.php><tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'><input type=submit name=btn value='참가' onclick='return confirm(\"참가비 금{$admin['develcost']}이 필요합니다. 참가하시겠습니까?\")'></td></tr></form>";
|
<form method=post action=c_tournament.php>
|
||||||
} else {
|
<tr>
|
||||||
echo "<tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'></td></tr>";
|
<td colspan=8><button type="button" class="btn btn-secondary" onclick='location.reload()'>갱신</button><button type="submit" class="btn btn-sammo-base2" onclick='return confirm("참가비 금<?= $admin['develcost'] ?>이 필요합니다. 참가하시겠습니까?")'>참가</button><input type='hidden' name='btn' value='참가'/></td>
|
||||||
}
|
</tr>
|
||||||
|
</form>
|
||||||
|
<?php else : ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan=8><button type="button" class="btn btn-secondary" onclick='location.reload()'>갱신</button></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif;
|
||||||
|
|
||||||
$str1 = getTournament($admin['tournament']);
|
$str1 = getTournament($admin['tournament']);
|
||||||
$str2 = getTournamentTime();
|
$str2 = getTournamentTime();
|
||||||
if ($str2) {
|
if ($str2) {
|
||||||
$str2 = ', ' . $str2;
|
$str2 = ', ' . $str2;
|
||||||
}
|
}
|
||||||
$str3 = getTournamentTermText();
|
$str3 = getTournamentTermText($turnTerm);
|
||||||
if ($str3) {
|
if ($str3) {
|
||||||
$str3 = ', ' . $str3;
|
$str3 = ', ' . $str3;
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-10
@@ -12,7 +12,8 @@ $db = DB::db();
|
|||||||
|
|
||||||
increaseRefresh("부대편성", 1);
|
increaseRefresh("부대편성", 1);
|
||||||
|
|
||||||
$me = $db->queryFirstRow('SELECT no,nation,troop FROM general WHERE owner=%i', $userID);
|
$me = $db->queryFirstRow('SELECT no,nation,troop,`officer_level`,permission,penalty FROM general WHERE owner=%i', $userID);
|
||||||
|
$permission = checkSecretPermission($me, false);
|
||||||
|
|
||||||
$troops = [];
|
$troops = [];
|
||||||
foreach ($db->query('SELECT troop_leader,name FROM troop WHERE nation = %i', $me['nation']) as $rawTroop) {
|
foreach ($db->query('SELECT troop_leader,name FROM troop WHERE nation = %i', $me['nation']) as $rawTroop) {
|
||||||
@@ -204,17 +205,37 @@ uasort($troops, function ($lhs, $rhs) {
|
|||||||
|
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
<table width=1000 class='tb_layout bg0'>
|
<div class="row">
|
||||||
<tr>
|
|
||||||
<td width=80 class='bg1'>부 대 명</td>
|
|
||||||
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=18 id='nameplate'></td>
|
|
||||||
<?php if($me['troop'] == 0): ?>
|
<?php if($me['troop'] == 0): ?>
|
||||||
<td><input type=button id='btnCreateTroop' value='부 대 창 설'></td>
|
<div class="col-6"><?php /*TODO: 모바일 */ ?>
|
||||||
<?php else : ?>
|
<div class="row gx-0 bg0">
|
||||||
<td><input type=button id='btnChangeTroopName' value='부 대 변 경'></td>
|
<div class="bg1 col d-grid"><span class="align-self-center center">부대명</span></div>
|
||||||
|
<div class="col d-grid"><input type=text style=color:white;background-color:black; size=18 maxlength=18 id='newTroopName'></div>
|
||||||
|
<div class="col d-grid"><button type='button' id="btnCreateTroop" class='btn btn-sm btn-secondary'>부대 창설</button></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</tr>
|
<?php if($troops && ($me['troop'] == $me['no'] || $permission == 4)): ?>
|
||||||
</table>
|
<div class="col-6">
|
||||||
|
<div class="row gx-0 bg0">
|
||||||
|
<div class="bg1 col d-grid"><span class="align-self-center center">부대명</span></div>
|
||||||
|
<div class="col d-grid"><select class="form-select" id="changeNameTroopID">
|
||||||
|
<?php if($permission != 4): ?>
|
||||||
|
<option value="<?=$me['troop']?>"><?=$troops[$me['troop']]['name']?></option>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($troops as $troopNo => $troop): ?>
|
||||||
|
<option value="<?=$troopNo?>"><?=$troop['name']?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col d-grid"><input type=text style=color:white;background-color:black; size=18 maxlength=18 id='changeTroopName'></div>
|
||||||
|
<div class="col d-grid"><button type='button' id="btnChangeTroopName" class='btn btn-sm btn-secondary'>이름 변경</button></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<table width=1000 class='tb_layout bg0'>
|
<table width=1000 class='tb_layout bg0'>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -113,11 +113,11 @@ if($session->userGrade < 5) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "자동개최설정") {
|
if($btn == "자동개최설정") {
|
||||||
$gameStor->tnmt_trig = $trig;
|
$gameStor->tnmt_trig = !!$trig;
|
||||||
} elseif($btn == "개최") {
|
} elseif($btn == "개최") {
|
||||||
startTournament($auto, $type);
|
startTournament($auto, $type);
|
||||||
} elseif($btn == "중단") {
|
} elseif($btn == "중단") {
|
||||||
$gameStor->tnmt_auto = 0;
|
$gameStor->tnmt_auto = false;
|
||||||
$gameStor->tournament = 0;
|
$gameStor->tournament = 0;
|
||||||
$gameStor->phase = 0;
|
$gameStor->phase = 0;
|
||||||
} elseif($btn == "랜덤투입") {
|
} elseif($btn == "랜덤투입") {
|
||||||
|
|||||||
+2
-2
@@ -1358,7 +1358,7 @@ function triggerTournament(RandUtil $rng)
|
|||||||
if ($tournament != 0) {
|
if ($tournament != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($tnmt_trig == 0) {
|
if (!$tnmt_trig) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$rng->nextBool(0.4)) {
|
if (!$rng->nextBool(0.4)) {
|
||||||
@@ -1374,7 +1374,7 @@ function triggerTournament(RandUtil $rng)
|
|||||||
|
|
||||||
$tnmt_type = array_pop($tnmt_pattern);
|
$tnmt_type = array_pop($tnmt_pattern);
|
||||||
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
|
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
|
||||||
startTournament($tnmt_trig, $tnmt_type);
|
startTournament($tnmt_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckHall($no)
|
function CheckHall($no)
|
||||||
|
|||||||
+22
-77
@@ -5,17 +5,25 @@ namespace sammo;
|
|||||||
use sammo\DTO\BettingInfo;
|
use sammo\DTO\BettingInfo;
|
||||||
use sammo\Enums\InheritanceKey;
|
use sammo\Enums\InheritanceKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $turnTerm 서버 턴 단위
|
||||||
|
* @return int 토너먼트 초 단위
|
||||||
|
*/
|
||||||
|
function calcTournamentTerm(int $turnTerm): int{
|
||||||
|
return Util::valueFit($turnTerm, 5, 120);
|
||||||
|
}
|
||||||
|
|
||||||
function processTournament()
|
function processTournament()
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time', 'last_tournament_betting_id']);
|
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time', 'turnterm', 'last_tournament_betting_id']);
|
||||||
$now = new \DateTime();
|
$now = new \DateTime();
|
||||||
$offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
$offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
||||||
|
|
||||||
//수동일땐 무시
|
//수동일땐 무시
|
||||||
if ($admin['tnmt_auto'] == 0) {
|
if (!$admin['tnmt_auto']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,18 +36,7 @@ function processTournament()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//현시간이 스탬프 지나친경우
|
//현시간이 스탬프 지나친경우
|
||||||
$unit = [
|
$unit = calcTournamentTerm($admin['turnterm']);
|
||||||
1 => 720,
|
|
||||||
2 => 420,
|
|
||||||
3 => 180,
|
|
||||||
4 => 60,
|
|
||||||
5 => 30,
|
|
||||||
6 => 15,
|
|
||||||
7 => 5,
|
|
||||||
][$admin['tnmt_auto']] ?? null;
|
|
||||||
if($unit === null){
|
|
||||||
throw new MustNotBeReachedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
//업데이트 횟수
|
//업데이트 횟수
|
||||||
$iter = intdiv($offset, $unit) + 1;
|
$iter = intdiv($offset, $unit) + 1;
|
||||||
@@ -123,10 +120,7 @@ function processTournament()
|
|||||||
|
|
||||||
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
||||||
if ($tnmt == 6) {
|
if ($tnmt == 6) {
|
||||||
$betTerm = $unit * 60;
|
$betTerm = Util::valueFit($unit * 60, null, 3600);
|
||||||
if ($betTerm > 3600) {
|
|
||||||
$betTerm = 3600;
|
|
||||||
}
|
|
||||||
//처리 초 더한 날짜
|
//처리 초 더한 날짜
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
||||||
$gameStor->tournament = $tnmt;
|
$gameStor->tournament = $tnmt;
|
||||||
@@ -134,20 +128,6 @@ function processTournament()
|
|||||||
$gameStor->tnmt_time = $dt;
|
$gameStor->tnmt_time = $dt;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($admin['tnmt_auto'] == 1) {
|
|
||||||
//처리 초 더한 날짜
|
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
|
|
||||||
$hr = substr($dt, 11, 2);
|
|
||||||
//지정시간대 넘어가면 중단 20~24시
|
|
||||||
if ($hr < 20) {
|
|
||||||
$dt = substr($dt, 0, 11) . "20:00:00";
|
|
||||||
$gameStor->tournament = $tnmt;
|
|
||||||
$gameStor->phase = $phase;
|
|
||||||
$gameStor->tnmt_time = $dt;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$second = $unit * $iter;
|
$second = $unit * $iter;
|
||||||
@@ -156,35 +136,9 @@ function processTournament()
|
|||||||
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTournamentTerm(): ?int
|
function getTournamentTermText(int $turnTerm)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$term = calcTournamentTerm($turnTerm);
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
|
|
||||||
$tnmt_auto = $gameStor->tnmt_auto;
|
|
||||||
if ($tnmt_auto === null) {
|
|
||||||
$tnmt_auto = $gameStor->tnmt_trig;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
0 => null,
|
|
||||||
1 => 12 * 60,
|
|
||||||
2 => 7 * 60,
|
|
||||||
3 => 3 * 60,
|
|
||||||
4 => 1 * 60,
|
|
||||||
5 => 30,
|
|
||||||
6 => 15,
|
|
||||||
7 => 5,
|
|
||||||
][$tnmt_auto] ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTournamentTermText()
|
|
||||||
{
|
|
||||||
$term = getTournamentTerm();
|
|
||||||
|
|
||||||
if ($term === null) {
|
|
||||||
return '수동';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($term % 60 === 0) {
|
if ($term % 60 === 0) {
|
||||||
$termMin = intdiv($term, 60);
|
$termMin = intdiv($term, 60);
|
||||||
@@ -320,26 +274,18 @@ function printFighting($tournament, $phase)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function startTournament($auto, $type)
|
function startTournament($type)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
eraseTnmtFightLogAll();
|
eraseTnmtFightLogAll();
|
||||||
|
|
||||||
$unit = [
|
$admin = $gameStor->getValues(['year', 'month', 'turnterm']);
|
||||||
1 => 60,
|
$turnTerm = $admin['turnterm'];
|
||||||
2 => 60,
|
$unit = calcTournamentTerm($turnTerm);
|
||||||
3 => 60,
|
|
||||||
4 => 60,
|
|
||||||
5 => 30,
|
|
||||||
6 => 15,
|
|
||||||
7 => 5,
|
|
||||||
][$auto] ?? 60;
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$gameStor->tnmt_auto = true;
|
||||||
|
|
||||||
$gameStor->tnmt_auto = $auto;
|
|
||||||
$gameStor->tnmt_time = (new \DateTimeImmutable())->add(new \DateInterval("PT{$unit}M"))->format('Y-m-d H:i:s');
|
$gameStor->tnmt_time = (new \DateTimeImmutable())->add(new \DateInterval("PT{$unit}M"))->format('Y-m-d H:i:s');
|
||||||
$gameStor->tournament = 1;
|
$gameStor->tournament = 1;
|
||||||
$gameStor->tnmt_type = $type;
|
$gameStor->tnmt_type = $type;
|
||||||
@@ -392,7 +338,7 @@ function getDummyBettingInfo(string $tnmt_type): BettingInfo
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function startBetting($type, $unit)
|
function startBetting($type)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
@@ -431,7 +377,6 @@ function startBetting($type, $unit)
|
|||||||
aux: $general
|
aux: $general
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$candidateCnt = count($candidates);
|
|
||||||
|
|
||||||
Betting::openBetting(new BettingInfo(
|
Betting::openBetting(new BettingInfo(
|
||||||
id: $bettingID,
|
id: $bettingID,
|
||||||
@@ -982,7 +927,7 @@ function setGift($tnmt_type, $tnmt, $phase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//자동진행 끝
|
//자동진행 끝
|
||||||
$gameStor->tnmt_auto = 0;
|
$gameStor->tnmt_auto = false;
|
||||||
|
|
||||||
//장수열전 기록
|
//장수열전 기록
|
||||||
/** @var ActionLogger */
|
/** @var ActionLogger */
|
||||||
@@ -1041,7 +986,7 @@ function setRefund()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//자동진행 끝
|
//자동진행 끝
|
||||||
$gameStor->tnmt_auto = 0;
|
$gameStor->tnmt_auto = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//10차이 1.1, 50 차이 1.17, 100차이 1.2
|
//10차이 1.1, 50 차이 1.17, 100차이 1.2
|
||||||
|
|||||||
+1
-1
@@ -190,7 +190,7 @@ if ($lastVoteID) {
|
|||||||
NPC선택 : <?= $npcmode ?>
|
NPC선택 : <?= $npcmode ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
||||||
토너먼트 : <?= getTournamentTermText() ?>
|
토너먼트 : <?= getTournamentTermText($gameStor->turnterm) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
<div class="s-border-t col py-2 col-4 col-md-2" style="color:<?= $color ?>;">
|
||||||
기타 설정: <?= $otherTextInfo ?>
|
기타 설정: <?= $otherTextInfo ?>
|
||||||
|
|||||||
+3
-9
@@ -194,17 +194,11 @@ if ($session->userGrade < 5 && !$allowReset) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="tournament_trig" class="col-sm-3 col-form-label"><span class="text-nowrap">토너먼트 자동 시작</span> <span class="text-nowrap">경기 단위</span></label>
|
<label for="tournament_trig" class="col-sm-3 col-form-label"><span class="text-nowrap">토너먼트 자동 시작</span></label>
|
||||||
<div class="col-sm-9" id="tournament_trig">
|
<div class="col-sm-9" id="tournament_trig">
|
||||||
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-bs-toggle="buttons">
|
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-bs-toggle="buttons">
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_0" name="tournament_trig" value="0"><label for="tournament_trig_0" class="btn btn-secondary w-25">안함</label>
|
<input type="radio" class="btn-check" id="tournament_trig_0" name="tournament_trig" value="0"><label for="tournament_trig_0" class="btn btn-secondary w-25">수동</label>
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_1" name="tournament_trig" value="1"><label for="tournament_trig_1" class="btn btn-secondary w-25">12분(총 5일)</label>
|
<input type="radio" class="btn-check" id="tournament_trig_1" name="tournament_trig" checked value="1"><label for="tournament_trig_1" class="btn btn-secondary w-25">자동</label>
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_2" name="tournament_trig" value="2"><label for="tournament_trig_2" class="btn btn-secondary w-25">7분(총 10시간)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_3" name="tournament_trig" value="3"><label for="tournament_trig_3" class="btn btn-secondary w-25">3분(총 4시간)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_4" name="tournament_trig" value="4" checked><label for="tournament_trig_4" class="btn btn-secondary w-25">1분(총 82분)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_5" name="tournament_trig" value="5"><label for="tournament_trig_5" class="btn btn-secondary w-25">30초(총 41분)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_6" name="tournament_trig" value="6"><label for="tournament_trig_6" class="btn btn-secondary w-25">15초(총 21분)</label>
|
|
||||||
<input type="radio" class="btn-check" id="tournament_trig_7" name="tournament_trig" value="7"><label for="tournament_trig_7" class="btn btn-secondary w-25">5초(총 7분)</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ $result = ResetHelper::buildScenario(
|
|||||||
$options['block_general_create'],
|
$options['block_general_create'],
|
||||||
$options['npcmode'],
|
$options['npcmode'],
|
||||||
$options['show_img_level'],
|
$options['show_img_level'],
|
||||||
$options['tournament_trig'],
|
!!$options['tournament_trig'],
|
||||||
$options['join_mode'],
|
$options['join_mode'],
|
||||||
$options['starttime'],
|
$options['starttime'],
|
||||||
$options['autorun_user']?:null
|
$options['autorun_user']?:null
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
|
|
||||||
WebUtil::requireAJAX();
|
|
||||||
|
|
||||||
$availableDieImmediately = false;
|
|
||||||
|
|
||||||
//로그인 검사
|
|
||||||
$session = Session::requireGameLogin();
|
|
||||||
$userID = Session::getUserID();
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
|
|
||||||
$general = $db->queryFirstRow('SELECT no,name,owner_name,npc,lastrefresh FROM general WHERE owner=%i AND npc = 0', $userID);
|
|
||||||
|
|
||||||
if(!$general){
|
|
||||||
Json::die([
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>'장수가 없습니다.'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
increaseRefresh("장수 삭제", 1);
|
|
||||||
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime', 'year', 'month']);
|
|
||||||
|
|
||||||
if($gameStor->turntime > $gameStor->opentime){
|
|
||||||
Json::die([
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>'이미 서버가 시작되었습니다.'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$targetTime = addTurn($general['lastrefresh'], $gameStor->turnterm, 2);
|
|
||||||
if($targetTime > TimeUtil::now()){
|
|
||||||
$targetTimeShort = substr($targetTime, 0, 19);
|
|
||||||
Json::die([
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>"아직 삭제할 수 없습니다. {$targetTimeShort} 부터 가능합니다."
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$generalObj = General::createGeneralObjFromDB($general['no']);
|
|
||||||
if($generalObj instanceof DummyGeneral){
|
|
||||||
trigger_error("올바르지 않은 삭제 프로세스 $userID", E_USER_WARNING);
|
|
||||||
}
|
|
||||||
$generalName = $generalObj->getName();
|
|
||||||
$josaYi = JosaUtil::pick($generalName, '이');
|
|
||||||
$generalObj->kill($db, true, "<Y>{$generalName}</>{$josaYi} 이 홀연히 모습을 <R>감추었습니다</>");
|
|
||||||
|
|
||||||
$session->logoutGame();
|
|
||||||
Json::die([
|
|
||||||
'result'=>true,
|
|
||||||
'reason'=>'success'
|
|
||||||
]);
|
|
||||||
+2
-2
@@ -111,7 +111,7 @@ $extend = (int)$_POST['extend'];
|
|||||||
$npcmode = (int)$_POST['npcmode'];
|
$npcmode = (int)$_POST['npcmode'];
|
||||||
$block_general_create = (bool)$_POST['block_general_create'];
|
$block_general_create = (bool)$_POST['block_general_create'];
|
||||||
$show_img_level = (int)$_POST['show_img_level'];
|
$show_img_level = (int)$_POST['show_img_level'];
|
||||||
$tournament_trig = (int)$_POST['tournament_trig'];
|
$tournament_trig = !!(int)$_POST['tournament_trig'];
|
||||||
$join_mode = $_POST['join_mode'];
|
$join_mode = $_POST['join_mode'];
|
||||||
$autorun_user_minutes = (int)$_POST['autorun_user_minutes'];
|
$autorun_user_minutes = (int)$_POST['autorun_user_minutes'];
|
||||||
$autorun_user_options = [];
|
$autorun_user_options = [];
|
||||||
@@ -208,7 +208,7 @@ Json::die(ResetHelper::buildScenario(
|
|||||||
$block_general_create,
|
$block_general_create,
|
||||||
$npcmode,
|
$npcmode,
|
||||||
$show_img_level,
|
$show_img_level,
|
||||||
$tournament_trig,
|
!!$tournament_trig,
|
||||||
$join_mode,
|
$join_mode,
|
||||||
TimeUtil::now(),
|
TimeUtil::now(),
|
||||||
$autorun_user
|
$autorun_user
|
||||||
|
|||||||
@@ -53,32 +53,6 @@ if($action == '부대창설'){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == '부대변경'){
|
|
||||||
$name = StringUtil::neutralize($name);
|
|
||||||
if(!$name){
|
|
||||||
Json::die([
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>'부대 이름이 없습니다.'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->update('troop', [
|
|
||||||
'name'=>$name
|
|
||||||
], 'troop_leader=%i',$generalID);
|
|
||||||
|
|
||||||
if($db->affectedRows() == 0){
|
|
||||||
Json::die([
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>'부대장이 아닙니다.'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
Json::die([
|
|
||||||
'result'=>true,
|
|
||||||
'reason'=>'success'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($action == '부대추방'){
|
if($action == '부대추방'){
|
||||||
if (!$gen){
|
if (!$gen){
|
||||||
Json::die([
|
Json::die([
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\General;
|
||||||
|
|
||||||
|
use sammo\Command\General\che_거병;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\JosaUtil;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\LiteHashDRBG;
|
||||||
|
use sammo\RandUtil;
|
||||||
|
use sammo\UniqueConst;
|
||||||
|
use sammo\Util;
|
||||||
|
|
||||||
|
use function sammo\increaseRefresh;
|
||||||
|
|
||||||
|
class BuildNationCandidate extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
$gameStor->cacheValues(['opentime', 'turntime']);
|
||||||
|
|
||||||
|
$general = $db->queryFirstRow('SELECT no,name,nation,owner_name,npc,lastrefresh FROM general WHERE owner=%i', $userID);
|
||||||
|
|
||||||
|
if (!$general) {
|
||||||
|
return '장수가 없습니다';
|
||||||
|
}
|
||||||
|
|
||||||
|
$generalID = $general['no'];
|
||||||
|
|
||||||
|
increaseRefresh("사전 거병", 1);
|
||||||
|
|
||||||
|
if ($gameStor->turntime > $gameStor->opentime) {
|
||||||
|
return '게임이 시작되었습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($general['nation'] != 0) {
|
||||||
|
return '이미 국가에 소속되어있습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$env = $gameStor->getAll();
|
||||||
|
|
||||||
|
$generalObj = General::createGeneralObjFromDB($general['no']);
|
||||||
|
|
||||||
|
$validCmd = false;
|
||||||
|
foreach(GameConst::$availableGeneralCommand as $cmdList){
|
||||||
|
if(in_array('che_거병', $cmdList)){
|
||||||
|
$validCmd = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$validCmd){
|
||||||
|
return '거병할 수 없는 모드입니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$cmd = new che_거병($generalObj, $env);
|
||||||
|
$failReason = $cmd->testFullConditionMet();
|
||||||
|
if ($failReason !== null) {
|
||||||
|
return $failReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rng = new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
|
||||||
|
UniqueConst::$hiddenSeed,
|
||||||
|
'BuildNationCandidate',
|
||||||
|
$generalID,
|
||||||
|
)));
|
||||||
|
$result = $cmd->run($rng);
|
||||||
|
|
||||||
|
if(!$result){
|
||||||
|
return '거병을 실패했습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\General;
|
||||||
|
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\DummyGeneral;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\JosaUtil;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
|
||||||
|
use function sammo\addTurn;
|
||||||
|
use function sammo\increaseRefresh;
|
||||||
|
|
||||||
|
class DieOnPrestart extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
//로그인 검사
|
||||||
|
$userID = $session->userID;
|
||||||
|
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime', 'year', 'month']);
|
||||||
|
|
||||||
|
$general = $db->queryFirstRow('SELECT no,name,nation,owner_name,npc,lastrefresh FROM general WHERE owner=%i AND npc = 0', $userID);
|
||||||
|
|
||||||
|
if (!$general) {
|
||||||
|
return '장수가 없습니다';
|
||||||
|
}
|
||||||
|
|
||||||
|
increaseRefresh("장수 삭제", 1);
|
||||||
|
|
||||||
|
|
||||||
|
if ($gameStor->turntime > $gameStor->opentime) {
|
||||||
|
return '게임이 시작되었습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($general['nation'] != 0){
|
||||||
|
return '이미 국가에 소속되어있습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
//서버 가오픈시 할 수 있는 행동
|
||||||
|
$targetTime = addTurn($general['lastrefresh'], $gameStor->turnterm, 2);
|
||||||
|
if ($targetTime > TimeUtil::now()) {
|
||||||
|
$targetTimeShort = substr($targetTime, 0, 19);
|
||||||
|
return "아직 삭제할 수 없습니다. {$targetTimeShort} 부터 가능합니다.";
|
||||||
|
}
|
||||||
|
|
||||||
|
$generalObj = General::createGeneralObjFromDB($general['no']);
|
||||||
|
if ($generalObj instanceof DummyGeneral) {
|
||||||
|
trigger_error("올바르지 않은 삭제 프로세스 $userID", E_USER_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
|
$generalName = $generalObj->getName();
|
||||||
|
$josaYi = JosaUtil::pick($generalName, '이');
|
||||||
|
$generalObj->kill($db, true, "<Y>{$generalName}</>{$josaYi} 이 홀연히 모습을 <R>감추었습니다</>");
|
||||||
|
|
||||||
|
$session->logoutGame();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,6 +75,7 @@ class Join extends \sammo\BaseAPI
|
|||||||
if (!$v->validate()) {
|
if (!$v->validate()) {
|
||||||
return $v->errorStr();
|
return $v->errorStr();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +105,10 @@ class Join extends \sammo\BaseAPI
|
|||||||
$inheritCity = $this->args['inheritCity'] ?? null;
|
$inheritCity = $this->args['inheritCity'] ?? null;
|
||||||
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
||||||
|
|
||||||
|
if($inheritTurntime !== null && $inheritCity !== null){
|
||||||
|
return '턴과 도시를 동시에 지정할 수 없습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
$rootDB = RootDB::db();
|
$rootDB = RootDB::db();
|
||||||
//회원 테이블에서 정보확인
|
//회원 테이블에서 정보확인
|
||||||
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
|
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\Session;
|
||||||
|
use sammo\Validator;
|
||||||
|
use sammo\Util;
|
||||||
|
|
||||||
|
class GetMoreLog extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v->rule('integer', 'lastID');
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
$this->args['lastID'] = Util::toInt($this->args['lastID']);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
|
||||||
|
}
|
||||||
|
|
||||||
|
function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$lastID = $this->args['lastID'];
|
||||||
|
$db = DB::db();
|
||||||
|
$lastInheritPointLogs = $db->query('SELECT id, server_id, year, month, date, text FROM user_record WHERE log_type = %s AND `user_id` = %i AND id < %i ORDER BY id desc LIMIT 30', "inheritPoint", $userID, $lastID);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'result'=> true,
|
||||||
|
'log' => $lastInheritPointLogs,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\Nation;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\StringUtil;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
use function sammo\checkSecretPermission;
|
||||||
|
|
||||||
|
class SetTroopName extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v->rule('required', [
|
||||||
|
'troopID',
|
||||||
|
'troopName',
|
||||||
|
])
|
||||||
|
->rule('stringWidthBetween', 'troopName', 1, 18)
|
||||||
|
->rule('integer', 'troopID');
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$db = DB::db();
|
||||||
|
$me = $db->queryFirstRow('SELECT `no`,nation,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
||||||
|
$permission = checkSecretPermission($me, false);
|
||||||
|
$troopID = $this->args['troopID'];
|
||||||
|
|
||||||
|
$generalID = $me['no'];
|
||||||
|
if($generalID != $troopID && $permission < 4){
|
||||||
|
return "권한이 부족합니다.";
|
||||||
|
}
|
||||||
|
|
||||||
|
$troopName = StringUtil::neutralize($this->args['troopName']);
|
||||||
|
if(!$troopName){
|
||||||
|
return '부대 이름이 없습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$nationID = $me['nation'];
|
||||||
|
$db->update('troop', [
|
||||||
|
'name'=>$troopName
|
||||||
|
], 'troop_leader=%i AND `nation`=%i',$troopID, $nationID);
|
||||||
|
|
||||||
|
if($db->affectedRows() == 0){
|
||||||
|
return '부대가 없습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,13 +7,13 @@ class che_간파_노군입산부 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '노군입산부';
|
protected $rawName = '노군입산부';
|
||||||
protected $name = '노군입산부(간파)';
|
protected $name = '노군입산부(간파)';
|
||||||
protected $info = '[전투] 상대 회피 확률 -30%p, 상대 필살 확률 -10%p';
|
protected $info = '[전투] 상대 회피 확률 -25%p, 상대 필살 확률 -10%p';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName === 'warAvoidRatio'){
|
if($statName === 'warAvoidRatio'){
|
||||||
return $value - 0.30;
|
return $value - 0.25;
|
||||||
}
|
}
|
||||||
if($statName === 'warCriticalRatio'){
|
if($statName === 'warCriticalRatio'){
|
||||||
return $value - 0.10;
|
return $value - 0.10;
|
||||||
|
|||||||
@@ -12,10 +12,15 @@ class che_격노_구정신단경 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '구정신단경';
|
protected $rawName = '구정신단경';
|
||||||
protected $name = '구정신단경(격노)';
|
protected $name = '구정신단경(격노)';
|
||||||
protected $info = '[전투] 상대방 필살 시 격노(필살) 발동, 회피 시도시 25% 확률로 격노 발동, 공격 시 일정 확률로 진노(1페이즈 추가)';
|
protected $info = '[전투] 상대방 필살 시 격노(필살) 발동, 회피 시도시 25% 확률로 격노 발동, 공격 시 일정 확률로 진노(1페이즈 추가), 격노마다 대미지 5% 추가 중첩';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
|
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||||
|
$activatedCnt = $unit->hasActivatedSkillOnLog('격노');
|
||||||
|
return [1 + 0.05*$activatedCnt, 1];
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_격노시도($unit, che_격노시도::TYPE_ITEM),
|
new che_격노시도($unit, che_격노시도::TYPE_ITEM),
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ class che_내정_납금박산로 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '납금박산로';
|
protected $rawName = '납금박산로';
|
||||||
protected $name = '납금박산로(내정)';
|
protected $name = '납금박산로(내정)';
|
||||||
protected $info = '[내정] 내정 성공률 +20%p';
|
protected $info = '[내정] 내정 성공률 +15%p';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
if(in_array($turnType, ['상업', '농업', '기술', '성벽', '수비', '치안', '민심', '인구'])){
|
if(in_array($turnType, ['상업', '농업', '기술', '성벽', '수비', '치안', '민심', '인구'])){
|
||||||
if($varType == 'success') return $value + 0.2;
|
if($varType == 'success') return $value + 0.15;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class che_능력치_무력_두강주 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '두강주';
|
protected $rawName = '두강주';
|
||||||
protected $name = '두강주(무력)';
|
protected $name = '두강주(무력)';
|
||||||
protected $info = '[능력치] 무력 +5 +(5년마다 +1)';
|
protected $info = '[능력치] 무력 +5 +(4년마다 +1)';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class che_능력치_무력_두강주 extends \sammo\BaseItem{
|
|||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
||||||
$relYear = $year - $startYear;
|
$relYear = $year - $startYear;
|
||||||
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
|
return $value + 5 + Util::valueFit(intdiv($relYear, 4), 0, GameConst::$maxTechLevel);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class che_능력치_지력_이강주 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '이강주';
|
protected $rawName = '이강주';
|
||||||
protected $name = '이강주(지력)';
|
protected $name = '이강주(지력)';
|
||||||
protected $info = '[능력치] 지력 +5 +(5년마다 +1)';
|
protected $info = '[능력치] 지력 +5 +(4년마다 +1)';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class che_능력치_지력_이강주 extends \sammo\BaseItem{
|
|||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
||||||
$relYear = $year - $startYear;
|
$relYear = $year - $startYear;
|
||||||
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
|
return $value + 5 + Util::valueFit(intdiv($relYear, 4), 0, GameConst::$maxTechLevel);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class che_능력치_통솔_보령압주 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '보령압주';
|
protected $rawName = '보령압주';
|
||||||
protected $name = '보령압주(통솔)';
|
protected $name = '보령압주(통솔)';
|
||||||
protected $info = '[능력치] 통솔 +5 +(5년마다 +1)';
|
protected $info = '[능력치] 통솔 +5 +(4년마다 +1)';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class che_능력치_통솔_보령압주 extends \sammo\BaseItem{
|
|||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
[$year, $startYear] = $gameStor->getValuesAsArray(['year', 'startyear']);
|
||||||
$relYear = $year - $startYear;
|
$relYear = $year - $startYear;
|
||||||
return $value + 5 + Util::valueFit(intdiv($relYear, 5), 0, GameConst::$maxTechLevel);
|
return $value + 5 + Util::valueFit(intdiv($relYear, 4), 0, GameConst::$maxTechLevel);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ class che_명성_구석 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '구석';
|
protected $rawName = '구석';
|
||||||
protected $name = '구석(명성)';
|
protected $name = '구석(명성)';
|
||||||
protected $info = '명성 +15%';
|
protected $info = '명성 +20%';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName == 'experience'){
|
if($statName == 'experience'){
|
||||||
return $value * 1.15;
|
return $value * 1.20;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class che_불굴_상편 extends \sammo\BaseItem
|
|||||||
|
|
||||||
protected $rawName = '상편';
|
protected $rawName = '상편';
|
||||||
protected $name = '상편(불굴)';
|
protected $name = '상편(불굴)';
|
||||||
protected $info = '[전투] 남은 병력이 적을수록 공격력 증가. 최대 +50%';
|
protected $info = '[전투] 남은 병력이 적을수록 공격력 증가. 최대 +60%';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ class che_불굴_상편 extends \sammo\BaseItem
|
|||||||
|
|
||||||
$crewRatio = Util::valueFit($crew / ($leadership * 100), 0, 1);
|
$crewRatio = Util::valueFit($crew / ($leadership * 100), 0, 1);
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new 전투력보정($unit, 1 + 0.5 * (1 - $crewRatio))
|
new 전투력보정($unit, 1 + 0.6 * (1 - $crewRatio))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ class che_숙련_동작 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '동작';
|
protected $rawName = '동작';
|
||||||
protected $name = '동작(숙련)';
|
protected $name = '동작(숙련)';
|
||||||
protected $info = '숙련 +15%';
|
protected $info = '숙련 +20%';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName == 'addDex'){
|
if($statName == 'addDex'){
|
||||||
return $value * 1.15;
|
return $value * 1.20;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ class che_전략_평만지장도 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '평만지장도';
|
protected $rawName = '평만지장도';
|
||||||
protected $name = '평만지장도(전략)';
|
protected $name = '평만지장도(전략)';
|
||||||
protected $info = '[전략] 국가전략 사용시 재사용 대기 기간 -15%';
|
protected $info = '[전략] 국가전략 사용시 재사용 대기 기간 -20%';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
if($varType == 'delay'){
|
if($varType == 'delay'){
|
||||||
return Util::round($value * 0.85);
|
return Util::round($value * 0.80);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,17 +7,17 @@ use sammo\WarUnitTrigger\che_저지발동;
|
|||||||
use sammo\WarUnitTrigger\WarActivateSkills;
|
use sammo\WarUnitTrigger\WarActivateSkills;
|
||||||
use sammo\WarUnitTriggerCaller;
|
use sammo\WarUnitTriggerCaller;
|
||||||
|
|
||||||
class che_반계저지_박혁론 extends \sammo\BaseItem{
|
class che_진압_박혁론 extends \sammo\BaseItem{
|
||||||
|
|
||||||
protected $rawName = '박혁론';
|
protected $rawName = '박혁론';
|
||||||
protected $name = '박혁론(반계저지)';
|
protected $name = '박혁론(진압)';
|
||||||
protected $info = '[전투] 상대의 계략 되돌림 불가';
|
protected $info = '[전투] 상대의 계략 되돌림, 격노 불가';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '반계불가'),
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '반계불가', '격노불가'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,13 +9,13 @@ class che_징병_낙주 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '낙주';
|
protected $rawName = '낙주';
|
||||||
protected $name = '낙주(징병)';
|
protected $name = '낙주(징병)';
|
||||||
protected $info = '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +15%';
|
protected $info = '[군사] 징·모병비 -30%, 통솔 순수 능력치 보정 +15%';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
if(in_array($turnType, ['징병', '모병'])){
|
if(in_array($turnType, ['징병', '모병'])){
|
||||||
if($varType == 'cost') return $value * 0.5;
|
if($varType == 'cost') return $value * 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ class che_필살_둔갑천서 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
protected $rawName = '둔갑천서';
|
protected $rawName = '둔갑천서';
|
||||||
protected $name = '둔갑천서(필살)';
|
protected $name = '둔갑천서(필살)';
|
||||||
protected $info = '[전투] 필살 확률 +25%p';
|
protected $info = '[전투] 필살 확률 +20%p';
|
||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
if($statName === 'warCriticalRatio'){
|
if($statName === 'warCriticalRatio'){
|
||||||
return $value + 0.25;
|
return $value + 0.20;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,6 +139,16 @@ class che_건국 extends Command\GeneralCommand
|
|||||||
$general = $this->generalObj;
|
$general = $this->generalObj;
|
||||||
$date = $general->getTurnTime($general::TURNTIME_HM);
|
$date = $general->getTurnTime($general::TURNTIME_HM);
|
||||||
$generalName = $general->getName();
|
$generalName = $general->getName();
|
||||||
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
|
$initYearMonth = Util::joinYearMonth($env['init_year'], $env['init_month']);
|
||||||
|
$yearMonth = Util::joinYearMonth($env['year'], $env['month']);
|
||||||
|
if($yearMonth <= $initYearMonth){
|
||||||
|
$logger->pushGeneralActionLog("다음 턴부터 건국할 수 있습니다. <1>$date</>");
|
||||||
|
$this->alternative = new che_인재탐색($general, $this->env, null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$josaYi = JosaUtil::pick($generalName, '이');
|
$josaYi = JosaUtil::pick($generalName, '이');
|
||||||
|
|
||||||
$nationName = $this->arg['nationName'];
|
$nationName = $this->arg['nationName'];
|
||||||
@@ -149,7 +159,7 @@ class che_건국 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$josaUl = JosaUtil::pick($nationName, '을');
|
$josaUl = JosaUtil::pick($nationName, '을');
|
||||||
|
|
||||||
$logger = $general->getLogger();
|
|
||||||
|
|
||||||
$nationTypeClass = buildNationTypeClass($nationType);
|
$nationTypeClass = buildNationTypeClass($nationType);
|
||||||
$nationTypeName = $nationTypeClass->getName();
|
$nationTypeName = $nationTypeClass->getName();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace sammo\Event\Action;
|
namespace sammo\Event\Action;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
use sammo\Betting;
|
use sammo\Betting;
|
||||||
use \sammo\GameConst;
|
use \sammo\GameConst;
|
||||||
use \sammo\Util;
|
use \sammo\Util;
|
||||||
@@ -10,8 +11,12 @@ use sammo\DTO\BettingInfo;
|
|||||||
use sammo\DTO\SelectItem;
|
use sammo\DTO\SelectItem;
|
||||||
use sammo\Json;
|
use sammo\Json;
|
||||||
use sammo\KVStorage;
|
use sammo\KVStorage;
|
||||||
|
use sammo\Message;
|
||||||
|
use sammo\MessageTarget;
|
||||||
|
|
||||||
use function sammo\getAllNationStaticInfo;
|
use function sammo\getAllNationStaticInfo;
|
||||||
|
use function sammo\GetImageURL;
|
||||||
|
use function sammo\getNationStaticInfo;
|
||||||
|
|
||||||
class OpenNationBetting extends \sammo\Event\Action
|
class OpenNationBetting extends \sammo\Event\Action
|
||||||
{
|
{
|
||||||
@@ -117,6 +122,32 @@ class OpenNationBetting extends \sammo\Event\Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
$logger->flush();
|
$logger->flush();
|
||||||
|
$now = new DateTime();
|
||||||
|
$text = "새로운 {$name} 내기가 열렸습니다. 천통국 베팅란을 확인해주세요.";
|
||||||
|
|
||||||
|
$src = new MessageTarget(0, '', 0, 'System', '#000000');
|
||||||
|
foreach ($db->query('SELECT `no`, `name`, `nation`, `imgsvr`, `picture` FROM `general` WHERE `npc` <= 1') as $general) {
|
||||||
|
$generalID = $general['no'];
|
||||||
|
$staticNation = getNationStaticInfo($general['nation']);
|
||||||
|
$dest = new MessageTarget(
|
||||||
|
$generalID,
|
||||||
|
$general['name'],
|
||||||
|
$general['nation'],
|
||||||
|
$staticNation['name'],
|
||||||
|
$staticNation['color'],
|
||||||
|
GetImageURL($general['imgsvr'], $general['picture'])
|
||||||
|
);
|
||||||
|
$msg = new Message(
|
||||||
|
Message::MSGTYPE_PRIVATE,
|
||||||
|
$src,
|
||||||
|
$dest,
|
||||||
|
$text,
|
||||||
|
$now,
|
||||||
|
new DateTime('9999-12-31'),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
$msg->send(true);
|
||||||
|
}
|
||||||
|
|
||||||
return [__CLASS__, true];
|
return [__CLASS__, true];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ class GameConstBase
|
|||||||
'che_저격_매화수전' => 1, 'che_저격_비도'=>1, 'che_위압_조목삭' => 1, 'che_공성_묵자' => 1,
|
'che_저격_매화수전' => 1, 'che_저격_비도'=>1, 'che_위압_조목삭' => 1, 'che_공성_묵자' => 1,
|
||||||
'che_집중_전국책' => 1, 'che_환술_논어집해' => 1,
|
'che_집중_전국책' => 1, 'che_환술_논어집해' => 1,
|
||||||
|
|
||||||
'che_반계저지_박혁론' => 1, 'che_부적_태현청생부' => 1, 'che_저지_삼황내문' => 1,
|
'che_진압_박혁론' => 1, 'che_부적_태현청생부' => 1, 'che_저지_삼황내문' => 1,
|
||||||
'che_행동_서촉지형도' => 1, 'che_간파_노군입산부' => 1, 'che_불굴_상편' => 1,
|
'che_행동_서촉지형도' => 1, 'che_간파_노군입산부' => 1, 'che_불굴_상편' => 1,
|
||||||
'che_약탈_옥벽' => 1,
|
'che_약탈_옥벽' => 1,
|
||||||
|
|
||||||
@@ -334,7 +334,6 @@ class GameConstBase
|
|||||||
'che_건국',
|
'che_건국',
|
||||||
'che_선양',
|
'che_선양',
|
||||||
'che_해산',
|
'che_해산',
|
||||||
'che_모반시도',
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,12 @@ class GeneralAI
|
|||||||
|
|
||||||
$yearMonth = Util::joinYearMonth($env['year'], $env['month']);
|
$yearMonth = Util::joinYearMonth($env['year'], $env['month']);
|
||||||
|
|
||||||
if ($yearMonth <= Util::joinYearMonth($env['startyear'] + 2, 5)) {
|
$warTarget = $db->queryAllLists(
|
||||||
|
'SELECT you, state, term FROM diplomacy WHERE me = %i AND state IN (0, 1)',
|
||||||
|
$nationID
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$warTarget && $yearMonth <= Util::joinYearMonth($env['startyear'] + 2, 5)) {
|
||||||
$this->dipState = self::d평화;
|
$this->dipState = self::d평화;
|
||||||
$this->attackable = false;
|
$this->attackable = false;
|
||||||
return;
|
return;
|
||||||
@@ -210,11 +215,6 @@ class GeneralAI
|
|||||||
// 공격가능도시 있으면
|
// 공격가능도시 있으면
|
||||||
$this->attackable = !!$frontStatus;
|
$this->attackable = !!$frontStatus;
|
||||||
|
|
||||||
$warTarget = $db->queryAllLists(
|
|
||||||
'SELECT you, state, term FROM diplomacy WHERE me = %i AND state IN (0, 1)',
|
|
||||||
$nationID
|
|
||||||
);
|
|
||||||
|
|
||||||
$onWar = 0;
|
$onWar = 0;
|
||||||
$onWarReady = 0;
|
$onWarReady = 0;
|
||||||
$onWarYet = 0;
|
$onWarYet = 0;
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class ResetHelper{
|
|||||||
bool $block_general_create,
|
bool $block_general_create,
|
||||||
int $npcmode,
|
int $npcmode,
|
||||||
int $show_img_level,
|
int $show_img_level,
|
||||||
int $tournament_trig,
|
bool $tournament_trig,
|
||||||
string $join_mode,
|
string $join_mode,
|
||||||
string $turntime,
|
string $turntime,
|
||||||
?array $autorun_user
|
?array $autorun_user
|
||||||
@@ -176,13 +176,6 @@ class ResetHelper{
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($tournament_trig < 0 || $tournament_trig > 7){
|
|
||||||
return [
|
|
||||||
'result'=>false,
|
|
||||||
'reason'=>'올바르지 않은 토너먼트 주기입니다.'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$clearResult = self::clearDB();
|
$clearResult = self::clearDB();
|
||||||
if(!$clearResult['result']){
|
if(!$clearResult['result']){
|
||||||
return $clearResult;
|
return $clearResult;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class che_회피발동 extends BaseWarUnitTrigger{
|
|||||||
$oppose->getLogger()->pushGeneralBattleDetailLog("상대가 <R>회피</>했다!</>", ActionLogger::PLAIN);
|
$oppose->getLogger()->pushGeneralBattleDetailLog("상대가 <R>회피</>했다!</>", ActionLogger::PLAIN);
|
||||||
$self->getLogger()->pushGeneralBattleDetailLog("<C>회피</>했다!</>", ActionLogger::PLAIN);
|
$self->getLogger()->pushGeneralBattleDetailLog("<C>회피</>했다!</>", ActionLogger::PLAIN);
|
||||||
|
|
||||||
$oppose->multiplyWarPowerMultiply(0.2);
|
$oppose->multiplyWarPowerMultiply(1/6);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -645,7 +645,7 @@
|
|||||||
[0, "나루토", null, 0, null, 80, 100, 6, 0, 160, 300, null, null, "나루토 사스케 싸움 레알 실화냐"],
|
[0, "나루토", null, 0, null, 80, 100, 6, 0, 160, 300, null, null, "나루토 사스케 싸움 레알 실화냐"],
|
||||||
[0, "달스케", null, 0, null, 73, 97, 43, 0, 160, 300, null, null],
|
[0, "달스케", null, 0, null, 73, 97, 43, 0, 160, 300, null, null],
|
||||||
[0, "독스케", null, 0, null, 79, 91, 46, 0, 160, 300, null, null],
|
[0, "독스케", null, 0, null, 79, 91, 46, 0, 160, 300, null, null],
|
||||||
[0, "마스케", null, 0, null, 74, 96, 45, 0, 160, 300, null, null],
|
[0, "마스케", null, 0, null, 74, 96, 45, 0, 160, 300, null, null, "픽스터 트롤링 ON"],
|
||||||
[0, "사람쥐", null, 0, null, 77, 42, 93, 0, 160, 300, null, null, "사람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
[0, "사람쥐", null, 0, null, 77, 42, 93, 0, 160, 300, null, null, "사람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
||||||
[0, "사숙개", null, 0, null, 78, 91, 44, 0, 160, 300, null, null],
|
[0, "사숙개", null, 0, null, 78, 91, 44, 0, 160, 300, null, null],
|
||||||
[0, "사스가키", null, 0, null, 71, 99, 47, 0, 160, 300, null, null, "허~접♡"],
|
[0, "사스가키", null, 0, null, 71, 99, 47, 0, 160, 300, null, null, "허~접♡"],
|
||||||
@@ -665,6 +665,7 @@
|
|||||||
[0, "삼수케", null, 0, null, 3, 33, 33, 0, 160, 300, null, null, "대학 입시를 3번 치르는 삼수케"],
|
[0, "삼수케", null, 0, null, 3, 33, 33, 0, 160, 300, null, null, "대학 입시를 3번 치르는 삼수케"],
|
||||||
[0, "사시케", null, 0, null, 44, 44, 44, 0, 160, 300, null, null],
|
[0, "사시케", null, 0, null, 44, 44, 44, 0, 160, 300, null, null],
|
||||||
[0, "사륜안", null, 0, null, 72, 49, 98, 0, 160, 300, null, null],
|
[0, "사륜안", null, 0, null, 72, 49, 98, 0, 160, 300, null, null],
|
||||||
|
[0, "사사게", null, 0, null, 76, 95, 43, 0, 160, 300, null, null],
|
||||||
[0, "네시", null, 0, "교지", 103, 119, 45, 0, 160, 300, "출세", "필살", "안 자고 싸우면 이겨요"],
|
[0, "네시", null, 0, "교지", 103, 119, 45, 0, 160, 300, "출세", "필살", "안 자고 싸우면 이겨요"],
|
||||||
[0, "영시", null, 0, null, 77, 43, 92, 0, 160, 300, null, null, "충성!"],
|
[0, "영시", null, 0, null, 77, 43, 92, 0, 160, 300, null, null, "충성!"],
|
||||||
[0, "한시", null, 0, null, 71, 47, 99, 0, 160, 300, null, null, "ㅁㄹ"],
|
[0, "한시", null, 0, null, 71, 47, 99, 0, 160, 300, null, null, "ㅁㄹ"],
|
||||||
@@ -722,7 +723,7 @@
|
|||||||
[0, "제라늄", null, 0, null, 64, 57, 83, 0, 160, 300, null, null],
|
[0, "제라늄", null, 0, null, 64, 57, 83, 0, 160, 300, null, null],
|
||||||
[0, "베고니아", null, 0, null, 37, 23, 48, 0, 160, 300, null, null],
|
[0, "베고니아", null, 0, null, 37, 23, 48, 0, 160, 300, null, null],
|
||||||
[0, "위시본", null, 0, null, 23, 54, 12, 0, 160, 300, null, null],
|
[0, "위시본", null, 0, null, 23, 54, 12, 0, 160, 300, null, null],
|
||||||
[0, "박쥐란", null, 0, null, 76, 93, 47, 0, 160, 300, null, null, "걸어키워주세요"],
|
[0, "박쥐란", null, 0, null, 76, 93, 47, 0, 160, 300, null, null],
|
||||||
[0, "골든드래곤", null, 0, null, 73, 45, 97, 0, 160, 300, null, null, "고가종 3대장 골든바리!"],
|
[0, "골든드래곤", null, 0, null, 73, 45, 97, 0, 160, 300, null, null, "고가종 3대장 골든바리!"],
|
||||||
[0, "빌리에티에", null, 0, null, 72, 44, 98, 0, 160, 300, null, null, "고가종 3대장 빌리바리!"],
|
[0, "빌리에티에", null, 0, null, 72, 44, 98, 0, 160, 300, null, null, "고가종 3대장 빌리바리!"],
|
||||||
[0, "윌리엄씨", null, 0, null, 77, 93, 46, 0, 160, 300, null, null, "고가종 3대장 윌리엄씨바리!"],
|
[0, "윌리엄씨", null, 0, null, 77, 93, 46, 0, 160, 300, null, null, "고가종 3대장 윌리엄씨바리!"],
|
||||||
@@ -755,7 +756,7 @@
|
|||||||
[0, "앤트승필맨", null, 0, null, 69, 88, 56, 0, 160, 300, null, null],
|
[0, "앤트승필맨", null, 0, null, 69, 88, 56, 0, 160, 300, null, null],
|
||||||
[0, "워승필머신", null, 0, null, 72, 98, 45, 0, 160, 300, null, null],
|
[0, "워승필머신", null, 0, null, 72, 98, 45, 0, 160, 300, null, null],
|
||||||
[0, "윈터승필솔져", null, 0, null, 77, 93, 43, 0, 160, 300, null, null],
|
[0, "윈터승필솔져", null, 0, null, 77, 93, 43, 0, 160, 300, null, null],
|
||||||
[0, "정승필실종사건", null, 0, null, 79, 45, 91, 0, 160, 300, null, null, "승필 실종됨 ㄷㄷㄷ"],
|
[0, "정승필실종사건", null, 0, null, 79, 45, 91, 0, 160, 300, null, null, "정승필 실종됨 ㄷㄷㄷㄷ"],
|
||||||
[0, "찐승필", null, 0, null, 80, 44, 90, 0, 160, 300, null, null],
|
[0, "찐승필", null, 0, null, 80, 44, 90, 0, 160, 300, null, null],
|
||||||
[0, "캡틴승필리카", null, 0, null, 80, 90, 44, 0, 160, 300, null, null],
|
[0, "캡틴승필리카", null, 0, null, 80, 90, 44, 0, 160, 300, null, null],
|
||||||
[0, "퀵승필", null, 0, null, 68, 88, 43, 0, 160, 300, null, null],
|
[0, "퀵승필", null, 0, null, 68, 88, 43, 0, 160, 300, null, null],
|
||||||
@@ -833,9 +834,9 @@
|
|||||||
[0, "마휘핑", null, 0, null, 77, 45, 93, 0, 160, 300, null, null, "총 69명의 친구들이 아이들의 돈을 쓸어담아줍니다"],
|
[0, "마휘핑", null, 0, null, 77, 45, 93, 0, 160, 300, null, null, "총 69명의 친구들이 아이들의 돈을 쓸어담아줍니다"],
|
||||||
[0, "미아핑", null, 0, null, 73, 46, 96, 0, 160, 300, null, null],
|
[0, "미아핑", null, 0, null, 73, 46, 96, 0, 160, 300, null, null],
|
||||||
[0, "앵벌스", null, 0, "진류", 108, 117, 40, 0, 160, 300, "출세", "의술", "다람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
[0, "앵벌스", null, 0, "진류", 108, 117, 40, 0, 160, 300, "출세", "의술", "다람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
||||||
[0, "앵드캡", null, 0, null, 72, 99, 47, 0, 160, 300, null, null, "내가 가는 길이 곧 재난이요"],
|
[0, "앵드캡", null, 0, null, 72, 99, 47, 0, 160, 300, null, null, "레드캡투어 풀매수"],
|
||||||
[0, "야람쥐", null, 0, null, 91, 80, 49, 0, 160, 300, null, null],
|
[0, "야람쥐", null, 0, null, 91, 80, 49, 0, 160, 300, null, null],
|
||||||
[0, "앵야호", null, 0, null, 73, 46, 97, 0, 160, 300, null, null],
|
[0, "앵야호", null, 0, null, 73, 46, 97, 0, 160, 300, null, null, "앵야~호"],
|
||||||
[0, "착한람쥐죽은람쥐", null, 0, null, 74, 96, 44, 0, 160, 300, null, null],
|
[0, "착한람쥐죽은람쥐", null, 0, null, 74, 96, 44, 0, 160, 300, null, null],
|
||||||
[0, "호람쥐", null, 0, null, 73, 49, 95, 0, 160, 300, null, null, "호우~"],
|
[0, "호람쥐", null, 0, null, 73, 49, 95, 0, 160, 300, null, null, "호우~"],
|
||||||
[0, "갤노트람쥐", null, 0, null, 79, 91, 41, 0, 160, 300, null, null, "초코송이"],
|
[0, "갤노트람쥐", null, 0, null, 79, 91, 41, 0, 160, 300, null, null, "초코송이"],
|
||||||
@@ -874,14 +875,14 @@
|
|||||||
[0, "독설가", null, 0, null, 72, 45, 98, 0, 160, 300, null, null],
|
[0, "독설가", null, 0, null, 72, 45, 98, 0, 160, 300, null, null],
|
||||||
[0, "독신", null, 0, null, 71, 47, 99, 0, 160, 300, null, null],
|
[0, "독신", null, 0, null, 71, 47, 99, 0, 160, 300, null, null],
|
||||||
[0, "독심술사", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독심술사", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
||||||
[0, "독악질", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독악질", null, 0, null, 71, 99, 46, 0, 160, 300, null, null, "시 스 시"],
|
||||||
[0, "독야청정", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
[0, "독야청정", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
||||||
[0, "독우", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
[0, "독우", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
||||||
[0, "독이 든 성배", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독이 든 성배", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
||||||
[0, "독재자", null, 0, null, 71, 46, 99, 0, 160, 300, null, null],
|
[0, "독재자", null, 0, null, 71, 46, 99, 0, 160, 300, null, null, "대 실 패"],
|
||||||
[0, "독종", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
[0, "독종", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
||||||
[0, "독지가", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독지가", null, 0, null, 71, 99, 46, 0, 160, 300, null, null, "대 성 공"],
|
||||||
[0, "독지각", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독지각", null, 0, null, 71, 99, 46, 0, 160, 300, null, null, "독 피 자"],
|
||||||
[0, "독피자", null, 0, null, 74, 48, 96, 0, 160, 300, null, null],
|
[0, "독피자", null, 0, null, 74, 48, 96, 0, 160, 300, null, null],
|
||||||
[0, "독해와 작문", null, 0, null, 73, 44, 97, 0, 160, 300, null, null],
|
[0, "독해와 작문", null, 0, null, 73, 44, 97, 0, 160, 300, null, null],
|
||||||
[0, "독식물", null, 0, null, 68, 83, 36, 0, 160, 300, null, null, "독식물키우세요"],
|
[0, "독식물", null, 0, null, 68, 83, 36, 0, 160, 300, null, null, "독식물키우세요"],
|
||||||
|
|||||||
@@ -785,7 +785,7 @@
|
|||||||
[0, "나루토", null, 0, null, 80, 100, 6, 0, 160, 300, null, null, "나루토 사스케 싸움 레알 실화냐"],
|
[0, "나루토", null, 0, null, 80, 100, 6, 0, 160, 300, null, null, "나루토 사스케 싸움 레알 실화냐"],
|
||||||
[0, "달스케", null, 0, null, 73, 97, 43, 0, 160, 300, null, null],
|
[0, "달스케", null, 0, null, 73, 97, 43, 0, 160, 300, null, null],
|
||||||
[0, "독스케", null, 0, null, 79, 91, 46, 0, 160, 300, null, null],
|
[0, "독스케", null, 0, null, 79, 91, 46, 0, 160, 300, null, null],
|
||||||
[0, "마스케", null, 0, null, 74, 96, 45, 0, 160, 300, null, null],
|
[0, "마스케", null, 0, null, 74, 96, 45, 0, 160, 300, null, null, "픽스터 트롤링 ON"],
|
||||||
[0, "사람쥐", null, 0, null, 77, 42, 93, 0, 160, 300, null, null, "사람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
[0, "사람쥐", null, 0, null, 77, 42, 93, 0, 160, 300, null, null, "사람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
||||||
[0, "사숙개", null, 0, null, 78, 91, 44, 0, 160, 300, null, null],
|
[0, "사숙개", null, 0, null, 78, 91, 44, 0, 160, 300, null, null],
|
||||||
[0, "사스가키", null, 0, null, 71, 99, 47, 0, 160, 300, null, null, "허~접♡"],
|
[0, "사스가키", null, 0, null, 71, 99, 47, 0, 160, 300, null, null, "허~접♡"],
|
||||||
@@ -805,6 +805,7 @@
|
|||||||
[0, "삼수케", null, 0, null, 3, 33, 33, 0, 160, 300, null, null, "대학 입시를 3번 치르는 삼수케"],
|
[0, "삼수케", null, 0, null, 3, 33, 33, 0, 160, 300, null, null, "대학 입시를 3번 치르는 삼수케"],
|
||||||
[0, "사시케", null, 0, null, 44, 44, 44, 0, 160, 300, null, null],
|
[0, "사시케", null, 0, null, 44, 44, 44, 0, 160, 300, null, null],
|
||||||
[0, "사륜안", null, 0, null, 72, 49, 98, 0, 160, 300, null, null],
|
[0, "사륜안", null, 0, null, 72, 49, 98, 0, 160, 300, null, null],
|
||||||
|
[0, "사사게", null, 0, null, 76, 95, 43, 0, 160, 300, null, null],
|
||||||
[0, "네시", null, 0, "교지", 103, 119, 45, 0, 160, 300, "출세", "필살", "안 자고 싸우면 이겨요"],
|
[0, "네시", null, 0, "교지", 103, 119, 45, 0, 160, 300, "출세", "필살", "안 자고 싸우면 이겨요"],
|
||||||
[0, "영시", null, 0, null, 77, 43, 92, 0, 160, 300, null, null, "충성!"],
|
[0, "영시", null, 0, null, 77, 43, 92, 0, 160, 300, null, null, "충성!"],
|
||||||
[0, "한시", null, 0, null, 71, 47, 99, 0, 160, 300, null, null, "ㅁㄹ"],
|
[0, "한시", null, 0, null, 71, 47, 99, 0, 160, 300, null, null, "ㅁㄹ"],
|
||||||
@@ -862,7 +863,7 @@
|
|||||||
[0, "제라늄", null, 0, null, 64, 57, 83, 0, 160, 300, null, null],
|
[0, "제라늄", null, 0, null, 64, 57, 83, 0, 160, 300, null, null],
|
||||||
[0, "베고니아", null, 0, null, 37, 23, 48, 0, 160, 300, null, null],
|
[0, "베고니아", null, 0, null, 37, 23, 48, 0, 160, 300, null, null],
|
||||||
[0, "위시본", null, 0, null, 23, 54, 12, 0, 160, 300, null, null],
|
[0, "위시본", null, 0, null, 23, 54, 12, 0, 160, 300, null, null],
|
||||||
[0, "박쥐란", null, 0, null, 76, 93, 47, 0, 160, 300, null, null, "걸어키워주세요"],
|
[0, "박쥐란", null, 0, null, 76, 93, 47, 0, 160, 300, null, null],
|
||||||
[0, "골든드래곤", null, 0, null, 73, 45, 97, 0, 160, 300, null, null, "고가종 3대장 골든바리!"],
|
[0, "골든드래곤", null, 0, null, 73, 45, 97, 0, 160, 300, null, null, "고가종 3대장 골든바리!"],
|
||||||
[0, "빌리에티에", null, 0, null, 72, 44, 98, 0, 160, 300, null, null, "고가종 3대장 빌리바리!"],
|
[0, "빌리에티에", null, 0, null, 72, 44, 98, 0, 160, 300, null, null, "고가종 3대장 빌리바리!"],
|
||||||
[0, "윌리엄씨", null, 0, null, 77, 93, 46, 0, 160, 300, null, null, "고가종 3대장 윌리엄씨바리!"],
|
[0, "윌리엄씨", null, 0, null, 77, 93, 46, 0, 160, 300, null, null, "고가종 3대장 윌리엄씨바리!"],
|
||||||
@@ -895,7 +896,7 @@
|
|||||||
[0, "앤트승필맨", null, 0, null, 69, 88, 56, 0, 160, 300, null, null],
|
[0, "앤트승필맨", null, 0, null, 69, 88, 56, 0, 160, 300, null, null],
|
||||||
[0, "워승필머신", null, 0, null, 72, 98, 45, 0, 160, 300, null, null],
|
[0, "워승필머신", null, 0, null, 72, 98, 45, 0, 160, 300, null, null],
|
||||||
[0, "윈터승필솔져", null, 0, null, 77, 93, 43, 0, 160, 300, null, null],
|
[0, "윈터승필솔져", null, 0, null, 77, 93, 43, 0, 160, 300, null, null],
|
||||||
[0, "정승필실종사건", null, 0, null, 79, 45, 91, 0, 160, 300, null, null, "승필 실종됨 ㄷㄷㄷ"],
|
[0, "정승필실종사건", null, 0, null, 79, 45, 91, 0, 160, 300, null, null, "정승필 실종됨 ㄷㄷㄷㄷ"],
|
||||||
[0, "찐승필", null, 0, null, 80, 44, 90, 0, 160, 300, null, null],
|
[0, "찐승필", null, 0, null, 80, 44, 90, 0, 160, 300, null, null],
|
||||||
[0, "캡틴승필리카", null, 0, null, 80, 90, 44, 0, 160, 300, null, null],
|
[0, "캡틴승필리카", null, 0, null, 80, 90, 44, 0, 160, 300, null, null],
|
||||||
[0, "퀵승필", null, 0, null, 68, 88, 43, 0, 160, 300, null, null],
|
[0, "퀵승필", null, 0, null, 68, 88, 43, 0, 160, 300, null, null],
|
||||||
@@ -973,9 +974,9 @@
|
|||||||
[0, "마휘핑", null, 0, null, 77, 45, 93, 0, 160, 300, null, null, "총 69명의 친구들이 아이들의 돈을 쓸어담아줍니다"],
|
[0, "마휘핑", null, 0, null, 77, 45, 93, 0, 160, 300, null, null, "총 69명의 친구들이 아이들의 돈을 쓸어담아줍니다"],
|
||||||
[0, "미아핑", null, 0, null, 73, 46, 96, 0, 160, 300, null, null],
|
[0, "미아핑", null, 0, null, 73, 46, 96, 0, 160, 300, null, null],
|
||||||
[0, "앵벌스", null, 0, "진류", 108, 117, 40, 0, 160, 300, "출세", "의술", "다람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
[0, "앵벌스", null, 0, "진류", 108, 117, 40, 0, 160, 300, "출세", "의술", "다람쥐는 위대하고 그 외에 다른 설치류는 없다"],
|
||||||
[0, "앵드캡", null, 0, null, 72, 99, 47, 0, 160, 300, null, null, "내가 가는 길이 곧 재난이요"],
|
[0, "앵드캡", null, 0, null, 72, 99, 47, 0, 160, 300, null, null, "레드캡투어 풀매수"],
|
||||||
[0, "야람쥐", null, 0, null, 91, 80, 49, 0, 160, 300, null, null],
|
[0, "야람쥐", null, 0, null, 91, 80, 49, 0, 160, 300, null, null],
|
||||||
[0, "앵야호", null, 0, null, 73, 46, 97, 0, 160, 300, null, null],
|
[0, "앵야호", null, 0, null, 73, 46, 97, 0, 160, 300, null, null, "앵야~호"],
|
||||||
[0, "착한람쥐죽은람쥐", null, 0, null, 74, 96, 44, 0, 160, 300, null, null],
|
[0, "착한람쥐죽은람쥐", null, 0, null, 74, 96, 44, 0, 160, 300, null, null],
|
||||||
[0, "호람쥐", null, 0, null, 73, 49, 95, 0, 160, 300, null, null, "호우~"],
|
[0, "호람쥐", null, 0, null, 73, 49, 95, 0, 160, 300, null, null, "호우~"],
|
||||||
[0, "갤노트람쥐", null, 0, null, 79, 91, 41, 0, 160, 300, null, null, "초코송이"],
|
[0, "갤노트람쥐", null, 0, null, 79, 91, 41, 0, 160, 300, null, null, "초코송이"],
|
||||||
@@ -1014,14 +1015,14 @@
|
|||||||
[0, "독설가", null, 0, null, 72, 45, 98, 0, 160, 300, null, null],
|
[0, "독설가", null, 0, null, 72, 45, 98, 0, 160, 300, null, null],
|
||||||
[0, "독신", null, 0, null, 71, 47, 99, 0, 160, 300, null, null],
|
[0, "독신", null, 0, null, 71, 47, 99, 0, 160, 300, null, null],
|
||||||
[0, "독심술사", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독심술사", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
||||||
[0, "독악질", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독악질", null, 0, null, 71, 99, 46, 0, 160, 300, null, null, "시 스 시"],
|
||||||
[0, "독야청정", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
[0, "독야청정", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
||||||
[0, "독우", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
[0, "독우", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
||||||
[0, "독이 든 성배", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독이 든 성배", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
||||||
[0, "독재자", null, 0, null, 71, 46, 99, 0, 160, 300, null, null],
|
[0, "독재자", null, 0, null, 71, 46, 99, 0, 160, 300, null, null, "대 실 패"],
|
||||||
[0, "독종", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
[0, "독종", null, 0, null, 73, 97, 44, 0, 160, 300, null, null],
|
||||||
[0, "독지가", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독지가", null, 0, null, 71, 99, 46, 0, 160, 300, null, null, "대 성 공"],
|
||||||
[0, "독지각", null, 0, null, 71, 99, 46, 0, 160, 300, null, null],
|
[0, "독지각", null, 0, null, 71, 99, 46, 0, 160, 300, null, null, "독 피 자"],
|
||||||
[0, "독피자", null, 0, null, 74, 48, 96, 0, 160, 300, null, null],
|
[0, "독피자", null, 0, null, 74, 48, 96, 0, 160, 300, null, null],
|
||||||
[0, "독해와 작문", null, 0, null, 73, 44, 97, 0, 160, 300, null, null],
|
[0, "독해와 작문", null, 0, null, 73, 44, 97, 0, 160, 300, null, null],
|
||||||
[0, "독식물", null, 0, null, 68, 83, 36, 0, 160, 300, null, null, "독식물키우세요"],
|
[0, "독식물", null, 0, null, 68, 83, 36, 0, 160, 300, null, null, "독식물키우세요"],
|
||||||
|
|||||||
+3
-1
@@ -25,7 +25,7 @@ body {
|
|||||||
#container {
|
#container {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 100px;
|
margin-bottom: 40px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='text'],
|
input[type='text'],
|
||||||
@@ -49,6 +49,8 @@ body {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
width: 125px;
|
width: 125px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
box-shadow: 0 -1px 0 $dark;
|
box-shadow: 0 -1px 0 $dark;
|
||||||
|
|||||||
+124
-114
@@ -185,10 +185,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="bg1 a-center">유산 포인트 변경 내역(최근 30건)</div>
|
<div class="bg1 a-center">유산 포인트 변경 내역</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(log, idx) in lastInheritPointLogs" :key="idx" class="row">
|
<div v-for="[idx, log] of inheritPointLogs" :key="idx" class="row">
|
||||||
<div class="col a-right" style="max-width: 20ch">
|
<div class="col a-right" style="max-width: 20ch">
|
||||||
<small class="text-muted tnum">[{{ log.date }}]</small>
|
<small class="text-muted tnum">[{{ log.date }}]</small>
|
||||||
</div>
|
</div>
|
||||||
@@ -196,21 +196,11 @@
|
|||||||
{{ log.text }}
|
{{ log.text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-grid"><BButton @click="getMoreLog()">더 가져오기</BButton></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue";
|
|
||||||
import "@scss/common/bootstrap5.scss";
|
|
||||||
import "@scss/game_bg.scss";
|
|
||||||
import TopBackBar from "@/components/TopBackBar.vue";
|
|
||||||
import _ from "lodash";
|
|
||||||
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
|
||||||
import { SammoAPI } from "./SammoAPI";
|
|
||||||
import type { inheritBuffType } from "./defs/API/InheritAction";
|
|
||||||
import * as JosaUtil from '@/util/JosaUtil';
|
|
||||||
import { BButton } from "bootstrap-vue-3";
|
|
||||||
|
|
||||||
type InheritanceType =
|
type InheritanceType =
|
||||||
| "previous"
|
| "previous"
|
||||||
| "lived_month"
|
| "lived_month"
|
||||||
@@ -227,15 +217,53 @@ type InheritanceType =
|
|||||||
|
|
||||||
type InheritanceViewType = InheritanceType | "sum" | "new";
|
type InheritanceViewType = InheritanceType | "sum" | "new";
|
||||||
|
|
||||||
declare const lastInheritPointLogs: {
|
declare const staticValues: {
|
||||||
server_id: string;
|
lastInheritPointLogs: InheritPointLogItem[];
|
||||||
year: number;
|
items: Record<InheritanceType, number>;
|
||||||
month: number;
|
currentInheritBuff: {
|
||||||
date: string;
|
[v in inheritBuffType]: number | undefined;
|
||||||
text: string;
|
};
|
||||||
}[];
|
maxInheritBuff: number;
|
||||||
|
inheritActionCost: {
|
||||||
|
buff: number[];
|
||||||
|
resetTurnTime: number;
|
||||||
|
resetSpecialWar: number;
|
||||||
|
randomUnique: number;
|
||||||
|
nextSpecial: number;
|
||||||
|
minSpecificUnique: number;
|
||||||
|
};
|
||||||
|
resetTurnTimeLevel: number;
|
||||||
|
resetSpecialWarLevel: number;
|
||||||
|
|
||||||
declare const items: Record<InheritanceType, number>;
|
availableSpecialWar: Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
|
title: string;
|
||||||
|
info: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
availableUnique: Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
|
title: string;
|
||||||
|
rawName: string;
|
||||||
|
info: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import "@scss/common/bootstrap5.scss";
|
||||||
|
import "@scss/game_bg.scss";
|
||||||
|
import TopBackBar from "@/components/TopBackBar.vue";
|
||||||
|
import _ from "lodash";
|
||||||
|
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
||||||
|
import { SammoAPI } from "./SammoAPI";
|
||||||
|
import type { inheritBuffType, InheritPointLogItem } from "./defs/API/InheritAction";
|
||||||
|
import * as JosaUtil from "@/util/JosaUtil";
|
||||||
|
import { BButton } from "bootstrap-vue-3";
|
||||||
|
import { unwrap } from "./util/unwrap";
|
||||||
|
|
||||||
const inheritanceViewText: Record<InheritanceViewType, { title: string; info: string }> = {
|
const inheritanceViewText: Record<InheritanceViewType, { title: string; info: string }> = {
|
||||||
sum: {
|
sum: {
|
||||||
@@ -296,11 +324,6 @@ const inheritanceViewText: Record<InheritanceViewType, { title: string; info: st
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
declare const currentInheritBuff: {
|
|
||||||
[v in inheritBuffType]: number | undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
const inheritBuffHelpText: Record<
|
const inheritBuffHelpText: Record<
|
||||||
inheritBuffType,
|
inheritBuffType,
|
||||||
{
|
{
|
||||||
@@ -342,81 +365,54 @@ const inheritBuffHelpText: Record<
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
declare const maxInheritBuff: number;
|
const inheritBuff = reactive({} as Record<inheritBuffType, number>);
|
||||||
declare const inheritActionCost: {
|
|
||||||
buff: number[];
|
|
||||||
resetTurnTime: number;
|
|
||||||
resetSpecialWar: number;
|
|
||||||
randomUnique: number;
|
|
||||||
nextSpecial: number;
|
|
||||||
minSpecificUnique: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const resetTurnTimeLevel: number;
|
|
||||||
declare const resetSpecialWarLevel: number;
|
|
||||||
|
|
||||||
declare const availableSpecialWar: Record<
|
|
||||||
string,
|
|
||||||
{
|
|
||||||
title: string;
|
|
||||||
info: string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
declare const availableUnique: Record<
|
|
||||||
string,
|
|
||||||
{
|
|
||||||
title: string;
|
|
||||||
rawName: string;
|
|
||||||
info: string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "PageInheritPoint",
|
|
||||||
components: {
|
|
||||||
TopBackBar,
|
|
||||||
NumberInputWithInfo,
|
|
||||||
BButton,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
const inheritBuff = {} as Record<inheritBuffType, number>;
|
|
||||||
for (const buffKey of Object.keys(inheritBuffHelpText) as inheritBuffType[]) {
|
for (const buffKey of Object.keys(inheritBuffHelpText) as inheritBuffType[]) {
|
||||||
inheritBuff[buffKey] = currentInheritBuff[buffKey] ?? 0;
|
inheritBuff[buffKey] = staticValues.currentInheritBuff[buffKey] ?? 0;
|
||||||
}
|
}
|
||||||
return {
|
|
||||||
title: "유산 관리",
|
const title = "유산 관리";
|
||||||
inheritanceViewText,
|
|
||||||
items: (() => {
|
const items = ref(
|
||||||
const totalPoint = Math.floor(_.sum(Object.values(items)));
|
(() => {
|
||||||
const previousPoint = Math.floor(items["previous"]);
|
const totalPoint = Math.floor(_.sum(Object.values(staticValues.items)));
|
||||||
|
const previousPoint = Math.floor(staticValues.items["previous"]);
|
||||||
const newPoint = Math.floor(totalPoint - previousPoint);
|
const newPoint = Math.floor(totalPoint - previousPoint);
|
||||||
const result: Record<InheritanceViewType, number> = {
|
const result: Record<InheritanceViewType, number> = {
|
||||||
...items,
|
...staticValues.items,
|
||||||
sum: totalPoint,
|
sum: totalPoint,
|
||||||
new: newPoint,
|
new: newPoint,
|
||||||
};
|
};
|
||||||
return result;
|
return result;
|
||||||
})(),
|
})()
|
||||||
inheritBuffHelpText,
|
);
|
||||||
inheritBuff,
|
|
||||||
prevInheritBuff: currentInheritBuff,
|
const {
|
||||||
maxInheritBuff,
|
maxInheritBuff,
|
||||||
inheritActionCost,
|
inheritActionCost,
|
||||||
resetTurnTimeLevel,
|
currentInheritBuff: prevInheritBuff,
|
||||||
resetSpecialWarLevel,
|
|
||||||
nextSpecialWar: Object.keys(availableSpecialWar)[0],
|
|
||||||
specificUnique: null,
|
|
||||||
availableSpecialWar,
|
availableSpecialWar,
|
||||||
availableUnique,
|
availableUnique,
|
||||||
specificUniqueAmount: inheritActionCost.minSpecificUnique,
|
} = staticValues;
|
||||||
lastInheritPointLogs,
|
|
||||||
};
|
const nextSpecialWar = ref(Object.keys(availableSpecialWar)[0]);
|
||||||
},
|
const specificUnique = ref<string | null>(null);
|
||||||
methods: {
|
const specificUniqueAmount = ref(inheritActionCost.minSpecificUnique);
|
||||||
async buyInheritBuff(buffKey: inheritBuffType) {
|
|
||||||
const level = Math.floor(this.inheritBuff[buffKey]);
|
const lastLogID = ref(Math.min(...staticValues.lastInheritPointLogs.map((v) => v.id)));
|
||||||
const prevLevel = this.prevInheritBuff[buffKey] ?? 0;
|
const inheritPointLogs = ref(
|
||||||
|
(() => {
|
||||||
|
const logs = new Map<number, InheritPointLogItem>();
|
||||||
|
for (const log of staticValues.lastInheritPointLogs) {
|
||||||
|
logs.set(log.id, log);
|
||||||
|
}
|
||||||
|
return logs;
|
||||||
|
})()
|
||||||
|
);
|
||||||
|
|
||||||
|
staticValues.lastInheritPointLogs;
|
||||||
|
async function buyInheritBuff(buffKey: inheritBuffType) {
|
||||||
|
const level = Math.floor(unwrap(inheritBuff[buffKey]));
|
||||||
|
const prevLevel = prevInheritBuff[buffKey] ?? 0;
|
||||||
if (level == prevLevel) {
|
if (level == prevLevel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -424,14 +420,14 @@ export default defineComponent({
|
|||||||
alert("낮출 수 없습니다.");
|
alert("낮출 수 없습니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cost = this.inheritActionCost.buff[level] - this.inheritActionCost.buff[prevLevel];
|
const cost = inheritActionCost.buff[level] - inheritActionCost.buff[prevLevel];
|
||||||
if (this.items.previous < cost) {
|
if (items.value.previous < cost) {
|
||||||
alert("유산 포인트가 부족합니다.");
|
alert("유산 포인트가 부족합니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = inheritBuffHelpText[buffKey].title;
|
const name = inheritBuffHelpText[buffKey].title;
|
||||||
const josaUl = JosaUtil.pick(name, '을');
|
const josaUl = JosaUtil.pick(name, "을");
|
||||||
if (!confirm(`${name}${josaUl} ${level}등급으로 올릴까요? ${cost} 포인트가 소모됩니다.`)) {
|
if (!confirm(`${name}${josaUl} ${level}등급으로 올릴까요? ${cost} 포인트가 소모됩니다.`)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -450,8 +446,8 @@ export default defineComponent({
|
|||||||
alert("성공했습니다.");
|
alert("성공했습니다.");
|
||||||
//TODO: 페이지 새로고침 필요없이 하도록
|
//TODO: 페이지 새로고침 필요없이 하도록
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
}
|
||||||
async buySimple(type: "ResetTurnTime" | "BuyRandomUnique" | "ResetSpecialWar") {
|
async function buySimple(type: "ResetTurnTime" | "BuyRandomUnique" | "ResetSpecialWar") {
|
||||||
const costMap: Record<typeof type, number> = {
|
const costMap: Record<typeof type, number> = {
|
||||||
ResetTurnTime: inheritActionCost.resetTurnTime,
|
ResetTurnTime: inheritActionCost.resetTurnTime,
|
||||||
ResetSpecialWar: inheritActionCost.resetSpecialWar,
|
ResetSpecialWar: inheritActionCost.resetSpecialWar,
|
||||||
@@ -469,7 +465,7 @@ export default defineComponent({
|
|||||||
ResetSpecialWar: `${cost} 포인트로 전투 특기를 초기화 하시겠습니까?`,
|
ResetSpecialWar: `${cost} 포인트로 전투 특기를 초기화 하시겠습니까?`,
|
||||||
BuyRandomUnique: `${cost} 포인트로 랜덤 유니크를 구입하시겠습니까?`,
|
BuyRandomUnique: `${cost} 포인트로 랜덤 유니크를 구입하시겠습니까?`,
|
||||||
};
|
};
|
||||||
if (this.items.previous < cost) {
|
if (items.value.previous < cost) {
|
||||||
alert("유산 포인트가 부족합니다.");
|
alert("유산 포인트가 부족합니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -488,28 +484,28 @@ export default defineComponent({
|
|||||||
alert("성공했습니다.");
|
alert("성공했습니다.");
|
||||||
//TODO: 페이지 새로고침 필요없이 하도록
|
//TODO: 페이지 새로고침 필요없이 하도록
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
}
|
||||||
async setNextSpecialWar() {
|
async function setNextSpecialWar() {
|
||||||
const specialWarName = this.availableSpecialWar[this.nextSpecialWar].title ?? undefined;
|
const specialWarName = availableSpecialWar[nextSpecialWar.value].title ?? undefined;
|
||||||
if (specialWarName === undefined) {
|
if (specialWarName === undefined) {
|
||||||
alert(`잘못된 타입: ${this.nextSpecialWar}`);
|
alert(`잘못된 타입: ${nextSpecialWar.value}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cost = inheritActionCost.nextSpecial;
|
const cost = inheritActionCost.nextSpecial;
|
||||||
if (this.items.previous < cost) {
|
if (items.value.previous < cost) {
|
||||||
alert("유산 포인트가 부족합니다.");
|
alert("유산 포인트가 부족합니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const josaRo = JosaUtil.pick(specialWarName, '로');
|
const josaRo = JosaUtil.pick(specialWarName, "로");
|
||||||
if (!confirm(`${cost} 포인트로 다음 전특을 ${specialWarName}${josaRo} 고정하겠습니까?`)) {
|
if (!confirm(`${cost} 포인트로 다음 전특을 ${specialWarName}${josaRo} 고정하겠습니까?`)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await SammoAPI.InheritAction.SetNextSpecialWar({
|
await SammoAPI.InheritAction.SetNextSpecialWar({
|
||||||
type: this.nextSpecialWar,
|
type: nextSpecialWar.value,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@@ -520,34 +516,34 @@ export default defineComponent({
|
|||||||
alert("성공했습니다.");
|
alert("성공했습니다.");
|
||||||
//TODO: 페이지 새로고침 필요없이 하도록
|
//TODO: 페이지 새로고침 필요없이 하도록
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
}
|
||||||
async openUniqueItemAuction() {
|
async function openUniqueItemAuction() {
|
||||||
if(this.specificUnique === null){
|
if (specificUnique.value === null) {
|
||||||
alert("유니크를 선택해주세요.");
|
alert("유니크를 선택해주세요.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uniqueName = this.availableUnique[this.specificUnique].title ?? undefined;
|
const uniqueName = availableUnique[specificUnique.value].title ?? undefined;
|
||||||
if (uniqueName === undefined) {
|
if (uniqueName === undefined) {
|
||||||
alert(`잘못된 타입: ${this.specificUnique}`);
|
alert(`잘못된 타입: ${specificUnique.value}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const uniqueRawName = this.availableUnique[this.specificUnique].rawName ?? undefined;
|
const uniqueRawName = availableUnique[specificUnique.value].rawName ?? undefined;
|
||||||
|
|
||||||
const amount = this.specificUniqueAmount;
|
const amount = specificUniqueAmount.value;
|
||||||
if (this.items.previous < amount) {
|
if (items.value.previous < amount) {
|
||||||
alert("유산 포인트가 부족합니다.");
|
alert("유산 포인트가 부족합니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const josaUl = JosaUtil.pick(uniqueRawName, '을');
|
const josaUl = JosaUtil.pick(uniqueRawName, "을");
|
||||||
if (!confirm(`${amount} 포인트로 ${uniqueName}${josaUl} 입찰하겠습니까?`)) {
|
if (!confirm(`${amount} 포인트로 ${uniqueName}${josaUl} 입찰하겠습니까?`)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await SammoAPI.Auction.OpenUniqueAuction({
|
await SammoAPI.Auction.OpenUniqueAuction({
|
||||||
itemID: this.specificUnique,
|
itemID: specificUnique.value,
|
||||||
amount,
|
amount,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -559,9 +555,23 @@ export default defineComponent({
|
|||||||
alert("성공했습니다. 경매장을 확인해주세요.");
|
alert("성공했습니다. 경매장을 확인해주세요.");
|
||||||
//TODO: 페이지 새로고침 필요없이 하도록
|
//TODO: 페이지 새로고침 필요없이 하도록
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
}
|
||||||
},
|
|
||||||
|
async function getMoreLog(): Promise<void>{
|
||||||
|
try{
|
||||||
|
const result = await SammoAPI.InheritAction.GetMoreLog({
|
||||||
|
lastID: lastLogID.value
|
||||||
});
|
});
|
||||||
|
for(const log of result.log){
|
||||||
|
inheritPointLogs.value.set(log.id, log);
|
||||||
|
lastLogID.value = Math.min(lastLogID.value, log.id);
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
console.error(e);
|
||||||
|
alert(`실패했습니다: ${e}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
+46
-7
@@ -174,7 +174,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-6 a-right align-self-center">도시</div>
|
<div class="col col-6 a-right align-self-center">도시</div>
|
||||||
<div class="col col-6 align-self-center">
|
<div class="col col-6 align-self-center">
|
||||||
<select v-model.number="args.inheritCity" class="form-select form-inline" style="max-width: 20ch">
|
<select v-model.number="inheritCity" class="form-select form-inline" style="max-width: 20ch">
|
||||||
<option :value="undefined">사용안함</option>
|
<option :value="undefined">사용안함</option>
|
||||||
<option v-for="city in availableInheritCity" :key="city.id" :value="city.id">
|
<option v-for="city in availableInheritCity" :key="city.id" :value="city.id">
|
||||||
{{ `[${city.region}] ${city.name}` }}
|
{{ `[${city.region}] ${city.name}` }}
|
||||||
@@ -216,13 +216,25 @@
|
|||||||
<div class="a-center">추가 능력치 고정</div>
|
<div class="a-center">추가 능력치 고정</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo v-model="(args.inheritBonusStat ?? [0, 0, 0])[0]" :max="stats.bonusMax" title="통솔" />
|
<NumberInputWithInfo
|
||||||
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[0]"
|
||||||
|
:max="stats.bonusMax"
|
||||||
|
title="통솔"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo v-model="(args.inheritBonusStat ?? [0, 0, 0])[1]" :max="stats.bonusMax" title="무력" />
|
<NumberInputWithInfo
|
||||||
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[1]"
|
||||||
|
:max="stats.bonusMax"
|
||||||
|
title="무력"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<NumberInputWithInfo v-model="(args.inheritBonusStat ?? [0, 0, 0])[2]" :max="stats.bonusMax" title="지력" />
|
<NumberInputWithInfo
|
||||||
|
v-model="(args.inheritBonusStat ?? [0, 0, 0])[2]"
|
||||||
|
:max="stats.bonusMax"
|
||||||
|
title="지력"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -346,7 +358,7 @@ watch(gameConstStore, (gameConst) => {
|
|||||||
total: gameConst.gameConst.defaultStatTotal,
|
total: gameConst.gameConst.defaultStatTotal,
|
||||||
bonusMin: gameConst.gameConst.defaultStatMin,
|
bonusMin: gameConst.gameConst.defaultStatMin,
|
||||||
bonusMax: gameConst.gameConst.defaultStatMax,
|
bonusMax: gameConst.gameConst.defaultStatMax,
|
||||||
}
|
};
|
||||||
|
|
||||||
args.value = {
|
args.value = {
|
||||||
name: member.name,
|
name: member.name,
|
||||||
@@ -361,8 +373,6 @@ watch(gameConstStore, (gameConst) => {
|
|||||||
inheritSpecial: undefined,
|
inheritSpecial: undefined,
|
||||||
inheritTurntime: undefined,
|
inheritTurntime: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -466,6 +476,17 @@ watch(displayInherit, (newValue: boolean) => {
|
|||||||
localStorage.setItem(`conf.${serverID}.join.displayInherit`, JSON.stringify(newValue));
|
localStorage.setItem(`conf.${serverID}.join.displayInherit`, JSON.stringify(newValue));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const inheritCity = ref<number>();
|
||||||
|
watch(inheritCity, (newValue: undefined | number) => {
|
||||||
|
if (!args.value) throw "nyc";
|
||||||
|
|
||||||
|
if (!newValue) {
|
||||||
|
args.value.inheritCity = undefined;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
args.value.inheritCity = inheritCity.value;
|
||||||
|
});
|
||||||
|
|
||||||
const inheritTurnTimeSet = ref(false);
|
const inheritTurnTimeSet = ref(false);
|
||||||
watch(inheritTurnTimeSet, (newValue: boolean) => {
|
watch(inheritTurnTimeSet, (newValue: boolean) => {
|
||||||
if (!args.value) throw "nyc";
|
if (!args.value) throw "nyc";
|
||||||
@@ -477,6 +498,24 @@ watch(inheritTurnTimeSet, (newValue: boolean) => {
|
|||||||
args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + inheritTurnTimeSecond.value;
|
args.value.inheritTurntime = inheritTurnTimeMinute.value * 60 + inheritTurnTimeSecond.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
[inheritCity, inheritTurnTimeSet],
|
||||||
|
([newInheritCity, newInheritTurnTimeSet], [oldInheritCity, oldInheritTurnTimeSet]) => {
|
||||||
|
if (newInheritCity === undefined || newInheritTurnTimeSet === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alert("도시와 턴 시간을 동시에 설정할 수 없습니다.");
|
||||||
|
|
||||||
|
if (newInheritCity !== oldInheritCity) {
|
||||||
|
inheritCity.value = undefined;
|
||||||
|
}
|
||||||
|
if (newInheritTurnTimeSet !== oldInheritTurnTimeSet) {
|
||||||
|
inheritTurnTimeSet.value = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
const inheritTurnTimeMinute = ref(0);
|
const inheritTurnTimeMinute = ref(0);
|
||||||
watch(inheritTurnTimeMinute, (newValue: number) => {
|
watch(inheritTurnTimeMinute, (newValue: number) => {
|
||||||
if (!args.value) throw "nyc";
|
if (!args.value) throw "nyc";
|
||||||
|
|||||||
+10
-1
@@ -17,7 +17,7 @@ import { APIPathGen, NumVar, StrVar } from "./util/APIPathGen.js";
|
|||||||
import type { BettingDetailResponse, BettingListResponse } from "./defs/API/Betting";
|
import type { BettingDetailResponse, BettingListResponse } from "./defs/API/Betting";
|
||||||
import type { ReserveBulkCommandResponse, ReserveCommandResponse, ReservedCommandResponse } from "./defs/API/Command";
|
import type { ReserveBulkCommandResponse, ReserveCommandResponse, ReservedCommandResponse } from "./defs/API/Command";
|
||||||
import type { ChiefResponse } from "./defs/API/NationCommand";
|
import type { ChiefResponse } from "./defs/API/NationCommand";
|
||||||
import type { inheritBuffType } from "./defs/API/InheritAction";
|
import type { inheritBuffType, InheritLogResponse } from "./defs/API/InheritAction";
|
||||||
import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListResponse } from "./defs/API/Nation";
|
import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListResponse } from "./defs/API/Nation";
|
||||||
import type { UploadImageResponse } from "./defs/API/Misc";
|
import type { UploadImageResponse } from "./defs/API/Misc";
|
||||||
import type { GeneralLogType, GetGeneralLogResponse, JoinArgs } from "./defs/API/General";
|
import type { GeneralLogType, GetGeneralLogResponse, JoinArgs } from "./defs/API/General";
|
||||||
@@ -125,6 +125,8 @@ const apiRealPath = {
|
|||||||
DropItem: PUT as APICallT<{
|
DropItem: PUT as APICallT<{
|
||||||
itemType: ItemTypeKey;
|
itemType: ItemTypeKey;
|
||||||
}>,
|
}>,
|
||||||
|
DieOnPrestart: POST as APICallT<undefined>,
|
||||||
|
BuildNationCandidate: POST as APICallT<undefined>,
|
||||||
},
|
},
|
||||||
Global: {
|
Global: {
|
||||||
GeneralList: GET as APICallT<undefined, GeneralListResponse>,
|
GeneralList: GET as APICallT<undefined, GeneralListResponse>,
|
||||||
@@ -154,6 +156,9 @@ const apiRealPath = {
|
|||||||
SetNextSpecialWar: PUT as APICallT<{
|
SetNextSpecialWar: PUT as APICallT<{
|
||||||
type: string;
|
type: string;
|
||||||
}>,
|
}>,
|
||||||
|
GetMoreLog: GET as APICallT<{
|
||||||
|
lastID: number
|
||||||
|
}, InheritLogResponse>
|
||||||
},
|
},
|
||||||
Misc: {
|
Misc: {
|
||||||
UploadImage: POST as APICallT<
|
UploadImage: POST as APICallT<
|
||||||
@@ -222,6 +227,10 @@ const apiRealPath = {
|
|||||||
},
|
},
|
||||||
GetGeneralLogResponse
|
GetGeneralLogResponse
|
||||||
>,
|
>,
|
||||||
|
SetTroopName: PATCH as APICallT<{
|
||||||
|
troopID: number;
|
||||||
|
troopName: string;
|
||||||
|
}>,
|
||||||
},
|
},
|
||||||
Vote: {
|
Vote: {
|
||||||
AddComment: POST as APICallT<{
|
AddComment: POST as APICallT<{
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import type { ValidResponse } from "@/util/callSammoAPI";
|
||||||
|
|
||||||
export type inheritBuffType =
|
export type inheritBuffType =
|
||||||
| "warAvoidRatio"
|
| "warAvoidRatio"
|
||||||
| "warCriticalRatio"
|
| "warCriticalRatio"
|
||||||
@@ -7,3 +9,16 @@ export type inheritBuffType =
|
|||||||
| "warAvoidRatioOppose"
|
| "warAvoidRatioOppose"
|
||||||
| "warCriticalRatioOppose"
|
| "warCriticalRatioOppose"
|
||||||
| "warMagicTrialProbOppose";
|
| "warMagicTrialProbOppose";
|
||||||
|
|
||||||
|
export type InheritPointLogItem = {
|
||||||
|
id: number;
|
||||||
|
server_id: string;
|
||||||
|
year: number;
|
||||||
|
month: number;
|
||||||
|
date: string;
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type InheritLogResponse = ValidResponse & {
|
||||||
|
log: InheritPointLogItem[];
|
||||||
|
};
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ const serverCreateTemplate = "\
|
|||||||
</div></td>";
|
</div></td>";
|
||||||
|
|
||||||
const serverLoginTemplate = "\
|
const serverLoginTemplate = "\
|
||||||
<td style='background:url(\"<%picture%>\");background-size: 64px 64px;'></td>\
|
<td style='background:url(\"<%picture%>\");background-size: 64px 64px;background-repeat: no-repeat;background-position: center center;'></td>\
|
||||||
<td><%name%></td>\
|
<td><%name%></td>\
|
||||||
<td class='ignore_border'>\
|
<td class='ignore_border'>\
|
||||||
<div class='d-grid'>\
|
<div class='d-grid'>\
|
||||||
|
|||||||
+19
-12
@@ -130,22 +130,15 @@ $(function ($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#die_immediately').on('click', async function (e) {
|
$('#dieOnPrestart').on('click', async function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!confirm('정말로 삭제하시겠습니까?')) {
|
if (!confirm('정말로 삭제하시겠습니까?')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let result: InvalidResponse;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios({
|
await SammoAPI.General.DieOnPrestart();
|
||||||
url: 'j_die_immediately.php',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'json',
|
|
||||||
});
|
|
||||||
result = response.data;
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@@ -154,13 +147,27 @@ $(function ($) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.result) {
|
location.replace('..');
|
||||||
alert(`실패했습니다: ${result.reason}`);
|
});
|
||||||
|
|
||||||
|
$('#buildNationCandidate').on('click', async function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
if(!confirm('거병 이후 장수를 삭제할 수 없게됩니다. 거병하시겠습니까?')){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await SammoAPI.General.BuildNationCandidate();
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
alert(`실패했습니다: ${e}`);
|
||||||
location.reload();
|
location.reload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
location.replace('..');
|
location.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#vacation').on('click', async function (e) {
|
$('#vacation').on('click', async function (e) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<b-button v-if="maxAmount > 2000" class="btn-sm" @click="amount = Math.min(amount + 1000, maxAmount)">
|
<b-button v-if="maxAmount > 2000" class="btn-sm" @click="amount = Math.min(amount + 1000, maxAmount)">
|
||||||
+천
|
+천
|
||||||
</b-button>
|
</b-button>
|
||||||
<b-button v-if="maxAmount > 20000" class="btn-sm" @click="amount = Math.min(amount + 10000, maxAmount)">
|
<b-button v-if="maxAmount >= 10000" class="btn-sm" @click="amount = Math.min(amount + 10000, maxAmount)">
|
||||||
+만
|
+만
|
||||||
</b-button>
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+18
-16
@@ -3,6 +3,8 @@ import "@scss/troop.scss";
|
|||||||
import { errUnknown } from "@/common_legacy";
|
import { errUnknown } from "@/common_legacy";
|
||||||
import { launchTroopPlugin } from "@/extPluginTroop";
|
import { launchTroopPlugin } from "@/extPluginTroop";
|
||||||
import jQuery from "jquery";
|
import jQuery from "jquery";
|
||||||
|
import { SammoAPI } from "./SammoAPI";
|
||||||
|
import { isString } from "lodash";
|
||||||
|
|
||||||
jQuery(function($){
|
jQuery(function($){
|
||||||
//btnJoinTroop, btnLeaveTroop, btnKickTroop, btnCreateTroop, btnChangeTroopName
|
//btnJoinTroop, btnLeaveTroop, btnKickTroop, btnCreateTroop, btnChangeTroopName
|
||||||
@@ -35,7 +37,7 @@ jQuery(function($){
|
|||||||
dataType:'json',
|
dataType:'json',
|
||||||
data:{
|
data:{
|
||||||
action:'부대창설',
|
action:'부대창설',
|
||||||
name:$('#nameplate').val()
|
name:$('#newTroopName').val()
|
||||||
}
|
}
|
||||||
}).then(function(data){
|
}).then(function(data){
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -50,24 +52,24 @@ jQuery(function($){
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btnChangeTroopName').click(function(){
|
$('#btnChangeTroopName').on('click', async ()=>{
|
||||||
$.post({
|
try{
|
||||||
url:'j_troop.php',
|
await SammoAPI.Nation.SetTroopName({
|
||||||
dataType:'json',
|
troopID: parseInt($('#changeNameTroopID').val() as string),
|
||||||
data:{
|
troopName: $('#changeTroopName').val() as string,
|
||||||
action:'부대변경',
|
});
|
||||||
name:$('#nameplate').val()
|
|
||||||
}
|
|
||||||
}).then(function(data){
|
|
||||||
console.log(data);
|
|
||||||
if(!data.result){
|
|
||||||
alert(data.reason);
|
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
catch(e){
|
||||||
|
console.error(e);
|
||||||
|
if(isString(e)){
|
||||||
|
alert(e);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
errUnknown();
|
||||||
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
|
}
|
||||||
}, errUnknown);
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ foreach (InheritanceKey::cases() as $key) {
|
|||||||
$resetTurnTimeLevel = ($me->getAuxVar('inheritResetTurnTime') ?? -1) + 1;
|
$resetTurnTimeLevel = ($me->getAuxVar('inheritResetTurnTime') ?? -1) + 1;
|
||||||
$resetSpecialWarLevel = ($me->getAuxVar('inheritResetSpecialWar') ?? -1) + 1;
|
$resetSpecialWarLevel = ($me->getAuxVar('inheritResetSpecialWar') ?? -1) + 1;
|
||||||
|
|
||||||
$lastInheritPointLogs = $db->query('SELECT server_id, year, month, date, text FROM user_record WHERE log_type = %s AND user_id = %i ORDER BY id desc LIMIT 30', "inheritPoint", $userID);
|
$lastInheritPointLogs = $db->query('SELECT id, server_id, year, month, date, text FROM user_record WHERE log_type = %s AND user_id = %i ORDER BY id desc LIMIT 30', "inheritPoint", $userID);
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -81,6 +81,7 @@ $lastInheritPointLogs = $db->query('SELECT server_id, year, month, date, text FR
|
|||||||
<?= WebUtil::printJS('../d_shared/common_path.js', true) ?>
|
<?= WebUtil::printJS('../d_shared/common_path.js', true) ?>
|
||||||
<?= WebUtil::printDist('vue', 'v_inheritPoint', true) ?>
|
<?= WebUtil::printDist('vue', 'v_inheritPoint', true) ?>
|
||||||
<?= WebUtil::printStaticValues([
|
<?= WebUtil::printStaticValues([
|
||||||
|
'staticValues' => [
|
||||||
'items' => $items,
|
'items' => $items,
|
||||||
'currentInheritBuff' => $currentInheritBuff,
|
'currentInheritBuff' => $currentInheritBuff,
|
||||||
'maxInheritBuff' => TriggerInheritBuff::MAX_STEP,
|
'maxInheritBuff' => TriggerInheritBuff::MAX_STEP,
|
||||||
@@ -97,6 +98,7 @@ $lastInheritPointLogs = $db->query('SELECT server_id, year, month, date, text FR
|
|||||||
'availableSpecialWar' => $avilableSpecialWar,
|
'availableSpecialWar' => $avilableSpecialWar,
|
||||||
'availableUnique' => $availableUnique,
|
'availableUnique' => $availableUnique,
|
||||||
'lastInheritPointLogs' => $lastInheritPointLogs,
|
'lastInheritPointLogs' => $lastInheritPointLogs,
|
||||||
|
]
|
||||||
]) ?>
|
]) ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -486,6 +486,14 @@ class Util extends \utilphp\util
|
|||||||
* $min과 $max 사이의 값으로 교정
|
* $min과 $max 사이의 값으로 교정
|
||||||
*/
|
*/
|
||||||
public static function valueFit($value, $min = null, $max = null)
|
public static function valueFit($value, $min = null, $max = null)
|
||||||
|
{
|
||||||
|
return static::clamp($value, $min, $max);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $min과 $max 사이의 값으로 교정
|
||||||
|
*/
|
||||||
|
public static function clamp($value, $min = null, $max = null)
|
||||||
{
|
{
|
||||||
if($max !== null && $min !== null && $max < $min){
|
if($max !== null && $min !== null && $max < $min){
|
||||||
return $min;
|
return $min;
|
||||||
|
|||||||
Reference in New Issue
Block a user