저격 버그 수정
This commit is contained in:
+11
-7
@@ -187,24 +187,28 @@ class GeneralAI
|
||||
$this->attackable = !!$frontStatus;
|
||||
|
||||
$warTarget = $db->queryAllLists(
|
||||
'SELECT you, state FROM diplomacy WHERE me = %i AND (state = 0 OR (state = 1 AND term < 5))',
|
||||
'SELECT you, state, term FROM diplomacy WHERE me = %i AND state IN (0, 1)',
|
||||
$nationID
|
||||
);
|
||||
|
||||
$onWar = 0;
|
||||
$onWarReady = 0;
|
||||
$onWarYet = 0;
|
||||
$warTargetNation = [];
|
||||
foreach ($warTarget as [$warNationID, $warState]) {
|
||||
foreach ($warTarget as [$warNationID, $warState, $warTerm]) {
|
||||
if ($warState == 0) {
|
||||
$onWar += 1;
|
||||
$warTargetNation[$warNationID] = 2;
|
||||
} else {
|
||||
} else if($warState == 1 && $warTerm < 5){
|
||||
$onWarReady += 1;
|
||||
$warTargetNation[$warNationID] = 1;
|
||||
}
|
||||
else{
|
||||
$onWarYet += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$onWar){
|
||||
if(!$onWar && !$onWarReady && !$onWarYet){
|
||||
$warTargetNation[0] = 1;
|
||||
}
|
||||
|
||||
@@ -224,7 +228,7 @@ class GeneralAI
|
||||
|
||||
if ($this->attackable) {
|
||||
//전쟁으로 인한 attackable인가?
|
||||
if ($onWar || !$onWarReady) {
|
||||
if ($onWar || (!$onWarReady && !$onWarYet)) {
|
||||
$this->dipState = self::d전쟁;
|
||||
}
|
||||
}
|
||||
@@ -1586,8 +1590,8 @@ class GeneralAI
|
||||
$avgGold /= $genCnt;
|
||||
$avgRice /= $genCnt;
|
||||
|
||||
$trialProp = $avgGold / max($this->nationPolicy->reqNPCWarGold, 2000);
|
||||
$trialProp += $avgRice / max($this->nationPolicy->reqNPCWarRice, 2000);
|
||||
$trialProp = $avgGold / max($this->nationPolicy->reqNPCWarGold * 1.5, 2000);
|
||||
$trialProp += $avgRice / max($this->nationPolicy->reqNPCWarRice * 1.5, 2000);
|
||||
|
||||
$devRate = $this->calcNationDevelopedRate();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class che_저격발동 extends BaseWarUnitTrigger{
|
||||
$oppose->getLogger()->pushGeneralActionLog("상대에게 <R>저격</>당했다!", ActionLogger::PLAIN);
|
||||
$oppose->getLogger()->pushGeneralBattleDetailLog("상대에게 <R>저격</>당했다!", ActionLogger::PLAIN);
|
||||
|
||||
$general->increaseVarWithLimit('atmos', 10, GameConst::$maxAtmosByWar);
|
||||
$general->increaseVarWithLimit('atmos', 10, 0, GameConst::$maxAtmosByWar);
|
||||
$oppose->getGeneral()->increaseVarWithLimit('injury', Util::randRangeInt($selfEnv['woundMin'], $selfEnv['woundMax']), null, 80);
|
||||
|
||||
$this->processConsumableItem();
|
||||
|
||||
Reference in New Issue
Block a user