Compare commits
42
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 | ||
|
|
dca341f35e | ||
|
|
d38ddcd79e | ||
|
|
03675349d8 | ||
|
|
72768ba7b5 | ||
|
|
a5477db6b6 | ||
|
|
c146e8587b | ||
|
|
24b65b0395 | ||
|
|
2f42691d2b | ||
|
|
ea619bd693 | ||
|
|
35a56e74bb | ||
|
|
6fb2358161 | ||
|
|
a039fb871b | ||
|
|
a19da6cda5 | ||
|
|
e5ba980865 | ||
|
|
f95ee8fab8 | ||
|
|
120706ef3f | ||
|
|
58da20f276 | ||
|
|
64af68e2d6 | ||
|
|
76a8740644 | ||
|
|
0863fafec0 |
@@ -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',
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
|
use Ds\Set;
|
||||||
use sammo\Enums\RankColumn;
|
use sammo\Enums\RankColumn;
|
||||||
|
use sammo\Enums\AuctionType;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
@@ -19,6 +21,7 @@ $gameStor = KVStorage::getStorage($db, 'game_env');
|
|||||||
increaseRefresh("명장일람", 1);
|
increaseRefresh("명장일람", 1);
|
||||||
$templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
$templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -326,6 +329,32 @@ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$dummyAuctionGeneral = [
|
||||||
|
'nation' => 0,
|
||||||
|
'no' => 0,
|
||||||
|
'ownerName' => '',
|
||||||
|
'pictureFullPath' => GetImageURL(0) . "/default.jpg",
|
||||||
|
'name' => '경매중',
|
||||||
|
'bgColor' => '#00582c',
|
||||||
|
'fgColor' => 'white',
|
||||||
|
'nationName' => '-',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($db->queryFirstColumn(
|
||||||
|
'SELECT `target` FROM ng_auction WHERE `finished` = 0 AND `type` = %s',
|
||||||
|
AuctionType::UniqueItem->value
|
||||||
|
) as $itemClassName) {
|
||||||
|
if(key_exists($itemClassName, $itemOwners)) {
|
||||||
|
$itemOwners[$itemClassName][] = $dummyAuctionGeneral;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$itemOwners[$itemClassName] = [$dummyAuctionGeneral];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (GameConst::$allItems as $itemType => $itemList) {
|
foreach (GameConst::$allItems as $itemType => $itemList) {
|
||||||
$itemNameType = $itemTypes[$itemType];
|
$itemNameType = $itemTypes[$itemType];
|
||||||
$itemList = array_reverse($itemList, true);
|
$itemList = array_reverse($itemList, true);
|
||||||
|
|||||||
+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>
|
||||||
|
|||||||
+47
-48
@@ -25,6 +25,17 @@ if ($meLevel == 0) {
|
|||||||
|
|
||||||
$nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nation where nation=%i', $nationID); //국가정보
|
$nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nation where nation=%i', $nationID); //국가정보
|
||||||
|
|
||||||
|
if ($meLevel >= 5) {
|
||||||
|
$candidateStrength = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and strength>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin);
|
||||||
|
$candidateIntel = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and intel>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin);
|
||||||
|
$candidateAny = $db->query('SELECT no,name,officer_level,city,npc,leadership,strength,intel,killturn from general where nation=%i and officer_level!=12 order by npc,binary(name)', $nationID); //추방 때문에 조금 더 김
|
||||||
|
} else {
|
||||||
|
$candidateStrength = [];
|
||||||
|
$candidateIntel = [];
|
||||||
|
$candidateAny = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -180,61 +191,21 @@ $nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nati
|
|||||||
<td colspan=5><?= $eaglestr ?></td>
|
<td colspan=5><?= $eaglestr ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=6 height=5></td>
|
<td colspan=4 height=5></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 align=center bgcolor=red>추 방</td>
|
<td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=498 align=right class='bg1'>대상 장수</td>
|
<?php $officerLevelText = getOfficerLevelText(11, $nation['level']); ?>
|
||||||
<td width=498>
|
<td width=98 align=right class='bg1'><?= getOfficerLevelText(12, $nation['level']) ?></td>
|
||||||
<?php
|
<td width=398><?= $level[12]['name'] ?> 【<?= CityConst::byID($level[12]['city'])->name ?>】</td>
|
||||||
|
<td width=98 align=right class='bg1'><?= $officerLevelText ?></td>
|
||||||
if ($meLevel >= 5) {
|
|
||||||
$candidateStrength = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and strength>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin);
|
|
||||||
$candidateIntel = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and intel>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin);
|
|
||||||
$candidateAny = $db->query('SELECT no,name,officer_level,city,npc,leadership,strength,intel,killturn from general where nation=%i and officer_level!=12 order by npc,binary(name)', $nationID); //추방 때문에 조금 더 김
|
|
||||||
} else {
|
|
||||||
$candidateStrength = [];
|
|
||||||
$candidateIntel = [];
|
|
||||||
$candidateAny = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $meLevel)) {
|
|
||||||
echo "
|
|
||||||
<select id='genlist_kick' size=1 style=color:white;background-color:black;>";
|
|
||||||
|
|
||||||
foreach ($candidateAny as $general) {
|
|
||||||
if ($general['no'] === $me['no']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<option data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} <small>({$general['leadership']}/{$general['strength']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "
|
|
||||||
</select>
|
|
||||||
<input type=$btn id='btn_kick' value=추방>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$officerLevelText = getOfficerLevelText(11, $nation['level']);
|
|
||||||
echo "
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr><td colspan=4 height=5></td></tr>
|
|
||||||
<tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr>
|
|
||||||
<tr>
|
|
||||||
<td width=98 align=right class='bg1'>" . getOfficerLevelText(12, $nation['level']) . "</td>
|
|
||||||
<td width=398>{$level[12]['name']} 【" . CityConst::byID($level[12]['city'])->name . "】</td>
|
|
||||||
<td width=98 align=right class='bg1'>{$officerLevelText}</td>
|
|
||||||
<td width=398>
|
<td width=398>
|
||||||
";
|
<?php
|
||||||
|
|
||||||
if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], 11)) {
|
if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], 11)) {
|
||||||
echo "
|
echo "
|
||||||
<select id='genlist_11' size=1 maxlength=15 style=color:white;background-color:black;>
|
<select id='genlist_11' size=1 maxlength=15 style=color:white;background-color:black;>
|
||||||
@@ -553,6 +524,34 @@ $nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nati
|
|||||||
<td colspan=5>※ <font color=orange>노란색</font>은 변경 불가능, 하얀색은 변경 가능 관직입니다.</td>
|
<td colspan=5>※ <font color=orange>노란색</font>은 변경 불가능, 하얀색은 변경 가능 관직입니다.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
|
<tr>
|
||||||
|
<td colspan=6 height=5></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan=2 align=center bgcolor=red>추 방</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width=498 align=right class='bg1'>대상 장수</td>
|
||||||
|
<td width=498>
|
||||||
|
<?php
|
||||||
|
if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $meLevel)) : ?>
|
||||||
|
|
||||||
|
<select id='genlist_kick' size=1 style=color:white;background-color:black;>";
|
||||||
|
|
||||||
|
<?php foreach ($candidateAny as $general) : ?>
|
||||||
|
<?php if ($general['no'] === $me['no']) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<option data-officer_level='<?= $general['officer_level'] ?>' data-name='<?= $general['name'] ?>' value='<?= $general['no'] ?>'><?= $general['name'] ?> <small>(<?= $general['leadership'] ?>/<?= $general['strength'] ?>/<?= $general['intel'] ?>, <?= $general['killturn'] ?>턴)</small></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<input type=<?= $btn ?> id='btn_kick' value=추방>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<br>
|
<br>
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
+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
|
||||||
|
|||||||
+28
-3
@@ -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 ?>
|
||||||
@@ -282,7 +282,21 @@ if($lastVoteID){
|
|||||||
<div id="nation-position"><?php myNationInfo($generalObj); ?></div>
|
<div id="nation-position"><?php myNationInfo($generalObj); ?></div>
|
||||||
<div id="general-position"><?php generalInfo($generalObj); ?></div>
|
<div id="general-position"><?php generalInfo($generalObj); ?></div>
|
||||||
<div id="generalCommandButton" class="row gx-0">
|
<div id="generalCommandButton" class="row gx-0">
|
||||||
<div class="buttonPlate bg2"><?= commandButton(['btnClass' => 'btn btn-sammo-nation', 'isTournamentApplicationOpen' => $isTournamentApplicationOpen, 'isBettingActive' => $isBettingActive]) ?></div>
|
<div class="buttonPlate bg2">
|
||||||
|
<?= commandButton([
|
||||||
|
'splitBtnBegin' => '<div class="btn-group">',
|
||||||
|
'splitBtnEnd' => '</div>',
|
||||||
|
'splitZoneSign' => '<button type="button" class="btn btn-sammo-nation dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false"><span class="visually-hidden">Toggle Dropdown</span></button>',
|
||||||
|
'splitZoneBegin' => '<ul class="dropdown-menu dropdown-menu-end">',
|
||||||
|
'splitZoneEnd' => '</ul>',
|
||||||
|
'splitSubBtnBegin' => '<li>',
|
||||||
|
'splitSubBtnEnd' => '</li>',
|
||||||
|
'btnClass' => 'btn btn-sammo-nation',
|
||||||
|
'btnSplitClass' => 'dropdown-item',
|
||||||
|
'isTournamentApplicationOpen' => $isTournamentApplicationOpen,
|
||||||
|
'isBettingActive' => $isBettingActive
|
||||||
|
])
|
||||||
|
?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -382,7 +396,18 @@ if($lastVoteID){
|
|||||||
국가 메뉴
|
국가 메뉴
|
||||||
</div>
|
</div>
|
||||||
<ul class="dropdown-menu" aria-labelledby="navbarNation" id="navbarNationItems">
|
<ul class="dropdown-menu" aria-labelledby="navbarNation" id="navbarNationItems">
|
||||||
<?= commandButton(['btnBegin' => '<li>', 'btnEnd' => '</li>', 'btnClass' => 'dropdown-item', 'isTournamentApplicationOpen' => $isTournamentApplicationOpen, 'isBettingActive' => $isBettingActive]) ?>
|
<?= commandButton([
|
||||||
|
'btnBegin' => '<li>',
|
||||||
|
'btnEnd' => '</li>',
|
||||||
|
'splitMainBegin' => '<div class="d-none">',
|
||||||
|
'splitMainEnd' => '</div>',
|
||||||
|
'splitSubBtnBegin' => '<li>',
|
||||||
|
'splitSubBtnEnd' => '</li>',
|
||||||
|
'btnClass' => 'dropdown-item',
|
||||||
|
'btnSplitClass' => 'dropdown-item',
|
||||||
|
'isTournamentApplicationOpen' => $isTournamentApplicationOpen,
|
||||||
|
'isBettingActive' => $isBettingActive
|
||||||
|
]) ?>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item dropup">
|
<li class="nav-item dropup">
|
||||||
|
|||||||
+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([
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ use sammo\DB;
|
|||||||
use sammo\DTO\AuctionBidItem;
|
use sammo\DTO\AuctionBidItem;
|
||||||
use sammo\DTO\AuctionInfo;
|
use sammo\DTO\AuctionInfo;
|
||||||
use sammo\Enums\AuctionType;
|
use sammo\Enums\AuctionType;
|
||||||
|
use sammo\Enums\InheritanceKey;
|
||||||
|
use sammo\InheritancePointManager;
|
||||||
use sammo\TimeUtil;
|
use sammo\TimeUtil;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
|
use sammo\General;
|
||||||
|
|
||||||
class GetUniqueItemAuctionDetail extends \sammo\BaseAPI
|
class GetUniqueItemAuctionDetail extends \sammo\BaseAPI
|
||||||
{
|
{
|
||||||
@@ -69,6 +72,13 @@ class GetUniqueItemAuctionDetail extends \sammo\BaseAPI
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$inheritMgr = InheritancePointManager::getInstance();
|
||||||
|
//preveious라서 column을 최대한 비울 수 있다.
|
||||||
|
$remainPoint = $inheritMgr->getInheritancePoint(
|
||||||
|
General::createGeneralObjFromDB($generalID, ['owner'], 0),
|
||||||
|
InheritanceKey::previous
|
||||||
|
);
|
||||||
|
|
||||||
$obfuscatedName = AuctionUniqueItem::genObfuscatedName($generalID);
|
$obfuscatedName = AuctionUniqueItem::genObfuscatedName($generalID);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -86,6 +96,7 @@ class GetUniqueItemAuctionDetail extends \sammo\BaseAPI
|
|||||||
],
|
],
|
||||||
'bidList' => $responseBid,
|
'bidList' => $responseBid,
|
||||||
'obfuscatedName' => $obfuscatedName,
|
'obfuscatedName' => $obfuscatedName,
|
||||||
|
'remainPoint' => $remainPoint,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class OpenBuyRiceAuction extends \sammo\BaseAPI
|
|||||||
$initYearMonth = Util::joinYearMonth($initYear, $initMonth);
|
$initYearMonth = Util::joinYearMonth($initYear, $initMonth);
|
||||||
$yearMonth = Util::joinYearMonth($year, $month);
|
$yearMonth = Util::joinYearMonth($year, $month);
|
||||||
|
|
||||||
if($yearMonth <= $initYearMonth + 3){
|
if($yearMonth < $initYearMonth + 3){
|
||||||
return '시작 후 3개월이 지나야 경매를 열 수 있습니다.';
|
return '시작 후 3개월이 지나야 경매를 열 수 있습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class OpenSellRiceAuction extends \sammo\BaseAPI
|
|||||||
$initYearMonth = Util::joinYearMonth($initYear, $initMonth);
|
$initYearMonth = Util::joinYearMonth($initYear, $initMonth);
|
||||||
$yearMonth = Util::joinYearMonth($year, $month);
|
$yearMonth = Util::joinYearMonth($year, $month);
|
||||||
|
|
||||||
if($yearMonth <= $initYearMonth + 3){
|
if($yearMonth < $initYearMonth + 3){
|
||||||
return '시작 후 3개월이 지나야 경매를 열 수 있습니다.';
|
return '시작 후 3개월이 지나야 경매를 열 수 있습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class OpenUniqueAuction extends \sammo\BaseAPI
|
|||||||
$initYearMonth = Util::joinYearMonth($initYear, $initMonth);
|
$initYearMonth = Util::joinYearMonth($initYear, $initMonth);
|
||||||
$yearMonth = Util::joinYearMonth($year, $month);
|
$yearMonth = Util::joinYearMonth($year, $month);
|
||||||
|
|
||||||
if($yearMonth <= $initYearMonth + 3){
|
if($yearMonth < $initYearMonth + 3){
|
||||||
return '시작 후 3개월이 지나야 경매를 열 수 있습니다.';
|
return '시작 후 3개월이 지나야 경매를 열 수 있습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -281,8 +281,8 @@ abstract class Auction
|
|||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
|
|
||||||
$highestBid = $this->getHighestBid();
|
$highestBid = $this->getHighestBid();
|
||||||
if ($highestBid !== null && $amount <= $highestBid->amount) {
|
if ($highestBid !== null && $amount < $highestBid->amount + 10) {
|
||||||
return '현재입찰가보다 높게 입찰해야 합니다.';
|
return '현재입찰가보다 10 포인트 높게 입찰해야 합니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
$myPrevBid = $this->getMyPrevBid();
|
$myPrevBid = $this->getMyPrevBid();
|
||||||
|
|||||||
@@ -124,6 +124,13 @@ abstract class AuctionBasicResource extends Auction
|
|||||||
$auctionHost->increaseVar($hostRes->value, $this->info->detail->amount);
|
$auctionHost->increaseVar($hostRes->value, $this->info->detail->amount);
|
||||||
$auctionHost->applyDB(DB::db());
|
$auctionHost->applyDB(DB::db());
|
||||||
|
|
||||||
|
if($this->info->hostGeneralID != 0){
|
||||||
|
$josaYiHost = JosaUtil::pick($auctionHost->getName(), '이');
|
||||||
|
$auctionAmount = $this->info->detail->amount;
|
||||||
|
$auctionLog = "{$this->auctionID}번 {$hostResName} 경매 <M>유찰</> : <Y>{$auctionHost->getName()}</>{$josaYiHost} {$hostResName} <C>{$auctionAmount}</> 판매, 그러나 입찰자 부재";
|
||||||
|
pushAuctionLog($auctionHost->getLogger()->formatText($auctionLog, ActionLogger::EVENT_PLAIN));
|
||||||
|
}
|
||||||
|
|
||||||
$staticNation = $auctionHost->getStaticNation();
|
$staticNation = $auctionHost->getStaticNation();
|
||||||
$src = new MessageTarget(0, '', 0, 'System', '#000000');
|
$src = new MessageTarget(0, '', 0, 'System', '#000000');
|
||||||
$dest = new MessageTarget(
|
$dest = new MessageTarget(
|
||||||
@@ -187,11 +194,11 @@ abstract class AuctionBasicResource extends Auction
|
|||||||
$auctionID = $this->info->id;
|
$auctionID = $this->info->id;
|
||||||
|
|
||||||
$auctionHost->getLogger()->pushGeneralActionLog(
|
$auctionHost->getLogger()->pushGeneralActionLog(
|
||||||
"{$auctionID}번 거래 <C>성사</>로 {$bidderResName} <C>{$bidAmount}</>{$josaUlBidder} 지불, {$hostResName} <C>{$auctionAmount}</>{$josaUlHost} 획득!",
|
"{$auctionID}번 거래 <C>성사</>로 {$hostResName} <C>{$auctionAmount}</>{$josaUlHost} 판매, {$bidderResName} <C>{$bidAmount}</>{$josaUlBidder} 획득!",
|
||||||
ActionLogger::EVENT_PLAIN
|
ActionLogger::EVENT_PLAIN
|
||||||
);
|
);
|
||||||
$bidder->getLogger()->pushGeneralActionLog(
|
$bidder->getLogger()->pushGeneralActionLog(
|
||||||
"{$auctionID}번 거래 <C>성사</>로 {$hostResName} <C>{$auctionAmount}</>{$josaUlHost} 판매, {$bidderResName} <C>{$bidAmount}</>{$josaUlBidder} 획득!",
|
"{$auctionID}번 거래 <C>성사</>로 {$bidderResName} <C>{$bidAmount}</>{$josaUlBidder} 지불, {$hostResName} <C>{$auctionAmount}</>{$josaUlHost} 획득!",
|
||||||
ActionLogger::EVENT_PLAIN
|
ActionLogger::EVENT_PLAIN
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -199,13 +206,14 @@ abstract class AuctionBasicResource extends Auction
|
|||||||
$josaYiBidder = JosaUtil::pick($bidder->getName(), '이');
|
$josaYiBidder = JosaUtil::pick($bidder->getName(), '이');
|
||||||
|
|
||||||
$auctionLog = [];
|
$auctionLog = [];
|
||||||
$auctionLog[] = "{$auctionID}번 {$hostResName} 경매 <C>성사</> : <Y>{$auctionHost->getName()}</>{$josaYiHost} {$hostResName} <C>{$auctionAmount}</> 판매, <Y>{$bidder->getName()}</>{$josaYiBidder} <C>{$bidAmount}</> 구매";
|
$josaRoBidder = JosaUtil::pick($bidAmount, '로');
|
||||||
|
$auctionLog[] = "{$auctionID}번 {$hostResName} 경매 <C>성사</> : <Y>{$auctionHost->getName()}</>{$josaYiHost} {$hostResName} <C>{$auctionAmount}</> 판매, <Y>{$bidder->getName()}</>{$josaYiBidder} {$bidderResName} <C>{$bidAmount}</>{$josaRoBidder} 구매";
|
||||||
|
|
||||||
|
|
||||||
if ($highestBid->amount === $this->info->detail->finishBidAmount) {
|
if ($highestBid->amount === $this->info->detail->finishBidAmount) {
|
||||||
$auctionLog[0] .= ' <M>★ 즉시구매가 거래 ★</>';
|
$auctionLog[0] .= ' <M>★ 마감가 거래 ★</>';
|
||||||
} else if ($highestBid->amount === $this->info->detail->startBidAmount) {
|
} else if ($highestBid->amount === $this->info->detail->startBidAmount) {
|
||||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||||
}
|
}
|
||||||
|
|
||||||
pushAuctionLog(array_map(
|
pushAuctionLog(array_map(
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class AuctionUniqueItem extends Auction
|
|||||||
return '아직 경매가 끝나지 않았습니다.';
|
return '아직 경매가 끝나지 않았습니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$availableCnt = 0;
|
||||||
|
foreach(GameConst::$allItems as $itemType => $itemList){
|
||||||
|
$availableCnt += $itemList[$itemKey] ?? 0;
|
||||||
|
$availableCnt -= $db->queryFirstField('SELECT count(*) FROM `general` WHERE %b = %s', $itemType, $itemKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($availableCnt <= 0){
|
||||||
|
return '그 유니크를 더 얻을 수 없습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
$now = new DateTimeImmutable();
|
$now = new DateTimeImmutable();
|
||||||
@@ -118,6 +129,10 @@ class AuctionUniqueItem extends Auction
|
|||||||
public function bid(int $amount, bool $tryExtendCloseDate): ?string
|
public function bid(int $amount, bool $tryExtendCloseDate): ?string
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($this->info->finished){
|
||||||
|
return '경매가 종료되었습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
/** @var AuctionInfo[] */
|
/** @var AuctionInfo[] */
|
||||||
$openUniqueAuctions = array_map(fn ($raw) => AuctionInfo::fromArray($raw), $db->query(
|
$openUniqueAuctions = array_map(fn ($raw) => AuctionInfo::fromArray($raw), $db->query(
|
||||||
@@ -129,7 +144,9 @@ class AuctionUniqueItem extends Auction
|
|||||||
foreach ($openUniqueAuctions as $auction) {
|
foreach ($openUniqueAuctions as $auction) {
|
||||||
$auctionIDList[] = $auction->id;
|
$auctionIDList[] = $auction->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
if($auctionIDList){
|
||||||
$rawHighestBids = Util::convertArrayToDict($db->query(
|
$rawHighestBids = Util::convertArrayToDict($db->query(
|
||||||
'SELECT bid.* FROM `ng_auction_bid` bid INNER JOIN (
|
'SELECT bid.* FROM `ng_auction_bid` bid INNER JOIN (
|
||||||
SELECT `auction_id`, MAX(`amount`) as `max_amount`
|
SELECT `auction_id`, MAX(`amount`) as `max_amount`
|
||||||
@@ -141,6 +158,11 @@ class AuctionUniqueItem extends Auction
|
|||||||
ON bid.`auction_id` = max_bid.`auction_id` AND bid.`amount` = max_bid.`max_amount`',
|
ON bid.`auction_id` = max_bid.`auction_id` AND bid.`amount` = max_bid.`max_amount`',
|
||||||
$auctionIDList,
|
$auctionIDList,
|
||||||
) ?? [], 'auction_id');
|
) ?? [], 'auction_id');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$rawHighestBids = [];
|
||||||
|
}
|
||||||
|
|
||||||
/** @var array<int,AuctionBidItem> */
|
/** @var array<int,AuctionBidItem> */
|
||||||
$highestBids = Util::mapWithKey(
|
$highestBids = Util::mapWithKey(
|
||||||
fn ($auctionID, $bid) => AuctionBidItem::fromArray($bid),
|
fn ($auctionID, $bid) => AuctionBidItem::fromArray($bid),
|
||||||
@@ -155,7 +177,7 @@ class AuctionUniqueItem extends Auction
|
|||||||
|
|
||||||
$bidItemTypes = new Set();
|
$bidItemTypes = new Set();
|
||||||
foreach (GameConst::$allItems as $itemType => $itemList) {
|
foreach (GameConst::$allItems as $itemType => $itemList) {
|
||||||
if (key_exists($itemCode, $itemList) && $itemList[$itemCode] <= 0) {
|
if (($itemList[$itemCode] ?? 0) <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$bidItemTypes->add($itemType);
|
$bidItemTypes->add($itemType);
|
||||||
@@ -234,6 +256,7 @@ class AuctionUniqueItem extends Auction
|
|||||||
return '유니크 아이템 소유 제한 상태입니다. 종료 시간이 연장됩니다.';
|
return '유니크 아이템 소유 제한 상태입니다. 종료 시간이 연장됩니다.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$isExtendCloseDateRequired = false;
|
||||||
foreach (GameConst::$allItems as $itemType => $itemList) {
|
foreach (GameConst::$allItems as $itemType => $itemList) {
|
||||||
//아직은 그런 경우는 없지만 동일 유니크를 여러 부위에 장착할 수 있을지도 모름
|
//아직은 그런 경우는 없지만 동일 유니크를 여러 부위에 장착할 수 있을지도 모름
|
||||||
if (!key_exists($itemKey, $itemList)) {
|
if (!key_exists($itemKey, $itemList)) {
|
||||||
@@ -243,11 +266,13 @@ class AuctionUniqueItem extends Auction
|
|||||||
$ownItem = $general->getItem($itemType);
|
$ownItem = $general->getItem($itemType);
|
||||||
if ($ownItem->getRawClassName() == $itemKey) {
|
if ($ownItem->getRawClassName() == $itemKey) {
|
||||||
//FIXME: 이 경우에는 환불이 되던가 해야함.
|
//FIXME: 이 경우에는 환불이 되던가 해야함.
|
||||||
|
$isExtendCloseDateRequired = true;
|
||||||
$reasons[] = '이미 그 유니크를 가지고 있습니다.';
|
$reasons[] = '이미 그 유니크를 가지고 있습니다.';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$ownItem->isBuyable()) {
|
if (!$ownItem->isBuyable()) {
|
||||||
|
$isExtendCloseDateRequired = true;
|
||||||
$reasons[] = '이미 다른 유니크를 가지고 있습니다.';
|
$reasons[] = '이미 다른 유니크를 가지고 있습니다.';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -263,6 +288,16 @@ class AuctionUniqueItem extends Auction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$availableItemTypes) {
|
if (!$availableItemTypes) {
|
||||||
|
if ($isExtendCloseDateRequired) {
|
||||||
|
$turnTerm = $gameStor->getValue('turnterm');
|
||||||
|
//동일 부위 제한에 걸렸다면 자동 연장
|
||||||
|
$extendedCloseDate = $this->info->closeDate->add(TimeUtil::secondsToDateInterval(
|
||||||
|
max(static::MIN_EXTENSION_MINUTES_LIMIT_BY_BID, $turnTerm * static::COEFF_EXTENSION_MINUTES_LIMIT_BY_BID) * 60
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->extendCloseDate($extendedCloseDate, true);
|
||||||
|
$this->extendLatestBidCloseDate(null);
|
||||||
|
}
|
||||||
return join(' ', $reasons);
|
return join(' ', $reasons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ class che_사기진작 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$general->addDex($general->getCrewTypeObj(), $score, false);
|
$general->addDex($general->getCrewTypeObj(), $score, false);
|
||||||
|
|
||||||
|
[$reqGold,] = $this->getCost();
|
||||||
|
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||||
|
|
||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$general->addDedication($ded);
|
$general->addDedication($ded);
|
||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
|
|||||||
@@ -243,30 +243,14 @@ class che_피장파장 extends Command\NationCommand
|
|||||||
{
|
{
|
||||||
$generalObj = $this->generalObj;
|
$generalObj = $this->generalObj;
|
||||||
$nationID = $generalObj->getNationID();
|
$nationID = $generalObj->getNationID();
|
||||||
$nationList = [];
|
|
||||||
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
|
|
||||||
foreach (getAllNationStaticInfo() as $destNation) {
|
|
||||||
$testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]);
|
|
||||||
|
|
||||||
$nationTarget = [
|
|
||||||
'id' => $destNation['nation'],
|
|
||||||
'name' => $destNation['name'],
|
|
||||||
'color' => $destNation['color'],
|
|
||||||
'power' => $destNation['power'],
|
|
||||||
];
|
|
||||||
if (!$testCommand->hasFullConditionMet()) {
|
|
||||||
$nationTarget['notAvailable'] = true;
|
|
||||||
}
|
|
||||||
if ($destNation['nation'] == $nationID) {
|
|
||||||
$nationTarget['notAvailable'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$nationList[] = $nationTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$testTurn = new LastTurn($this->getName(), null, null);
|
||||||
|
|
||||||
$availableCommandTypeList = [];
|
$availableCommandTypeList = [];
|
||||||
$currYearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
|
$currYearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
|
||||||
|
|
||||||
|
$oneAvailableCommandName = null;
|
||||||
|
|
||||||
foreach (GameConst::$availableChiefCommand['전략'] as $commandType) {
|
foreach (GameConst::$availableChiefCommand['전략'] as $commandType) {
|
||||||
$cmd = buildNationCommandClass($commandType, $generalObj, $this->env, new LastTurn());
|
$cmd = buildNationCommandClass($commandType, $generalObj, $this->env, new LastTurn());
|
||||||
$cmdName = $cmd->getName();
|
$cmdName = $cmd->getName();
|
||||||
@@ -276,9 +260,40 @@ class che_피장파장 extends Command\NationCommand
|
|||||||
if ($nextAvailableTurn !== null && $currYearMonth < $nextAvailableTurn) {
|
if ($nextAvailableTurn !== null && $currYearMonth < $nextAvailableTurn) {
|
||||||
$remainTurn = $nextAvailableTurn - $currYearMonth;
|
$remainTurn = $nextAvailableTurn - $currYearMonth;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$oneAvailableCommandName = $cmd->getRawClassName();
|
||||||
|
}
|
||||||
$availableCommandTypeList[$commandType] = ['name' => $cmdName, 'remainTurn' => $remainTurn];
|
$availableCommandTypeList[$commandType] = ['name' => $cmdName, 'remainTurn' => $remainTurn];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nationList = [];
|
||||||
|
foreach (getAllNationStaticInfo() as $destNation) {
|
||||||
|
$nationTarget = [
|
||||||
|
'id' => $destNation['nation'],
|
||||||
|
'name' => $destNation['name'],
|
||||||
|
'color' => $destNation['color'],
|
||||||
|
'power' => $destNation['power'],
|
||||||
|
];
|
||||||
|
|
||||||
|
if($oneAvailableCommandName === null){
|
||||||
|
$nationTarget['notAvailable'] = true;
|
||||||
|
}
|
||||||
|
else if ($destNation['nation'] == $nationID) {
|
||||||
|
$nationTarget['notAvailable'] = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$testCommand = new static($generalObj, $this->env, $testTurn, [
|
||||||
|
'destNationID' => $destNation['nation'],
|
||||||
|
'commandType' => $oneAvailableCommandName
|
||||||
|
]);
|
||||||
|
if (!$testCommand->hasFullConditionMet()) {
|
||||||
|
$nationTarget['notAvailable'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$nationList[] = $nationTarget;
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'procRes' => [
|
'procRes' => [
|
||||||
'nationList' => $nationList,
|
'nationList' => $nationList,
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ class CreateManyNPC extends \sammo\Event\Action
|
|||||||
$env['year'],
|
$env['year'],
|
||||||
$env['month']
|
$env['month']
|
||||||
)));
|
)));
|
||||||
$age = $rng->nextRangeInt(20, 25);
|
|
||||||
$birthYear = $env['year'] - $age;
|
|
||||||
$deathYear = $env['year'] + $rng->nextRangeInt(10, 60);
|
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach (pickGeneralFromPool(DB::db(), $rng, 0, $cnt) as $pickedNPC) {
|
foreach (pickGeneralFromPool(DB::db(), $rng, 0, $cnt) as $pickedNPC) {
|
||||||
|
$age = $rng->nextRangeInt(20, 25);
|
||||||
|
$birthYear = $env['year'] - $age;
|
||||||
|
$deathYear = $env['year'] + $rng->nextRangeInt(10, 50);
|
||||||
$newNPC = $pickedNPC->getGeneralBuilder();
|
$newNPC = $pickedNPC->getGeneralBuilder();
|
||||||
$newNPC->setNationID(0)
|
$newNPC->setNationID(0)
|
||||||
->setNPCType(3)
|
->setNPCType(3)
|
||||||
|
|||||||
@@ -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, "독식물키우세요"],
|
||||||
|
|||||||
+4
-2
@@ -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;
|
||||||
@@ -65,7 +67,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#navbarNationItems {
|
#navbarNationItems {
|
||||||
columns: 2;
|
columns: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navbarQuickItems {
|
#navbarQuickItems {
|
||||||
|
|||||||
@@ -16,5 +16,12 @@
|
|||||||
<?=$btnBegin??''?><a href='b_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='b_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='v_inheritPoint.php' class='commandButton <?=$btnClass??""?>'>유산 관리</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='v_inheritPoint.php' class='commandButton <?=$btnClass??""?>'>유산 관리</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='b_myPage.php' class='commandButton <?=$btnClass??""?>'>내 정보&설정</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='b_myPage.php' class='commandButton <?=$btnClass??""?>'>내 정보&설정</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnClass??""?>'>거 래 장</a><?=$btnEnd??''?>
|
<?=$splitBtnBegin??''?>
|
||||||
|
<?=$splitMainBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnClass??""?>'>경 매 장</a><?=$splitMainEnd??''?>
|
||||||
|
<?=$splitZoneSign??''?>
|
||||||
|
<?=$splitZoneBegin??''?>
|
||||||
|
<?=$splitSubBtnBegin??''?><a href='v_auction.php' target='_blank' class='open-window commandButton <?=$btnSplitClass??''?>'>금/쌀 경매장</a><?=$splitSubBtnEnd??''?>
|
||||||
|
<?=$splitSubBtnBegin??''?><a href='v_auction.php?type=unique' target='_blank' class='open-window commandButton <?=$btnSplitClass??''?>'>유니크 경매장</a><?=$splitSubBtnEnd??''?>
|
||||||
|
<?=$splitZoneEnd??''?>
|
||||||
|
<?=$splitBtnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='b_betting.php' target='_blank' class='open-window <?=$btnClassForBetting??""?>'>베 팅 장</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='b_betting.php' target='_blank' class='open-window <?=$btnClassForBetting??""?>'>베 팅 장</a><?=$btnEnd??''?>
|
||||||
+22
-5
@@ -4,8 +4,8 @@
|
|||||||
<BButton @click="isResAuction = true">금/쌀</BButton>
|
<BButton @click="isResAuction = true">금/쌀</BButton>
|
||||||
<BButton @click="isResAuction = false">유니크</BButton>
|
<BButton @click="isResAuction = false">유니크</BButton>
|
||||||
</TopBackBar>
|
</TopBackBar>
|
||||||
<AuctionResource v-if="isResAuction"></AuctionResource>
|
<AuctionResource v-if="isResAuction" ref="auctionResource"></AuctionResource>
|
||||||
<AuctionUniqueItem v-else></AuctionUniqueItem>
|
<AuctionUniqueItem v-else ref="auctionUniqueItem"></AuctionUniqueItem>
|
||||||
<BottomBar type="close"></BottomBar>
|
<BottomBar type="close"></BottomBar>
|
||||||
</BContainer>
|
</BContainer>
|
||||||
</template>
|
</template>
|
||||||
@@ -24,9 +24,26 @@ import AuctionResource from "@/components/AuctionResource.vue";
|
|||||||
import AuctionUniqueItem from "@/components/AuctionUniqueItem.vue";
|
import AuctionUniqueItem from "@/components/AuctionUniqueItem.vue";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
const isResAuction = ref(true);
|
const props = defineProps({
|
||||||
|
isResAuction: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
function tryReload() {
|
const auctionResource = ref<InstanceType<typeof AuctionResource> | null>(null);
|
||||||
console.log('갱신');
|
const auctionUniqueItem = ref<InstanceType<typeof AuctionUniqueItem> | null>(null);
|
||||||
|
|
||||||
|
const isResAuction = ref(props.isResAuction);
|
||||||
|
|
||||||
|
async function tryReload() {
|
||||||
|
console.log(auctionResource.value);
|
||||||
|
console.log(auctionUniqueItem.value);
|
||||||
|
if(isResAuction.value && auctionResource.value){
|
||||||
|
await auctionResource.value.refresh();
|
||||||
|
}
|
||||||
|
if(!isResAuction.value && auctionUniqueItem.value){
|
||||||
|
await auctionUniqueItem.value.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -221,4 +221,11 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.hidden_but_copyable {
|
||||||
|
color: rgba(0, 0, 0, 0);
|
||||||
|
font-size: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
+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";
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="nationPolicy.minimumResourceActionAmount"
|
v-model="nationPolicy.minimumResourceActionAmount"
|
||||||
:step="100"
|
:step="100"
|
||||||
|
:min="100"
|
||||||
title="포상/몰수/헌납/삼/팜 최소 단위"
|
title="포상/몰수/헌납/삼/팜 최소 단위"
|
||||||
>
|
>
|
||||||
연산결과가 이 단위보다 적다면 수행하지 않습니다.
|
연산결과가 이 단위보다 적다면 수행하지 않습니다.
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="nationPolicy.maximumResourceActionAmount"
|
v-model="nationPolicy.maximumResourceActionAmount"
|
||||||
:step="100"
|
:step="100"
|
||||||
|
:min="100"
|
||||||
title="포상/몰수/헌납/삼/팜 최대 단위"
|
title="포상/몰수/헌납/삼/팜 최대 단위"
|
||||||
>
|
>
|
||||||
연산결과가 이 단위보다 크다면, 이 값에 맞춥니다.
|
연산결과가 이 단위보다 크다면, 이 값에 맞춥니다.
|
||||||
|
|||||||
+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<{
|
||||||
|
|||||||
@@ -2,89 +2,101 @@
|
|||||||
<div class="bg0">
|
<div class="bg0">
|
||||||
<div class="bg2">거래장</div>
|
<div class="bg2">거래장</div>
|
||||||
<div style="background-color: orange">쌀 구매</div>
|
<div style="background-color: orange">쌀 구매</div>
|
||||||
<div class="row gx-0">
|
<div class="auctionItem gx-0">
|
||||||
<div class="col">번호</div>
|
<div class="idx">번호</div>
|
||||||
<div class="col">판매자</div>
|
<div class="host">판매자</div>
|
||||||
<div class="col">물품</div>
|
<div class="amount">수량</div>
|
||||||
<div class="col">수량</div>
|
<div class="highestBidder">입찰자</div>
|
||||||
<div class="col">시작 구매가</div>
|
<div class="highestBid">입찰가</div>
|
||||||
<div class="col">현재 구매가</div>
|
<div class="bidRatio">단가</div>
|
||||||
<div class="col">즉시 구매가</div>
|
<div class="finishBid">마감가</div>
|
||||||
<div class="col">단가</div>
|
<div class="closeDate">거래 종료</div>
|
||||||
<div class="col">구매 예정자</div>
|
|
||||||
<div class="col">거래 종료</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-for="auction of buyRice" :key="auction.id" class="row gx-0" @click="selectedBuyRiceAuction = auction">
|
<div
|
||||||
<div class="col">{{ auction.id }}</div>
|
v-for="auction of buyRice"
|
||||||
<div class="col">{{ auction.hostName }}</div>
|
:key="auction.id"
|
||||||
<div class="col">쌀</div>
|
class="auctionItem gx-0"
|
||||||
<div class="col">{{ auction.amount }}</div>
|
@click="selectedBuyRiceAuction = auction"
|
||||||
<div class="col">{{ auction.startBidAmount }}</div>
|
>
|
||||||
<div class="col">{{ auction.highestBid ? auction.highestBid.amount : "-" }}</div>
|
<div class="idx f_tnum">{{ auction.id }}</div>
|
||||||
<div class="col">{{ auction.finishBidAmount }}</div>
|
<div class="host">{{ auction.hostName }}</div>
|
||||||
<div class="col">{{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }}</div>
|
<div class="amount f_tnum">쌀 {{ auction.amount.toLocaleString() }}</div>
|
||||||
<div class="col">{{ auction.highestBid ? auction.highestBid.generalName : "-" }}</div>
|
<div class="highestBidder">{{ auction.highestBid?.generalName ?? "-" }}</div>
|
||||||
<div class="col">{{ auction.closeDate }}</div>
|
<div :class="['highestBid f_tnum', auction.highestBid ? '' : 'noBid']">
|
||||||
|
금 {{ (auction.highestBid?.amount ?? auction.startBidAmount).toLocaleString() }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="selectedBuyRiceAuction !== undefined" class="row">
|
<div class="bidRatio f_tnum">
|
||||||
<div class="col">{{ selectedBuyRiceAuction.id }}번 쌀 {{ selectedBuyRiceAuction.amount }} 경매에</div>
|
{{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }}
|
||||||
<div class="col">
|
</div>
|
||||||
|
<div class="finishBid f_tnum">금 {{ auction.finishBidAmount.toLocaleString() }}</div>
|
||||||
|
<div class="closeDate f_tnum">{{ cutDateTime(auction.closeDate) }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="selectedBuyRiceAuction !== undefined" class="row gx-1">
|
||||||
|
<div class="offset-1 col-4 offset-md-3 col-md-2 align-self-center f_tnum text-end">
|
||||||
|
{{ selectedBuyRiceAuction.id }}번 쌀 {{ selectedBuyRiceAuction.amount }} 경매에 금
|
||||||
|
</div>
|
||||||
|
<div class="col-3 col-md-2">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="bidAmountBuyRiceAuction"
|
v-model="bidAmountBuyRiceAuction"
|
||||||
:int="true"
|
:int="true"
|
||||||
:min="selectedBuyRiceAuction.startBidAmount"
|
:min="selectedBuyRiceAuction.startBidAmount"
|
||||||
:max="selectedBuyRiceAuction.finishBidAmount"
|
:max="selectedBuyRiceAuction.finishBidAmount"
|
||||||
title="금"
|
|
||||||
:step="10"
|
:step="10"
|
||||||
></NumberInputWithInfo>
|
></NumberInputWithInfo>
|
||||||
</div>
|
</div>
|
||||||
<div class="col"><BButton @click="bidBuyRiceAuction">입찰</BButton></div>
|
<div class="col-2 col-md-1 d-grid"><BButton @click="bidBuyRiceAuction">입찰</BButton></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="background-color: skyblue">쌀 판매</div>
|
<div style="background-color: skyblue">쌀 판매</div>
|
||||||
<div class="row gx-0">
|
<div class="auctionItem gx-0">
|
||||||
<div class="col">번호</div>
|
<div class="idx">번호</div>
|
||||||
<div class="col">판매자</div>
|
<div class="host">판매자</div>
|
||||||
<div class="col">물품</div>
|
<div class="amount">수량</div>
|
||||||
<div class="col">수량</div>
|
<div class="highestBidder">입찰자</div>
|
||||||
<div class="col">시작 구매가</div>
|
<div class="highestBid">입찰가</div>
|
||||||
<div class="col">현재 구매가</div>
|
<div class="bidRatio">단가</div>
|
||||||
<div class="col">즉시 구매가</div>
|
<div class="finishBid">마감가</div>
|
||||||
<div class="col">단가</div>
|
<div class="closeDate">거래 종료</div>
|
||||||
<div class="col">구매 예정자</div>
|
|
||||||
<div class="col">거래 종료</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-for="auction of sellRice" :key="auction.id" class="row gx-0" @click="selectedSellRiceAuction = auction">
|
<div
|
||||||
<div class="col">{{ auction.id }}</div>
|
v-for="auction of sellRice"
|
||||||
<div class="col">{{ auction.hostName }}</div>
|
:key="auction.id"
|
||||||
<div class="col">금</div>
|
class="auctionItem gx-0"
|
||||||
<div class="col">{{ auction.amount }}</div>
|
@click="selectedSellRiceAuction = auction"
|
||||||
<div class="col">{{ auction.startBidAmount }}</div>
|
>
|
||||||
<div class="col">{{ auction.highestBid ? auction.highestBid.amount : "-" }}</div>
|
<div class="idx f_tnum">{{ auction.id }}</div>
|
||||||
<div class="col">{{ auction.finishBidAmount }}</div>
|
<div class="host">{{ auction.hostName }}</div>
|
||||||
<div class="col">{{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }}</div>
|
<div class="amount f_tnum">금{{ auction.amount.toLocaleString() }}</div>
|
||||||
<div class="col">{{ auction.highestBid ? auction.highestBid.generalName : "-" }}</div>
|
<div class="highestBidder">{{ auction.highestBid?.generalName ?? "-" }}</div>
|
||||||
<div class="col">{{ auction.closeDate }}</div>
|
<div :class="['highestBid f_tnum', auction.highestBid ? '' : 'noBid']">
|
||||||
|
쌀 {{ (auction.highestBid?.amount ?? auction.startBidAmount).toLocaleString() }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="selectedSellRiceAuction !== undefined" class="row">
|
<div class="bidRatio f_tnum">
|
||||||
<div class="col">{{ selectedSellRiceAuction.id }}번 금 {{ selectedSellRiceAuction.amount }} 경매에</div>
|
{{ auction.highestBid ? (auction.highestBid.amount / auction.amount).toFixed(2) : "-" }}
|
||||||
<div class="col">
|
</div>
|
||||||
|
<div class="finishBid f_tnum">쌀 {{ auction.finishBidAmount.toLocaleString() }}</div>
|
||||||
|
<div class="closeDate f_tnum">{{ cutDateTime(auction.closeDate) }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="selectedSellRiceAuction !== undefined" class="row gx-1">
|
||||||
|
<div class="offset-1 col-4 offset-md-3 col-md-2 align-self-center f_tnum text-end">
|
||||||
|
{{ selectedSellRiceAuction.id }}번 금 {{ selectedSellRiceAuction.amount }} 경매에 쌀
|
||||||
|
</div>
|
||||||
|
<div class="col-3 col-md-2">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="bidAmountSellRiceAuction"
|
v-model="bidAmountSellRiceAuction"
|
||||||
:int="true"
|
:int="true"
|
||||||
:min="selectedSellRiceAuction.startBidAmount"
|
:min="selectedSellRiceAuction.startBidAmount"
|
||||||
:max="selectedSellRiceAuction.finishBidAmount"
|
:max="selectedSellRiceAuction.finishBidAmount"
|
||||||
title="쌀"
|
|
||||||
:step="10"
|
:step="10"
|
||||||
></NumberInputWithInfo>
|
></NumberInputWithInfo>
|
||||||
</div>
|
</div>
|
||||||
<div class="col"><BButton @click="bidSellRiceAuction">입찰</BButton></div>
|
<div class="col-2 col-md-1 d-grid"><BButton @click="bidSellRiceAuction">입찰</BButton></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>경매 등록</div>
|
<div>경매 등록</div>
|
||||||
<div class="row">
|
<div class="row gx-1">
|
||||||
<div class="col">
|
<div class="col-2 offset-md-2 col-md-1">
|
||||||
매물
|
매물<br />
|
||||||
<BButtonGroup>
|
<BButtonGroup>
|
||||||
<BButton :pressed="openAuctionInfo.type == 'buyRice'" @click="openAuctionInfo.type = 'buyRice'"> 쌀 </BButton>
|
<BButton :pressed="openAuctionInfo.type == 'buyRice'" @click="openAuctionInfo.type = 'buyRice'"> 쌀 </BButton>
|
||||||
<BButton :pressed="openAuctionInfo.type == 'sellRice'" @click="openAuctionInfo.type = 'sellRice'">
|
<BButton :pressed="openAuctionInfo.type == 'sellRice'" @click="openAuctionInfo.type = 'sellRice'">
|
||||||
@@ -92,50 +104,56 @@
|
|||||||
</BButton>
|
</BButton>
|
||||||
</BButtonGroup>
|
</BButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
|
||||||
<NumberInputWithInfo
|
<div class="col col-md-2">
|
||||||
v-model="openAuctionInfo.closeTurnCnt"
|
수량 ({{ openAuctionInfo.type == "buyRice" ? "쌀" : "금" }})<br />
|
||||||
:int="true"
|
|
||||||
:min="3"
|
|
||||||
:max="24"
|
|
||||||
title="기간(턴)"
|
|
||||||
:step="1"
|
|
||||||
></NumberInputWithInfo>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="openAuctionInfo.amount"
|
v-model="openAuctionInfo.amount"
|
||||||
:int="true"
|
:int="true"
|
||||||
:min="100"
|
:min="100"
|
||||||
:max="10000"
|
:max="10000"
|
||||||
title="수량"
|
|
||||||
:step="10"
|
:step="10"
|
||||||
></NumberInputWithInfo>
|
></NumberInputWithInfo>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col-2 col-md-1">
|
||||||
|
기간(턴)
|
||||||
|
<NumberInputWithInfo
|
||||||
|
v-model="openAuctionInfo.closeTurnCnt"
|
||||||
|
:int="true"
|
||||||
|
:min="3"
|
||||||
|
:max="24"
|
||||||
|
:step="1"
|
||||||
|
></NumberInputWithInfo>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-2">
|
||||||
|
시작가 ({{ openAuctionInfo.type == "buyRice" ? "금" : "쌀" }})
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="openAuctionInfo.startBidAmount"
|
v-model="openAuctionInfo.startBidAmount"
|
||||||
:int="true"
|
:int="true"
|
||||||
:min="100"
|
:min="100"
|
||||||
:max="10000"
|
:max="10000"
|
||||||
title="시작구매가"
|
|
||||||
:step="10"
|
:step="10"
|
||||||
></NumberInputWithInfo>
|
></NumberInputWithInfo>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col col-md-2">
|
||||||
|
마감가 ({{ openAuctionInfo.type == "buyRice" ? "금" : "쌀" }})
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="openAuctionInfo.finishBidAmount"
|
v-model="openAuctionInfo.finishBidAmount"
|
||||||
:int="true"
|
:int="true"
|
||||||
:min="100"
|
:min="100"
|
||||||
:max="10000"
|
:max="10000"
|
||||||
title="즉시구매가"
|
|
||||||
:step="10"
|
:step="10"
|
||||||
></NumberInputWithInfo>
|
></NumberInputWithInfo>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col-1 d-grid">
|
||||||
<BButton @click="openAuction">등록</BButton>
|
<BButton @click="openAuction">등록</BButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>이전 경매(최근 20건)</div>
|
||||||
|
<div v-for="(log, idx) in recentLogs" :key="idx">
|
||||||
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
|
<div v-html="formatLog(log)" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -147,10 +165,12 @@ import { useToast, BButtonGroup, BButton } from "bootstrap-vue-3";
|
|||||||
import { isString } from "lodash";
|
import { isString } from "lodash";
|
||||||
import { onMounted, reactive, ref, watch } from "vue";
|
import { onMounted, reactive, ref, watch } from "vue";
|
||||||
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
import NumberInputWithInfo from "@/components/NumberInputWithInfo.vue";
|
||||||
|
import { formatLog } from "@/utilGame/formatLog";
|
||||||
const toasts = unwrap(useToast());
|
const toasts = unwrap(useToast());
|
||||||
|
|
||||||
const buyRice = ref<BasicResourceAuctionInfo[]>([]);
|
const buyRice = ref<BasicResourceAuctionInfo[]>([]);
|
||||||
const sellRice = ref<BasicResourceAuctionInfo[]>([]);
|
const sellRice = ref<BasicResourceAuctionInfo[]>([]);
|
||||||
|
const recentLogs = ref<string[]>([]);
|
||||||
|
|
||||||
const selectedBuyRiceAuction = ref<BasicResourceAuctionInfo | undefined>(undefined);
|
const selectedBuyRiceAuction = ref<BasicResourceAuctionInfo | undefined>(undefined);
|
||||||
const bidAmountBuyRiceAuction = ref<number>(0);
|
const bidAmountBuyRiceAuction = ref<number>(0);
|
||||||
@@ -162,6 +182,12 @@ watch(selectedBuyRiceAuction, (auction) => {
|
|||||||
bidAmountBuyRiceAuction.value = auction.highestBid ? auction.highestBid.amount : auction.startBidAmount;
|
bidAmountBuyRiceAuction.value = auction.highestBid ? auction.highestBid.amount : auction.startBidAmount;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function cutDateTime(dateTime: string, showSecond = false) {
|
||||||
|
if (showSecond) {
|
||||||
|
return dateTime.substring(5, 19);
|
||||||
|
}
|
||||||
|
return dateTime.substring(5, 16);
|
||||||
|
}
|
||||||
|
|
||||||
async function bidBuyRiceAuction() {
|
async function bidBuyRiceAuction() {
|
||||||
if (selectedBuyRiceAuction.value === undefined) {
|
if (selectedBuyRiceAuction.value === undefined) {
|
||||||
@@ -244,6 +270,7 @@ async function refresh() {
|
|||||||
const result = await SammoAPI.Auction.GetActiveResourceAuctionList();
|
const result = await SammoAPI.Auction.GetActiveResourceAuctionList();
|
||||||
buyRice.value = result.buyRice;
|
buyRice.value = result.buyRice;
|
||||||
sellRice.value = result.sellRice;
|
sellRice.value = result.sellRice;
|
||||||
|
recentLogs.value = result.recentLogs;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
if (isString(e)) {
|
if (isString(e)) {
|
||||||
@@ -282,8 +309,85 @@ async function openAuction() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
refresh,
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
void refresh();
|
void refresh();
|
||||||
console.log("mounted");
|
console.log("mounted");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "@scss/common/break_500px.scss";
|
||||||
|
|
||||||
|
.auctionItem {
|
||||||
|
display: grid;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noBid {
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
border-bottom: solid gray 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-500px {
|
||||||
|
.auctionItem {
|
||||||
|
grid-template-columns: 1fr 3fr 3fr 1fr 2fr 2fr;
|
||||||
|
grid-template-rows: 1fr 1fr;
|
||||||
|
|
||||||
|
.idx {
|
||||||
|
grid-column: 1 / 2;
|
||||||
|
grid-row: 1 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.host {
|
||||||
|
grid-column: 2 / 3;
|
||||||
|
grid-row: 1 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.amount {
|
||||||
|
grid-column: 2 / 3;
|
||||||
|
grid-row: 2/ 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highestBidder {
|
||||||
|
grid-column: 3 / 4;
|
||||||
|
grid-row: 1 / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highestBid {
|
||||||
|
grid-column: 3 / 4;
|
||||||
|
grid-row: 2 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bidRatio {
|
||||||
|
grid-column: 4 / 5;
|
||||||
|
grid-row: 1 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.finishBid {
|
||||||
|
grid-column: 5 / 6;
|
||||||
|
grid-row: 1 / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.closeDate {
|
||||||
|
grid-column: 6 / 7;
|
||||||
|
grid-row: 1 / 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-1000px {
|
||||||
|
.auctionItem {
|
||||||
|
grid-template-columns: 1fr 2fr 2fr 2fr 2fr 1fr 3fr 2fr;
|
||||||
|
grid-template-rows: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,61 +1,121 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="bg0">
|
<div class="bg0">
|
||||||
<div class="bg2">유니크 경매장</div>
|
<div>
|
||||||
<div>내 가명: {{ obfuscatedName }}</div>
|
내 가명: <span class="isMe">{{ obfuscatedName }}</span>
|
||||||
|
</div>
|
||||||
<template v-if="currentAuction !== undefined">
|
<template v-if="currentAuction !== undefined">
|
||||||
<div class="bg1">상세</div>
|
<div class="bg2">경매 {{ currentAuction.auction.id }}번 상세</div>
|
||||||
<div class="row gx-0">
|
<div class="row gx-0 text-center">
|
||||||
<div class="col-4 col-md-2 bg2">경매 번호</div>
|
<div class="col-2 col-md-1 bg1">경매명</div>
|
||||||
<div class="col-4 col-md-2">{{ currentAuction.auction.id }}</div>
|
|
||||||
|
|
||||||
<div class="col-4 col-md-2 bg2">경매명</div>
|
|
||||||
<div class="col-4 col-md-2">{{ currentAuction.auction.title }}</div>
|
<div class="col-4 col-md-2">{{ currentAuction.auction.title }}</div>
|
||||||
|
|
||||||
<div class="col-4 col-md-2 bg2">주최자(익명)</div>
|
<div class="col-2 col-md-1 bg1">주최자(익명)</div>
|
||||||
<div class="col-4 col-md-2">{{ currentAuction.auction.hostName }}</div>
|
<div :class="['col-4 col-md-2', currentAuction.auction.isCallerHost ? 'isMe' : '']">
|
||||||
|
{{ currentAuction.auction.hostName }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-4 col-md-2 bg2">종료시점</div>
|
<div class="col-2 col-md-1 bg1">종료일시</div>
|
||||||
<div class="col-4 col-md-2">{{ currentAuction.auction.closeDate }}</div>
|
<div class="col-4 col-md-2 f_tnum">{{ cutDateTime(currentAuction.auction.closeDate, true) }}</div>
|
||||||
|
|
||||||
<div class="col-4 col-md-2 bg2">최대지연</div>
|
<div class="col-2 col-md-1 bg1">최대지연</div>
|
||||||
<div class="col-4 col-md-2">{{ currentAuction.auction.availableLatestBidCloseDate }}</div>
|
<div class="col-4 col-md-2 f_tnum">
|
||||||
|
{{ cutDateTime(currentAuction.auction.availableLatestBidCloseDate, true) }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg1">입찰자 목록</div>
|
<div class="bg1">입찰자 목록</div>
|
||||||
<div class="row gx-0 bg2">
|
<div
|
||||||
<div class="col-4">입찰자</div>
|
class="row gx-0 px-md-5 text-center"
|
||||||
<div class="col-4">입찰포인트</div>
|
:style="{
|
||||||
<div class="col-4">시각</div>
|
borderBottom: 'solid 1px white',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div class="col-4 offset-md-2 col-md-3">입찰자</div>
|
||||||
|
<div class="col-4 col-md-2 text-end px-5">입찰포인트</div>
|
||||||
|
<div class="col-4 col-md-3">시각</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="bidder of currentAuction.bidList" :key="bidder.amount" class="row gx-0">
|
<div v-for="bidder of currentAuction.bidList" :key="bidder.amount" class="row gx-0 px-md-5 text-center">
|
||||||
<div class="col-4">{{ bidder.generalName }}</div>
|
<div :class="['col-4 offset-md-2 col-md-3', bidder.isCallerHighestBidder ? 'isMe' : '']">{{ bidder.generalName }}</div>
|
||||||
<div class="col-4">{{ bidder.amount }}</div>
|
<div class="col-4 col-md-2 text-end px-5 f_tnum">{{ bidder.amount.toLocaleString() }}</div>
|
||||||
<div class="col-4">{{ bidder.date }}</div>
|
<div class="col-4 col-md-3 f_tnum">{{ cutDateTime(bidder.date) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg1">입찰하기</div>
|
<div class="bg1">입찰하기</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<label class="col-5 offset-md-3 col-md-3 col-form-label text-center">유산포인트 (잔여: {{ currentAuction.remainPoint.toLocaleString() }}포인트)</label>
|
||||||
|
<div class="col-4 col-md-2">
|
||||||
<NumberInputWithInfo
|
<NumberInputWithInfo
|
||||||
v-model="bidAmount"
|
v-model="bidAmount"
|
||||||
:int="true"
|
:int="true"
|
||||||
:min="currentAuction.bidList[0].amount"
|
:min="currentAuction.bidList[0].amount"
|
||||||
title="유산포인트"
|
:max="currentAuction.remainPoint"
|
||||||
|
title=""
|
||||||
:step="1"
|
:step="1"
|
||||||
></NumberInputWithInfo>
|
></NumberInputWithInfo>
|
||||||
</div>
|
</div>
|
||||||
<div class="col"><BButton @click="bidAuction">입찰</BButton></div>
|
<div class="col-3 col-md-1 d-grid"><BButton @click="bidAuction">입찰</BButton></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="bg1">목록</div>
|
<div class="bg1">진행중인 경매 목록</div>
|
||||||
<div v-for="[auctionID, auction] of auctionList" :key="auctionID" class="row" @click="currentAuctionID = auctionID">
|
<div
|
||||||
<div class="col">{{ auction.id }}</div>
|
class="row gx-0 text-center"
|
||||||
<div class="col">{{ auction.finished ? "종료됨" : "진행중" }}</div>
|
:style="{
|
||||||
<div class="col">{{ auction.title }}</div>
|
borderBottom: 'solid 1px white',
|
||||||
<div class="col">{{ auction.hostName }}</div>
|
}"
|
||||||
<div class="col">{{ auction.closeDate }}</div>
|
>
|
||||||
<div class="col">{{ auction.remainCloseDateExtensionCnt > 0 ? "남음" : "소진" }}</div>
|
<div class="col-1">번호</div>
|
||||||
<div class="col">{{ auction.highestBid.generalName }}</div>
|
<div class="col-4">경매명</div>
|
||||||
<div class="col">{{ auction.highestBid.amount }}</div>
|
<div class="col-1">주최자</div>
|
||||||
|
<div class="col-2">종료일시</div>
|
||||||
|
<div class="col-1">연장</div>
|
||||||
|
<div class="col-1">1순위</div>
|
||||||
|
<div class="col-2 text-end px-2">포인트</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="[auctionID, auction] of ongoingAuctionList"
|
||||||
|
:key="auctionID"
|
||||||
|
class="row gx-0 text-center clickableRow"
|
||||||
|
@click="currentAuctionID = auctionID"
|
||||||
|
>
|
||||||
|
<div class="col-1">{{ auction.id }}</div>
|
||||||
|
<div class="col-4">{{ auction.title }}</div>
|
||||||
|
<div :class="['col-1', auction.isCallerHost ? 'isMe' : '']">{{ auction.hostName }}</div>
|
||||||
|
<div class="col-2 f_tnum">{{ cutDateTime(auction.closeDate) }}</div>
|
||||||
|
<div class="col-1">{{ auction.remainCloseDateExtensionCnt > 0 ? "남음" : "소진" }}</div>
|
||||||
|
<div :class="['col-1', auction.highestBid.isCallerHighestBidder ? 'isMe' : '']">
|
||||||
|
{{ auction.highestBid.generalName }}
|
||||||
|
</div>
|
||||||
|
<div class="col-2 text-end px-2 f_tnum">{{ auction.highestBid.amount.toLocaleString() }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg1">종료된 경매 목록</div>
|
||||||
|
<div
|
||||||
|
class="row gx-0 text-center"
|
||||||
|
:style="{
|
||||||
|
borderBottom: 'solid 1px white',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div class="col-1">번호</div>
|
||||||
|
<div class="col-4">경매명</div>
|
||||||
|
<div class="col-1">주최자</div>
|
||||||
|
<div class="col-2">종료일시</div>
|
||||||
|
<div class="col-1">연장</div>
|
||||||
|
<div class="col-1">1순위</div>
|
||||||
|
<div class="col-2 text-end px-2">포인트</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="[auctionID, auction] of finishedAuctionList"
|
||||||
|
:key="auctionID"
|
||||||
|
class="row gx-0 text-center clickableRow"
|
||||||
|
@click="currentAuctionID = auctionID"
|
||||||
|
>
|
||||||
|
<div class="col-1">{{ auction.id }}</div>
|
||||||
|
<div class="col-4">{{ auction.title }}</div>
|
||||||
|
<div :class="['col-1', auction.isCallerHost ? 'isMe' : '']">{{ auction.hostName }}</div>
|
||||||
|
<div class="col-2 f_tnum">{{ cutDateTime(auction.closeDate) }}</div>
|
||||||
|
<div class="col-1">{{ auction.remainCloseDateExtensionCnt > 0 ? "남음" : "소진" }}</div>
|
||||||
|
<div :class="['col-1', auction.highestBid.isCallerHighestBidder ? 'isMe' : '']">
|
||||||
|
{{ auction.highestBid.generalName }}
|
||||||
|
</div>
|
||||||
|
<div class="col-2 text-end px-2 f_tnum">{{ auction.highestBid.amount.toLocaleString() }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -95,19 +155,35 @@ async function refreshDetail() {
|
|||||||
watch(currentAuctionID, () => {
|
watch(currentAuctionID, () => {
|
||||||
void refreshDetail();
|
void refreshDetail();
|
||||||
});
|
});
|
||||||
const auctionList = ref(new Map<number, AuctionItemInfo>());
|
const ongoingAuctionList = ref(new Map<number, AuctionItemInfo>());
|
||||||
|
const finishedAuctionList = ref(new Map<number, AuctionItemInfo>());
|
||||||
const obfuscatedName = ref("");
|
const obfuscatedName = ref("");
|
||||||
|
|
||||||
const toasts = unwrap(useToast());
|
const toasts = unwrap(useToast());
|
||||||
|
|
||||||
async function refresh() {
|
function cutDateTime(dateTime: string, showSecond = false) {
|
||||||
|
if (showSecond) {
|
||||||
|
return dateTime.substring(5, 19);
|
||||||
|
}
|
||||||
|
return dateTime.substring(5, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function refreshList() {
|
||||||
try {
|
try {
|
||||||
const result = await SammoAPI.Auction.GetUniqueItemAuctionList();
|
const result = await SammoAPI.Auction.GetUniqueItemAuctionList();
|
||||||
obfuscatedName.value = result.obfuscatedName;
|
obfuscatedName.value = result.obfuscatedName;
|
||||||
auctionList.value = new Map(result.list.map((auction) => [auction.id, auction]));
|
finishedAuctionList.value = new Map(
|
||||||
if (currentAuctionID.value === undefined && result.list.length > 0) {
|
result.list.filter((auction) => auction.finished).map((auction) => [auction.id, auction])
|
||||||
currentAuctionID.value = result.list[0].id;
|
);
|
||||||
bidAmount.value = result.list[0].highestBid.amount;
|
ongoingAuctionList.value = new Map(
|
||||||
|
result.list.filter((auction) => !auction.finished).map((auction) => [auction.id, auction])
|
||||||
|
);
|
||||||
|
if (currentAuctionID.value === undefined && ongoingAuctionList.value.size > 0) {
|
||||||
|
const auctionIterator = ongoingAuctionList.value.values().next();
|
||||||
|
if (!auctionIterator.done) {
|
||||||
|
currentAuctionID.value = auctionIterator.value.id;
|
||||||
|
bidAmount.value = auctionIterator.value.highestBid.amount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@@ -135,8 +211,7 @@ async function bidAuction() {
|
|||||||
title: "성공",
|
title: "성공",
|
||||||
body: "입찰이 완료되었습니다.",
|
body: "입찰이 완료되었습니다.",
|
||||||
});
|
});
|
||||||
void refreshDetail();
|
await refresh();
|
||||||
void refresh();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
if (isString(e)) {
|
if (isString(e)) {
|
||||||
@@ -149,7 +224,31 @@ async function bidAuction() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function refresh() {
|
||||||
|
const waiters = [refreshList(), refreshDetail()];
|
||||||
|
await Promise.all(waiters);
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
refresh,
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
void refresh();
|
void refreshList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.isMe {
|
||||||
|
font-weight: bold;
|
||||||
|
color: aquamarine;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickableRow{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickableRow:hover{
|
||||||
|
background-color: rgba(255, 255, 255, 0.3);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="row form-group number-input-with-info">
|
<div class="row form-group number-input-with-info">
|
||||||
<label v-if="!right" class="col-6 col-form-label">{{ title }}</label>
|
<label v-if="!right && title" class="col col-form-label">{{ title }}</label>
|
||||||
<div class="col-6">
|
<div class="col">
|
||||||
<input
|
<input
|
||||||
ref="input"
|
ref="input"
|
||||||
v-model="rawValue"
|
v-model="rawValue"
|
||||||
@@ -23,13 +23,14 @@
|
|||||||
@focus="onFocusText"
|
@focus="onFocusText"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<label v-if="right" class="col-6 col-form-label">{{ title }}</label>
|
<label v-if="right && title" class="col col-form-label">{{ title }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
<small class="form-text text-muted"><slot /></small>
|
<small class="form-text text-muted"><slot /></small>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { clamp } from "lodash";
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -47,7 +48,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: false,
|
||||||
|
default: null,
|
||||||
},
|
},
|
||||||
min: {
|
min: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -97,11 +99,23 @@ export default defineComponent({
|
|||||||
this.rawValue = Math.floor(this.rawValue);
|
this.rawValue = Math.floor(this.rawValue);
|
||||||
}
|
}
|
||||||
this.printValue = this.rawValue.toLocaleString();
|
this.printValue = this.rawValue.toLocaleString();
|
||||||
|
if (this.min !== undefined || this.max !== undefined) {
|
||||||
|
const clampedValue = clamp(this.rawValue, this.min ?? this.rawValue, this.max ?? this.rawValue);
|
||||||
|
this.$emit("update:modelValue", clampedValue);
|
||||||
|
} else {
|
||||||
this.$emit("update:modelValue", this.rawValue);
|
this.$emit("update:modelValue", this.rawValue);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onBlurNumber() {
|
onBlurNumber() {
|
||||||
this.editmode = false;
|
this.editmode = false;
|
||||||
this.printValue = this.rawValue.toLocaleString();
|
this.printValue = this.rawValue.toLocaleString();
|
||||||
|
if (this.min !== undefined || this.max !== undefined) {
|
||||||
|
const clampedValue = clamp(this.rawValue, this.min ?? this.rawValue, this.max ?? this.rawValue);
|
||||||
|
if (clampedValue !== this.rawValue) {
|
||||||
|
this.rawValue = clampedValue;
|
||||||
|
this.updateValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onFocusText() {
|
onFocusText() {
|
||||||
if (this.readonly) {
|
if (this.readonly) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export type BasicResourceAuctionInfo = {
|
|||||||
amount: number;
|
amount: number;
|
||||||
startBidAmount: number;
|
startBidAmount: number;
|
||||||
finishBidAmount: number;
|
finishBidAmount: number;
|
||||||
highestBid: BasicResourceAuctionBidder;
|
highestBid?: BasicResourceAuctionBidder;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UniqueItemAuctionBidder = {
|
export type UniqueItemAuctionBidder = {
|
||||||
@@ -57,6 +57,7 @@ export type UniqueItemAuctionDetail = ValidResponse & {
|
|||||||
auction: UniqueItemAuctionInfo;
|
auction: UniqueItemAuctionInfo;
|
||||||
bidList: UniqueItemAuctionBidder[];
|
bidList: UniqueItemAuctionBidder[];
|
||||||
obfuscatedName: string;
|
obfuscatedName: string;
|
||||||
|
remainPoint: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OpenAuctionResponse = ValidResponse & {
|
export type OpenAuctionResponse = ValidResponse & {
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -23,14 +23,31 @@
|
|||||||
현재 피장파장이 불가능한 국가는
|
현재 피장파장이 불가능한 국가는
|
||||||
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
|
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row gx-3">
|
||||||
<div class="col-6 col-md-3">
|
<div class="col-5 col-md-3">
|
||||||
국가 :
|
국가 :
|
||||||
<SelectNation v-model="selectedNationID" :nations="nationList" :searchable="searchable" />
|
<SelectNation v-model="selectedNationID" :nations="nationList" :searchable="searchable" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 col-md-2">
|
<div class="col-4 col-md-2">
|
||||||
<label>전략 :</label>
|
<label>전략 :</label>
|
||||||
<b-form-select v-model="selectedCommandID" :options="commandTypesOption" />
|
<select
|
||||||
|
v-model="selectedCommandID"
|
||||||
|
class="form-control"
|
||||||
|
:style="{
|
||||||
|
color: availableCommandTypeList[selectedCommandID].remainTurn > 0 ? 'red' : undefined,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for="(command, commandRawName) in availableCommandTypeList"
|
||||||
|
:key="commandRawName"
|
||||||
|
:value="commandRawName"
|
||||||
|
:style="{
|
||||||
|
color: command.remainTurn > 0 ? 'red' : 'black',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ command.name }} {{ command.remainTurn > 0 ? `(불가, ${command.remainTurn}턴)` : "" }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 col-md-2 d-grid">
|
<div class="col-3 col-md-2 d-grid">
|
||||||
<b-button @click="submit">
|
<b-button @click="submit">
|
||||||
@@ -56,7 +73,7 @@ declare const procRes: {
|
|||||||
delayCnt: number;
|
delayCnt: number;
|
||||||
postReqTurn: number;
|
postReqTurn: number;
|
||||||
availableCommandTypeList: Record<
|
availableCommandTypeList: Record<
|
||||||
number,
|
string,
|
||||||
{
|
{
|
||||||
name: string;
|
name: string;
|
||||||
remainTurn: number;
|
remainTurn: number;
|
||||||
@@ -98,7 +115,6 @@ void Promise.all([storeP]).then(() => {
|
|||||||
asyncReady.value = true;
|
asyncReady.value = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const nationList = new Map<number, procNationItem>();
|
const nationList = new Map<number, procNationItem>();
|
||||||
for (const nationItem of procRes.nationList) {
|
for (const nationItem of procRes.nationList) {
|
||||||
nationList.set(nationItem.id, nationItem);
|
nationList.set(nationItem.id, nationItem);
|
||||||
@@ -111,19 +127,8 @@ const map = ref<MapResult>();
|
|||||||
const delayCnt = procRes.delayCnt;
|
const delayCnt = procRes.delayCnt;
|
||||||
const postReqTurn = procRes.postReqTurn;
|
const postReqTurn = procRes.postReqTurn;
|
||||||
|
|
||||||
const commandTypesOption: { html: string; value: string }[] = [];
|
const availableCommandTypeList = procRes.availableCommandTypeList;
|
||||||
for (const [commandTypeID, commandTypeInfo] of Object.entries(procRes.availableCommandTypeList)) {
|
const selectedCommandID = ref(Object.keys(availableCommandTypeList)[0]);
|
||||||
const notAvailable = commandTypeInfo.remainTurn > 0;
|
|
||||||
const notAvailableText = notAvailable ? " (불가)" : "";
|
|
||||||
const name = `${commandTypeInfo.name}${notAvailableText}`;
|
|
||||||
const html = notAvailable ? `<span style='color:red;'>${name}</span>` : name;
|
|
||||||
commandTypesOption.push({
|
|
||||||
html,
|
|
||||||
value: commandTypeID,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectedCommandID = ref(Object.keys(procRes.availableCommandTypeList)[0]);
|
|
||||||
|
|
||||||
async function submit(e: Event) {
|
async function submit(e: Event) {
|
||||||
const event = new CustomEvent<Args>("customSubmit", {
|
const event = new CustomEvent<Args>("customSubmit", {
|
||||||
|
|||||||
@@ -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;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -6,9 +6,18 @@ import { auto500px } from "./util/auto500px";
|
|||||||
import { insertCustomCSS } from "./util/customCSS";
|
import { insertCustomCSS } from "./util/customCSS";
|
||||||
import { htmlReady } from "./util/htmlReady";
|
import { htmlReady } from "./util/htmlReady";
|
||||||
|
|
||||||
|
declare const staticValues: {
|
||||||
|
serverID: string,
|
||||||
|
turnterm: number,
|
||||||
|
serverNick: string,
|
||||||
|
isResAuction: boolean,
|
||||||
|
};
|
||||||
|
|
||||||
auto500px();
|
auto500px();
|
||||||
|
|
||||||
htmlReady(() => {
|
htmlReady(() => {
|
||||||
insertCustomCSS();
|
insertCustomCSS();
|
||||||
});
|
});
|
||||||
createApp(PageAuction).use(BootstrapVue3).use(BToastPlugin).mount('#app')
|
createApp(PageAuction, {
|
||||||
|
isResAuction: staticValues.isResAuction,
|
||||||
|
}).use(BootstrapVue3).use(BToastPlugin).mount('#app')
|
||||||
@@ -11,6 +11,8 @@ $userID = Session::getUserID();
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
|
$isResAuction = Util::getReq('type') !== 'unique';
|
||||||
|
|
||||||
$me = $db->queryFirstRow('SELECT no, nation, officer_level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
$me = $db->queryFirstRow('SELECT no, nation, officer_level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -28,6 +30,7 @@ $me = $db->queryFirstRow('SELECT no, nation, officer_level, permission, con, tur
|
|||||||
'serverID' => UniqueConst::$serverID,
|
'serverID' => UniqueConst::$serverID,
|
||||||
'serverNick' => DB::prefix(),
|
'serverNick' => DB::prefix(),
|
||||||
'turnterm' => $gameStor->turnterm,
|
'turnterm' => $gameStor->turnterm,
|
||||||
|
'isResAuction' => $isResAuction,
|
||||||
]
|
]
|
||||||
]) ?>
|
]) ?>
|
||||||
<?= WebUtil::printDist('vue', 'v_auction', true) ?>
|
<?= WebUtil::printDist('vue', 'v_auction', true) ?>
|
||||||
|
|||||||
@@ -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