feat: '능동 행동 수' 유산 포인트 추가

- 거병, 건국, 방량, 선양, 모반
- 임관, 랜덤임관, 장수대상임관, 등용수락, 하야
- 출병(500명 이상, 훈사 7070 초과)
- 인재탐색 성공(난도에 따라 추가 보정)
- 첩보(예외, 0.5)
- 증축, 감축, 국기변경, 국호변경, 천도성공
This commit is contained in:
2021-11-16 21:38:55 +09:00
parent 375b08be87
commit 0c0283dc02
21 changed files with 63 additions and 37 deletions
+1
View File
@@ -162,6 +162,7 @@ class che_거병 extends Command\GeneralCommand{
$exp = 100;
$ded = 100;
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp);
$general->addDedication($ded);
$general->setVar('belong', 1);
+1
View File
@@ -188,6 +188,7 @@ class che_건국 extends Command\GeneralCommand
refreshNationStaticInfo();
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange();
tryUniqueItemLottery($general, '건국');
@@ -100,7 +100,7 @@ class che_등용수락 extends Command\GeneralCommand{
public function getCost():array{
return [0, 0];
}
public function getPreReqTurn():int{
return 0;
}
@@ -135,7 +135,7 @@ class che_등용수락 extends Command\GeneralCommand{
}
$isTroopLeader = ($generalID == $general->getVar('troop'));
$destGeneral->addExperience(100);
$destGeneral->addDedication(100);
@@ -188,13 +188,13 @@ class che_등용수락 extends Command\GeneralCommand{
$destLogger->pushGeneralHistoryLog("<Y>{$generalName}</> 등용에 성공");
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>{$josaRo} <S>망명</>하였습니다.");
if($nationID != 0){
$db->update('nation', $setOriginalNationValues, 'nation=%i', $nationID);
}
$db->update('nation', $setScoutNationValues, 'nation=%i', $destNationID);
$general->increaseInheritancePoint('active_action', 1);
$general->setVar('permission', 'normal');
$general->setVar('belong', 1);
$general->setVar('officer_level', 1);
@@ -285,6 +285,7 @@ class che_랜덤임관 extends Command\GeneralCommand
$general->setAuxVar('joinedNations', $joinedNations);
}
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange();
@@ -96,6 +96,7 @@ class che_모반시도 extends Command\GeneralCommand{
$lordLogger->pushGeneralHistoryLog("<D><b>{$generalName}</b></>의 모반으로 인해 <D><b>{$nationName}</b></>의 군주자리를 박탈당함");
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->increaseInheritancePoint('active_action', 1);
$general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db);
+1 -1
View File
@@ -121,7 +121,7 @@ class che_방랑 extends Command\GeneralCommand{
], 'me=%i OR you=%i', $nationID, $nationID);
refreshNationStaticInfo();
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
tryRollbackInheritUniqueItem($general);
$general->applyDB($db);
+1
View File
@@ -135,6 +135,7 @@ class che_선양 extends Command\GeneralCommand
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 <Y>{$destGeneralName}</>에게 선양");
$destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 물려 받음");
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange();
tryRollbackInheritUniqueItem($general);
@@ -160,7 +160,7 @@ class che_인재탐색 extends Command\GeneralCommand
$exp = 100 * (sqrt(1 / $foundProp) + 1);
$ded = 150 * (sqrt(1 / $foundProp) + 1);
$scoutType = "발견";
$age = Util::randRangeInt(20, 25);
@@ -172,7 +172,7 @@ class che_인재탐색 extends Command\GeneralCommand
avg(dex1+dex2+dex3+dex4) as dex_t, avg(age) as age, avg(dex5) as dex5
from general where npc < 4'
);
$pickTypeList = ['무' => 6, '지' => 6, '무지' => 3];
$pickedNPC = pickGeneralFromPool($db, 0, 1)[0];
@@ -210,6 +210,7 @@ class che_인재탐색 extends Command\GeneralCommand
$exp = 200;
$ded = 300;
$general->increaseInheritancePoint('active_action', Util::valueFit(sqrt(1 / $foundProp), 1));
$general->increaseVarWithLimit('gold', -$reqGold, 0);
$general->increaseVarWithLimit('rice', -$reqRice, 0);
$general->addExperience($exp);
+10 -9
View File
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
use \sammo\{
DB, Util, JosaUtil,
General,
General,
ActionLogger,
GameConst, GameUnitConst,
LastTurn,
@@ -46,7 +46,7 @@ class che_임관 extends Command\GeneralCommand{
$this->arg = [
'destNationID' => $destNationID
];
return true;
}
@@ -69,7 +69,7 @@ class che_임관 extends Command\GeneralCommand{
ConstraintHelper::BeNeutral(),
ConstraintHelper::AllowJoinAction()
];
}
public function getCommandDetailTitle():string{
@@ -99,7 +99,7 @@ class che_임관 extends Command\GeneralCommand{
public function getCost():array{
return [0, 0];
}
public function getPreReqTurn():int{
return 0;
}
@@ -150,7 +150,7 @@ class che_임관 extends Command\GeneralCommand{
$general->setVar('officer_level', 1);
$general->setVar('officer_city', 0);
$general->setVar('belong', 1);
if($this->destGeneralObj !== null){
$general->setVar('city', $this->destGeneralObj->getCityID());
}
@@ -171,6 +171,7 @@ class che_임관 extends Command\GeneralCommand{
$general->setAuxVar('joinedNations', $joinedNations);
}
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange();
@@ -221,17 +222,17 @@ class che_임관 extends Command\GeneralCommand{
}
}
unset($nation);
ob_start();
ob_start();
?>
국가에 임관합니다.<br>
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
바로 군주의 위치로 이동합니다.<br>
임관할 국가를 목록에서 선택하세요.<br>
임관할 국가를 목록에서 선택하세요.<br>
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
<?php foreach($nationList as $nation): ?>
<?php if(key_exists($nation['nation'], $hiddenItems)){ continue; } ?>
<option
value='<?=$nation['nation']?>'
<option
value='<?=$nation['nation']?>'
style='<?=$nation['availableJoin']?'':'background-color:red;'?>'
>【<?=$nation['name']?> 】</option>
<?php endforeach; ?>
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
use \sammo\{
DB, Util, JosaUtil,
General,
General,
ActionLogger,
GameConst, GameUnitConst,
LastTurn,
@@ -73,7 +73,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
ConstraintHelper::BeNeutral(),
ConstraintHelper::AllowJoinAction()
];
}
public function getCommandDetailTitle():string{
@@ -105,7 +105,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
public function getCost():array{
return [0, 0];
}
public function getPreReqTurn():int{
return 0;
}
@@ -155,7 +155,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
$general->setVar('officer_level', 1);
$general->setVar('officer_city', 0);
$general->setVar('belong', 1);
if($this->destGeneralObj !== null){
$general->setVar('city', $this->destGeneralObj->getCityID());
}
@@ -176,6 +176,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
$general->setAuxVar('joinedNations', $joinedNations);
}
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange();
@@ -229,12 +230,12 @@ class che_장수대상임관 extends Command\GeneralCommand{
}
}
unset($nation);
ob_start();
ob_start();
?>
장수를 따라 임관합니다.<br>
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
바로 군주의 위치로 이동합니다.<br>
임관할 국가를 목록에서 선택하세요.<br>
임관할 국가를 목록에서 선택하세요.<br>
<select class='formInput' name="destGeneralID" id="destGeneralID" size='1' style='color:white;background-color:black;'>
<?php foreach($generalList as $targetGeneral): ?>
<?php if(key_exists($targetGeneral['nation'], $hiddenItems)){ continue; } ?>
+1
View File
@@ -211,6 +211,7 @@ class che_첩보 extends Command\GeneralCommand
$ded = Util::randRangeInt(1, 70);
[$reqGold, $reqRice] = $this->getCost();
$general->increaseInheritancePoint('active_action', 0.5);//NOTE: 첩보만 예외!
$general->increaseVarWithLimit('gold', -$reqGold, 0);
$general->increaseVarWithLimit('rice', -$reqRice, 0);
$general->addExperience($exp);
+5 -1
View File
@@ -223,9 +223,13 @@ class che_출병 extends Command\GeneralCommand
$this->destCity['term'] = 3;
$general->addDex($general->getCrewTypeObj(), $general->getVar('crew') / 100);
if($general->getVar('crew') > 500 && $general->getVar('train') * $general->getVar('atmos') > 70 * 70){
//500명 이상, 모훈출, 모사출
$general->increaseInheritancePoint('active_action', 1);
}
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->applyDB($db);
processWar($general, $this->nation, $this->destCity);
+1
View File
@@ -101,6 +101,7 @@ class che_하야 extends Command\GeneralCommand{
$general->setVar('officer_city', 0);
$general->setVar('belong', 0);
$general->setVar('makelimit', 12);
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange();