Squashed commit of the following:
commit3ef363a01eAuthor: hide_d <hided62@gmail.com> Date: Mon Sep 6 02:30:00 2021 +0900 fix: 은퇴 시 숙련 포인트를 지나치게 많이 받는 문제 수정 commit9e68bc90c2Author: hide_d <hided62@gmail.com> Date: Mon Sep 6 02:17:56 2021 +0900 재야에서 도시보기 warning commitd2590607c2Author: hide_d <hided62@gmail.com> Date: Sun Sep 5 23:05:06 2021 +0900 fix: div 0 commit2bce6e4f02Author: hide_d <hided62@gmail.com> Date: Sun Sep 5 23:02:52 2021 +0900 warning 메시지 수정 commite64812da72Author: hide_d <hided62@gmail.com> Date: Sat Sep 4 03:42:09 2021 +0900 fix: m장, 의병장 숙련이 설정되지 않는 버그 수정 commit7cd40fca03Author: hide_d <hided62@gmail.com> Date: Sat Aug 21 16:04:03 2021 +0900 fix: 모병/징병에서 조건 검사부 통솔 계산값 commitd1568a3b2cAuthor: hide_d <hided62@gmail.com> Date: Sat Aug 21 02:50:54 2021 +0900 허보에 수몰이 같이 들어간 버그 수정 commite7dcc84afcAuthor: hide_d <hided62@gmail.com> Date: Thu Aug 19 14:51:50 2021 +0900 REAMDME.md 버전 수정 commit8eaa940d4eAuthor: hide_d <hided62@gmail.com> Date: Wed Aug 18 20:40:37 2021 +0900 Revert "fix: 7.2에서 오동작 버그 수정" This reverts commit9997675b1d. commit9997675b1dAuthor: hide_d <hided62@gmail.com> Date: Wed Aug 18 20:32:47 2021 +0900 fix: 7.2에서 오동작 버그 수정 commit9ef566f11fAuthor: hide_d <hided62@gmail.com> Date: Wed Aug 18 20:26:31 2021 +0900 fix: 아이템중 WarActivateSkill 관련 중첩 해제 버그 수정
This commit is contained in:
@@ -20,9 +20,9 @@
|
|||||||
* `git`
|
* `git`
|
||||||
* `curl`
|
* `curl`
|
||||||
|
|
||||||
Linux는 Ubuntu 18.04, 20.04, Windows는 Windows 10에서 XAMPP, WSL2를 사용한 환경에서 테스트되었습니다.
|
Linux는 Ubuntu 18.04, 20.04, Windows는 WSL2를 사용한 환경에서 테스트되었습니다.
|
||||||
|
|
||||||
Docker를 이용한 설치는 테스트버전만 제공됩니다.
|
Docker를 이용한 설치도 제공하고 있습니다.
|
||||||
|
|
||||||
## Docker를 이용한 설치
|
## Docker를 이용한 설치
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ $db = DB::db();
|
|||||||
increaseRefresh("현재도시", 1);
|
increaseRefresh("현재도시", 1);
|
||||||
|
|
||||||
$me = $db->queryFirstRow('SELECT no,nation,officer_level,city from general where owner=%i', $userID);
|
$me = $db->queryFirstRow('SELECT no,nation,officer_level,city from general where owner=%i', $userID);
|
||||||
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']);
|
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation'])??[
|
||||||
|
'nation'=>0,
|
||||||
|
'level'=>0,
|
||||||
|
'spy'=>''
|
||||||
|
];
|
||||||
|
|
||||||
$templates = new \League\Plates\Engine('templates');
|
$templates = new \League\Plates\Engine('templates');
|
||||||
|
|
||||||
@@ -375,7 +379,7 @@ $genTotal = 0;
|
|||||||
|
|
||||||
|
|
||||||
foreach($generalsFormat as $general){
|
foreach($generalsFormat as $general){
|
||||||
if($general['nation'] == 0){
|
if(!$general['nation'] || !$myNation['nation']){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if($general['nation'] != $myNation['nation']){
|
if($general['nation'] != $myNation['nation']){
|
||||||
|
|||||||
+15
-8
@@ -654,7 +654,7 @@ function updateNationState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
$score *= $trialCnt;
|
$score *= $trialCnt;
|
||||||
|
|
||||||
$uniqueLotteryWeightList[$nationGen->getID()] = [$nationGen, $score];
|
$uniqueLotteryWeightList[$nationGen->getID()] = [$nationGen, $score];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,7 +745,7 @@ function checkStatistic()
|
|||||||
];
|
];
|
||||||
|
|
||||||
$avgGeneral = $db->queryFirstRow(
|
$avgGeneral = $db->queryFirstRow(
|
||||||
'SELECT avg(gold) as avggold, avg(rice) as avgrice, avg(dex1+dex2+dex3+dex4) as avgdex,
|
'SELECT avg(gold) as avggold, avg(rice) as avgrice, avg(dex1+dex2+dex3+dex4) as avgdex,
|
||||||
max(dex1+dex2+dex3+dex4) as maxdex, avg(experience+dedication) as avgexpded, max(experience+dedication) as maxexpded
|
max(dex1+dex2+dex3+dex4) as maxdex, avg(experience+dedication) as avgexpded, max(experience+dedication) as maxexpded
|
||||||
FROM general'
|
FROM general'
|
||||||
);
|
);
|
||||||
@@ -1022,8 +1022,8 @@ function checkEmperior()
|
|||||||
$nation['generals'] = $nationGenerals;
|
$nation['generals'] = $nationGenerals;
|
||||||
|
|
||||||
$tigers = $db->query(
|
$tigers = $db->query(
|
||||||
'SELECT value, name
|
'SELECT value, name
|
||||||
FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no
|
FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no
|
||||||
WHERE rank_data.nation_id = %i AND rank_data.type = "killnum" AND value > 0 ORDER BY value DESC LIMIT 5',
|
WHERE rank_data.nation_id = %i AND rank_data.type = "killnum" AND value > 0 ORDER BY value DESC LIMIT 5',
|
||||||
$nationID
|
$nationID
|
||||||
); // 오호장군
|
); // 오호장군
|
||||||
@@ -1034,8 +1034,8 @@ function checkEmperior()
|
|||||||
}, $tigers));
|
}, $tigers));
|
||||||
|
|
||||||
$eagles = $db->query(
|
$eagles = $db->query(
|
||||||
'SELECT value, name
|
'SELECT value, name
|
||||||
FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no
|
FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no
|
||||||
WHERE rank_data.nation_id = %i AND rank_data.type = "firenum" AND value > 0 ORDER BY value DESC LIMIT 7',
|
WHERE rank_data.nation_id = %i AND rank_data.type = "firenum" AND value > 0 ORDER BY value DESC LIMIT 7',
|
||||||
$nationID
|
$nationID
|
||||||
); // 건안칠자
|
); // 건안칠자
|
||||||
@@ -1150,10 +1150,17 @@ function checkEmperior()
|
|||||||
LogHistory();
|
LogHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetInheritanceUser(int $userID){
|
function resetInheritanceUser(int $userID, bool $isRebirth=false){
|
||||||
|
$rebirthDegraded = [
|
||||||
|
'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 [$value,]){
|
foreach($inheritStor->getAll() as $key=>[$value,]){
|
||||||
|
if(key_exists($key, $rebirthDegraded)){
|
||||||
|
$value *= $rebirthDegraded[$key];
|
||||||
|
}
|
||||||
$totalPoint += $value;
|
$totalPoint += $value;
|
||||||
}
|
}
|
||||||
$totalPoint = Util::toInt($totalPoint);
|
$totalPoint = Util::toInt($totalPoint);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo\ActionItem;
|
namespace sammo\ActionItem;
|
||||||
|
|
||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
use \sammo\GeneralTrigger;
|
use \sammo\GeneralTrigger;
|
||||||
@@ -10,7 +12,8 @@ use sammo\BaseWarUnitTrigger;
|
|||||||
use sammo\WarUnitTrigger\che_부상무효;
|
use sammo\WarUnitTrigger\che_부상무효;
|
||||||
use sammo\WarUnitTrigger\WarActivateSkills;
|
use sammo\WarUnitTrigger\WarActivateSkills;
|
||||||
|
|
||||||
class che_부적_태현청생부 extends \sammo\BaseItem{
|
class che_부적_태현청생부 extends \sammo\BaseItem
|
||||||
|
{
|
||||||
|
|
||||||
protected $id = 9;
|
protected $id = 9;
|
||||||
protected $rawName = '태현청생부';
|
protected $rawName = '태현청생부';
|
||||||
@@ -19,16 +22,18 @@ class che_부적_태현청생부 extends \sammo\BaseItem{
|
|||||||
protected $cost = 200;
|
protected $cost = 200;
|
||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE),
|
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 303),
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 303, false, '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 303, false, '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class event_전투특기_반계 extends \sammo\BaseItem{
|
|||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '계략약화'),
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*401, false, '계략약화'),
|
||||||
new che_반계시도($unit),
|
new che_반계시도($unit),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ class che_event_견고 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE),
|
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM),
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*402, false, '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '계략약화', '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*402, false, '필살불가', '계략약화', '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo\ActionSpecialDomestic;
|
namespace sammo\ActionSpecialDomestic;
|
||||||
|
|
||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
use \sammo\SpecialityHelper;
|
use \sammo\SpecialityHelper;
|
||||||
@@ -10,7 +12,8 @@ use \sammo\WarUnitTrigger\WarActivateSkills;
|
|||||||
use \sammo\WarUnitTrigger\che_반계시도;
|
use \sammo\WarUnitTrigger\che_반계시도;
|
||||||
use \sammo\WarUnitTrigger\che_반계발동;
|
use \sammo\WarUnitTrigger\che_반계발동;
|
||||||
|
|
||||||
class che_event_반계 extends \sammo\BaseSpecial{
|
class che_event_반계 extends \sammo\BaseSpecial
|
||||||
|
{
|
||||||
|
|
||||||
protected $id = 45;
|
protected $id = 45;
|
||||||
protected $name = '반계';
|
protected $name = '반계';
|
||||||
@@ -22,18 +25,20 @@ class che_event_반계 extends \sammo\BaseSpecial{
|
|||||||
SpecialityHelper::STAT_INTEL,
|
SpecialityHelper::STAT_INTEL,
|
||||||
];
|
];
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux = null)
|
||||||
if($statName === 'warMagicSuccessDamage' && $aux === '반목'){
|
{
|
||||||
|
if ($statName === 'warMagicSuccessDamage' && $aux === '반목') {
|
||||||
return $value + 0.9;
|
return $value + 0.9;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '계략약화'),
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 403, false, '계략약화'),
|
||||||
new che_반계시도($unit),
|
new che_반계시도($unit),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo\ActionSpecialWar;
|
namespace sammo\ActionSpecialWar;
|
||||||
|
|
||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
use \sammo\SpecialityHelper;
|
use \sammo\SpecialityHelper;
|
||||||
@@ -9,7 +11,8 @@ use sammo\BaseWarUnitTrigger;
|
|||||||
use sammo\WarUnitTrigger\che_부상무효;
|
use sammo\WarUnitTrigger\che_부상무효;
|
||||||
use sammo\WarUnitTrigger\WarActivateSkills;
|
use sammo\WarUnitTrigger\WarActivateSkills;
|
||||||
|
|
||||||
class che_견고 extends \sammo\BaseSpecial{
|
class che_견고 extends \sammo\BaseSpecial
|
||||||
|
{
|
||||||
|
|
||||||
protected $id = 62;
|
protected $id = 62;
|
||||||
protected $name = '견고';
|
protected $name = '견고';
|
||||||
@@ -21,20 +24,23 @@ class che_견고 extends \sammo\BaseSpecial{
|
|||||||
SpecialityHelper::STAT_STRENGTH
|
SpecialityHelper::STAT_STRENGTH
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE),
|
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 404),
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 404, false, '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '계략약화', '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 404, false, '필살불가', '계략약화', '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
public function getWarPowerMultiplier(WarUnit $unit): array
|
||||||
|
{
|
||||||
return [1, 0.9];
|
return [1, 0.9];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class che_반계 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '계략약화'),
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 406, false, '계략약화'),
|
||||||
new che_반계시도($unit),
|
new che_반계시도($unit),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -184,12 +184,6 @@ class che_허보 extends Command\NationCommand
|
|||||||
);
|
);
|
||||||
$destNationLogger->flush();
|
$destNationLogger->flush();
|
||||||
|
|
||||||
|
|
||||||
$db->update('city', [
|
|
||||||
'def' => $db->sqleval('def * 0.2'),
|
|
||||||
'wall' => $db->sqleval('wall * 0.2'),
|
|
||||||
], 'city=%i', $destCityID);
|
|
||||||
|
|
||||||
$josaYiNation = JosaUtil::pick($nationName, '이');
|
$josaYiNation = JosaUtil::pick($nationName, '이');
|
||||||
|
|
||||||
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>에 <M>허보</>를 발동");
|
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>에 <M>허보</>를 발동");
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ class ReqGeneralCrewMargin extends Constraint{
|
|||||||
$reqCrewType = GameUnitConst::byID($this->arg);
|
$reqCrewType = GameUnitConst::byID($this->arg);
|
||||||
|
|
||||||
//XXX: 왜 General -> obj -> General 변환을 하고 있나?
|
//XXX: 왜 General -> obj -> General 변환을 하고 있나?
|
||||||
$generalObj = new General($this->general, null, null, null, null, null, false);
|
//FIXME: RankVar, city에 따라 통솔이 바뀐다면 이 부분에 문제가 발생.
|
||||||
|
$generalObj = new General($this->general, null, null, null, null, null, true);
|
||||||
|
|
||||||
if($reqCrewType->id != $generalObj->getCrewTypeObj()->id){
|
if($reqCrewType->id != $generalObj->getCrewTypeObj()->id){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+87
-87
@@ -46,7 +46,7 @@ class General implements iAction{
|
|||||||
'tsw'=>1, 'tsd'=>1, 'tsl'=>1, 'tsg'=>1, 'tsp'=>1,
|
'tsw'=>1, 'tsd'=>1, 'tsl'=>1, 'tsg'=>1, 'tsp'=>1,
|
||||||
'tiw'=>1, 'tid'=>1, 'til'=>1, 'tig'=>1, 'tip'=>1,
|
'tiw'=>1, 'tid'=>1, 'til'=>1, 'tig'=>1, 'tip'=>1,
|
||||||
'betwin'=>1, 'betgold'=>1, 'betwingold'=>1,
|
'betwin'=>1, 'betgold'=>1, 'betwingold'=>1,
|
||||||
'killcrew_person'=>1, 'deathcrew_person'=>1,
|
'killcrew_person'=>1, 'deathcrew_person'=>1,
|
||||||
'occupied'=>1,
|
'occupied'=>1,
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class General implements iAction{
|
|||||||
if($nation === null){
|
if($nation === null){
|
||||||
$nation = getNationStaticInfo($raw['nation']);
|
$nation = getNationStaticInfo($raw['nation']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->raw = $raw;
|
$this->raw = $raw;
|
||||||
$this->rawCity = $city;
|
$this->rawCity = $city;
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj = buildGeneralSpecialWarClass($raw['special2']);
|
$this->specialWarObj = buildGeneralSpecialWarClass($raw['special2']);
|
||||||
|
|
||||||
$this->personalityObj = buildPersonalityClass($raw['personal']);
|
$this->personalityObj = buildPersonalityClass($raw['personal']);
|
||||||
|
|
||||||
$this->itemObjs['horse'] = buildItemClass($raw['horse']);
|
$this->itemObjs['horse'] = buildItemClass($raw['horse']);
|
||||||
$this->itemObjs['weapon'] = buildItemClass($raw['weapon']);
|
$this->itemObjs['weapon'] = buildItemClass($raw['weapon']);
|
||||||
$this->itemObjs['book'] = buildItemClass($raw['book']);
|
$this->itemObjs['book'] = buildItemClass($raw['book']);
|
||||||
@@ -140,9 +140,9 @@ class General implements iAction{
|
|||||||
|
|
||||||
function initLogger(int $year, int $month){
|
function initLogger(int $year, int $month){
|
||||||
$this->logger = new ActionLogger(
|
$this->logger = new ActionLogger(
|
||||||
$this->getVar('no'),
|
$this->getVar('no'),
|
||||||
$this->getVar('nation'),
|
$this->getVar('nation'),
|
||||||
$year,
|
$year,
|
||||||
$month,
|
$month,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@@ -330,10 +330,10 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param General[] $generalList
|
* @param General[] $generalList
|
||||||
* @param int $turnIdxFrom [$turnIdxFrom, $turnIdxTo)
|
* @param int $turnIdxFrom [$turnIdxFrom, $turnIdxTo)
|
||||||
* @param int $turnIdxTo [$turnIdxFrom, $turnIdxTo)
|
* @param int $turnIdxTo [$turnIdxFrom, $turnIdxTo)
|
||||||
* @param array $env
|
* @param array $env
|
||||||
* @return GeneralCommand[]
|
* @return GeneralCommand[]
|
||||||
*/
|
*/
|
||||||
public function getReservedTurnList(int $turnIdxFrom, int $turnIdxTo, array $env){
|
public function getReservedTurnList(int $turnIdxFrom, int $turnIdxTo, array $env){
|
||||||
@@ -346,9 +346,9 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$generalID = $this->getID();
|
$generalID = $this->getID();
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id = %i AND %i <= turn_idx AND turn_idx < %i ORDER BY turn_idx ASC', $generalID, $turnIdxFrom, $turnIdxTo);
|
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id = %i AND %i <= turn_idx AND turn_idx < %i ORDER BY turn_idx ASC', $generalID, $turnIdxFrom, $turnIdxTo);
|
||||||
@@ -359,23 +359,23 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($rawCmds as $turnIdx=>$rawCmd){
|
foreach($rawCmds as $turnIdx=>$rawCmd){
|
||||||
$result[$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg']??null));
|
$result[$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg']??null));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 장수의 스탯을 계산해옴
|
* 장수의 스탯을 계산해옴
|
||||||
*
|
*
|
||||||
* @param string $statName 스탯값, leadership, strength, intel 가능
|
* @param string $statName 스탯값, leadership, strength, intel 가능
|
||||||
* @param bool $withInjury 부상값 사용 여부
|
* @param bool $withInjury 부상값 사용 여부
|
||||||
* @param bool $withIActionObj 아이템, 특성, 성격 등 보정치 적용 여부
|
* @param bool $withIActionObj 아이템, 특성, 성격 등 보정치 적용 여부
|
||||||
* @param bool $withStatAdjust 능력치간 보정 사용 여부
|
* @param bool $withStatAdjust 능력치간 보정 사용 여부
|
||||||
* @param bool $useFloor 내림 사용 여부, false시 float 값을 반환할 수도 있음
|
* @param bool $useFloor 내림 사용 여부, false시 float 값을 반환할 수도 있음
|
||||||
*
|
*
|
||||||
* @return int|float 계산된 능력치
|
* @return int|float 계산된 능력치
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -416,7 +416,7 @@ class General implements iAction{
|
|||||||
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->itemObjs as $actionObj){
|
foreach($this->itemObjs as $actionObj){
|
||||||
if($actionObj !== null){
|
if($actionObj !== null){
|
||||||
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
||||||
@@ -429,7 +429,7 @@ class General implements iAction{
|
|||||||
if($useFloor){
|
if($useFloor){
|
||||||
return Util::toInt($statValue);
|
return Util::toInt($statValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $statValue;
|
return $statValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,7 +486,7 @@ class General implements iAction{
|
|||||||
if($affectTrigger){
|
if($affectTrigger){
|
||||||
$experience = $this->onCalcStat($this, 'experience', $experience);
|
$experience = $this->onCalcStat($this, 'experience', $experience);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->increaseVar('experience', $experience);
|
$this->increaseVar('experience', $experience);
|
||||||
$nextExpLevel = getExpLevel($this->getVar('experience'));
|
$nextExpLevel = getExpLevel($this->getVar('experience'));
|
||||||
$comp = $nextExpLevel <=> $this->getVar('explevel');
|
$comp = $nextExpLevel <=> $this->getVar('explevel');
|
||||||
@@ -503,14 +503,14 @@ class General implements iAction{
|
|||||||
else{
|
else{
|
||||||
$this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <R>레벨다운</>!", ActionLogger::PLAIN);
|
$this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <R>레벨다운</>!", ActionLogger::PLAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addDedication(float $dedication, bool $affectTrigger=true){
|
function addDedication(float $dedication, bool $affectTrigger=true){
|
||||||
if($affectTrigger){
|
if($affectTrigger){
|
||||||
$dedication = $this->onCalcStat($this, 'dedication', $dedication);
|
$dedication = $this->onCalcStat($this, 'dedication', $dedication);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->increaseVar('dedication', $dedication);
|
$this->increaseVar('dedication', $dedication);
|
||||||
$nextDedLevel = getDedLevel($this->getVar('dedication'));
|
$nextDedLevel = getDedLevel($this->getVar('dedication'));
|
||||||
$comp = $nextDedLevel <=> $this->getVar('dedlevel');
|
$comp = $nextDedLevel <=> $this->getVar('dedlevel');
|
||||||
@@ -530,7 +530,7 @@ class General implements iAction{
|
|||||||
else{
|
else{
|
||||||
$this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <R>강등</>되어 봉록이 <C>{$billText}</>{$josaRoBill} <R>하락</>했습니다!", ActionLogger::PLAIN);
|
$this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <R>강등</>되어 봉록이 <C>{$billText}</>{$josaRoBill} <R>하락</>했습니다!", ActionLogger::PLAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateVar(string $key, $value){
|
function updateVar(string $key, $value){
|
||||||
@@ -583,7 +583,7 @@ class General implements iAction{
|
|||||||
$dyingMessageObj = new TextDecoration\DyingMessage($this);
|
$dyingMessageObj = new TextDecoration\DyingMessage($this);
|
||||||
$logger->pushGlobalActionLog($dyingMessageObj->getText());
|
$logger->pushGlobalActionLog($dyingMessageObj->getText());
|
||||||
}
|
}
|
||||||
$logger->flush();
|
$logger->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->update('select_pool', [
|
$db->update('select_pool', [
|
||||||
@@ -611,7 +611,7 @@ class General implements iAction{
|
|||||||
$ownerID = $this->getVar('owner');
|
$ownerID = $this->getVar('owner');
|
||||||
if($ownerID){
|
if($ownerID){
|
||||||
$this->mergeTotalInheritancePoint();
|
$this->mergeTotalInheritancePoint();
|
||||||
resetInheritanceUser($ownerID);
|
resetInheritanceUser($ownerID, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->multiplyVarWithLimit('leadership', 0.85, 10);
|
$this->multiplyVarWithLimit('leadership', 0.85, 10);
|
||||||
@@ -701,7 +701,7 @@ class General implements iAction{
|
|||||||
$this->setVar('last_turn', $this->getResultTurn()->toJson());
|
$this->setVar('last_turn', $this->getResultTurn()->toJson());
|
||||||
}
|
}
|
||||||
$updateVals = $this->getUpdatedValues();
|
$updateVals = $this->getUpdatedValues();
|
||||||
|
|
||||||
|
|
||||||
$generalID = $this->getID();
|
$generalID = $this->getID();
|
||||||
$result = false;
|
$result = false;
|
||||||
@@ -726,7 +726,7 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->rankVarSet){
|
if($this->rankVarSet){
|
||||||
foreach($this->rankVarSet as $rankKey => $rankVal){
|
foreach($this->rankVarSet as $rankKey => $rankVal){
|
||||||
$db->update('rank_data', [
|
$db->update('rank_data', [
|
||||||
@@ -736,7 +736,7 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rankVarIncrease = [];
|
$this->rankVarIncrease = [];
|
||||||
$this->rankVarSet = [];
|
$this->rankVarSet = [];
|
||||||
|
|
||||||
@@ -779,14 +779,14 @@ class General implements iAction{
|
|||||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||||
$caller = new GeneralTriggerCaller();
|
$caller = new GeneralTriggerCaller();
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
|
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -798,11 +798,11 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -817,11 +817,11 @@ class General implements iAction{
|
|||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
//xxx: $general?
|
//xxx: $general?
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -835,11 +835,11 @@ class General implements iAction{
|
|||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -853,11 +853,11 @@ class General implements iAction{
|
|||||||
|
|
||||||
public function onCalcNationalIncome(string $type, $amount){
|
public function onCalcNationalIncome(string $type, $amount){
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -874,11 +874,11 @@ class General implements iAction{
|
|||||||
$att = 1;
|
$att = 1;
|
||||||
$def = 1;
|
$def = 1;
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -894,11 +894,11 @@ class General implements iAction{
|
|||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
$caller = new WarUnitTriggerCaller();
|
$caller = new WarUnitTriggerCaller();
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -921,11 +921,11 @@ class General implements iAction{
|
|||||||
new WarUnitTrigger\che_계략실패($unit)
|
new WarUnitTrigger\che_계략실패($unit)
|
||||||
);
|
);
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -946,8 +946,8 @@ class General implements iAction{
|
|||||||
'horse', 'weapon', 'book', 'item', 'last_turn'
|
'horse', 'weapon', 'book', 'item', 'last_turn'
|
||||||
];
|
];
|
||||||
$fullColumn = [
|
$fullColumn = [
|
||||||
'no', 'name', 'owner', 'owner_name', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity',
|
'no', 'name', 'owner', 'owner_name', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity',
|
||||||
'leadership', 'leadership_exp', 'strength', 'strength_exp', 'intel', 'intel_exp', 'weapon', 'book', 'horse', 'item',
|
'leadership', 'leadership_exp', 'strength', 'strength_exp', 'intel', 'intel_exp', 'weapon', 'book', 'horse', 'item',
|
||||||
'experience', 'dedication', 'officer_level', 'officer_city', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime',
|
'experience', 'dedication', 'officer_level', 'officer_city', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime',
|
||||||
'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'startage', 'belong',
|
'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'startage', 'belong',
|
||||||
'personal', 'special', 'special2', 'defence_train', 'tnmt', 'npc', 'npc_org', 'deadyear', 'npcmsg',
|
'personal', 'special', 'special2', 'defence_train', 'tnmt', 'npc', 'npc_org', 'deadyear', 'npcmsg',
|
||||||
@@ -979,17 +979,17 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ?int[] $generalIDList
|
* @param ?int[] $generalIDList
|
||||||
* @param null|string[] $column
|
* @param null|string[] $column
|
||||||
* @param int $constructMode
|
* @param int $constructMode
|
||||||
* @return \sammo\General[]
|
* @return \sammo\General[]
|
||||||
* @throws MustNotBeReachedException
|
* @throws MustNotBeReachedException
|
||||||
*/
|
*/
|
||||||
static public function createGeneralObjListFromDB(?array $generalIDList, ?array $column=null, int $constructMode=2):array{
|
static public function createGeneralObjListFromDB(?array $generalIDList, ?array $column=null, int $constructMode=2):array{
|
||||||
if($generalIDList === []){
|
if($generalIDList === []){
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
if($constructMode > 0){
|
if($constructMode > 0){
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
@@ -999,7 +999,7 @@ class General implements iAction{
|
|||||||
$year = null;
|
$year = null;
|
||||||
$month = null;
|
$month = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
||||||
|
|
||||||
if($generalIDList === null){
|
if($generalIDList === null){
|
||||||
@@ -1015,7 +1015,7 @@ class General implements iAction{
|
|||||||
'no'
|
'no'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$rawRanks = [];
|
$rawRanks = [];
|
||||||
if($rankColumn){
|
if($rankColumn){
|
||||||
@@ -1043,7 +1043,7 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
$result[$generalID] = new static($rawGenerals[$generalID], $rawRanks[$generalID]??null, null, null, $year, $month, $constructMode > 1);
|
$result[$generalID] = new static($rawGenerals[$generalID], $rawRanks[$generalID]??null, null, null, $year, $month, $constructMode > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,7 +1057,7 @@ class General implements iAction{
|
|||||||
$year = null;
|
$year = null;
|
||||||
$month = null;
|
$month = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
||||||
|
|
||||||
$rawGeneral = $db->queryFirstRow('SELECT %l FROM general WHERE no = %i', Util::formatListOfBackticks($column), $generalID);
|
$rawGeneral = $db->queryFirstRow('SELECT %l FROM general WHERE no = %i', Util::formatListOfBackticks($column), $generalID);
|
||||||
@@ -1072,17 +1072,17 @@ class General implements iAction{
|
|||||||
$rawRankValues[$rankType] = $rankValue;
|
$rawRankValues[$rankType] = $rankValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$general = new static($rawGeneral, $rawRankValues, null, null, $year, $month, $constructMode > 1);
|
$general = new static($rawGeneral, $rawRankValues, null, null, $year, $month, $constructMode > 1);
|
||||||
|
|
||||||
return $general;
|
return $general;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param General[] $generalList
|
* @param General[] $generalList
|
||||||
* @param int $turnIdx
|
* @param int $turnIdx
|
||||||
* @param array $env
|
* @param array $env
|
||||||
* @return GeneralCommand[]
|
* @return GeneralCommand[]
|
||||||
*/
|
*/
|
||||||
static public function getReservedTurnByGeneralList(array $generalList, int $turnIdx, array $env){
|
static public function getReservedTurnByGeneralList(array $generalList, int $turnIdx, array $env){
|
||||||
@@ -1110,10 +1110,10 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param General[] $generalList
|
* @param General[] $generalList
|
||||||
* @param int $turnIdxFrom [$turnIdxFrom, $turnIdxTo)
|
* @param int $turnIdxFrom [$turnIdxFrom, $turnIdxTo)
|
||||||
* @param int $turnIdxTo [$turnIdxFrom, $turnIdxTo)
|
* @param int $turnIdxTo [$turnIdxFrom, $turnIdxTo)
|
||||||
* @param array $env
|
* @param array $env
|
||||||
* @return GeneralCommand[][]
|
* @return GeneralCommand[][]
|
||||||
*/
|
*/
|
||||||
static public function getReservedTurnListByGeneralList(array $generalList, int $turnIdxFrom, int $turnIdxTo, array $env){
|
static public function getReservedTurnListByGeneralList(array $generalList, int $turnIdxFrom, int $turnIdxTo, array $env){
|
||||||
@@ -1135,7 +1135,7 @@ class General implements iAction{
|
|||||||
}, $generalList);
|
}, $generalList);
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id IN %i AND %i <= turn_idx AND turn_idx < %i ORDER BY general_id ASC, turn_idx ASC', $generalIDList, $turnIdxFrom, $turnIdxTo);
|
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id IN %i AND %i <= turn_idx AND turn_idx < %i ORDER BY general_id ASC, turn_idx ASC', $generalIDList, $turnIdxFrom, $turnIdxTo);
|
||||||
$orderedRawCmds = [];
|
$orderedRawCmds = [];
|
||||||
foreach($rawCmds as $rawCmd){
|
foreach($rawCmds as $rawCmd){
|
||||||
@@ -1224,7 +1224,7 @@ class General implements iAction{
|
|||||||
$extractFn = function() use ($multiplier){
|
$extractFn = function() use ($multiplier){
|
||||||
$betWin = $this->getRankVar('betwin');
|
$betWin = $this->getRankVar('betwin');
|
||||||
$betWinRate = $this->getRankVar('betwingold')/max(1, $this->getRankVar('betgold'));
|
$betWinRate = $this->getRankVar('betwingold')/max(1, $this->getRankVar('betgold'));
|
||||||
|
|
||||||
return [$betWin * $multiplier * pow($betWinRate, 2), null];
|
return [$betWin * $multiplier * pow($betWinRate, 2), null];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
@@ -1272,7 +1272,7 @@ class General implements iAction{
|
|||||||
if($gameStor->isunited != 0){
|
if($gameStor->isunited != 0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
||||||
$inheritStor->setValue($key, [$value, $aux]);
|
$inheritStor->setValue($key, [$value, $aux]);
|
||||||
}
|
}
|
||||||
|
|||||||
+76
-76
@@ -97,7 +97,7 @@ class GeneralAI
|
|||||||
else{
|
else{
|
||||||
$this->city = $general->getRawCity();
|
$this->city = $general->getRawCity();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->nation = $db->queryFirstRow(
|
$this->nation = $db->queryFirstRow(
|
||||||
'SELECT nation,name,color,capital,capset,gennum,gold,rice,bill,rate,rate_tmp,scout,war,strategic_cmd_limit,surlimit,tech,power,level,chief_set,type,aux FROM nation WHERE nation = %i',
|
'SELECT nation,name,color,capital,capset,gennum,gold,rice,bill,rate,rate_tmp,scout,war,strategic_cmd_limit,surlimit,tech,power,level,chief_set,type,aux FROM nation WHERE nation = %i',
|
||||||
$general->getNationID()
|
$general->getNationID()
|
||||||
@@ -144,7 +144,7 @@ class GeneralAI
|
|||||||
$this->fullStrength = $general->getStrength(false);
|
$this->fullStrength = $general->getStrength(false);
|
||||||
$this->fullIntel = $general->getIntel(false);
|
$this->fullIntel = $general->getIntel(false);
|
||||||
|
|
||||||
|
|
||||||
$this->genType = $this->calcGenType($general);
|
$this->genType = $this->calcGenType($general);
|
||||||
|
|
||||||
$this->calcDiplomacyState();
|
$this->calcDiplomacyState();
|
||||||
@@ -184,7 +184,7 @@ class GeneralAI
|
|||||||
$genType |= self::t통솔장;
|
$genType |= self::t통솔장;
|
||||||
}
|
}
|
||||||
return $genType;
|
return $genType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function calcDiplomacyState()
|
protected function calcDiplomacyState()
|
||||||
@@ -228,9 +228,9 @@ class GeneralAI
|
|||||||
if(!$onWar && !$onWarReady && !$onWarYet){
|
if(!$onWar && !$onWarReady && !$onWarYet){
|
||||||
$warTargetNation[0] = 1;
|
$warTargetNation[0] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->warTargetNation = $warTargetNation;
|
$this->warTargetNation = $warTargetNation;
|
||||||
|
|
||||||
|
|
||||||
$minWarTerm = $db->queryFirstField('SELECT min(term) FROM diplomacy WHERE me = %i AND state=1', $nationID);
|
$minWarTerm = $db->queryFirstField('SELECT min(term) FROM diplomacy WHERE me = %i AND state=1', $nationID);
|
||||||
if ($minWarTerm === null) {
|
if ($minWarTerm === null) {
|
||||||
@@ -271,7 +271,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
$this->calcWarRoute();
|
$this->calcWarRoute();
|
||||||
$troopCandidate = [];
|
$troopCandidate = [];
|
||||||
|
|
||||||
$chiefTurn = cutTurn($this->general->getTurnTime(), $this->env['turnterm']);
|
$chiefTurn = cutTurn($this->general->getTurnTime(), $this->env['turnterm']);
|
||||||
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
|
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
|
||||||
|
|
||||||
@@ -319,8 +319,8 @@ class GeneralAI
|
|||||||
$troopCandidate[] = [$leaderID, Util::choiceRandom($this->frontCities)['city']];
|
$troopCandidate[] = [$leaderID, Util::choiceRandom($this->frontCities)['city']];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//출발지가 아국땅이 아닌경우 수도->출발지
|
//출발지가 아국땅이 아닌경우 수도->출발지
|
||||||
if(!key_exists($fromCityID, $this->supplyCities)){
|
if(!key_exists($fromCityID, $this->supplyCities)){
|
||||||
$toCityID = $fromCityID;
|
$toCityID = $fromCityID;
|
||||||
@@ -377,7 +377,7 @@ class GeneralAI
|
|||||||
|
|
||||||
$chiefTurn = cutTurn($this->general->getTurnTime(), $this->env['turnterm']);
|
$chiefTurn = cutTurn($this->general->getTurnTime(), $this->env['turnterm']);
|
||||||
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
|
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
|
||||||
|
|
||||||
$troopCandidate = [];
|
$troopCandidate = [];
|
||||||
foreach($this->troopLeaders as $troopLeader){
|
foreach($this->troopLeaders as $troopLeader){
|
||||||
$leaderID = $troopLeader->getID();
|
$leaderID = $troopLeader->getID();
|
||||||
@@ -416,7 +416,7 @@ class GeneralAI
|
|||||||
if(!$troopCandidate){
|
if(!$troopCandidate){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($this->supplyCities) == 1){
|
if(count($this->supplyCities) == 1){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -485,7 +485,7 @@ class GeneralAI
|
|||||||
if(!$troopCandidate){
|
if(!$troopCandidate){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cityCandidates = [];
|
$cityCandidates = [];
|
||||||
|
|
||||||
foreach($this->frontCities as $city){
|
foreach($this->frontCities as $city){
|
||||||
@@ -679,7 +679,7 @@ class GeneralAI
|
|||||||
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
|
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
|
||||||
$pop_ratio /= 4;
|
$pop_ratio /= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
$recruitableCityList[$cityID] = $pop_ratio;
|
$recruitableCityList[$cityID] = $pop_ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -746,9 +746,9 @@ class GeneralAI
|
|||||||
$troopID = $lostGeneral->getVar('troop');
|
$troopID = $lostGeneral->getVar('troop');
|
||||||
if($troopID && key_exists($troopID, $this->troopLeaders)){
|
if($troopID && key_exists($troopID, $this->troopLeaders)){
|
||||||
$troopLeader = $this->troopLeaders[$troopID];
|
$troopLeader = $this->troopLeaders[$troopID];
|
||||||
|
|
||||||
if(
|
if(
|
||||||
key_exists($troopLeader->getCityID(), $this->supplyCities) &&
|
key_exists($troopLeader->getCityID(), $this->supplyCities) &&
|
||||||
$this->troopLeaders[$troopID]->getTurnTime() < $lostGeneral->getTurnTime()
|
$this->troopLeaders[$troopID]->getTurnTime() < $lostGeneral->getTurnTime()
|
||||||
){
|
){
|
||||||
//이미 탈출 가능한 부대를 탔다
|
//이미 탈출 가능한 부대를 탔다
|
||||||
@@ -770,10 +770,10 @@ class GeneralAI
|
|||||||
if(!$args){
|
if(!$args){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$arg = Util::choiceRandom($args);
|
$arg = Util::choiceRandom($args);
|
||||||
$cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, $arg);
|
$cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, $arg);
|
||||||
|
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
LogText('구출실패', [$arg, $cmd->getFailString()]);
|
LogText('구출실패', [$arg, $cmd->getFailString()]);
|
||||||
return null;
|
return null;
|
||||||
@@ -840,7 +840,7 @@ class GeneralAI
|
|||||||
|
|
||||||
return $cmd;
|
return $cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function do유저장내정발령(LastTurn $lastTurn): ?NationCommand
|
protected function do유저장내정발령(LastTurn $lastTurn): ?NationCommand
|
||||||
{
|
{
|
||||||
if(!$this->nation['capital']){
|
if(!$this->nation['capital']){
|
||||||
@@ -870,7 +870,7 @@ class GeneralAI
|
|||||||
if(!key_exists($cityID, $this->supplyCities)){
|
if(!key_exists($cityID, $this->supplyCities)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$city = $this->supplyCities[$cityID];
|
$city = $this->supplyCities[$cityID];
|
||||||
|
|
||||||
if($city['dev'] < 0.95){
|
if($city['dev'] < 0.95){
|
||||||
@@ -980,7 +980,7 @@ class GeneralAI
|
|||||||
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
|
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$recruitableCityList[$cityID] = $pop_ratio;
|
$recruitableCityList[$cityID] = $pop_ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1227,7 +1227,7 @@ class GeneralAI
|
|||||||
$reqMoney = max($reqMoney, $reqHumanMinRes);
|
$reqMoney = max($reqMoney, $reqHumanMinRes);
|
||||||
}
|
}
|
||||||
$enoughMoney = $reqMoney * 1.1;
|
$enoughMoney = $reqMoney * 1.1;
|
||||||
|
|
||||||
if ($targetUserGeneral->getVar($resName) >= $reqMoney) {
|
if ($targetUserGeneral->getVar($resName) >= $reqMoney) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1257,9 +1257,9 @@ class GeneralAI
|
|||||||
if(!$candidateArgs){
|
if(!$candidateArgs){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass(
|
$cmd = buildNationCommandClass(
|
||||||
'che_포상', $this->general, $this->env, $lastTurn,
|
'che_포상', $this->general, $this->env, $lastTurn,
|
||||||
Util::choiceRandomUsingWeightPair($candidateArgs)
|
Util::choiceRandomUsingWeightPair($candidateArgs)
|
||||||
);
|
);
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
@@ -1295,7 +1295,7 @@ class GeneralAI
|
|||||||
|
|
||||||
|
|
||||||
$userGenerals = $this->userGenerals;
|
$userGenerals = $this->userGenerals;
|
||||||
|
|
||||||
|
|
||||||
foreach($remainResource as $resName=>[$reqNationRes, $resVal,$reqHumanMinWarRes,$reqHumanMinDevelRes]){
|
foreach($remainResource as $resName=>[$reqNationRes, $resVal,$reqHumanMinWarRes,$reqHumanMinDevelRes]){
|
||||||
if($resVal < $reqNationRes){
|
if($resVal < $reqNationRes){
|
||||||
@@ -1333,7 +1333,7 @@ class GeneralAI
|
|||||||
$reqMoney = max($reqMoney, $reqHumanMinRes);
|
$reqMoney = max($reqMoney, $reqHumanMinRes);
|
||||||
}
|
}
|
||||||
$enoughMoney = $reqMoney * 1.2;
|
$enoughMoney = $reqMoney * 1.2;
|
||||||
|
|
||||||
if ($targetUserGeneral->getVar($resName) >= $reqMoney) {
|
if ($targetUserGeneral->getVar($resName) >= $reqMoney) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1360,13 +1360,13 @@ class GeneralAI
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$candidateArgs){
|
if(!$candidateArgs){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass(
|
$cmd = buildNationCommandClass(
|
||||||
'che_포상', $this->general, $this->env, $lastTurn,
|
'che_포상', $this->general, $this->env, $lastTurn,
|
||||||
Util::choiceRandomUsingWeightPair($candidateArgs)
|
Util::choiceRandomUsingWeightPair($candidateArgs)
|
||||||
);
|
);
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
@@ -1422,7 +1422,7 @@ class GeneralAI
|
|||||||
$reqMoney = max($reqMoney, $reqNPCMinWarRes);
|
$reqMoney = max($reqMoney, $reqNPCMinWarRes);
|
||||||
}
|
}
|
||||||
$enoughMoney = $reqMoney * 1.2;
|
$enoughMoney = $reqMoney * 1.2;
|
||||||
|
|
||||||
if ($targetNPCGeneral->getVar($resName) >= $reqMoney) {
|
if ($targetNPCGeneral->getVar($resName) >= $reqMoney) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1453,9 +1453,9 @@ class GeneralAI
|
|||||||
if(!$candidateArgs){
|
if(!$candidateArgs){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass(
|
$cmd = buildNationCommandClass(
|
||||||
'che_포상', $this->general, $this->env, $lastTurn,
|
'che_포상', $this->general, $this->env, $lastTurn,
|
||||||
Util::choiceRandomUsingWeightPair($candidateArgs)
|
Util::choiceRandomUsingWeightPair($candidateArgs)
|
||||||
);
|
);
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
@@ -1514,7 +1514,7 @@ class GeneralAI
|
|||||||
$reqMoney = max($reqMoney, $reqNPCMinWarRes);
|
$reqMoney = max($reqMoney, $reqNPCMinWarRes);
|
||||||
}
|
}
|
||||||
$enoughMoney = $reqMoney * 1.5;
|
$enoughMoney = $reqMoney * 1.5;
|
||||||
|
|
||||||
if ($targetNPCGeneral->getVar($resName) >= $reqMoney) {
|
if ($targetNPCGeneral->getVar($resName) >= $reqMoney) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1570,9 +1570,9 @@ class GeneralAI
|
|||||||
if(!$candidateArgs){
|
if(!$candidateArgs){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass(
|
$cmd = buildNationCommandClass(
|
||||||
'che_포상', $this->general, $this->env, $lastTurn,
|
'che_포상', $this->general, $this->env, $lastTurn,
|
||||||
Util::choiceRandomUsingWeightPair($candidateArgs)
|
Util::choiceRandomUsingWeightPair($candidateArgs)
|
||||||
);
|
);
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
@@ -1654,14 +1654,14 @@ class GeneralAI
|
|||||||
return -($lhs->getVar($resName) <=> $rhs->getVar($resName));
|
return -($lhs->getVar($resName) <=> $rhs->getVar($resName));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($npcWarGenerals as $idx=>$targetNPCGeneral){
|
foreach($npcWarGenerals as $idx=>$targetNPCGeneral){
|
||||||
if($willTakeSmallAmount){
|
if($willTakeSmallAmount){
|
||||||
if($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes * 2){
|
if($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes * 2){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes){
|
else if($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes){
|
||||||
break;
|
break;
|
||||||
@@ -1700,9 +1700,9 @@ class GeneralAI
|
|||||||
if(!$candidateArgs){
|
if(!$candidateArgs){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass(
|
$cmd = buildNationCommandClass(
|
||||||
'che_몰수', $this->general, $this->env, $lastTurn,
|
'che_몰수', $this->general, $this->env, $lastTurn,
|
||||||
Util::choiceRandomUsingWeightPair($candidateArgs)
|
Util::choiceRandomUsingWeightPair($candidateArgs)
|
||||||
);
|
);
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
@@ -1777,7 +1777,7 @@ class GeneralAI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[$targetYear, $targetMonth] = Util::parseYearMonth($yearMonth + $diplomatMonth);
|
[$targetYear, $targetMonth] = Util::parseYearMonth($yearMonth + $diplomatMonth);
|
||||||
|
|
||||||
$cmd = buildNationCommandClass('che_불가침제의', $this->general, $this->env, $lastTurn, [
|
$cmd = buildNationCommandClass('che_불가침제의', $this->general, $this->env, $lastTurn, [
|
||||||
@@ -1788,10 +1788,10 @@ class GeneralAI
|
|||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$respAssistTry["n{$destNationID}"] = [$destNationID, $yearMonth];
|
$respAssistTry["n{$destNationID}"] = [$destNationID, $yearMonth];
|
||||||
$nationStor->setValue('resp_assist_try', $respAssistTry);
|
$nationStor->setValue('resp_assist_try', $respAssistTry);
|
||||||
|
|
||||||
return $cmd;
|
return $cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1900,7 +1900,7 @@ class GeneralAI
|
|||||||
else{
|
else{
|
||||||
$warNations[$destNationID] = 1 / sqrt($destNationPower + 1);
|
$warNations[$destNationID] = 1 / sqrt($destNationPower + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!$nations) {
|
if (!$nations) {
|
||||||
if(!$warNations){
|
if(!$warNations){
|
||||||
@@ -1964,7 +1964,7 @@ class GeneralAI
|
|||||||
|
|
||||||
|
|
||||||
//checkSupply()와 비슷하면서 다름
|
//checkSupply()와 비슷하면서 다름
|
||||||
|
|
||||||
$nationCityIDList = [];
|
$nationCityIDList = [];
|
||||||
$this->categorizeNationCities();
|
$this->categorizeNationCities();
|
||||||
foreach($this->nationCities as $city){
|
foreach($this->nationCities as $city){
|
||||||
@@ -1987,7 +1987,7 @@ class GeneralAI
|
|||||||
//수도와 연결된 도시 탐색
|
//수도와 연결된 도시 탐색
|
||||||
while(!$queue->isEmpty()){
|
while(!$queue->isEmpty()){
|
||||||
$cityID = $queue->dequeue();
|
$cityID = $queue->dequeue();
|
||||||
|
|
||||||
foreach(array_keys(CityConst::byID($cityID)->path) as $nextCityID){
|
foreach(array_keys(CityConst::byID($cityID)->path) as $nextCityID){
|
||||||
if(!key_exists($nextCityID, $nationCityIDList)){
|
if(!key_exists($nextCityID, $nationCityIDList)){
|
||||||
continue;
|
continue;
|
||||||
@@ -2049,7 +2049,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
$targetCityID = Util::choiceRandom($candidates);
|
$targetCityID = Util::choiceRandom($candidates);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass('che_천도', $this->general, $this->env, $lastTurn, [
|
$cmd = buildNationCommandClass('che_천도', $this->general, $this->env, $lastTurn, [
|
||||||
'destCityID'=>$targetCityID
|
'destCityID'=>$targetCityID
|
||||||
]);
|
]);
|
||||||
@@ -2058,7 +2058,7 @@ class GeneralAI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$nationStor->last천도Trial = [$general->getVar('officer_level'), $general->getTurnTime()];
|
$nationStor->last천도Trial = [$general->getVar('officer_level'), $general->getTurnTime()];
|
||||||
return $cmd;
|
return $cmd;
|
||||||
}
|
}
|
||||||
@@ -2332,7 +2332,7 @@ class GeneralAI
|
|||||||
|
|
||||||
$absGold = $general->getVar('gold');
|
$absGold = $general->getVar('gold');
|
||||||
$absRice = $general->getVar('rice');
|
$absRice = $general->getVar('rice');
|
||||||
|
|
||||||
$relGold = $absGold;
|
$relGold = $absGold;
|
||||||
$relRice = $absRice * $deathRate;
|
$relRice = $absRice * $deathRate;
|
||||||
|
|
||||||
@@ -2374,7 +2374,7 @@ class GeneralAI
|
|||||||
{
|
{
|
||||||
$tryBuying = true;
|
$tryBuying = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if($relRice * 2 < $relGold && $relRice < $riceCost * 3)
|
if($relRice * 2 < $relGold && $relRice < $riceCost * 3)
|
||||||
@@ -2409,7 +2409,7 @@ class GeneralAI
|
|||||||
{
|
{
|
||||||
$trySelling = true;
|
$trySelling = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if($relGold * 2 < $relRice && $relGold < $goldCost * 3)
|
if($relGold * 2 < $relRice && $relGold < $goldCost * 3)
|
||||||
@@ -2433,7 +2433,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -2448,7 +2448,7 @@ class GeneralAI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$general = $this->getGeneralObj();
|
$general = $this->getGeneralObj();
|
||||||
$city = $this->city;
|
$city = $this->city;
|
||||||
@@ -2470,7 +2470,7 @@ class GeneralAI
|
|||||||
(Util::randF($remainPop/$maxPop))){
|
(Util::randF($remainPop/$maxPop))){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nationID = $general->getNationID();
|
$nationID = $general->getNationID();
|
||||||
@@ -2499,7 +2499,7 @@ class GeneralAI
|
|||||||
GameUnitConst::T_WIZARD => sqrt($general->getVar('dex4') + 500),
|
GameUnitConst::T_WIZARD => sqrt($general->getVar('dex4') + 500),
|
||||||
GameUnitConst::T_SIEGE => sqrt($general->getVar('dex5') + 500),
|
GameUnitConst::T_SIEGE => sqrt($general->getVar('dex5') + 500),
|
||||||
];
|
];
|
||||||
|
|
||||||
$availableArmType = [];
|
$availableArmType = [];
|
||||||
if($this->fullStrength > $this->fullIntel * 0.9){
|
if($this->fullStrength > $this->fullIntel * 0.9){
|
||||||
$availableArmType[GameUnitConst::T_FOOTMAN] = $dex[GameUnitConst::T_FOOTMAN] * $this->fullStrength;
|
$availableArmType[GameUnitConst::T_FOOTMAN] = $dex[GameUnitConst::T_FOOTMAN] * $this->fullStrength;
|
||||||
@@ -2548,7 +2548,7 @@ class GeneralAI
|
|||||||
//굳이 뽑은 이유가 있겠지
|
//굳이 뽑은 이유가 있겠지
|
||||||
$type = $currCrewType->id;
|
$type = $currCrewType->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//XXX: 훈련, 사기진작 금액을 하드코딩으로 계산중
|
//XXX: 훈련, 사기진작 금액을 하드코딩으로 계산중
|
||||||
@@ -2566,7 +2566,7 @@ class GeneralAI
|
|||||||
|
|
||||||
$riceCost = $crewType->riceWithTech(
|
$riceCost = $crewType->riceWithTech(
|
||||||
$this->nation['tech'],
|
$this->nation['tech'],
|
||||||
$this->fullLeadership*100 *
|
$this->fullLeadership*100 *
|
||||||
$general->getRankVar('killcrew')/max($general->getRankVar('deathcrew'),1)*1.2
|
$general->getRankVar('killcrew')/max($general->getRankVar('deathcrew'),1)*1.2
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2584,7 +2584,7 @@ class GeneralAI
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else if($gold < $cost && $gold * 2 >= $cost){
|
else if($gold < $cost && $gold * 2 >= $cost){
|
||||||
$crew *= 0.5;
|
$crew *= 0.5;
|
||||||
$riceCost *= 0.5;
|
$riceCost *= 0.5;
|
||||||
$crew = Util::round($crew-49, -2);
|
$crew = Util::round($crew-49, -2);
|
||||||
$cmd = buildGeneralCommandClass('che_징병', $general, $env, [
|
$cmd = buildGeneralCommandClass('che_징병', $general, $env, [
|
||||||
@@ -2597,7 +2597,7 @@ class GeneralAI
|
|||||||
//이 쌀도 없어?
|
//이 쌀도 없어?
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -2749,7 +2749,7 @@ class GeneralAI
|
|||||||
|
|
||||||
foreach($resourceMap as [$resKey, $reqNation, $reqNPCWar, $reqNPCDevel]){
|
foreach($resourceMap as [$resKey, $reqNation, $reqNPCWar, $reqNPCDevel]){
|
||||||
$genRes = $general->getVar($resKey);
|
$genRes = $general->getVar($resKey);
|
||||||
|
|
||||||
if($this->genType & self::t통솔장){
|
if($this->genType & self::t통솔장){
|
||||||
$reqRes = $reqNPCWar;
|
$reqRes = $reqNPCWar;
|
||||||
}
|
}
|
||||||
@@ -2794,7 +2794,7 @@ class GeneralAI
|
|||||||
if($genRes < $reqRes * 1.5){
|
if($genRes < $reqRes * 1.5){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!Util::randBool(($genRes / $reqRes)-0.5)){
|
if($reqRes > 0 && !Util::randBool(($genRes / $reqRes)-0.5)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$amount = $genRes - $reqRes;
|
$amount = $genRes - $reqRes;
|
||||||
@@ -2917,7 +2917,7 @@ class GeneralAI
|
|||||||
'optionText' => '순간이동',
|
'optionText' => '순간이동',
|
||||||
'destCityID' => Util::choiceRandomUsingWeight($recruitableCityList),
|
'destCityID' => Util::choiceRandomUsingWeight($recruitableCityList),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 조건 불충족", $cmd->getArg());
|
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 조건 불충족", $cmd->getArg());
|
||||||
@@ -2969,7 +2969,7 @@ class GeneralAI
|
|||||||
'optionText' => '순간이동',
|
'optionText' => '순간이동',
|
||||||
'destCityID' => Util::choiceRandomUsingWeight($candidateCities),
|
'destCityID' => Util::choiceRandomUsingWeight($candidateCities),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
if(!$cmd->hasFullConditionMet()){
|
if(!$cmd->hasFullConditionMet()){
|
||||||
return null;
|
return null;
|
||||||
@@ -2986,7 +2986,7 @@ class GeneralAI
|
|||||||
if(($this->genType & self::t통솔장)&&in_array($this->dipState, [self::d징병, self::d직전, self::d전쟁])){
|
if(($this->genType & self::t통솔장)&&in_array($this->dipState, [self::d징병, self::d직전, self::d전쟁])){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$city = $this->city;
|
$city = $this->city;
|
||||||
if(Util::randBool(0.6)){
|
if(Util::randBool(0.6)){
|
||||||
return null;
|
return null;
|
||||||
@@ -3028,9 +3028,9 @@ class GeneralAI
|
|||||||
$realDevelRate += $develVal;
|
$realDevelRate += $develVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$realDevelRate /= $availableTypeCnt;
|
$realDevelRate /= $availableTypeCnt;
|
||||||
|
|
||||||
if($realDevelRate >= 0.95){
|
if($realDevelRate >= 0.95){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -3158,7 +3158,7 @@ class GeneralAI
|
|||||||
|
|
||||||
$prop = Util::randF() * (GameConst::$defaultStatNPCMax + GameConst::$chiefStatMin) / 2;
|
$prop = Util::randF() * (GameConst::$defaultStatNPCMax + GameConst::$chiefStatMin) / 2;
|
||||||
$ratio = ($this->fullLeadership + $this->fullStrength + $this->fullIntel) / 3;
|
$ratio = ($this->fullLeadership + $this->fullStrength + $this->fullIntel) / 3;
|
||||||
|
|
||||||
|
|
||||||
if($prop >= $ratio){
|
if($prop >= $ratio){
|
||||||
return null;
|
return null;
|
||||||
@@ -3251,7 +3251,7 @@ class GeneralAI
|
|||||||
if ($nationCnt == 0 || $notFullNationCnt == 0) {
|
if ($nationCnt == 0 || $notFullNationCnt == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Util::randBool(pow(1 / ($nationCnt + 1) / pow($notFullNationCnt, 3), 1 / 4))) {
|
if (Util::randBool(pow(1 / ($nationCnt + 1) / pow($notFullNationCnt, 3), 1 / 4))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -3355,7 +3355,7 @@ class GeneralAI
|
|||||||
$nationID = $nation['nation'];
|
$nationID = $nation['nation'];
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$nationCities = [];
|
$nationCities = [];
|
||||||
$frontCities = [];
|
$frontCities = [];
|
||||||
$supplyCities = [];
|
$supplyCities = [];
|
||||||
@@ -3399,7 +3399,7 @@ class GeneralAI
|
|||||||
$userGenerals = [];
|
$userGenerals = [];
|
||||||
$userCivilGenerals = [];
|
$userCivilGenerals = [];
|
||||||
$userWarGenerals = [];
|
$userWarGenerals = [];
|
||||||
|
|
||||||
$lostGenerals = [];
|
$lostGenerals = [];
|
||||||
$npcCivilGenerals = [];
|
$npcCivilGenerals = [];
|
||||||
$npcWarGenerals = [];
|
$npcWarGenerals = [];
|
||||||
@@ -3541,7 +3541,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->nationPolicy->priority as $actionName){
|
foreach($this->nationPolicy->priority as $actionName){
|
||||||
|
|
||||||
if(!property_exists($this->nationPolicy, 'can'.$actionName)){
|
if(!property_exists($this->nationPolicy, 'can'.$actionName)){
|
||||||
trigger_error ("can{$actionName}이 없음", E_USER_NOTICE );
|
trigger_error ("can{$actionName}이 없음", E_USER_NOTICE );
|
||||||
continue;
|
continue;
|
||||||
@@ -3625,7 +3625,7 @@ class GeneralAI
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($npcType == 5){
|
if($npcType == 5){
|
||||||
if($general->getNationID()==0){
|
if($general->getNationID()==0){
|
||||||
$general->setVar('killturn', 1);
|
$general->setVar('killturn', 1);
|
||||||
@@ -3765,10 +3765,10 @@ class GeneralAI
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$picked = false;
|
$picked = false;
|
||||||
foreach(Util::range(5) as $idx){
|
foreach(Util::range(5) as $idx){
|
||||||
|
|
||||||
/** @var General */
|
/** @var General */
|
||||||
if($this->npcWarGenerals){
|
if($this->npcWarGenerals){
|
||||||
$randGeneral = Util::choiceRandom($this->npcWarGenerals);
|
$randGeneral = Util::choiceRandom($this->npcWarGenerals);
|
||||||
@@ -3785,7 +3785,7 @@ class GeneralAI
|
|||||||
else{
|
else{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($randGeneral->getVar('officer_level') != 1){
|
if($randGeneral->getVar('officer_level') != 1){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -3864,7 +3864,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$minBelong = min($this->general->getVar('belong') - 1, 3);
|
$minBelong = min($this->general->getVar('belong') - 1, 3);
|
||||||
$updatedChiefSet = 0;
|
$updatedChiefSet = 0;
|
||||||
@@ -3910,7 +3910,7 @@ class GeneralAI
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach(Util::range(11, $minChiefLevel-1, -1) as $chiefLevel) {
|
foreach(Util::range(11, $minChiefLevel-1, -1) as $chiefLevel) {
|
||||||
if(isOfficerSet($nation['chief_set'], $chiefLevel)){
|
if(isOfficerSet($nation['chief_set'], $chiefLevel)){
|
||||||
continue;
|
continue;
|
||||||
@@ -3918,7 +3918,7 @@ class GeneralAI
|
|||||||
if($this->general->getVar('officer_level') === $chiefLevel){
|
if($this->general->getVar('officer_level') === $chiefLevel){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_exists($chiefLevel, $this->chiefGenerals)){
|
if(key_exists($chiefLevel, $this->chiefGenerals)){
|
||||||
$oldChief = $this->chiefGenerals[$chiefLevel];
|
$oldChief = $this->chiefGenerals[$chiefLevel];
|
||||||
if($oldChief->getNPCType() < 2 && $oldChief->getVar('killturn') >= $minChiefLevel){
|
if($oldChief->getNPCType() < 2 && $oldChief->getVar('killturn') >= $minChiefLevel){
|
||||||
@@ -3964,7 +3964,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
$newChief = $general;
|
$newChief = $general;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$newChief){
|
if(!$newChief){
|
||||||
|
|||||||
@@ -16,22 +16,22 @@ class GeneralBuilder{
|
|||||||
|
|
||||||
protected $owner = 0;
|
protected $owner = 0;
|
||||||
protected $ownerName = null;
|
protected $ownerName = null;
|
||||||
protected $affinity=null;
|
protected $affinity=null;
|
||||||
protected $nameCustomPrefix=null;
|
protected $nameCustomPrefix=null;
|
||||||
protected $name;
|
protected $name;
|
||||||
protected $imgsvr = 0;
|
protected $imgsvr = 0;
|
||||||
protected $picturePath;
|
protected $picturePath;
|
||||||
protected $nationID;
|
protected $nationID;
|
||||||
protected $cityID;
|
protected $cityID;
|
||||||
protected $leadership=null;
|
protected $leadership=null;
|
||||||
protected $strength=null;
|
protected $strength=null;
|
||||||
protected $intel=null;
|
protected $intel=null;
|
||||||
protected $officerLevel;
|
protected $officerLevel;
|
||||||
protected $birth=null;
|
protected $birth=null;
|
||||||
protected $death=null;
|
protected $death=null;
|
||||||
protected $ego=null;
|
protected $ego=null;
|
||||||
protected $specialDomestic=null;
|
protected $specialDomestic=null;
|
||||||
protected $specialWar=null;
|
protected $specialWar=null;
|
||||||
protected $npc = 2;
|
protected $npc = 2;
|
||||||
protected $text;
|
protected $text;
|
||||||
static $prefixList = [
|
static $prefixList = [
|
||||||
@@ -42,7 +42,7 @@ class GeneralBuilder{
|
|||||||
4 => 'ⓖ', //의병장(전략)
|
4 => 'ⓖ', //의병장(전략)
|
||||||
5 => '㉥', //부대장
|
5 => '㉥', //부대장
|
||||||
6 => 'ⓤ', //unselectable npc, 빙의 불가 npc
|
6 => 'ⓤ', //unselectable npc, 빙의 불가 npc
|
||||||
|
|
||||||
9 => 'ⓞ', //오랑캐?
|
9 => 'ⓞ', //오랑캐?
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -66,12 +66,12 @@ class GeneralBuilder{
|
|||||||
protected $aux = [];
|
protected $aux = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $name,
|
string $name,
|
||||||
bool $isDynamicImageSvr,
|
bool $isDynamicImageSvr,
|
||||||
$picturePath,
|
$picturePath,
|
||||||
int $nationID
|
int $nationID
|
||||||
){
|
){
|
||||||
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->imgsvr = $isDynamicImageSvr;
|
$this->imgsvr = $isDynamicImageSvr;
|
||||||
$this->picturePath = $picturePath;
|
$this->picturePath = $picturePath;
|
||||||
@@ -144,7 +144,7 @@ class GeneralBuilder{
|
|||||||
$this->specialDomestic = $specialDomestic;
|
$this->specialDomestic = $specialDomestic;
|
||||||
$this->specialWar = $specialWar;
|
$this->specialWar = $specialWar;
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOfficerLevel(int $level):self{
|
public function setOfficerLevel(int $level):self{
|
||||||
@@ -380,7 +380,7 @@ class GeneralBuilder{
|
|||||||
if($this->specialWar === null){
|
if($this->specialWar === null){
|
||||||
$this->specialWar = GameConst::$defaultSpecialWar;
|
$this->specialWar = GameConst::$defaultSpecialWar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->killturn === null && $this->owner){
|
if($this->killturn === null && $this->owner){
|
||||||
$this->killturn = 5;
|
$this->killturn = 5;
|
||||||
}
|
}
|
||||||
@@ -408,7 +408,7 @@ class GeneralBuilder{
|
|||||||
$this->death = $this->birth+Util::randRangeInt(60, 80);
|
$this->death = $this->birth+Util::randRangeInt(60, 80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($this->specAge===null){
|
if($this->specAge===null){
|
||||||
$age = $env['year']-$this->birth;
|
$age = $env['year']-$this->birth;
|
||||||
$relYear = Util::valueFit($env['year'] - $env['startyear'], 0);
|
$relYear = Util::valueFit($env['year'] - $env['startyear'], 0);
|
||||||
@@ -459,7 +459,7 @@ class GeneralBuilder{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->dex1 === null){
|
if(!$this->dex1 && in_array('dex_t', $avgGen)){
|
||||||
$dexTotal = $avgGen['dex_t'];
|
$dexTotal = $avgGen['dex_t'];
|
||||||
if ($pickType == '무') {
|
if ($pickType == '무') {
|
||||||
$dexVal = Util::choiceRandom([
|
$dexVal = Util::choiceRandom([
|
||||||
@@ -532,7 +532,7 @@ class GeneralBuilder{
|
|||||||
public function build($env){
|
public function build($env){
|
||||||
//scenario에 life==1인 경우 수명 제한이 없어지는 모양.
|
//scenario에 life==1인 경우 수명 제한이 없어지는 모양.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!key_exists('stored_icons', $env)){
|
if(!key_exists('stored_icons', $env)){
|
||||||
try{
|
try{
|
||||||
@@ -542,7 +542,7 @@ class GeneralBuilder{
|
|||||||
catch(\Exception $e){
|
catch(\Exception $e){
|
||||||
$storedIcons = [];
|
$storedIcons = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$env['stored_icons'] = $storedIcons;
|
$env['stored_icons'] = $storedIcons;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,7 +559,7 @@ class GeneralBuilder{
|
|||||||
else{
|
else{
|
||||||
$name = $this->nameCustomPrefix.$this->name;
|
$name = $this->nameCustomPrefix.$this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->realName = $name;
|
$this->realName = $name;
|
||||||
|
|
||||||
if($this->death <= $year){
|
if($this->death <= $year){
|
||||||
@@ -635,7 +635,6 @@ class GeneralBuilder{
|
|||||||
'@phan-var array<string,string|int> $cityObj';
|
'@phan-var array<string,string|int> $cityObj';
|
||||||
$this->cityID = $cityObj['id'];
|
$this->cityID = $cityObj['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$experience = $this->experience?:$age * 100;
|
$experience = $this->experience?:$age * 100;
|
||||||
$dedication = $this->dedication?:$age * 100;
|
$dedication = $this->dedication?:$age * 100;
|
||||||
|
|||||||
Reference in New Issue
Block a user