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