feat: 장수 생성 시 유산 포인트에 따라 생성해주는 기능 추가

This commit is contained in:
2021-09-12 02:59:49 +09:00
parent f510a312e3
commit d670dbf081
4 changed files with 276 additions and 191 deletions
+2 -2
View File
@@ -2158,7 +2158,7 @@ function getRandTurn($term, ?\DateTimeInterface $baseDateTime = null)
$randSecond = Util::randRangeInt(0, 60 * $term - 1); $randSecond = Util::randRangeInt(0, 60 * $term - 1);
$randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수 $randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수
return $baseDateTime->add(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s'); return $baseDateTime->add(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s.u');
} }
function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null) function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null)
@@ -2173,5 +2173,5 @@ function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null)
$randSecond = Util::randRangeInt(0, 60 * $term - 1); $randSecond = Util::randRangeInt(0, 60 * $term - 1);
$randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수 $randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수
return $baseDateTime->sub(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s'); return $baseDateTime->sub(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s.u');
} }
+12 -2
View File
@@ -1150,14 +1150,23 @@ function checkEmperior()
LogHistory(); LogHistory();
} }
function resetInheritanceUser(int $userID, bool $isRebirth=false){ function resetInheritanceUser(int $userID, bool $isRebirth=false):float{
$rebirthDegraded = [ $rebirthDegraded = [
'dex'=>0.5, 'dex'=>0.5,
]; ];
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}"); $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
$totalPoint = 0; $totalPoint = 0;
foreach($inheritStor->getAll() as $key=>[$value,]){ $allPoints = $inheritStor->getAll();
if(count($allPoints) == 0){
//비었으므로 리셋 안함
return 0;
}
if(count($allPoints) == 1 && key_exists('previous', $allPoints)){
//이미 리셋되었으므로 리셋 안함
return $allPoints['previous'];
}
foreach($allPoints as $key=>[$value,]){
if($isRebirth && key_exists($key, $rebirthDegraded)){ if($isRebirth && key_exists($key, $rebirthDegraded)){
$value *= $rebirthDegraded[$key]; $value *= $rebirthDegraded[$key];
} }
@@ -1166,6 +1175,7 @@ function resetInheritanceUser(int $userID, bool $isRebirth=false){
$totalPoint = Util::toInt($totalPoint); $totalPoint = Util::toInt($totalPoint);
$inheritStor->resetValues(); $inheritStor->resetValues();
$inheritStor->setValue('previous', [$totalPoint, null]); $inheritStor->setValue('previous', [$totalPoint, null]);
return $totalPoint;
} }
function updateMaxDomesticCritical(General $general, $score){ function updateMaxDomesticCritical(General $general, $score){
+200 -131
View File
@@ -1,39 +1,50 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
function dieMsg(string $msg)
{
$jmsg = Json::encode($msg);
echo "<html><head><style>html,body{background:black;}</style><script>alert({$jmsg});history.go(-1);</script></head><body></body></html>";
exit(1);
}
$v = new Validator($_POST); $v = new Validator($_POST);
$v $v
->rule('required', [ ->rule('required', [
'name', 'name',
'leadership', 'leadership',
'strength', 'strength',
'intel' 'intel'
]) ])
->rule('integer', [ ->rule('integer', [
'leadership', 'leadership',
'strength', 'strength',
'intel', 'intel',
]) ])
->rule('stringWidthBetween', 'name', 1, 18) ->rule('stringWidthBetween', 'name', 1, 18)
->rule('min', [ ->rule('min', [
'leadership', 'leadership',
'strength', 'strength',
'intel' 'intel'
], GameConst::$defaultStatMin) ], GameConst::$defaultStatMin)
->rule('max', [ ->rule('max', [
'leadership', 'leadership',
'strength', 'strength',
'intel' 'intel'
], GameConst::$defaultStatMax) ], GameConst::$defaultStatMax)
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random'])); ->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']))
->rule('in', 'inheritSpecial', GameConst::$availableSpecialWar)
->rule('integer', 'inheritTurntime')
->rule('min', 'inheritTurntime', 0)
->rule('in', 'inheritCity', array_keys(CityConst::all()))
->rule('integerArray', 'inheritBonusStat');
if (!$v->validate()) { if (!$v->validate()) {
MessageBox($v->errorStr()); dieMsg($v->errorStr());
echo "<script>history.go(-1);</script>";
exit(1);
} }
$session = Session::requireLogin()->setReadOnly(); $session = Session::requireLogin()->setReadOnly();
@@ -52,6 +63,11 @@ $leadership = Util::getPost('leadership', 'int', 50);
$strength = Util::getPost('strength', 'int', 50); $strength = Util::getPost('strength', 'int', 50);
$intel = Util::getPost('intel', 'int', 50); $intel = Util::getPost('intel', 'int', 50);
$inheritSpecial = Util::getPost('inheritSpecial');
$inheritTurntime = Util::getPost('inheritTurntime', 'int');
$inheritCity = Util::getPost('inheritCity', 'int');
$inheritBonusStat = Util::getPost('inheritBonusStat', 'array_int');
$join = Util::getPost('join'); //쓸모 없음 $join = Util::getPost('join'); //쓸모 없음
$rootDB = RootDB::db(); $rootDB = RootDB::db();
@@ -59,14 +75,12 @@ $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);
if (!$member) { if (!$member) {
MessageBox("잘못된 접근입니다!!!"); dieMsg("잘못된 접근입니다!!!");
echo "<script>history.go(-1);</script>";
exit(1);
} }
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->cacheValues(['year','month','maxgeneral','scenario','show_img_level','turnterm','turntime','genius','npcmode']); $gameStor->cacheValues(['year', 'month', 'maxgeneral', 'scenario', 'show_img_level', 'turnterm', 'turntime', 'genius', 'npcmode']);
########## 동일 정보 존재여부 확인. ########## ########## 동일 정보 존재여부 확인. ##########
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'); $gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
@@ -74,76 +88,110 @@ $oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i',
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name); $oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
if ($oldGeneral) { if ($oldGeneral) {
echo("<script> dieMsg("이미 등록하셨습니다!");
window.alert('이미 등록하셨습니다!')
history.go(-1)
</script>");
exit;
} }
if ($oldName) { if ($oldName) {
echo("<script> dieMsg("이미 있는 장수입니다. 다른 이름으로 등록해 주세요!");
window.alert('이미 있는 장수입니다. 다른 이름으로 등록해 주세요!')
history.go(-1)
</script>");
exit;
} }
if ($gameStor->maxgeneral <= $gencount) { if ($gameStor->maxgeneral <= $gencount) {
echo("<script> dieMsg("더이상 등록할 수 없습니다!");
window.alert('더이상 등록할 수 없습니다!')
history.go(-1)
</script>");
exit;
} }
if ($name == '') { if ($name == '') {
echo("<script> dieMsg("이름이 짧습니다. 다시 가입해주세요!");
window.alert('이름이 짧습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} }
if (mb_strwidth($name) > 18) { if (mb_strwidth($name) > 18) {
echo("<script> dieMsg("이름이 유효하지 않습니다. 다시 가입해주세요!");
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} }
if ($leadership + $strength + $intel > GameConst::$defaultStatTotal) { if ($leadership + $strength + $intel > GameConst::$defaultStatTotal) {
echo("<script> dieMsg("능력치가 " . GameConst::$defaultStatTotal . "을 넘어섰습니다. 다시 가입해주세요!");
window.alert('능력치가 ".GameConst::$defaultStatTotal."을 넘어섰습니다. 다시 가입해주세요!') }
history.go(-1)
</script>"); if ($inheritBonusStat) {
exit; if (count($inheritBonusStat) != 3) {
dieMsg("보너스 능력치가 잘못 지정되었습니다. 다시 가입해주세요!");
}
$sum = array_sum($inheritBonusStat);
if ($sum < 3 || $sum > 5) {
dieMsg("보너스 능력치 합이 잘못 지정되었습니다. 다시 가입해주세요!");
}
foreach ($inheritBonusStat as $stat) {
if ($stat < 0) {
dieMsg("보너스 능력치가 음수입니다. 다시 가입해주세요!");
}
}
}
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year']);
$inheritTotalPoint = resetInheritanceUser($userID);
$inheritRequiredPoint = 0;
if ($inheritCity !== null) {
$inheritRequiredPoint += GameConst::$inheritBornCityPoint;
}
if ($inheritBonusStat !== null) {
$inheritRequiredPoint += GameConst::$inheritBornMaxBonusStat;
}
if ($inheritSpecial !== null) {
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
}
if ($inheritTurntime !== null) {
$inheritRequiredPoint += GameConst::$inheritBornTurntimePoint;
}
if ($inheritTotalPoint < $inheritRequiredPoint) {
dieMsg("유산 포인트가 부족합니다. 다시 가입해주세요!");
}
if ($inheritSpecial !== null && $gameStor->genius == 0) {
dieMsg("이미 천재가 모두 나타났습니다. 다시 가입해주세요!");
}
if ($inheritCity !== null && !key_exists($inheritCity, CityConst::all())) {
dieMsg("도시가 잘못 지정되었습니다. 다시 가입해주세요!");
}
if ($inheritSpecial) {
$genius = true;
} else {
// 현재 1%
$genius = Util::randBool(0.01);
} }
$genius = Util::randBool(0.01);
// 현재 1%
if ($genius && $gameStor->genius > 0) { if ($genius && $gameStor->genius > 0) {
$gameStor->genius = $gameStor->genius-1; $gameStor->genius = $gameStor->genius - 1;
} else { } else {
$genius = false; $genius = false;
} }
// 공백지에서만 태어나게 if ($inheritCity !== null) {
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 and nation=0 order by rand() limit 0,1"); $city = $inheritCity;
if (!$city) { } else {
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 order by rand() limit 0,1"); // 공백지에서만 태어나게
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 and nation=0 order by rand() limit 0,1");
if (!$city) {
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 order by rand() limit 0,1");
}
} }
$pleadership = 0; if ($inheritBonusStat) {
$pstrength = 0; [$pleadership, $pstrength, $pintel] = $inheritBonusStat;
$pintel = 0; } else {
foreach(Util::range(Util::randRangeInt(3, 5)) as $statIdx){ $pleadership = 0;
switch (Util::choiceRandomUsingWeight([$leadership, $strength, $intel])) { $pstrength = 0;
case 0: $pintel = 0;
$pleadership++; foreach (Util::range(Util::randRangeInt(3, 5)) as $statIdx) {
break; switch (Util::choiceRandomUsingWeight([$leadership, $strength, $intel])) {
case 1: case 0:
$pstrength++; $pleadership++;
break; break;
case 2: case 1:
$pintel++; $pstrength++;
break; break;
case 2:
$pintel++;
break;
}
} }
} }
@@ -151,29 +199,32 @@ $leadership = $leadership + $pleadership;
$strength = $strength + $pstrength; $strength = $strength + $pstrength;
$intel = $intel + $pintel; $intel = $intel + $pintel;
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year']);
$relYear = Util::valueFit($admin['year'] - $admin['startyear'], 0); $relYear = Util::valueFit($admin['year'] - $admin['startyear'], 0);
$age = 20 + ($pleadership + $pstrength + $pintel) * 2 - (mt_rand(0, 1)); $age = 20 + ($pleadership + $pstrength + $pintel) * 2 - (mt_rand(0, 1));
// 아직 남았고 천재등록상태이면 특기 부여 // 아직 남았고 천재등록상태이면 특기 부여
if ($genius) { if ($genius) {
$specage2 = $age; $specage2 = $age;
$special2 = SpecialityHelper::pickSpecialWar([ if ($inheritSpecial) {
'leadership'=>$leadership, $special2 = $inheritSpecial;
'strength'=>$strength, } else {
'intel'=>$intel, $special2 = SpecialityHelper::pickSpecialWar([
'dex1'=>0, 'leadership' => $leadership,
'dex2'=>0, 'strength' => $strength,
'dex3'=>0, 'intel' => $intel,
'dex4'=>0, 'dex1' => 0,
'dex5'=>0 'dex2' => 0,
]); 'dex3' => 0,
'dex4' => 0,
'dex5' => 0
]);
}
} else { } else {
$specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/6 - $relYear / 2), 3) + $age; $specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age) / 6 - $relYear / 2), 3) + $age;
$special2 = GameConst::$defaultSpecialWar; $special2 = GameConst::$defaultSpecialWar;
} }
//내특 //내특
$specage = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/12 - $relYear / 2), 3) + $age; $specage = Util::valueFit(Util::round((GameConst::$retirementYear - $age) / 12 - $relYear / 2), 3) + $age;
$special = GameConst::$defaultSpecialDomestic; $special = GameConst::$defaultSpecialDomestic;
if ($admin['scenario'] >= 1000) { if ($admin['scenario'] >= 1000) {
@@ -181,22 +232,29 @@ if ($admin['scenario'] >= 1000) {
$specage = $age + 3; $specage = $age + 3;
} }
if($relYear < 3){ if ($relYear < 3) {
$experience = 0; $experience = 0;
} } else {
else{
$expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 4'); $expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 4');
$targetGenOrder = Util::round($expGenCount * 0.2); $targetGenOrder = Util::round($expGenCount * 0.2);
$experience = $db->queryFirstField( $experience = $db->queryFirstField(
'SELECT experience FROM general WHERE nation != 0 AND npc < 4 ORDER BY experience ASC LIMIT %i, 1', 'SELECT experience FROM general WHERE nation != 0 AND npc < 4 ORDER BY experience ASC LIMIT %i, 1',
$targetGenOrder - 1 $targetGenOrder - 1
); );
$experience *= 0.8; $experience *= 0.8;
} }
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime'])); if ($inheritTurntime === null) {
$inheritTurntime = $inheritTurntime % ($gameStor->turnterm * 60);
$inheritTurntime += Util::randRangeInt(0, 999999) / 1000000;
$turntime = cutTurn($admin['turntime'], $admin['turnterm']);
$turntime = TimeUtil::nowAddSeconds($inheritTurntime, true);
} else {
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
}
$now = date('Y-m-d H:i:s');
$now = TimeUtil::now(true);
if ($now >= $turntime) { if ($now >= $turntime) {
$turntime = addTurn($turntime, $admin['turnterm']); $turntime = addTurn($turntime, $admin['turnterm']);
} }
@@ -211,11 +269,11 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
} }
//성격 랜덤시 //성격 랜덤시
if (!in_array($character, GameConst::$availablePersonality)){ if (!in_array($character, GameConst::$availablePersonality)) {
$character = Util::choiceRandom(GameConst::$availablePersonality); $character = Util::choiceRandom(GameConst::$availablePersonality);
} }
//상성 랜덤 //상성 랜덤
$affinity = rand()%150 + 1; $affinity = rand() % 150 + 1;
########## 회원정보 테이블에 입력값을 등록한다. ########## ########## 회원정보 테이블에 입력값을 등록한다. ##########
$db->insert('general', [ $db->insert('general', [
@@ -243,7 +301,7 @@ $db->insert('general', [
'killturn' => 6, 'killturn' => 6,
'lastconnect' => $now, 'lastconnect' => $now,
'lastrefresh' => $now, 'lastrefresh' => $now,
'crewtype'=>GameUnitConst::DEFAULT_CREWTYPE, 'crewtype' => GameUnitConst::DEFAULT_CREWTYPE,
'makelimit' => 0, 'makelimit' => 0,
'age' => $age, 'age' => $age,
'startage' => $age, 'startage' => $age,
@@ -255,36 +313,34 @@ $db->insert('general', [
]); ]);
$generalID = $db->insertId(); $generalID = $db->insertId();
$turnRows = []; $turnRows = [];
foreach(Util::range(GameConst::$maxTurn) as $turnIdx){ foreach (Util::range(GameConst::$maxTurn) as $turnIdx) {
$turnRows[] = [ $turnRows[] = [
'general_id'=>$generalID, 'general_id' => $generalID,
'turn_idx'=>$turnIdx, 'turn_idx' => $turnIdx,
'action'=>'휴식', 'action' => '휴식',
'arg'=>null, 'arg' => null,
'brief'=>'휴식' 'brief' => '휴식'
]; ];
} }
$db->insert('general_turn', $turnRows); $db->insert('general_turn', $turnRows);
resetInheritanceUser($userID);
$rank_data = []; $rank_data = [];
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){ foreach (array_keys(General::RANK_COLUMN) as $rankColumn) {
$rank_data[] = [ $rank_data[] = [
'general_id'=>$generalID, 'general_id' => $generalID,
'nation_id'=>0, 'nation_id' => 0,
'type'=>$rankColumn, 'type' => $rankColumn,
'value'=>0 'value' => 0
]; ];
} }
$db->insert('rank_data', $rank_data); $db->insert('rank_data', $rank_data);
$db->insert('betting', [ $db->insert('betting', [
'general_id'=>$generalID, 'general_id' => $generalID,
]); ]);
$cityname = CityConst::byID($city)->name; $cityname = CityConst::byID($city)->name;
$me = [ $me = [
'no'=>$generalID 'no' => $generalID
]; ];
$log = []; $log = [];
@@ -295,7 +351,7 @@ $logger = new ActionLogger($generalID, 0, $gameStor->year, $gameStor->month);
$josaRa = JosaUtil::pick($name, '라'); $josaRa = JosaUtil::pick($name, '라');
$speicalText = getGeneralSpecialWarName($special2); $speicalText = getGeneralSpecialWarName($special2);
if ($genius) { if ($genius) {
$logger->pushGlobalActionLog("<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다."); $logger->pushGlobalActionLog("<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.");
$logger->pushGlobalActionLog("<C>{$speicalText}</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다."); $logger->pushGlobalActionLog("<C>{$speicalText}</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.");
$logger->pushGlobalHistoryLog("<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."); $logger->pushGlobalHistoryLog("<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다.");
@@ -318,24 +374,37 @@ if ($genius) {
$logger->flush(); $logger->flush();
pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR")]); pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}" . getenv("REMOTE_ADDR")]);
$rootDB->insert('member_log', [ $rootDB->insert('member_log', [
'member_no' => $userID, 'member_no' => $userID,
'date'=>TimeUtil::now(), 'date' => TimeUtil::now(),
'action_type'=>'make_general', 'action_type' => 'make_general',
'action'=>Json::encode([ 'action' => Json::encode([
'server'=>DB::prefix(), 'server' => DB::prefix(),
'type'=>'general', 'type' => 'general',
'generalID'=>$generalID, 'generalID' => $generalID,
'generalName'=>$name 'generalName' => $name
]) ])
]); ]);
?> ?>
<script> <html>
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
</script>
<script>location.replace('./');</script>
<head>
<style>
html,
body {
background: black;
}
</style>
<script>
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?= $name ?> \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
location.replace('./');
</script>
</head>
<body>
</body>
</html>
+62 -56
View File
@@ -1,15 +1,16 @@
<?php <?php
namespace sammo; namespace sammo;
class GameConstBase class GameConstBase
{ {
/** @var string 게임명 */ /** @var string 게임명 */
public static $title = "삼국지 모의전투 PHP HiDCHe"; public static $title = "삼국지 모의전투 PHP HiDCHe";
/** @var string 코드 아래에 붙는 설명 코드 */ /** @var string 코드 아래에 붙는 설명 코드 */
public static $banner = "KOEI의 이미지를 사용, 응용하였습니다 / 제작 : HideD(hided62@gmail.com) / <a href='https://sam.hided.net/wiki/hidche/credit' target='_blank' style='color:white;text-decoration: underline;'>Credit</a>"; public static $banner = "KOEI의 이미지를 사용, 응용하였습니다 / 제작 : HideD(hided62@gmail.com) / <a href='https://sam.hided.net/wiki/hidche/credit' target='_blank' style='color:white;text-decoration: underline;'>Credit</a>";
/** @var string 사용중인 지도명 */ /** @var string 사용중인 지도명 */
public static $mapName = 'che'; public static $mapName = 'che';
/** @var string 사용중인 유닛셋 */ /** @var string 사용중인 유닛셋 */
public static $unitSet = 'che'; public static $unitSet = 'che';
/** @var int 내정시 최하 민심 설정*/ /** @var int 내정시 최하 민심 설정*/
public static $develrate = 50; public static $develrate = 50;
@@ -137,7 +138,7 @@ class GameConstBase
public static $maxChiefTurn = 12; public static $maxChiefTurn = 12;
public static $statGradeLevel = 5; public static $statGradeLevel = 5;
/** @var int 초반 제한 기간 */ /** @var int 초반 제한 기간 */
public static $openingPartYear = 3; public static $openingPartYear = 3;
/** @var int 거병,임관 제한 기간 */ /** @var int 거병,임관 제한 기간 */
@@ -166,83 +167,88 @@ class GameConstBase
public static $defaultSpecialWar = 'None'; public static $defaultSpecialWar = 'None';
/** @var array 선택 가능한 장수 전투 특기 */ /** @var array 선택 가능한 장수 전투 특기 */
public static $availableSpecialWar = [ public static $availableSpecialWar = [
'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_무쌍', 'che_견고', 'che_위압',
'che_저격', 'che_필살', 'che_징병', 'che_의술', 'che_격노', 'che_척사', 'che_저격', 'che_필살', 'che_징병', 'che_의술', 'che_격노', 'che_척사',
]; ];
/** @var array 선택할 수 없으나 게임 내에 유효한 장수 전투 특기 */ /** @var array 선택할 수 없으나 게임 내에 유효한 장수 전투 특기 */
public static $optionalSpecialWar = [ public static $optionalSpecialWar = [
'None', 'None',
]; ];
/** @var string 기본 성향(공용) */ /** @var string 기본 성향(공용) */
public static $neutralPersonality = 'None'; public static $neutralPersonality = 'None';
/** @var array 선택 가능한 성향 */ /** @var array 선택 가능한 성향 */
public static $availablePersonality = [ public static $availablePersonality = [
'che_안전', 'che_유지', 'che_재간', 'che_출세', 'che_할거', 'che_정복', 'che_안전', 'che_유지', 'che_재간', 'che_출세', 'che_할거', 'che_정복',
'che_패권', 'che_의협', 'che_대의', 'che_왕좌' 'che_패권', 'che_의협', 'che_대의', 'che_왕좌'
]; ];
/** @var array 존재하는 모든 성향 */ /** @var array 존재하는 모든 성향 */
public static $optionalPersonality = [ public static $optionalPersonality = [
'che_은둔', 'None' 'che_은둔', 'None'
]; ];
public static $inheritBornSpecialPoint = 12000;
public static $inheritBornTurntimePoint = 3000;
public static $inheritBornCityPoint = 1000;
public static $inheritBornMaxBonusStat = 1000;
public static $allItems = [ public static $allItems = [
'horse' => [ 'horse' => [
'che_명마_01_노기'=>0, 'che_명마_02_조랑'=>0, 'che_명마_03_노새'=>0, 'che_명마_01_노기' => 0, 'che_명마_02_조랑' => 0, 'che_명마_03_노새' => 0,
'che_명마_04_나귀'=>0, 'che_명마_05_갈색마'=>0, 'che_명마_06_흑색마'=>0, 'che_명마_04_나귀' => 0, 'che_명마_05_갈색마' => 0, 'che_명마_06_흑색마' => 0,
'che_명마_07_백마'=>2, 'che_명마_07_기주마'=>2, 'che_명마_07_백마' => 2, 'che_명마_07_기주마' => 2,
'che_명마_08_양주마'=>2, 'che_명마_09_과하마'=>2, 'che_명마_08_양주마' => 2, 'che_명마_09_과하마' => 2,
'che_명마_10_대완마'=>2, 'che_명마_11_서량마'=>2, 'che_명마_10_대완마' => 2, 'che_명마_11_서량마' => 2,
'che_명마_12_사륜거'=>2, 'che_명마_13_절영'=>1, 'che_명마_13_적로'=>1, 'che_명마_12_사륜거' => 2, 'che_명마_13_절영' => 1, 'che_명마_13_적로' => 1,
'che_명마_14_적란마'=>1, 'che_명마_14_조황비전'=>1, 'che_명마_15_한혈마'=>1, 'che_명마_15_적토마'=>1, 'che_명마_14_적란마' => 1, 'che_명마_14_조황비전' => 1, 'che_명마_15_한혈마' => 1, 'che_명마_15_적토마' => 1,
], ],
'weapon' => [ 'weapon' => [
'che_무기_01_단도'=>0, 'che_무기_02_단궁'=>0, 'che_무기_03_단극'=>0, 'che_무기_01_단도' => 0, 'che_무기_02_단궁' => 0, 'che_무기_03_단극' => 0,
'che_무기_04_목검'=>0, 'che_무기_05_죽창'=>0, 'che_무기_06_소부'=>0, 'che_무기_04_목검' => 0, 'che_무기_05_죽창' => 0, 'che_무기_06_소부' => 0,
'che_무기_07_동추'=>1, 'che_무기_07_철편'=>1, 'che_무기_07_철쇄'=>1, 'che_무기_07_맥궁'=>1, 'che_무기_07_동추' => 1, 'che_무기_07_철편' => 1, 'che_무기_07_철쇄' => 1, 'che_무기_07_맥궁' => 1,
'che_무기_08_유성추'=>1, 'che_무기_08_철질여골'=>1, 'che_무기_09_쌍철극'=>1, 'che_무기_09_동호비궁'=>1, 'che_무기_10_삼첨도'=>1, 'che_무기_10_대부'=>1, 'che_무기_11_고정도'=>1, 'che_무기_11_이광궁'=>1, 'che_무기_12_철척사모'=>1, 'che_무기_12_칠성검'=>1, 'che_무기_13_사모'=>1, 'che_무기_13_양유기궁'=>1, 'che_무기_08_유성추' => 1, 'che_무기_08_철질여골' => 1, 'che_무기_09_쌍철극' => 1, 'che_무기_09_동호비궁' => 1, 'che_무기_10_삼첨도' => 1, 'che_무기_10_대부' => 1, 'che_무기_11_고정도' => 1, 'che_무기_11_이광궁' => 1, 'che_무기_12_철척사모' => 1, 'che_무기_12_칠성검' => 1, 'che_무기_13_사모' => 1, 'che_무기_13_양유기궁' => 1,
'che_무기_14_언월도'=>1, 'che_무기_14_방천화극'=>1, 'che_무기_15_청홍검'=>1, 'che_무기_15_의천검'=>1 'che_무기_14_언월도' => 1, 'che_무기_14_방천화극' => 1, 'che_무기_15_청홍검' => 1, 'che_무기_15_의천검' => 1
], ],
'book' => [ 'book' => [
'che_서적_01_효경전'=>0, 'che_서적_02_회남자'=>0, 'che_서적_03_변도론'=>0, 'che_서적_01_효경전' => 0, 'che_서적_02_회남자' => 0, 'che_서적_03_변도론' => 0,
'che_서적_04_건상역주'=>0, 'che_서적_05_여씨춘추'=>0, 'che_서적_06_사민월령'=>0, 'che_서적_04_건상역주' => 0, 'che_서적_05_여씨춘추' => 0, 'che_서적_06_사민월령' => 0,
'che_서적_07_위료자'=>1, 'che_서적_07_사마법'=>1, 'che_서적_07_한서'=>1, 'che_서적_07_논어'=>1, 'che_서적_07_위료자' => 1, 'che_서적_07_사마법' => 1, 'che_서적_07_한서' => 1, 'che_서적_07_논어' => 1,
'che_서적_08_전론'=>1, 'che_서적_08_사기'=>1, 'che_서적_09_장자'=>1, 'che_서적_09_역경'=>1, 'che_서적_08_전론' => 1, 'che_서적_08_사기' => 1, 'che_서적_09_장자' => 1, 'che_서적_09_역경' => 1,
'che_서적_10_시경'=>1, 'che_서적_10_구국론'=>1, 'che_서적_11_상군서'=>1, 'che_서적_11_춘추전'=>1, 'che_서적_10_시경' => 1, 'che_서적_10_구국론' => 1, 'che_서적_11_상군서' => 1, 'che_서적_11_춘추전' => 1,
'che_서적_12_산해경'=>1, 'che_서적_12_맹덕신서'=>1, 'che_서적_13_관자'=>1, 'che_서적_13_병법24편'=>1, 'che_서적_12_산해경' => 1, 'che_서적_12_맹덕신서' => 1, 'che_서적_13_관자' => 1, 'che_서적_13_병법24편' => 1,
'che_서적_14_한비자'=>1, 'che_서적_14_오자병법'=>1, 'che_서적_15_노자'=>1, 'che_서적_15_손자병법'=>1, 'che_서적_14_한비자' => 1, 'che_서적_14_오자병법' => 1, 'che_서적_15_노자' => 1, 'che_서적_15_손자병법' => 1,
], ],
'item' => [ 'item' => [
'che_치료_환약'=>0, 'che_저격_수극'=>0, 'che_사기_탁주'=>0, 'che_치료_환약' => 0, 'che_저격_수극' => 0, 'che_사기_탁주' => 0,
'che_훈련_청주'=>0, 'che_계략_이추'=>0, 'che_계략_향낭'=>0, 'che_훈련_청주' => 0, 'che_계략_이추' => 0, 'che_계략_향낭' => 0,
'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, '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,
] ]
]; ];
/** @var array 선택 가능한 커맨드 */ /** @var array 선택 가능한 커맨드 */
public static $availableGeneralCommand = [ public static $availableGeneralCommand = [
''=>[ '' => [
'휴식', '휴식',
'che_요양' 'che_요양'
], ],
'내정'=>[ '내정' => [
'che_농지개간', 'che_농지개간',
'che_상업투자', 'che_상업투자',
'che_기술연구', 'che_기술연구',
@@ -253,7 +259,7 @@ class GameConstBase
'che_주민선정', 'che_주민선정',
'che_물자조달', 'che_물자조달',
], ],
'군사'=>[ '군사' => [
'che_소집해제', 'che_소집해제',
'che_첩보', 'che_첩보',
'che_징병', 'che_징병',
@@ -262,7 +268,7 @@ class GameConstBase
'che_사기진작', 'che_사기진작',
'che_출병', 'che_출병',
], ],
'인사'=>[ '인사' => [
'che_이동', 'che_이동',
'che_강행', 'che_강행',
'che_인재탐색', 'che_인재탐색',
@@ -273,13 +279,13 @@ class GameConstBase
'che_랜덤임관', 'che_랜덤임관',
'che_장수대상임관', 'che_장수대상임관',
], ],
'계략'=>[ '계략' => [
'che_화계', 'che_화계',
'che_파괴', 'che_파괴',
'che_탈취', 'che_탈취',
'che_선동', 'che_선동',
], ],
'개인'=>[ '개인' => [
'che_내정특기초기화', 'che_내정특기초기화',
'che_전투특기초기화', 'che_전투특기초기화',
'che_단련', 'che_단련',
@@ -301,28 +307,28 @@ class GameConstBase
/** @var array 선택 가능한 커맨드 */ /** @var array 선택 가능한 커맨드 */
public static $availableChiefCommand = [ public static $availableChiefCommand = [
'휴식'=>[ '휴식' => [
'휴식', '휴식',
], ],
'인사'=>[ '인사' => [
'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_필사즉생',
'che_백성동원', 'che_백성동원',
'che_수몰', 'che_수몰',
@@ -331,7 +337,7 @@ class GameConstBase
'che_이호경식', 'che_이호경식',
'che_급습', 'che_급습',
], ],
'기타'=>[ '기타' => [
'che_피장파장', 'che_피장파장',
'che_국기변경', 'che_국기변경',
'che_국호변경', 'che_국호변경',