의병모집, 소형b 초기 m장, 작위보상금쌀
의병모집 -> 초기 금쌀 1000 작위보상 -> 작위에 따라 금쌀*1000 소형b -> 초기 m장 10 추가
This commit is contained in:
@@ -565,7 +565,9 @@ function updateNationState()
|
|||||||
$nation['level'] = $nationlevel;
|
$nation['level'] = $nationlevel;
|
||||||
|
|
||||||
$updateVals = [
|
$updateVals = [
|
||||||
'level' => $nationlevel
|
'level' => $nationlevel,
|
||||||
|
'gold'=>$db->sqleval('gold + %i', $nationlevel*1000),
|
||||||
|
'rice'=>$db->sqleval('rice + %i', $nationlevel*1000),
|
||||||
];
|
];
|
||||||
|
|
||||||
switch ($nationlevel) {
|
switch ($nationlevel) {
|
||||||
@@ -708,7 +710,8 @@ function updateNationState()
|
|||||||
'troop' => $npcID
|
'troop' => $npcID
|
||||||
], 'no=%i', $npcID);
|
], 'no=%i', $npcID);
|
||||||
|
|
||||||
//TODO: 5턴간 집합턴 입력
|
$cmd = buildGeneralCommandClass('che_집합', General::createGeneralObjFromDB($npcID), $admin);
|
||||||
|
_setGeneralCommand($cmd, iterator_to_array(Util::range(GameConst::$maxTurn)));
|
||||||
$assemblerCnt += 1;
|
$assemblerCnt += 1;
|
||||||
$gameStor->assembler_id = $lastAssemblerID;
|
$gameStor->assembler_id = $lastAssemblerID;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
$totalStat = GameConst::$defaultStatNPCTotal;
|
$totalStat = GameConst::$defaultStatNPCTotal;
|
||||||
$minStat = GameConst::$defaultStatNPCMin;
|
$minStat = GameConst::$defaultStatNPCMin;
|
||||||
$mainStat = GameConst::$defaultStatNPCMax - Util::randRangeInt(0, GameConst::$defaultStatNPCMin);
|
$mainStat = GameConst::$defaultStatNPCMax - Util::randRangeInt(0, GameConst::$defaultStatNPCMin);
|
||||||
//TODO: defaultStatNPCTotal, defaultStatNPCMin 추가
|
|
||||||
$otherStat = $minStat + Util::randRangeInt(0, Util::toInt(GameConst::$defaultStatNPCMin/2));
|
$otherStat = $minStat + Util::randRangeInt(0, Util::toInt(GameConst::$defaultStatNPCMin/2));
|
||||||
$subStat = $totalStat - $mainStat - $otherStat;
|
$subStat = $totalStat - $mainStat - $otherStat;
|
||||||
if ($subStat < $minStat) {
|
if ($subStat < $minStat) {
|
||||||
@@ -235,12 +234,13 @@ class che_인재탐색 extends Command\GeneralCommand
|
|||||||
$birthYear = $env['year'] - $age;
|
$birthYear = $env['year'] - $age;
|
||||||
$deathYear = $env['year'] + Util::randRangeInt(10, 50);
|
$deathYear = $env['year'] + Util::randRangeInt(10, 50);
|
||||||
|
|
||||||
|
$cityID = Util::choiceRandom(array_keys(\sammo\CityConst::all()));
|
||||||
$newNPC = new \sammo\Scenario\NPC(
|
$newNPC = new \sammo\Scenario\NPC(
|
||||||
Util::randRangeInt(1, 150),
|
Util::randRangeInt(1, 150),
|
||||||
\sammo\getRandGenName(),
|
\sammo\getRandGenName(),
|
||||||
null,
|
null,
|
||||||
$scoutNation,
|
$scoutNation,
|
||||||
$general->getCityID(),
|
$cityID,
|
||||||
$leadership,
|
$leadership,
|
||||||
$strength,
|
$strength,
|
||||||
$intel,
|
$intel,
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class che_의병모집 extends Command\NationCommand
|
|||||||
);
|
);
|
||||||
$newNPC->killturn = Util::randRangeInt(64, 70);
|
$newNPC->killturn = Util::randRangeInt(64, 70);
|
||||||
$newNPC->npc = 4;
|
$newNPC->npc = 4;
|
||||||
$newNPC->setMoney(100, 100);
|
$newNPC->setMoney(1000, 1000);
|
||||||
$newNPC->setExpDed($avgGen['exp'], $avgGen['ded']);
|
$newNPC->setExpDed($avgGen['exp'], $avgGen['ded']);
|
||||||
$newNPC->setDex(
|
$newNPC->setDex(
|
||||||
$dexVal[0],
|
$dexVal[0],
|
||||||
|
|||||||
@@ -6,20 +6,19 @@ use \sammo\Util;
|
|||||||
class CreateManyNPC extends \sammo\Event\Action{
|
class CreateManyNPC extends \sammo\Event\Action{
|
||||||
protected $npcCount;
|
protected $npcCount;
|
||||||
protected $avgGen;
|
protected $avgGen;
|
||||||
public function __construct($npcCount = 200){
|
public function __construct($npcCount = 10){
|
||||||
$this->npcCount = $npcCount;
|
$this->npcCount = $npcCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function generateNPC($env){
|
protected function generateNPC($env){
|
||||||
$pickTypeList = ['무'=>6, '지'=>6, '무지'=>3];
|
$pickTypeList = ['무'=>1, '지'=>1];
|
||||||
|
|
||||||
$pickType = Util::choiceRandomUsingWeightPair($pickTypeList);
|
$pickType = Util::choiceRandomUsingWeight($pickTypeList);
|
||||||
|
|
||||||
$totalStat = GameConst::$defaultStatNPCMax * 2 + 10;
|
$totalStat = GameConst::$defaultStatNPCTotal;
|
||||||
$minStat = 10;
|
$minStat = GameConst::$defaultStatNPCMin;
|
||||||
$mainStat = GameConst::$defaultStatNPCMax - Util::randRangeInt(0, 10);
|
$mainStat = GameConst::$defaultStatNPCMax - Util::randRangeInt(0, GameConst::$defaultStatNPCMin);
|
||||||
//TODO: defaultStatNPCTotal, defaultStatNPCMin 추가
|
$otherStat = $minStat + Util::randRangeInt(0, Util::toInt(GameConst::$defaultStatNPCMin/2));
|
||||||
$otherStat = $minStat + Util::randRangeInt(0, 5);
|
|
||||||
$subStat = $totalStat - $mainStat - $otherStat;
|
$subStat = $totalStat - $mainStat - $otherStat;
|
||||||
if ($subStat < $minStat) {
|
if ($subStat < $minStat) {
|
||||||
$subStat = $otherStat;
|
$subStat = $otherStat;
|
||||||
@@ -50,7 +49,10 @@ class CreateManyNPC extends \sammo\Event\Action{
|
|||||||
$strength = Util::round($strength);
|
$strength = Util::round($strength);
|
||||||
$intel = Util::round($intel);
|
$intel = Util::round($intel);
|
||||||
|
|
||||||
$age = $env['year'] - 20;
|
$age = Util::randRangeInt(20, 25);
|
||||||
|
$birthYear = $env['year'] - $age;
|
||||||
|
$deathYear = $env['year'] + Util::randRangeInt(10, 50);
|
||||||
|
|
||||||
$cityID = Util::choiceRandom(array_keys(\sammo\CityConst::all()));
|
$cityID = Util::choiceRandom(array_keys(\sammo\CityConst::all()));
|
||||||
$newNPC = new \sammo\Scenario\NPC(
|
$newNPC = new \sammo\Scenario\NPC(
|
||||||
Util::randRangeInt(1, 150),
|
Util::randRangeInt(1, 150),
|
||||||
@@ -62,13 +64,14 @@ class CreateManyNPC extends \sammo\Event\Action{
|
|||||||
$strength,
|
$strength,
|
||||||
$intel,
|
$intel,
|
||||||
0,
|
0,
|
||||||
$age,
|
$birthYear,
|
||||||
$env['year'] + Util::randRangeInt(10, 50),
|
$deathYear,
|
||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
$newNPC->npc = 6;
|
$newNPC->npc = 3;
|
||||||
$newNPC->setMoney(100, 100);
|
$newNPC->setMoney(1000, 1000);
|
||||||
|
$newNPC->setExpDed(0, 0);
|
||||||
$newNPC->setSpecYear(
|
$newNPC->setSpecYear(
|
||||||
Util::round((GameConst::$retirementYear - $age) / 12) + $age,
|
Util::round((GameConst::$retirementYear - $age) / 12) + $age,
|
||||||
Util::round((GameConst::$retirementYear - $age) / 3) + $age
|
Util::round((GameConst::$retirementYear - $age) / 3) + $age
|
||||||
@@ -93,12 +96,12 @@ class CreateManyNPC extends \sammo\Event\Action{
|
|||||||
if($genCnt == 1){
|
if($genCnt == 1){
|
||||||
$npcName = $result[0][0];
|
$npcName = $result[0][0];
|
||||||
$josaRa = \sammo\JosaUtil::pick($npcName, '라');
|
$josaRa = \sammo\JosaUtil::pick($npcName, '라');
|
||||||
$logger->pushGlobalActionLog("운영자가 <Y>$npcName</>{$josaRa}는 장수를 <S>생성</>하였습니다.");
|
$logger->pushGlobalActionLog("<Y>$npcName</>{$josaRa}는 장수가 <S>등장</>하였습니다.");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$logger->pushGlobalActionLog("운영자가 장수 <C>{$genCnt}</>명을 <S>생성</>하였습니다.");
|
$logger->pushGlobalActionLog("장수 <C>{$genCnt}</>명이 <S>등장</>하였습니다.");
|
||||||
}
|
}
|
||||||
$logger->pushGlobalHistoryLog("운영자가 장수 <C>{$genCnt}</>명을 <S>생성</>했습니다.", \sammo\ActionLogger::NOTICE_YEAR_MONTH);
|
$logger->pushGlobalHistoryLog("장수 <C>{$genCnt}</>명이 <S>등장</>했습니다.", \sammo\ActionLogger::NOTICE_YEAR_MONTH);
|
||||||
$logger->flush();
|
$logger->flush();
|
||||||
|
|
||||||
return [__CLASS__, $result];
|
return [__CLASS__, $result];
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Date extends \sammo\Event\Condition{
|
|||||||
|
|
||||||
//TODO:구현
|
//TODO:구현
|
||||||
|
|
||||||
public function __construct(string $cmp, int $year, int $month){
|
public function __construct(string $cmp, ?int $year, ?int $month){
|
||||||
//Cmp('==', '!=', '<=', '>=', '<', '>'), Year, Month(Optional)
|
//Cmp('==', '!=', '<=', '>=', '<', '>'), Year, Month(Optional)
|
||||||
if(!array_key_exists($cmp, self::AVAILABLE_CMP)){
|
if(!array_key_exists($cmp, self::AVAILABLE_CMP)){
|
||||||
throw new \InvalidArgumentException('올바르지 않은 비교연산자입니다');
|
throw new \InvalidArgumentException('올바르지 않은 비교연산자입니다');
|
||||||
|
|||||||
@@ -3358,7 +3358,7 @@ class GeneralAI
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($npcType == 2 && $nationID == 0){
|
if(($npcType == 2 || $npcType == 3) && $nationID == 0){
|
||||||
$result = $this->do거병();
|
$result = $this->do거병();
|
||||||
if($result !== null){
|
if($result !== null){
|
||||||
$result->reason='do거병';
|
$result->reason='do거병';
|
||||||
|
|||||||
@@ -376,16 +376,6 @@ class TurnExecutionHelper
|
|||||||
|
|
||||||
turnDate($nextTurn);
|
turnDate($nextTurn);
|
||||||
|
|
||||||
// 이벤트 핸들러 동작
|
|
||||||
foreach (DB::db()->query('SELECT * from event') as $rawEvent) {
|
|
||||||
$eventID = $rawEvent['id'];
|
|
||||||
$cond = Json::decode($rawEvent['condition']);
|
|
||||||
$action = Json::decode($rawEvent['action']);
|
|
||||||
$event = new Event\EventHandler($cond, $action);
|
|
||||||
|
|
||||||
$event->tryRunEvent(['currentEventID'=>$eventID] + $gameStor->getAll(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
$logger = new ActionLogger(0, 0, $gameStor->year, $gameStor->month, false);
|
$logger = new ActionLogger(0, 0, $gameStor->year, $gameStor->month, false);
|
||||||
|
|
||||||
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
||||||
@@ -414,6 +404,16 @@ class TurnExecutionHelper
|
|||||||
disaster();
|
disaster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 이벤트 핸들러 동작
|
||||||
|
foreach (DB::db()->query('SELECT * from event') as $rawEvent) {
|
||||||
|
$eventID = $rawEvent['id'];
|
||||||
|
$cond = Json::decode($rawEvent['condition']);
|
||||||
|
$action = Json::decode($rawEvent['action']);
|
||||||
|
$event = new Event\EventHandler($cond, $action);
|
||||||
|
|
||||||
|
$event->tryRunEvent(['currentEventID'=>$eventID] + $gameStor->getAll(true));
|
||||||
|
}
|
||||||
|
|
||||||
postUpdateMonthly();
|
postUpdateMonthly();
|
||||||
|
|
||||||
// 다음달로 넘김
|
// 다음달로 넘김
|
||||||
|
|||||||
@@ -12,5 +12,12 @@
|
|||||||
"expandCityWallIncreaseAmount": 1600,
|
"expandCityWallIncreaseAmount": 1600,
|
||||||
"defaultMaxGeneral":300,
|
"defaultMaxGeneral":300,
|
||||||
"joinRuinedNPCProp":0
|
"joinRuinedNPCProp":0
|
||||||
}
|
},
|
||||||
|
"events":[
|
||||||
|
[
|
||||||
|
["Date", "==", null, 12],
|
||||||
|
["CreateManyNPC", 10],
|
||||||
|
["DeleteEvent"]
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user