인탐, 의병모집 수정, npcMin, npcTotal 추가

This commit is contained in:
2020-05-16 18:59:10 +09:00
parent b4d5fbcb61
commit 5c2d9dddb0
19 changed files with 184 additions and 132 deletions
+35 -27
View File
@@ -1,8 +1,11 @@
<?php
namespace sammo\Command\General;
use\sammo\{
DB, Util, JosaUtil,
DB,
Util,
JosaUtil,
General,
ActionLogger,
GameConst,
@@ -23,15 +26,18 @@ use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper;
class che_인재탐색 extends Command\GeneralCommand{
class che_인재탐색 extends Command\GeneralCommand
{
static protected $actionName = '인재탐색';
protected function argTest():bool{
protected function argTest(): bool
{
$this->arg = null;
return true;
}
protected function init(){
protected function init()
{
$general = $this->generalObj;
@@ -53,10 +59,10 @@ class che_인재탐색 extends Command\GeneralCommand{
$josaUn = JosaUtil::pick($nationName, '은');
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail("현재 <D>{$nationName}</>{$josaUn} 탐색이 제한되고 있습니다.");
}
}
public function getCommandDetailTitle():string{
public function getCommandDetailTitle(): string
{
$db = DB::db();
$env = $this->env;
@@ -82,19 +88,23 @@ class che_인재탐색 extends Command\GeneralCommand{
return $title;
}
public function getCost():array{
public function getCost(): array
{
return [$this->env['develcost'], 0];
}
public function getPreReqTurn():int{
public function getPreReqTurn(): int
{
return 0;
}
public function getPostReqTurn():int{
public function getPostReqTurn(): int
{
return 0;
}
public function calcFoundProp(int $maxGenCnt, int $totalGenCnt, int $totalNpcCnt):float{
public function calcFoundProp(int $maxGenCnt, int $totalGenCnt, int $totalNpcCnt): float
{
$currCnt = Util::toInt($totalGenCnt + $totalNpcCnt / 2);
@@ -109,14 +119,14 @@ class che_인재탐색 extends Command\GeneralCommand{
if ($totalNpcCnt < 50) {
$foundProp = max($foundPropMain, $foundPropSmall);
}
else{
} else {
$foundProp = max($foundPropMain, $foundPropBig);
}
return $foundProp;
}
public function run():bool{
public function run(): bool
{
if (!$this->hasFullConditionMet()) {
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}
@@ -178,13 +188,16 @@ class che_인재탐색 extends Command\GeneralCommand{
$pickType = Util::choiceRandomUsingWeight($pickTypeList);
$mainStat = GameConst::$defaultStatMax - Util::randRangeInt(0, 10);
$otherStat = GameConst::$defaultStatMin + Util::randRangeInt(0, 5);
$subStat = GameConst::$defaultStatTotal - $mainStat - $otherStat;
if($subStat < GameConst::$defaultStatMin){
$totalStat = GameConst::$defaultStatNPCMax * 2 + 10;
$minStat = 10;
$mainStat = GameConst::$defaultStatNPCMax - Util::randRangeInt(0, 10);
//TODO: defaultStatNPCTotal, defaultStatNPCMin 추가
$otherStat = $minStat + Util::randRangeInt(0, 5);
$subStat = $totalStat - $mainStat - $otherStat;
if ($subStat < $minStat) {
$subStat = $otherStat;
$otherStat = GameConst::$defaultStatMin;
$mainStat = GameConst::$defaultStatTotal - $subStat - $otherStat;
$otherStat = $minStat;
$mainStat = $totalStat - $subStat - $otherStat;
if ($mainStat) {
throw new \LogicException('기본 스탯 설정값이 잘못되어 있음');
}
@@ -207,14 +220,12 @@ class che_인재탐색 extends Command\GeneralCommand{
[$dexTotal / 8, $dexTotal * 5 / 8, $dexTotal / 8, $dexTotal / 8],
[$dexTotal / 8, $dexTotal / 8, $dexTotal * 5 / 8, $dexTotal / 8],
]);
}
else if($pickType == '지'){
} else if ($pickType == '지') {
$leadership = $subStat;
$strength = $otherStat;
$intel = $mainStat;
$dexVal = [$dexTotal / 8, $dexTotal / 8, $dexTotal * 5 / 8, $dexTotal / 8];
}
else{
} else {
$leadership = $otherStat;
$strength = $subStat;
$intel = $mainStat;
@@ -245,8 +256,7 @@ class che_인재탐색 extends Command\GeneralCommand{
$noScout = false;
if ($this->nation['scout'] != 0) {
$noScout = true;
}
else if($relYear < 3 && $this->nation['gennum'] >= GameConst::$initialNationGenLimit){
} else if ($relYear < 3 && $this->nation['gennum'] >= GameConst::$initialNationGenLimit) {
$noScout = true;
}
@@ -329,6 +339,4 @@ class che_인재탐색 extends Command\GeneralCommand{
$general->applyDB($db);
return true;
}
}
+31 -21
View File
@@ -1,8 +1,11 @@
<?php
namespace sammo\Command\Nation;
use\sammo\{
DB, Util, JosaUtil,
DB,
Util,
JosaUtil,
General,
ActionLogger,
GameConst,
@@ -23,15 +26,18 @@ use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper;
class che_의병모집 extends Command\NationCommand{
class che_의병모집 extends Command\NationCommand
{
static protected $actionName = '의병모집';
protected function argTest():bool{
protected function argTest(): bool
{
$this->arg = null;
return true;
}
protected function init(){
protected function init()
{
$general = $this->generalObj;
@@ -49,7 +55,8 @@ class che_의병모집 extends Command\NationCommand{
];
}
public function getCommandDetailTitle():string{
public function getCommandDetailTitle(): string
{
$name = $this->getName();
$reqTurn = $this->getPreReqTurn() + 1;
$postReqTurn = $this->getPostReqTurn();
@@ -57,15 +64,18 @@ class che_의병모집 extends Command\NationCommand{
return "{$name}/{$reqTurn}턴(전략$postReqTurn)";
}
public function getCost():array{
public function getCost(): array
{
return [0, 0];
}
public function getPreReqTurn():int{
public function getPreReqTurn(): int
{
return 2;
}
public function getPostReqTurn():int{
public function getPostReqTurn(): int
{
$genCount = Util::valueFit($this->nation['gennum'], GameConst::$initialNationGenLimit);
$nextTerm = Util::round(sqrt($genCount * 10) * 10);
@@ -73,7 +83,8 @@ class che_의병모집 extends Command\NationCommand{
return $nextTerm;
}
public function run():bool{
public function run(): bool
{
if (!$this->hasFullConditionMet()) {
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}
@@ -146,13 +157,16 @@ class che_의병모집 extends Command\NationCommand{
for (; $createGenIdx <= $lastCreatGenIdx; $createGenIdx++) {
$pickType = Util::choiceRandomUsingWeight($pickTypeList);
$mainStat = GameConst::$defaultStatMax - Util::randRangeInt(0, 10);
$otherStat = GameConst::$defaultStatMin + Util::randRangeInt(0, 5);
$subStat = GameConst::$defaultStatTotal - $mainStat - $otherStat;
if($subStat < GameConst::$defaultStatMin){
$totalStat = GameConst::$defaultStatNPCMax * 2 + 10;
$minStat = 10;
$mainStat = GameConst::$defaultStatNPCMax - Util::randRangeInt(0, 10);
//TODO: defaultStatNPCTotal, defaultStatNPCMin 추가
$otherStat = $minStat + Util::randRangeInt(0, 5);
$subStat = $totalStat - $mainStat - $otherStat;
if ($subStat < $minStat) {
$subStat = $otherStat;
$otherStat = GameConst::$defaultStatMin;
$mainStat = GameConst::$defaultStatTotal - $subStat - $otherStat;
$otherStat = $minStat;
$mainStat = $totalStat - $subStat - $otherStat;
if ($mainStat) {
throw new \LogicException('기본 스탯 설정값이 잘못되어 있음');
}
@@ -167,14 +181,12 @@ class che_의병모집 extends Command\NationCommand{
[$dexTotal / 8, $dexTotal * 5 / 8, $dexTotal / 8, $dexTotal / 8],
[$dexTotal / 8, $dexTotal / 8, $dexTotal * 5 / 8, $dexTotal / 8],
]);
}
else if($pickType == '지'){
} else if ($pickType == '지') {
$leadership = $subStat;
$strength = $otherStat;
$intel = $mainStat;
$dexVal = [$dexTotal / 8, $dexTotal / 8, $dexTotal * 5 / 8, $dexTotal / 8];
}
else{
} else {
$leadership = $otherStat;
$strength = $subStat;
$intel = $mainStat;
@@ -243,6 +255,4 @@ class che_의병모집 extends Command\NationCommand{
return true;
}
}
+2
View File
@@ -235,7 +235,9 @@ class Scenario{
'defaultStatTotal'=>$this->data['stat']['total']??$default['stat']['total'],
'defaultStatMin'=>$this->data['stat']['min']??$default['stat']['min'],
'defaultStatMax'=>$this->data['stat']['max']??$default['stat']['max'],
'defaultStatNPCTotal'=>$this->data['stat']['npcTotal']??$default['stat']['npcTotal'],
'defaultStatNPCMax'=>$this->data['stat']['npcMax']??$default['stat']['npcMax'],
'defaultStatNPCMin'=>$this->data['stat']['npcMin']??$default['stat']['npcMin'],
'chiefStatMin'=>$this->data['stat']['chiefMin']??$default['stat']['chiefMin'],
];
+3 -1
View File
@@ -3,7 +3,9 @@
"total":150,
"min":10,
"max":75,
"npcMax":95,
"npcTotal":155,
"npcMax":80,
"npcMin":10,
"chiefMin":65
},
"iconPath":"."
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":170,
"npcMax":95,
"npcMin":10
},
"const":{
"defaultMaxGeneral":800
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":170,
"npcMax":95,
"npcMin":10
},
"map":{
"mapName":"miniche"
+2
View File
@@ -7,7 +7,9 @@
"diplomacy":[
],
"stat":{
"npcTotal":120,
"npcMax":65,
"npcMin":10,
"chiefMin":55
},
"const":{
+2
View File
@@ -10,7 +10,9 @@
"total":260,
"min":40,
"max":120,
"npcTotal":120,
"npcMax":65,
"npcMin":10,
"chiefMin":55
},
"const":{
+2
View File
@@ -10,7 +10,9 @@
"total":260,
"min":40,
"max":120,
"npcTotal":120,
"npcMax":65,
"npcMin":10,
"chiefMin":55
},
"map":{
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":170,
"npcMax":95,
"npcMin":10
},
"const":{
"defaultMaxGeneral":600
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":170,
"npcMax":95,
"npcMin":10
},
"const":{
"defaultMaxGeneral":800
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":170,
"npcMax":95,
"npcMin":10
},
"const":{
"defaultMaxGeneral":800
+3 -1
View File
@@ -6,7 +6,9 @@
"total":250,
"min":60,
"max":110,
"npcMax":100
"npcTotal":190,
"npcMax":100,
"npcMin":10
},
"iconPath":"환상향",
"nation":[
+3 -1
View File
@@ -6,7 +6,9 @@
"total":250,
"min":60,
"max":110,
"npcMax":100
"npcTotal":190,
"npcMax":100,
"npcMin":10
},
"iconPath":"환상향",
"nation":[
+3 -1
View File
@@ -11,7 +11,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":210,
"npcMax":95,
"npcMin":40
},
"general":[
[0, "아이유", null, 0, null, 90, 56, 100, 0, 160, 250, "의협", "집중"],
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":200,
"npcMax":95,
"npcMin":20
},
"general":[
[0, "모에", null, 0, null, 68, 55, 82, 0, 160, 300, null, null],
+3 -1
View File
@@ -10,7 +10,9 @@
"total":220,
"min":40,
"max":95,
"npcMax":95
"npcTotal":200,
"npcMax":95,
"npcMin":20
},
"general":[
[0, "흑뢰의라이제", null, 0, null, 91, 71, 93, 0, 160, 300, "의협", "집중"],
+2
View File
@@ -9,7 +9,9 @@
"total": 225,
"min": 40,
"max": 95,
"npcTotal":190,
"npcMax":90,
"npcMin":30,
"chiefMin": 65
},
"iconPath": "스타1프로게이머",
+2
View File
@@ -9,7 +9,9 @@
"total": 240,
"min": 40,
"max": 110,
"npcTotal":200,
"npcMax":90,
"npcMin":20,
"chiefMin": 65
},
"iconPath": "포켓몬스터",