내특을 int에서 string으로 변경
This commit is contained in:
+1
-1
@@ -178,7 +178,7 @@ for ($j=0; $j < $gencount; $j++) {
|
|||||||
<td align=center>$name</td>
|
<td align=center>$name</td>
|
||||||
<td align=center>{$general['age']}세</td>
|
<td align=center>{$general['age']}세</td>
|
||||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
<td align=center>".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."</td>
|
||||||
<td align=center>Lv ".getExpLevel($general['experience'])."</td>
|
<td align=center>Lv ".getExpLevel($general['experience'])."</td>
|
||||||
<td align=center>{$nation}</td>
|
<td align=center>{$nation}</td>
|
||||||
<td align=center>".getHonor($general['experience'])."</td>
|
<td align=center>".getHonor($general['experience'])."</td>
|
||||||
|
|||||||
+1
-1
@@ -111,7 +111,7 @@ for ($j=0; $j < $gencount; $j++) {
|
|||||||
<td align=center>Lv {$general['explevel']}</td>
|
<td align=center>Lv {$general['explevel']}</td>
|
||||||
<td align=center>{$nation}</td>
|
<td align=center>{$nation}</td>
|
||||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
<td align=center>".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."</td>
|
||||||
<td align=center>{$general['sum']}</td>
|
<td align=center>{$general['sum']}</td>
|
||||||
<td align=center>{$general['leader']}</td>
|
<td align=center>{$general['leader']}</td>
|
||||||
<td align=center>{$general['power']}</td>
|
<td align=center>{$general['power']}</td>
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ $bidCount = MYDB_num_rows($result);
|
|||||||
|
|
||||||
$btCount = $tradeCount + $bidCount;
|
$btCount = $tradeCount + $bidCount;
|
||||||
|
|
||||||
if ($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
|
if ($session->userGrade >= 5) {
|
||||||
$btn = "submit";
|
$btn = "submit";
|
||||||
} else {
|
} else {
|
||||||
$btn = "hidden";
|
$btn = "hidden";
|
||||||
|
|||||||
+1
-1
@@ -186,7 +186,7 @@ for($j=0; $j < $gencount; $j++) {
|
|||||||
<td align=center>{$general['gold']}</td>
|
<td align=center>{$general['gold']}</td>
|
||||||
<td align=center>{$general['rice']}</td>
|
<td align=center>{$general['rice']}</td>
|
||||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
<td align=center>".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."</td>
|
||||||
<td align=center>{$general['belong']}</td>
|
<td align=center>{$general['belong']}</td>
|
||||||
<td align=center>{$general['connect']}"; echo "<br>(".getConnect($general['connect']).")</td>
|
<td align=center>{$general['connect']}"; echo "<br>(".getConnect($general['connect']).")</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ $startYear = $gameStor->getValue('startyear');
|
|||||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/download2.js')?>
|
<?=WebUtil::printJS('../e_lib/download2.js')?>
|
||||||
<?=WebUtil::printJS('js/common.js')?>
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<script>
|
||||||
|
var defaultSpecial = <?=GameConst::$defaultSpecial?>;
|
||||||
|
</script>
|
||||||
<?=WebUtil::printJS('js/battle_simulator.js')?>
|
<?=WebUtil::printJS('js/battle_simulator.js')?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ if ($term > 24) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$valid = 1;
|
$valid = 1;
|
||||||
if ($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
|
if ($session->userGrade >= 5) {
|
||||||
} else {
|
} else {
|
||||||
$msg = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
||||||
|
|||||||
+12
-14
@@ -595,7 +595,7 @@ function commandTable() {
|
|||||||
addCommand("단련(자금$develcost, 군량$develcost)", 41, 0);
|
addCommand("단련(자금$develcost, 군량$develcost)", 41, 0);
|
||||||
}
|
}
|
||||||
addCommand("견문(자금?, 군량?, 경험치?)", 42);
|
addCommand("견문(자금?, 군량?, 경험치?)", 42);
|
||||||
if($city['trade'] > 0 || $me['special'] == 30) {
|
if($city['trade'] > 0) {
|
||||||
addCommand("장비매매", 48);
|
addCommand("장비매매", 48);
|
||||||
addCommand("군량매매", 49);
|
addCommand("군량매매", 49);
|
||||||
} else {
|
} else {
|
||||||
@@ -847,8 +847,8 @@ function generalInfo($no) {
|
|||||||
else { $general['age'] = "<font color=red>{$general['age']} 세</font>"; }
|
else { $general['age'] = "<font color=red>{$general['age']} 세</font>"; }
|
||||||
|
|
||||||
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
||||||
$special = $general['special'] == 0 ? "{$general['specage']}세" : "<font color=limegreen>".displaySpecialInfo($general['special'])."</font>";
|
$special = $general['special'] == GameConst::$defaultSpecial ? "{$general['specage']}세" : "<font color=limegreen>".displaySpecialDomesticInfo($general['special'])."</font>";
|
||||||
$special2 = $general['special2'] == 0 ? "{$general['specage2']}세" : "<font color=limegreen>".displaySpecialInfo($general['special2'])."</font>";
|
$special2 = $general['special2'] == 0 ? "{$general['specage2']}세" : "<font color=limegreen>".displaySpecialWarInfo($general['special2'])."</font>";
|
||||||
|
|
||||||
switch($general['personal']) {
|
switch($general['personal']) {
|
||||||
case 2: case 4:
|
case 2: case 4:
|
||||||
@@ -1732,19 +1732,17 @@ function addAge() {
|
|||||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||||
|
|
||||||
if($admin['year'] >= $admin['startyear']+3) {
|
if($admin['year'] >= $admin['startyear']+3) {
|
||||||
$query = "select no,name,nation,leader,power,intel from general where specage<=age and special='0'";
|
foreach($db->query('SELECT no,name,nation,leader,power,intel from general where specage<=age and special=%s', GameConst::$defaultSpecial) as $general){
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gencount = MYDB_num_rows($result);
|
|
||||||
|
|
||||||
for($i=0; $i < $gencount; $i++) {
|
|
||||||
$general = MYDB_fetch_array($result);
|
|
||||||
$special = getSpecial($general['leader'], $general['power'], $general['intel']);
|
$special = getSpecial($general['leader'], $general['power'], $general['intel']);
|
||||||
$query = "update general set special='$special' where no='{$general['no']}'";
|
$specialClass = getGeneralSpecialDomesticClass($special);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$specialText = $specialClass::$name;
|
||||||
|
$db->update('general', [
|
||||||
|
'special'=>$special
|
||||||
|
], 'no=%i',$general['no']);
|
||||||
|
|
||||||
$josaUl = JosaUtil::pick($special, '을');
|
$josaUl = JosaUtil::pick($specialText, '을');
|
||||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>".getGenSpecial($special)."</></b>】{$josaUl} 습득");
|
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>{$specialText}</></b>】{$josaUl} 습득");
|
||||||
pushGenLog($general, "<C>●</>특기 【<b><L>".getGenSpecial($special)."</></b>】{$josaUl} 익혔습니다!");
|
pushGenLog($general, "<C>●</>특기 【<b><L>{$specialText}</></b>】{$josaUl} 익혔습니다!");
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "select no,name,nation,leader,power,intel,npc,dex0,dex10,dex20,dex30,dex40 from general where specage2<=age and special2='0'";
|
$query = "select no,name,nation,leader,power,intel,npc,dex0,dex10,dex20,dex30,dex40 from general where specage2<=age and special2='0'";
|
||||||
|
|||||||
+27
-34
@@ -123,20 +123,6 @@ function getCharInfo(?int $type):?string {
|
|||||||
|
|
||||||
function getGenSpecial($type) {
|
function getGenSpecial($type) {
|
||||||
switch($type) {
|
switch($type) {
|
||||||
case 0: $call = '-'; break;
|
|
||||||
case 1: $call = '경작'; break;
|
|
||||||
case 2: $call = '상재'; break;
|
|
||||||
case 3: $call = '발명'; break;
|
|
||||||
|
|
||||||
case 10: $call = '축성'; break;
|
|
||||||
case 11: $call = '수비'; break;
|
|
||||||
case 12: $call = '통찰'; break;
|
|
||||||
|
|
||||||
case 20: $call = '인덕'; break;
|
|
||||||
|
|
||||||
case 30: $call = '거상'; break;
|
|
||||||
case 31: $call = '귀모'; break;
|
|
||||||
|
|
||||||
case 40: $call = '귀병'; break;
|
case 40: $call = '귀병'; break;
|
||||||
case 41: $call = '신산'; break;
|
case 41: $call = '신산'; break;
|
||||||
case 42: $call = '환술'; break;
|
case 42: $call = '환술'; break;
|
||||||
@@ -172,19 +158,6 @@ function getSpecialInfo(?int $type):?string{
|
|||||||
|
|
||||||
//앞칸은 '설명을 위해' '그냥' 적어둠
|
//앞칸은 '설명을 위해' '그냥' 적어둠
|
||||||
$infoText = [
|
$infoText = [
|
||||||
0 => ['-', null],
|
|
||||||
1 => ['경작', '[내정] 농지 개간 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
2 => ['상재', '[내정] 상업 투자 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
3 => ['발명', '[내정] 기술 연구 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
|
|
||||||
10 => ['축성', '[내정] 성벽 보수 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
11 => ['수비', '[내정] 수비 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
12 => ['통찰', '[내정] 치안 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
|
|
||||||
20 => ['인덕', '[내정] 주민 선정·정착 장려 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
|
||||||
|
|
||||||
31 => ['귀모', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
|
||||||
|
|
||||||
40 => ['귀병', '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p'],
|
40 => ['귀병', '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p'],
|
||||||
41 => ['신산', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p '],
|
41 => ['신산', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p '],
|
||||||
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
|
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
|
||||||
@@ -250,21 +223,41 @@ function getNationTypeClass(?string $type){
|
|||||||
$type = GameConst::$neutralNationType;
|
$type = GameConst::$neutralNationType;
|
||||||
}
|
}
|
||||||
|
|
||||||
static $path = __NAMESPACE__.'\\TriggerNationType\\';
|
static $basePath = __NAMESPACE__.'\\TriggerNationType\\';
|
||||||
$nationClass = ($path.$type);
|
$classPath = ($basePath.$type);
|
||||||
|
|
||||||
if(class_exists($nationClass)){
|
if(class_exists($classPath)){
|
||||||
return $nationClass;
|
return $classPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nationClass = ($path.'che_'.$type);
|
$classPath = ($basePath.'che_'.$type);
|
||||||
if(class_exists($nationClass)){
|
if(class_exists($classPath)){
|
||||||
return $nationClass;
|
return $classPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
new \InvalidArgumentException("{$type}은 올바른 국가 타입 클래스가 아님");
|
new \InvalidArgumentException("{$type}은 올바른 국가 타입 클래스가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGeneralSpecialDomesticClass(?string $type){
|
||||||
|
if($type === null){
|
||||||
|
$type = GameConst::$defaultSpecial;
|
||||||
|
}
|
||||||
|
|
||||||
|
static $basePath = __NAMESPACE__.'\\TriggerSpecialDomestic\\';
|
||||||
|
$classPath = ($basePath.$type);
|
||||||
|
|
||||||
|
if(class_exists($classPath)){
|
||||||
|
return $classPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
$classPath = ($basePath.'che_'.$type);
|
||||||
|
if(class_exists($classPath)){
|
||||||
|
return $classPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
new \InvalidArgumentException("{$type}은 올바른 내정 특기가 아님");
|
||||||
|
}
|
||||||
|
|
||||||
function getLevel($level, $nlevel=8) {
|
function getLevel($level, $nlevel=8) {
|
||||||
if($level >= 0 && $level <= 4) { $nlevel = 0; }
|
if($level >= 0 && $level <= 4) { $nlevel = 0; }
|
||||||
$code = $nlevel * 100 + $level;
|
$code = $nlevel * 100 + $level;
|
||||||
|
|||||||
+10
-9
@@ -64,36 +64,37 @@ function getCityLevelList():array{
|
|||||||
// 20 인덕 = 1 통솔내정
|
// 20 인덕 = 1 통솔내정
|
||||||
// 30 거상, 귀모 = 2 공통내정
|
// 30 거상, 귀모 = 2 공통내정
|
||||||
|
|
||||||
|
//TODO: 클래스로 이동
|
||||||
function getSpecial($leader, $power, $intel) {
|
function getSpecial($leader, $power, $intel) {
|
||||||
//통장
|
//통장
|
||||||
if($leader*0.9 > $power && $leader*0.9 > $intel) {
|
if($leader*0.9 > $power && $leader*0.9 > $intel) {
|
||||||
$type = array(20, 31);
|
$type = array('che_인덕', 'che_귀모');
|
||||||
$special = $type[array_rand($type)];
|
$special = $type[array_rand($type)];
|
||||||
// 귀모는 50% * 5% = 2.5%
|
// 귀모는 50% * 5% = 2.5%
|
||||||
if($special == 31 && Util::randBool(0.95)) {
|
if($special == 31 && Util::randBool(0.95)) {
|
||||||
$special = 20;
|
$special = 'che_인덕';
|
||||||
}
|
}
|
||||||
//무장
|
//무장
|
||||||
} elseif($power >= $intel) {
|
} elseif($power >= $intel) {
|
||||||
$type = array(10, 11, 12, 31);
|
$type = array('che_축성', 'che_수비', 'che_통찰', 'che_귀모');
|
||||||
$special = $type[array_rand($type)];
|
$special = $type[array_rand($type)];
|
||||||
// 귀모는 그중에 25% * 10% = 2.5%
|
// 귀모는 그중에 25% * 10% = 2.5%
|
||||||
if($special == 31 && Util::randBool(0.9)) {
|
if($special == 'che_귀모' && Util::randBool(0.9)) {
|
||||||
$type = array(10, 11, 12);
|
$type = array('che_축성', 'che_수비', 'che_통찰');
|
||||||
$special = $type[array_rand($type)];
|
$special = $type[array_rand($type)];
|
||||||
}
|
}
|
||||||
//지장
|
//지장
|
||||||
} elseif($intel > $power) {
|
} elseif($intel > $power) {
|
||||||
$type = array(1, 2, 3, 31);
|
$type = array('che_상재', 'che_경작', 'che_발명', 'che_귀모');
|
||||||
$special = $type[array_rand($type)];
|
$special = $type[array_rand($type)];
|
||||||
// 거상, 귀모는 그중에 25% * 10% = 2.5%
|
// 거상, 귀모는 그중에 25% * 10% = 2.5%
|
||||||
if($special == 31 && Util::randBool(0.9)) {
|
if($special == 'che_귀모' && Util::randBool(0.9)) {
|
||||||
$type = array(1, 2, 3);
|
$type = array('che_상재', 'che_경작', 'che_발명');
|
||||||
$special = $type[array_rand($type)];
|
$special = $type[array_rand($type)];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//귀모. 다만 이쪽으로 빠지지 않음.
|
//귀모. 다만 이쪽으로 빠지지 않음.
|
||||||
$type = 31;
|
$special = 'che_귀모';
|
||||||
}
|
}
|
||||||
return $special;
|
return $special;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-15
@@ -2300,10 +2300,7 @@ function process_48(&$general) {
|
|||||||
if($isweap == 3) { $cost = getItemCost2($type); }
|
if($isweap == 3) { $cost = getItemCost2($type); }
|
||||||
else { $cost = getItemCost($type); }
|
else { $cost = getItemCost($type); }
|
||||||
|
|
||||||
//특기 보정 : 거상
|
if($city['trade'] == 0) {
|
||||||
if($general['special'] == 30 && $type != 0) { $cost *= 0.5; }
|
|
||||||
|
|
||||||
if($city['trade'] == 0 && $general['special'] != 30) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:도시에 상인이 없습니다. 장비매매 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:도시에 상인이 없습니다. 장비매매 실패. <1>$date</>";
|
||||||
} elseif($city['secu']/1000 < $type) {
|
} elseif($city['secu']/1000 < $type) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:이 도시에서는 구할 수 없었습니다. 구입 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:이 도시에서는 구할 수 없었습니다. 구입 실패. <1>$date</>";
|
||||||
@@ -2415,7 +2412,7 @@ function process_49(&$general) {
|
|||||||
if($amount < 100) { $amount = 100; }
|
if($amount < 100) { $amount = 100; }
|
||||||
elseif($amount > 10000) { $amount = 10000; }
|
elseif($amount > 10000) { $amount = 10000; }
|
||||||
|
|
||||||
if($city['trade'] == 0 && ($general['special'] == 30 || $general['npc'] >= 2)) {
|
if($city['trade'] == 0 && $general['npc'] >= 2) {
|
||||||
$city['trade'] = 100;
|
$city['trade'] = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2427,26 +2424,17 @@ function process_49(&$general) {
|
|||||||
$dtype = "군량 판매";
|
$dtype = "군량 판매";
|
||||||
if($general['rice'] < $amount) { $amount = $general['rice']; }
|
if($general['rice'] < $amount) { $amount = $general['rice']; }
|
||||||
$cost = $amount * $city['trade'] / 100;
|
$cost = $amount * $city['trade'] / 100;
|
||||||
//특기 보정 : 거상
|
|
||||||
if($general['special'] == 30 && $city['trade'] > 100) { $cost = $amount * (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득
|
|
||||||
if($general['special'] == 30 && $city['trade'] < 100) { $cost = $amount * (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해
|
|
||||||
$tax = $cost * GameConst::$exchangeFee;
|
$tax = $cost * GameConst::$exchangeFee;
|
||||||
$cost = $cost - $tax;
|
$cost = $cost - $tax;
|
||||||
} elseif($type == 2) {
|
} elseif($type == 2) {
|
||||||
$dtype = "군량 구입";
|
$dtype = "군량 구입";
|
||||||
$cost = $amount * $city['trade'] / 100;
|
$cost = $amount * $city['trade'] / 100;
|
||||||
//특기 보정 : 거상
|
|
||||||
if($general['special'] == 30 && $city['trade'] < 100) { $cost = $amount * (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득
|
|
||||||
if($general['special'] == 30 && $city['trade'] > 100) { $cost = $amount * (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해
|
|
||||||
$tax = $cost * GameConst::$exchangeFee;
|
$tax = $cost * GameConst::$exchangeFee;
|
||||||
$cost = $cost + $tax;
|
$cost = $cost + $tax;
|
||||||
if($general['gold'] < $cost) {
|
if($general['gold'] < $cost) {
|
||||||
$cost = $general['gold'];
|
$cost = $general['gold'];
|
||||||
$tax = $cost * GameConst::$exchangeFee;
|
$tax = $cost * GameConst::$exchangeFee;
|
||||||
$amount = ($cost-$tax) * 100 / $city['trade'];
|
$amount = ($cost-$tax) * 100 / $city['trade'];
|
||||||
//특기 보정 : 거상
|
|
||||||
if($general['special'] == 30 && $city['trade'] < 100) { $amount = ($cost-$tax) / (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득
|
|
||||||
if($general['special'] == 30 && $city['trade'] > 100) { $amount = ($cost-$tax) / (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2454,7 +2442,7 @@ function process_49(&$general) {
|
|||||||
$amount = Util::round($amount);
|
$amount = Util::round($amount);
|
||||||
$tax = Util::round($tax);
|
$tax = Util::round($tax);
|
||||||
|
|
||||||
if($city['trade'] == 0 && $general['special'] != 30 && $general['npc'] < 2) {
|
if($city['trade'] == 0 && $general['npc'] < 2) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:도시에 상인이 없습니다. $dtype 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:도시에 상인이 없습니다. $dtype 실패. <1>$date</>";
|
||||||
} elseif($general['nation'] != $city['nation'] && $nation['level'] != 0) {
|
} elseif($general['nation'] != $city['nation'] && $nation['level'] != 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. $dtype 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. $dtype 실패. <1>$date</>";
|
||||||
|
|||||||
+14
-1
@@ -76,7 +76,7 @@ function displayCharInfo(?int $type):string{
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function displaySpecialInfo(?int $type):string{
|
function displaySpecialWarInfo(?int $type):string{
|
||||||
$info = getSpecialInfo($type);
|
$info = getSpecialInfo($type);
|
||||||
$text = getGenSpecial($type);
|
$text = getGenSpecial($type);
|
||||||
|
|
||||||
@@ -88,6 +88,19 @@ function displaySpecialInfo(?int $type):string{
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function displaySpecialDomesticInfo(?string $type):string{
|
||||||
|
$class = getGeneralSpecialDomesticClass($type);
|
||||||
|
$info = $class::$info;
|
||||||
|
$name = $class::$name;
|
||||||
|
|
||||||
|
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||||
|
|
||||||
|
return $templates->render('tooltip', [
|
||||||
|
'text'=>$name,
|
||||||
|
'info'=>$info,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
function displayItemInfo(?int $type):string{
|
function displayItemInfo(?int $type):string{
|
||||||
$info = getItemInfo($type);
|
$info = getItemInfo($type);
|
||||||
$text = getItemName($type);
|
$text = getItemName($type);
|
||||||
|
|||||||
+8
-16
@@ -17,15 +17,11 @@ function processSpring() {
|
|||||||
$query = "update city set dead=0,agri=agri*0.99,comm=comm*0.99,secu=secu*0.99,def=def*0.99,wall=wall*0.99";
|
$query = "update city set dead=0,agri=agri*0.99,comm=comm*0.99,secu=secu*0.99,def=def*0.99,wall=wall*0.99";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// 유지비 1% 거상 0.5%
|
// 유지비 1%
|
||||||
$query = "update general set gold=gold*0.99 where gold>1000 and gold<=10000 and special!=30";
|
$query = "update general set gold=gold*0.99 where gold>1000 and gold<=10000";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$query = "update general set gold=gold*0.995 where gold>1000 and gold<=10000 and special=30";
|
// 유지비 3%
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$query = "update general set gold=gold*0.97 where gold>10000";
|
||||||
// 유지비 3% 거상 1.5%
|
|
||||||
$query = "update general set gold=gold*0.97 where gold>10000 and special!=30";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set gold=gold*0.985 where gold>10000 and special=30";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// 유지비 1%
|
// 유지비 1%
|
||||||
@@ -343,15 +339,11 @@ function processFall() {
|
|||||||
$query = "update city set dead=0,agri=agri*0.99,comm=comm*0.99,secu=secu*0.99,def=def*0.99,wall=wall*0.99";
|
$query = "update city set dead=0,agri=agri*0.99,comm=comm*0.99,secu=secu*0.99,def=def*0.99,wall=wall*0.99";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// 유지비 3% 거상 1.5%
|
// 유지비 3%
|
||||||
$query = "update general set rice=rice*0.97 where rice>10000 and special!=30";
|
$query = "update general set rice=rice*0.97 where rice>10000";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$query = "update general set rice=rice*0.985 where rice>10000 and special=30";
|
// 유지비 1%
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$query = "update general set rice=rice*0.99 where rice>1000 and rice<=10000";
|
||||||
// 유지비 1% 거상 0.5%
|
|
||||||
$query = "update general set rice=rice*0.99 where rice>1000 and rice<=10000 and special!=30";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set rice=rice*0.995 where rice>1000 and rice<=10000 and special=30";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 유지비 5%
|
// 유지비 5%
|
||||||
$query = "update nation set rice=rice*0.95 where rice>100000";
|
$query = "update nation set rice=rice*0.95 where rice>100000";
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ $candidates = [];
|
|||||||
|
|
||||||
$weight = [];
|
$weight = [];
|
||||||
foreach($db->query('SELECT `no`, `name`, leader, power, intel, imgsvr, picture, special, special2 FROM general WHERE npc=2') as $general){
|
foreach($db->query('SELECT `no`, `name`, leader, power, intel, imgsvr, picture, special, special2 FROM general WHERE npc=2') as $general){
|
||||||
$general['special'] = \sammo\SpecialityConst::DOMESTIC[$general['special']][0]??'-';
|
$general['special'] = (getGeneralSpecialDomesticClass($general['special']))::$name;
|
||||||
$general['special2'] = \sammo\SpecialityConst::WAR[$general['special2']][0]??'-';
|
$general['special2'] = \sammo\SpecialityConst::WAR[$general['special2']][0]??'-';
|
||||||
$candidates[$general['no']] = $general + ['keepCnt'=>KEEP_CNT];
|
$candidates[$general['no']] = $general + ['keepCnt'=>KEEP_CNT];
|
||||||
$allStat = $general['leader'] + $general['power'] + $general['intel'];
|
$allStat = $general['leader'] + $general['power'] + $general['intel'];
|
||||||
|
|||||||
+1
-1
@@ -166,7 +166,7 @@ if ($genius) {
|
|||||||
}
|
}
|
||||||
//내특
|
//내특
|
||||||
$specage = Util::round((80 - $age)/12) + $age;
|
$specage = Util::round((80 - $age)/12) + $age;
|
||||||
$special = 0;
|
$special = GameConst::$defaultSpecial;
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['scenario', 'turnterm', 'show_img_level']);
|
$admin = $gameStor->getValues(['scenario', 'turnterm', 'show_img_level']);
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ jQuery(function($){
|
|||||||
nation: (generalData.no)<=1 ? 1 : 2,
|
nation: (generalData.no)<=1 ? 1 : 2,
|
||||||
city: (generalData.no)<=1 ? 1 : 3,
|
city: (generalData.no)<=1 ? 1 : 3,
|
||||||
turntime:'2018-08-26 12:00',
|
turntime:'2018-08-26 12:00',
|
||||||
special:0,
|
special:defaultSpecial,
|
||||||
leader2:0,
|
leader2:0,
|
||||||
power2:0,
|
power2:0,
|
||||||
intel2:0,
|
intel2:0,
|
||||||
|
|||||||
@@ -99,6 +99,12 @@ class GameConstBase
|
|||||||
'che_도적', 'che_명가', 'che_음양가', 'che_종횡가', 'che_불가', 'che_오두미도', 'che_태평도', 'che_도가',
|
'che_도적', 'che_명가', 'che_음양가', 'che_종횡가', 'che_불가', 'che_오두미도', 'che_태평도', 'che_도가',
|
||||||
'che_묵가', 'che_덕가', 'che_병가', 'che_유가', 'che_법가'
|
'che_묵가', 'che_덕가', 'che_병가', 'che_유가', 'che_법가'
|
||||||
];
|
];
|
||||||
|
/** @var array 기본 국가 성향 */
|
||||||
public static $neutralNationType = 'che_중립';
|
public static $neutralNationType = 'che_중립';
|
||||||
|
/** @var array 선택 가능한 장수 내정 특기 */
|
||||||
|
public static $availableSpecialDomestic = [
|
||||||
|
'che_경작', 'che_상재', 'che_발명', 'che_축성', 'che_수비', 'che_통찰', 'che_인덕', 'che_귀모',
|
||||||
|
];
|
||||||
|
/** @var array 기본 특기(공용) */
|
||||||
|
public static $defaultSpecial = 'None';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class General{
|
|||||||
|
|
||||||
protected $nationType;
|
protected $nationType;
|
||||||
protected $levelObj;
|
protected $levelObj;
|
||||||
|
protected $specialDomesticObj;
|
||||||
|
|
||||||
public function __construct(array $raw, ?array $city, int $year, int $month){
|
public function __construct(array $raw, ?array $city, int $year, int $month){
|
||||||
//TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함.
|
//TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class NPC{
|
|||||||
public $birth;
|
public $birth;
|
||||||
public $death;
|
public $death;
|
||||||
public $ego;
|
public $ego;
|
||||||
public $charDomestic = 0;
|
public $charDomestic;
|
||||||
public $charWar = 0;
|
public $charWar = 0;
|
||||||
public $npc = 2;
|
public $npc = 2;
|
||||||
public $text;
|
public $text;
|
||||||
@@ -62,6 +62,8 @@ class NPC{
|
|||||||
'intel'=>$intel
|
'intel'=>$intel
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$this->charDomestic = \sammo\GameConst::$defaultSpecial;
|
||||||
|
|
||||||
if($char === '랜덤전특'){
|
if($char === '랜덤전특'){
|
||||||
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
|
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
|
||||||
}
|
}
|
||||||
@@ -76,13 +78,17 @@ class NPC{
|
|||||||
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
|
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else if($char !== null){
|
||||||
$char = \sammo\SpecCall($char);
|
|
||||||
if($char < 40){
|
|
||||||
$this->charDomestic = $char;
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$this->charWar = $char;
|
//TODO: 내특, 전특 구분 필요
|
||||||
|
|
||||||
|
try{
|
||||||
|
$domesticClass = \sammo\getGeneralSpecialDomesticClass($char);
|
||||||
|
$this->charDomestic = Util::getClassName($domesticClass);
|
||||||
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
$this->charWar = \sammo\SpecCall($char);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,7 +159,7 @@ class NPC{
|
|||||||
|
|
||||||
if($isFictionMode){
|
if($isFictionMode){
|
||||||
$charWar = 0;
|
$charWar = 0;
|
||||||
$charDomestic = 0;
|
$charDomestic = GameConst::$defaultSpecial;
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = 'ⓝ'.$this->name;
|
$name = 'ⓝ'.$this->name;
|
||||||
|
|||||||
@@ -29,18 +29,17 @@ class SpecialityConst{
|
|||||||
|
|
||||||
//음수 : 절대값 %, 양수 : 상대적 비중
|
//음수 : 절대값 %, 양수 : 상대적 비중
|
||||||
const DOMESTIC = [
|
const DOMESTIC = [
|
||||||
1 => ['경작', 1, [self::STAT_INTEL]],
|
'che_경작' => ['경작', 1, [self::STAT_INTEL]],
|
||||||
2 => ['상재', 1, [self::STAT_INTEL]],
|
'che_상재' => ['상재', 1, [self::STAT_INTEL]],
|
||||||
3 => ['발명', 1, [self::STAT_INTEL]],
|
'che_발명' => ['발명', 1, [self::STAT_INTEL]],
|
||||||
|
|
||||||
10 => ['축성', 1, [self::STAT_POWER]],
|
'che_축성' => ['축성', 1, [self::STAT_POWER]],
|
||||||
11 => ['수비', 1, [self::STAT_POWER]],
|
'che_수비' => ['수비', 1, [self::STAT_POWER]],
|
||||||
12 => ['통찰', 1, [self::STAT_POWER]],
|
'che_통찰' => ['통찰', 1, [self::STAT_POWER]],
|
||||||
|
|
||||||
20 => ['인덕', 1, [self::STAT_LEADERSHIP]],
|
'che_인덕' => ['인덕', 1, [self::STAT_LEADERSHIP]],
|
||||||
|
|
||||||
30 => ['거상', -2.5, [self::DISABLED]],
|
'che_귀모' => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
31 => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const WAR = [
|
const WAR = [
|
||||||
@@ -162,7 +161,7 @@ class SpecialityConst{
|
|||||||
return array_keys($dex, max($dex))[0];
|
return array_keys($dex, max($dex))[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function pickSpecialDomestic(array $general) : int{
|
public static function pickSpecialDomestic(array $general) : string{
|
||||||
$pAbs = [];
|
$pAbs = [];
|
||||||
$pRel = [];
|
$pRel = [];
|
||||||
|
|
||||||
@@ -204,7 +203,7 @@ class SpecialityConst{
|
|||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return static::pickStatickWar($general);
|
throw new MustNotBeReachedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function pickSpecialWar(array $general) : int{
|
public static function pickSpecialWar(array $general) : int{
|
||||||
@@ -258,6 +257,6 @@ class SpecialityConst{
|
|||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return static::pickStatickWar($general);
|
throw new MustNotBeReachedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,8 +110,8 @@ class WarUnit{
|
|||||||
return $this->deadCurr;
|
return $this->deadCurr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSpecialDomestic():int{
|
function getSpecialDomestic():string{
|
||||||
return 0;
|
return GameConst::$defaultSpecial;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSpecialWar():int{
|
function getSpecialWar():int{
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return $this->rawCity[$key];
|
return $this->rawCity[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSpecialDomestic():int{
|
function getSpecialDomestic():string{
|
||||||
return $this->getVar('special');
|
return $this->getVar('special');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -37,10 +37,11 @@ $nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation
|
|||||||
var specialInfo =
|
var specialInfo =
|
||||||
<?php
|
<?php
|
||||||
$specialAll = [];
|
$specialAll = [];
|
||||||
foreach (SpecialityConst::DOMESTIC as $id=>$values) {
|
foreach (GameConst::$availableSpecialDomestic as $id) {
|
||||||
$name = $values[0];
|
$domesticClass = getGeneralSpecialDomesticClass($id);
|
||||||
$text = getSpecialInfo($id);
|
$name = $domesticClass::$name;
|
||||||
$specialAll[$name] = $text;
|
$info = $domesticClass::$info;
|
||||||
|
$specialAll[$name] = $info;
|
||||||
}
|
}
|
||||||
foreach (SpecialityConst::WAR as $id=>$values) {
|
foreach (SpecialityConst::WAR as $id=>$values) {
|
||||||
$name = $values[0];
|
$name = $values[0];
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ CREATE TABLE `general` (
|
|||||||
`belong` INT(2) NULL DEFAULT '1',
|
`belong` INT(2) NULL DEFAULT '1',
|
||||||
`betray` INT(2) NULL DEFAULT '0',
|
`betray` INT(2) NULL DEFAULT '0',
|
||||||
`personal` INT(2) NULL DEFAULT '0',
|
`personal` INT(2) NULL DEFAULT '0',
|
||||||
`special` INT(2) NULL DEFAULT '0',
|
`special` VARCHAR(20) NOT NULL DEFAULT 'None',
|
||||||
`specage` INT(2) NULL DEFAULT '0',
|
`specage` INT(2) NULL DEFAULT '0',
|
||||||
`special2` INT(2) NULL DEFAULT '0',
|
`special2` INT(2) NULL DEFAULT '0',
|
||||||
`specage2` INT(2) NULL DEFAULT '0',
|
`specage2` INT(2) NULL DEFAULT '0',
|
||||||
@@ -202,7 +202,7 @@ CREATE TABLE `nation` (
|
|||||||
`power` INT(8) NULL DEFAULT '0',
|
`power` INT(8) NULL DEFAULT '0',
|
||||||
`spy` CHAR(255) NOT NULL DEFAULT '{}',
|
`spy` CHAR(255) NOT NULL DEFAULT '{}',
|
||||||
`level` INT(1) NULL DEFAULT '0',
|
`level` INT(1) NULL DEFAULT '0',
|
||||||
`type` VARCHAR(16) NULL DEFAULT 'che_중립',
|
`type` VARCHAR(20) NOT NULL DEFAULT 'che_중립',
|
||||||
`rule` TEXT NULL DEFAULT '',
|
`rule` TEXT NULL DEFAULT '',
|
||||||
`history` MEDIUMTEXT NULL DEFAULT '',
|
`history` MEDIUMTEXT NULL DEFAULT '',
|
||||||
`board0` TEXT NULL DEFAULT '',
|
`board0` TEXT NULL DEFAULT '',
|
||||||
|
|||||||
@@ -451,4 +451,10 @@ class Util extends \utilphp\util
|
|||||||
{
|
{
|
||||||
return $items[array_rand($items)];
|
return $items[array_rand($items)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getClassName(string $classpath)
|
||||||
|
{
|
||||||
|
if ($pos = strrpos($classpath, '\\')) return substr($classpath, $pos + 1);
|
||||||
|
return $pos;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user