fix: 사전거병 후 군주가 사라지는 경우에 대한 수정 #247

Merged
Hide_D merged 3 commits from jyp9/core:nomore_wandering_lord_run into devel 2024-02-17 00:01:35 +09:00
2 changed files with 8 additions and 1 deletions
@@ -90,6 +90,9 @@ class BuildNationCandidate extends \sammo\BaseAPI
return '거병을 실패했습니다.';
}
$general->setVar('killturn', $env['killturn']);
jyp9 marked this conversation as resolved Outdated
Outdated
Review

이 위치가 맞을까요? 거병에 성공한 시점이 이 시점인거 같아서 여기에 넣었습니다만..

이 위치가 맞을까요? 거병에 성공한 시점이 이 시점인거 같아서 여기에 넣었습니다만..
Outdated
Review

API를 호출하는건 항상 유저이므로, NPCType 자체는 검사할 필요가 없는것 같고,
$general->setVar()를 했기 때문에, $general->applyDB($db)는 호출해줘야 할 것 같습니다.

API를 호출하는건 항상 유저이므로, NPCType 자체는 검사할 필요가 없는것 같고, `$general->setVar()`를 했기 때문에, `$general->applyDB($db)`는 호출해줘야 할 것 같습니다.
$general->applyDB($db);
return null;
}
}
+5 -1
View File
@@ -3439,8 +3439,12 @@ class GeneralAI
$cmd = buildGeneralCommandClass($this->rng->choice($candidate), $this->general, $this->env);
if (!$cmd->hasFullConditionMet()) {
jyp9 marked this conversation as resolved Outdated
Outdated
Review

이번 코드 한정으로 제 스타일은

if (!$cmd->hasFullConditionMet()) {
   $cmd = buildGeneralCommandClass(딴거);
}
if (!$cmd->hasFullConditionMet()) {
   $cmd = buildGeneralCommandClass(또딴거);
}

에 가깝긴 하겠네요.

물론 조기 탈출은 좋아합니다:)

이번 코드 한정으로 제 스타일은 ``` if (!$cmd->hasFullConditionMet()) { $cmd = buildGeneralCommandClass(딴거); } if (!$cmd->hasFullConditionMet()) { $cmd = buildGeneralCommandClass(또딴거); } ``` 에 가깝긴 하겠네요. 물론 조기 탈출은 좋아합니다:)
Outdated
Review

아 이거 맨 처음 $cmd가 잘 되어 있으면 hasFullConditionMet()을 두 번이나 검사하게 되긴 하지만.. 그래도 스타일 맞추는 게 좋은게 좋은거지 싶어서 일단 따라가봄미다..

아 이거 맨 처음 $cmd가 잘 되어 있으면 hasFullConditionMet()을 두 번이나 검사하게 되긴 하지만.. 그래도 스타일 맞추는 게 좋은게 좋은거지 싶어서 일단 따라가봄미다..
Outdated
Review

는 아무래도 아닌 거 같아서 약간 더 수정했습니다.

는 아무래도 아닌 거 같아서 약간 더 수정했습니다.
return buildGeneralCommandClass('che_물자조달', $this->general, $this->env);
$cmd = buildGeneralCommandClass('che_물자조달', $this->general, $this->env);
if (!$cmd->hasFullConditionMet()) {
$cmd = buildGeneralCommandClass('che_견문', $this->general, $this->env);
}
}
return $cmd;
}