getVar('npc') -> getNPCType()

This commit is contained in:
2020-05-09 23:18:47 +09:00
parent d083dc36b2
commit 6e19722742
21 changed files with 51 additions and 47 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ $showGeneral = General::createGeneralObjFromDB($gen);
<?=formatHistoryToHTML(getBattleResultRecent($gen, 24))?> <?=formatHistoryToHTML(getBattleResultRecent($gen, 24))?>
</td> </td>
</tr> </tr>
<?php if($showGeneral->getVar('npc') > 1 || $permission >= 2): ?> <?php if($showGeneral->getNPCType() > 1 || $permission >= 2): ?>
<tr> <tr>
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td> <td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
<td align=center id=bg1><font color=orange size=3>&nbsp;</font></td> <td align=center id=bg1><font color=orange size=3>&nbsp;</font></td>
+1 -1
View File
@@ -457,7 +457,7 @@ foreach($tournamentType as $tournamentTypeText=>[$statTypeText,$statFunc,$rankCo
foreach($tournamentRankerList as $rank=>$ranker){ foreach($tournamentRankerList as $rank=>$ranker){
printRow( printRow(
$rank+1, $rank+1,
$ranker->getVar('npc'), $ranker->getNPCType(),
$ranker->getName(), $ranker->getName(),
($statFunc)($ranker), ($statFunc)($ranker),
$ranker->getRankVar($winColumn)+$ranker->getRankVar($drawColumn)+$ranker->getRankVar($loseColumn), $ranker->getRankVar($winColumn)+$ranker->getRankVar($drawColumn)+$ranker->getRankVar($loseColumn),
+2 -2
View File
@@ -71,7 +71,7 @@ if (($btn == "설정저장" || $detachNPC) && $myset > 0) {
$me->setVar('tnmt', $tnmt); $me->setVar('tnmt', $tnmt);
} }
if($me->getVar('npc') == 1 && $detachNPC){ if($me->getNPCType() == 1 && $detachNPC){
$turnterm = $gameStor->turnterm; $turnterm = $gameStor->turnterm;
if($turnterm < 10){ if($turnterm < 10){
@@ -88,7 +88,7 @@ $me->applyDB($db);
if($gameStor->turntime <= $gameStor->opentime){ if($gameStor->turntime <= $gameStor->opentime){
//서버 가오픈시 할 수 있는 행동 //서버 가오픈시 할 수 있는 행동
if($me->getVar('npc') == 0){ if($me->getNPCType() == 0){
$showDieImmediatelyBtn = true; $showDieImmediatelyBtn = true;
if(addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2) <= TimeUtil::now()){ if(addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2) <= TimeUtil::now()){
$availableDieImmediately = true; $availableDieImmediately = true;
+3 -3
View File
@@ -1581,11 +1581,11 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
if ($general->getVar('npc') >= 2) { if ($general->getNPCType() >= 2) {
return false; return false;
} }
if ($general->getVar('npc') > 6) { if ($general->getNPCType() > 6) {
return false; return false;
} }
@@ -1729,7 +1729,7 @@ function nextRuler(General $general)
$candidate = null; $candidate = null;
//npc or npc유저인 경우 후계 찾기 //npc or npc유저인 경우 후계 찾기
if ($general->getVar('npc') > 0) { if ($general->getNPCType() > 0) {
$candidate = $db->queryFirstRow( $candidate = $db->queryFirstRow(
'SELECT no,name,officer_level,IF(ABS(affinity-%i)>75,150-ABS(affinity-%i),ABS(affinity-%i)) as npcmatch2 from general where nation=%i and officer_level!=12 and 1 <= npc and npc<=3 order by npcmatch2,rand() LIMIT 1', 'SELECT no,name,officer_level,IF(ABS(affinity-%i)>75,150-ABS(affinity-%i),ABS(affinity-%i)) as npcmatch2 from general where nation=%i and officer_level!=12 and 1 <= npc and npc<=3 order by npcmatch2,rand() LIMIT 1',
$general->getVar('affinity'), $general->getVar('affinity'),
+1 -1
View File
@@ -77,7 +77,7 @@ foreach($nationTurnList as $officer_level=>$turnBrief){
'name'=>$general->getName(), 'name'=>$general->getName(),
'turnTime'=>$general->getTurnTime($general::TURNTIME_FULL), 'turnTime'=>$general->getTurnTime($general::TURNTIME_FULL),
'officerLevelText'=>getOfficerLevelText($general->getVar('officer_level'), $nationLevel), 'officerLevelText'=>getOfficerLevelText($general->getVar('officer_level'), $nationLevel),
'npcType'=>$general->getVar('npc'), 'npcType'=>$general->getNPCType(),
'turn'=>$turnBrief 'turn'=>$turnBrief
]; ];
} }
+4 -4
View File
@@ -223,7 +223,7 @@ function do추방(General $general, int $myOfficerLevel):?string{
$logger->pushGeneralActionLog("<D><b>{$nationName}</b></>에서 <R>추방</>당했습니다.", ActionLogger::PLAIN); $logger->pushGeneralActionLog("<D><b>{$nationName}</b></>에서 <R>추방</>당했습니다.", ActionLogger::PLAIN);
// 명성/공헌 N*10%감소 // 명성/공헌 N*10%감소
if($env['year'] <= $env['startyear'] && $general->getVar('npc') < 2){ if($env['year'] <= $env['startyear'] && $general->getNPCType() < 2){
$general->setVar('makelimit', $oldMakeLimit); $general->setVar('makelimit', $oldMakeLimit);
} }
else{ else{
@@ -243,7 +243,7 @@ function do추방(General $general, int $myOfficerLevel):?string{
} }
$general->setVar('troop', 0); $general->setVar('troop', 0);
if($general->getVar('npc') >= 2 && ($env['scenario'] < 100 || Util::randBool(0.01))) { if($general->getNPCType() >= 2 && ($env['scenario'] < 100 || Util::randBool(0.01))) {
$str = Util::choiceRandom([ $str = Util::choiceRandom([
'날 버리다니... 곧 전장에서 복수해주겠다...', '날 버리다니... 곧 전장에서 복수해주겠다...',
@@ -280,7 +280,7 @@ function do추방(General $general, int $myOfficerLevel):?string{
], 'nation=%i AND officer_level=12', $nationID); ], 'nation=%i AND officer_level=12', $nationID);
$db->update('nation', [ $db->update('nation', [
'gennum'=>$db->sqleval('gennum - %i', $general->getVar('npc')!=5?1:0), 'gennum'=>$db->sqleval('gennum - %i', $general->getNPCType()!=5?1:0),
'gold'=>$db->sqleval('gold + %i', $gold), 'gold'=>$db->sqleval('gold + %i', $gold),
'rice'=>$db->sqleval('rice + %i', $rice), 'rice'=>$db->sqleval('rice + %i', $rice),
], 'nation = %i', $nationID); ], 'nation = %i', $nationID);
@@ -288,7 +288,7 @@ function do추방(General $general, int $myOfficerLevel):?string{
//이번분기는 추방불가(초반 제외) //이번분기는 추방불가(초반 제외)
$db->update('nation', [ $db->update('nation', [
'chief_set'=>$db->sqleval('chief_set | %i', doOfficerSet(0, $myOfficerLevel)), 'chief_set'=>$db->sqleval('chief_set | %i', doOfficerSet(0, $myOfficerLevel)),
'gennum'=>$db->sqleval('gennum - %i', $general->getVar('npc')!=5?1:0), 'gennum'=>$db->sqleval('gennum - %i', $general->getNPCType()!=5?1:0),
'gold'=>$db->sqleval('gold + %i', $gold), 'gold'=>$db->sqleval('gold + %i', $gold),
'rice'=>$db->sqleval('rice + %i', $rice), 'rice'=>$db->sqleval('rice + %i', $rice),
], 'nation = %i', $nationID); ], 'nation = %i', $nationID);
+1 -1
View File
@@ -553,7 +553,7 @@ function ConquerCity(array $admin, General $general, array $city) {
} }
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병) //NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
$npcType = $oldGeneral->getVar('npc'); $npcType = $oldGeneral->getNPCType();
if($admin['join_mode'] != 'onlyRandom' && 2 <= $npcType && $npcType <= 8 && $npcType != 5 && Util::randBool(0.1)) { if($admin['join_mode'] != 'onlyRandom' && 2 <= $npcType && $npcType <= 8 && $npcType != 5 && Util::randBool(0.1)) {
$cmd = buildGeneralCommandClass('che_임관', $oldGeneral, $admin, [ $cmd = buildGeneralCommandClass('che_임관', $oldGeneral, $admin, [
'destNationID'=>$attackerNationID 'destNationID'=>$attackerNationID
+2 -2
View File
@@ -90,7 +90,7 @@ class AutorunGeneralPolicy{
public $can선양 = false; public $can선양 = false;
function doNPCState(General $general){ function doNPCState(General $general){
$npc = $general->getVar('npc'); $npc = $general->getNPCType();
$nationID = $general->getNationID(); $nationID = $general->getNationID();
if($npc==5){ if($npc==5){
@@ -117,7 +117,7 @@ class AutorunGeneralPolicy{
//TODO: 국가 정책을 받아와야함 //TODO: 국가 정책을 받아와야함
$this->priority = static::$default_priority; $this->priority = static::$default_priority;
if($general->getVar('npc') >= 2){ if($general->getNPCType() >= 2){
$this->doNPCState($general); $this->doNPCState($general);
return; return;
} }
+1 -1
View File
@@ -198,7 +198,7 @@ class AutorunNationPolicy {
$this->reqHumanWarRecommandRice = Util::round(max(20000, $this->reqHumanWarRecommandRice * 3), -2); $this->reqHumanWarRecommandRice = Util::round(max(20000, $this->reqHumanWarRecommandRice * 3), -2);
} }
if($general->getVar('npc') >= 2){ if($general->getNPCType() >= 2){
return; return;
} }
@@ -65,7 +65,7 @@ class che_군량매매 extends Command\GeneralCommand{
$this->setNation(); $this->setNation();
$this->minConditionConstraints=[ $this->minConditionConstraints=[
ConstraintHelper::ReqCityTrader($general->getVar('npc')), ConstraintHelper::ReqCityTrader($general->getNPCType()),
ConstraintHelper::OccupiedCity(true), ConstraintHelper::OccupiedCity(true),
ConstraintHelper::SuppliedCity(), ConstraintHelper::SuppliedCity(),
]; ];
@@ -76,7 +76,7 @@ class che_군량매매 extends Command\GeneralCommand{
$general = $this->generalObj; $general = $this->generalObj;
$this->fullConditionConstraints=[ $this->fullConditionConstraints=[
ConstraintHelper::ReqCityTrader($general->getVar('npc')), ConstraintHelper::ReqCityTrader($general->getNPCType()),
ConstraintHelper::OccupiedCity(true), ConstraintHelper::OccupiedCity(true),
ConstraintHelper::SuppliedCity(), ConstraintHelper::SuppliedCity(),
]; ];
@@ -115,7 +115,7 @@ class che_군량매매 extends Command\GeneralCommand{
$buyRice = $this->arg['buyRice']; $buyRice = $this->arg['buyRice'];
if($tradeRate === null){ if($tradeRate === null){
if($general->getVar('npc') >= 2){ if($general->getNPCType() >= 2){
$tradeRate = 1.0; $tradeRate = 1.0;
} }
else{ else{
@@ -135,7 +135,7 @@ class che_등용수락 extends Command\GeneralCommand{
$destNationName = $this->destNation['name']; $destNationName = $this->destNation['name'];
$relYear = $env['year'] - $env['startyear']; $relYear = $env['year'] - $env['startyear'];
if($general->getVar('npc') == 1 || $relYear >= 3){ if($general->getNPCType() == 1 || $relYear >= 3){
$joinedNations = $general->getAuxVar('joinedNations')??[]; $joinedNations = $general->getAuxVar('joinedNations')??[];
$joinedNations[] = $destNationID; $joinedNations[] = $destNationID;
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
@@ -178,7 +178,7 @@ class che_등용수락 extends Command\GeneralCommand{
$general->addDedication(100); $general->addDedication(100);
} }
if($general->getVar('npc') < 2){ if($general->getNPCType() < 2){
$general->setVar('killturn', $env['killturn']); $general->setVar('killturn', $env['killturn']);
} }
@@ -125,7 +125,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
$destNation = null; $destNation = null;
if ($general->getVar('npc') >= 2 && !$env['fiction'] && 1000 <= $env['scenario'] && $env['scenario'] < 2000) { if ($general->getNPCType() >= 2 && !$env['fiction'] && 1000 <= $env['scenario'] && $env['scenario'] < 2000) {
if($notIn){ if($notIn){
$nations = $db->query( $nations = $db->query(
'SELECT nation.`name` as `name`,nation.nation as nation,scout,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.officer_level = 12 WHERE scout=0 and gennum<%i and nation.nation not in %li', 'SELECT nation.`name` as `name`,nation.nation as nation,scout,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.officer_level = 12 WHERE scout=0 and gennum<%i and nation.nation not in %li',
@@ -276,7 +276,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
], 'nation=%i', $destNationID); ], 'nation=%i', $destNationID);
$relYear = $env['year'] - $env['startyear']; $relYear = $env['year'] - $env['startyear'];
if($general->getVar('npc') == 1 || $relYear >= 3){ if($general->getNPCType() == 1 || $relYear >= 3){
$joinedNations = $general->getAuxVar('joinedNations')??[]; $joinedNations = $general->getAuxVar('joinedNations')??[];
$joinedNations[] = $destNationID; $joinedNations[] = $destNationID;
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
+1 -1
View File
@@ -168,7 +168,7 @@ class che_임관 extends Command\GeneralCommand{
\sammo\refreshNationStaticInfo(); \sammo\refreshNationStaticInfo();
$relYear = $env['year'] - $env['startyear']; $relYear = $env['year'] - $env['startyear'];
if($general->getVar('npc') == 1 || $relYear >= 3){ if($general->getNPCType() == 1 || $relYear >= 3){
$joinedNations = $general->getAuxVar('joinedNations')??[]; $joinedNations = $general->getAuxVar('joinedNations')??[];
$joinedNations[] = $destNationID; $joinedNations[] = $destNationID;
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
@@ -64,7 +64,7 @@ class che_장비매매 extends Command\GeneralCommand{
$this->setNation(); $this->setNation();
$this->minConditionConstraints=[ $this->minConditionConstraints=[
ConstraintHelper::ReqCityTrader($general->getVar('npc')), ConstraintHelper::ReqCityTrader($general->getNPCType()),
]; ];
} }
@@ -80,7 +80,7 @@ class che_장비매매 extends Command\GeneralCommand{
[$reqGold, $reqRice] = $this->getCost(); [$reqGold, $reqRice] = $this->getCost();
$this->fullConditionConstraints=[ $this->fullConditionConstraints=[
ConstraintHelper::ReqCityTrader($general->getVar('npc')), ConstraintHelper::ReqCityTrader($general->getNPCType()),
ConstraintHelper::ReqCityCapacity('secu', '치안 수치', $itemClass->getReqSecu()), ConstraintHelper::ReqCityCapacity('secu', '치안 수치', $itemClass->getReqSecu()),
ConstraintHelper::ReqGeneralGold($reqGold), ConstraintHelper::ReqGeneralGold($reqGold),
ConstraintHelper::ReqGeneralRice($reqRice), ConstraintHelper::ReqGeneralRice($reqRice),
@@ -173,7 +173,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
\sammo\refreshNationStaticInfo(); \sammo\refreshNationStaticInfo();
$relYear = $env['year'] - $env['startyear']; $relYear = $env['year'] - $env['startyear'];
if($general->getVar('npc') == 1 || $relYear >= 3){ if($general->getNPCType() == 1 || $relYear >= 3){
$joinedNations = $general->getAuxVar('joinedNations')??[]; $joinedNations = $general->getAuxVar('joinedNations')??[];
$joinedNations[] = $destNationID; $joinedNations[] = $destNationID;
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
+1 -1
View File
@@ -97,7 +97,7 @@ class che_하야 extends Command\GeneralCommand{
$db->update('nation', [ $db->update('nation', [
'gold'=>$db->sqleval('gold + %i', $lostGold), 'gold'=>$db->sqleval('gold + %i', $lostGold),
'rice'=>$db->sqleval('rice + %i', $lostRice), 'rice'=>$db->sqleval('rice + %i', $lostRice),
'gennum'=>$db->sqleval('gennum - %i', $general->getVar('npc')!=5?1:0) 'gennum'=>$db->sqleval('gennum - %i', $general->getNPCType()!=5?1:0)
], 'nation=%i', $nationID); ], 'nation=%i', $nationID);
\sammo\refreshNationStaticInfo(); \sammo\refreshNationStaticInfo();
+1 -1
View File
@@ -175,7 +175,7 @@ class che_몰수 extends Command\NationCommand
); );
$amountText = number_format($amount, 0); $amountText = number_format($amount, 0);
if ($destGeneral->getVar('npc') >= 2 && Util::randBool(0.01)) { if ($destGeneral->getNPCType() >= 2 && Util::randBool(0.01)) {
$npcTexts = [ $npcTexts = [
'몰수를 하다니... 이것이 윗사람이 할 짓이란 말입니까...', '몰수를 하다니... 이것이 윗사람이 할 짓이란 말입니까...',
'사유재산까지 몰수해가면서 이 나라가 잘 될거라 믿습니까? 정말 이해할 수가 없군요...', '사유재산까지 몰수해가면서 이 나라가 잘 될거라 믿습니까? 정말 이해할 수가 없군요...',
+4
View File
@@ -158,6 +158,10 @@ class General implements iAction{
return $this->itemObjs[$itemKey]; return $this->itemObjs[$itemKey];
} }
function getNPCType():int{
return $this->raw['npc'];
}
/** @return BaseItem[] */ /** @return BaseItem[] */
function getItems():array{ function getItems():array{
return $this->itemObjs; return $this->itemObjs;
+13 -13
View File
@@ -634,7 +634,7 @@ class GeneralAI
//고립 도시 장수 발령 //고립 도시 장수 발령
$args = []; $args = [];
foreach ($this->lostGenerals as $lostGeneral) { foreach ($this->lostGenerals as $lostGeneral) {
if ($lostGeneral->getVar('npc') >= 2) { if ($lostGeneral->getNPCType() >= 2) {
continue; continue;
} }
@@ -885,7 +885,7 @@ class GeneralAI
//고립 도시 장수 발령 //고립 도시 장수 발령
$args = []; $args = [];
foreach ($this->lostGenerals as $lostGeneral) { foreach ($this->lostGenerals as $lostGeneral) {
if ($lostGeneral->getVar('npc') < 2 || $lostGeneral->getVar('npc') == 5) { if ($lostGeneral->getNPCType() < 2 || $lostGeneral->getNPCType() == 5) {
continue; continue;
} }
$selCity = Util::choiceRandom($this->supplyCities); $selCity = Util::choiceRandom($this->supplyCities);
@@ -2662,7 +2662,7 @@ class GeneralAI
{ {
$general = $this->general; $general = $this->general;
if($general->getVar('npc') == 5){ if($general->getNPCType() == 5){
$newKillTurn = ($general->getVar('killturn') + Util::randRangeInt(2, 4)) % 5; $newKillTurn = ($general->getVar('killturn') + Util::randRangeInt(2, 4)) % 5;
$newKillTurn += 70; $newKillTurn += 70;
$general->setVar('killturn', $newKillTurn); $general->setVar('killturn', $newKillTurn);
@@ -2812,7 +2812,7 @@ class GeneralAI
$db = DB::db(); $db = DB::db();
// 오랑캐는 바로 임관 // 오랑캐는 바로 임관
if ($general->getVar('npc') == 9) { if ($general->getNPCType() == 9) {
$rulerNation = $db->queryFirstField( $rulerNation = $db->queryFirstField(
'SELECT nation FROM general WHERE `officer_level`=12 AND npc=9 and nation not in %li ORDER BY RAND() limit 1', 'SELECT nation FROM general WHERE `officer_level`=12 AND npc=9 and nation not in %li ORDER BY RAND() limit 1',
$general->getAuxVar('joinedNations') ?? [0] $general->getAuxVar('joinedNations') ?? [0]
@@ -3010,7 +3010,7 @@ class GeneralAI
foreach($nationGenerals as $nationGeneral){ foreach($nationGenerals as $nationGeneral){
$generalID = $nationGeneral->getID(); $generalID = $nationGeneral->getID();
$cityID = $nationGeneral->getCityID(); $cityID = $nationGeneral->getCityID();
$npcType = $nationGeneral->getVar('npc'); $npcType = $nationGeneral->getNPCType();
$officerLevel = $nationGeneral->getVar('officer_level'); $officerLevel = $nationGeneral->getVar('officer_level');
$officerCity = $nationGeneral->getVar('officer_city'); $officerCity = $nationGeneral->getVar('officer_city');
@@ -3081,7 +3081,7 @@ class GeneralAI
//TODO: NationTurn과 InstantNationTurn 구분 필요 //TODO: NationTurn과 InstantNationTurn 구분 필요
$lastTurn = $reservedCommand->getLastTurn(); $lastTurn = $reservedCommand->getLastTurn();
$general = $this->general; $general = $this->general;
$npcType = $general->getVar('npc'); $npcType = $general->getNPCType();
$this->categorizeNationGeneral(); $this->categorizeNationGeneral();
$this->categorizeNationCities(); $this->categorizeNationCities();
@@ -3160,7 +3160,7 @@ class GeneralAI
public function chooseGeneralTurn(GeneralCommand $reservedCommand): GeneralCommand{ public function chooseGeneralTurn(GeneralCommand $reservedCommand): GeneralCommand{
$general = $this->general; $general = $this->general;
$npcType = $general->getVar('npc'); $npcType = $general->getNPCType();
$nationID = $general->getNationID(); $nationID = $general->getNationID();
//특별 메세지 있는 경우 출력 하루 4번 //특별 메세지 있는 경우 출력 하루 4번
@@ -3427,7 +3427,7 @@ class GeneralAI
continue; continue;
} }
$chief = $this->chiefGenerals[$chiefLevel]; $chief = $this->chiefGenerals[$chiefLevel];
if($chief->getVar('npc') < 2 && $chief->getVar('killturn') >= $minUserKillturn){ if($chief->getNPCType() < 2 && $chief->getVar('killturn') >= $minUserKillturn){
$userChiefCnt+=1; $userChiefCnt+=1;
$chief->setVar('permission', 'ambassador'); $chief->setVar('permission', 'ambassador');
} }
@@ -3490,7 +3490,7 @@ class GeneralAI
if(key_exists($chiefLevel, $this->chiefGenerals)){ if(key_exists($chiefLevel, $this->chiefGenerals)){
$oldChief = $this->chiefGenerals[$chiefLevel]; $oldChief = $this->chiefGenerals[$chiefLevel];
if($oldChief->getVar('npc') < 2 && $oldChief->getVar('killturn') >= $minChiefLevel){ if($oldChief->getNPCType() < 2 && $oldChief->getVar('killturn') >= $minChiefLevel){
continue; continue;
} }
} }
@@ -3512,10 +3512,10 @@ class GeneralAI
if($general->getVar('officer_level') !== 1){ if($general->getVar('officer_level') !== 1){
continue; continue;
} }
if($general->getVar('npc') < 2 && $general->getVar('killturn') < $minUserKillturn){ if($general->getNPCType() < 2 && $general->getVar('killturn') < $minUserKillturn){
continue; continue;
} }
if($general->getVar('npc') >= 2 && $general->getVar('killturn') < $minNPCKillturn){ if($general->getNPCType() >= 2 && $general->getVar('killturn') < $minNPCKillturn){
continue; continue;
} }
@@ -3528,7 +3528,7 @@ class GeneralAI
continue; continue;
} }
if($general->getVar('npc') < 2 && $userChiefCnt >= 3){ if($general->getNPCType() < 2 && $userChiefCnt >= 3){
continue; continue;
} }
@@ -3540,7 +3540,7 @@ class GeneralAI
continue; continue;
} }
if($newChief->getVar('npc') < 2){ if($newChief->getNPCType() < 2){
$userChiefCnt += 1; $userChiefCnt += 1;
$newChief->setVar('permission', 'ambassador'); $newChief->setVar('permission', 'ambassador');
} }
+1 -1
View File
@@ -97,7 +97,7 @@ class DyingMessage{
} }
$this->general = $general; $this->general = $general;
$this->name = $general->getName(); $this->name = $general->getName();
$this->npc = $general->getVar('npc'); $this->npc = $general->getNPCType();
if($general->getVar('owner') > 0 && $general->getVar('startage') - $general->getVar('age') > 1){ if($general->getVar('owner') > 0 && $general->getVar('startage') - $general->getVar('age') > 1){
$this->realName = $general->getVar('owner_name'); $this->realName = $general->getVar('owner_name');
} }
+4 -4
View File
@@ -142,7 +142,7 @@ class TurnExecutionHelper
$killTurn = $gameStor->killturn; $killTurn = $gameStor->killturn;
if($general->getVar('npc') >= 2){ if($general->getNPCType() >= 2){
$general->increaseVarWithLimit('killturn', -1); $general->increaseVarWithLimit('killturn', -1);
} }
else if($general->getVar('killturn') > $killTurn){ else if($general->getVar('killturn') > $killTurn){
@@ -175,7 +175,7 @@ class TurnExecutionHelper
// 삭턴장수 삭제처리 // 삭턴장수 삭제처리
if($general->getVar('killturn') <= 0){ if($general->getVar('killturn') <= 0){
// npc유저 삭턴시 npc로 전환 // npc유저 삭턴시 npc로 전환
if($general->getVar('npc') == 1 && $general->getVar('deadyear') > $gameStor->year){ if($general->getNPCType() == 1 && $general->getVar('deadyear') > $gameStor->year){
$ownerName = $general->getVar('owner_name'); $ownerName = $general->getVar('owner_name');
$josaYi = JosaUtil::pick($ownerName, '이'); $josaYi = JosaUtil::pick($ownerName, '이');
@@ -197,7 +197,7 @@ class TurnExecutionHelper
} }
//은퇴 //은퇴
if($general->getVar('age') >= GameConst::$retirementYear && $general->getVar('npc') == 0) { if($general->getVar('age') >= GameConst::$retirementYear && $general->getNPCType() == 0) {
if($gameStor->isunited == 0) { if($gameStor->isunited == 0) {
$general->applyDB($db); $general->applyDB($db);
CheckHall($generalID); CheckHall($generalID);
@@ -258,7 +258,7 @@ class TurnExecutionHelper
$turnObj->preprocessCommand(); $turnObj->preprocessCommand();
if($general->getVar('npc') >= 2 || ($autorun_user['limit_minutes']??false)){ if($general->getNPCType() >= 2 || ($autorun_user['limit_minutes']??false)){
$ai = new GeneralAI($turnObj->getGeneral()); $ai = new GeneralAI($turnObj->getGeneral());
} }