전략 턴 버그 수정. 글로벌 쿨 9턴으로 변경
This commit is contained in:
@@ -1,42 +1,45 @@
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\Util;
|
||||
|
||||
class che_종횡가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '종횡가';
|
||||
protected $info = '';
|
||||
static $pros = '전략↑ 수성↑';
|
||||
static $cons = '금수입↓ 내정↓';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '수비' || $turnType == '성벽'){
|
||||
if($varType == 'score') return $value * 1.1;
|
||||
if($varType == 'cost') return $value * 0.8;
|
||||
}
|
||||
|
||||
else if($turnType == '농업' || $turnType == '상업'){
|
||||
if($varType == 'score') return $value * 0.9;
|
||||
if($varType == 'cost') return $value * 1.2;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onCalcNationalIncome(string $type, $amount){
|
||||
if($type == 'gold'){
|
||||
return $amount * 0.9;
|
||||
}
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||
if($varType == 'delay'){
|
||||
return Util::round($value / 2);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
<?php
|
||||
namespace sammo\ActionNationType;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
use \sammo\Util;
|
||||
|
||||
class che_종횡가 extends \sammo\BaseNation{
|
||||
|
||||
protected $name = '종횡가';
|
||||
protected $info = '';
|
||||
static $pros = '전략↑ 수성↑';
|
||||
static $cons = '금수입↓ 내정↓';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '수비' || $turnType == '성벽'){
|
||||
if($varType == 'score') return $value * 1.1;
|
||||
if($varType == 'cost') return $value * 0.8;
|
||||
}
|
||||
|
||||
else if($turnType == '농업' || $turnType == '상업'){
|
||||
if($varType == 'score') return $value * 0.9;
|
||||
if($varType == 'cost') return $value * 1.2;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onCalcNationalIncome(string $type, $amount){
|
||||
if($type == 'gold'){
|
||||
return $amount * 0.9;
|
||||
}
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||
if($varType == 'delay'){
|
||||
return Util::round($value / 2);
|
||||
}
|
||||
if($varType == 'globalDelay'){
|
||||
return Util::round($value / 2);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class che_급습 extends Command\NationCommand
|
||||
$this->minConditionConstraints = [
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class che_급습 extends Command\NationCommand
|
||||
12,
|
||||
'선포 12개월 이상인 상대국에만 가능합니다.'
|
||||
),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ class che_급습 extends Command\NationCommand
|
||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>에 <M>{$commandName}</>{$josaUl} 발동");
|
||||
|
||||
$db->update('nation', [
|
||||
'strategic_cmd_limit' => $this->getPostReqTurn()
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
$db->update('diplomacy', [
|
||||
'term' => $db->sqleval('`term` - %i', 3),
|
||||
|
||||
@@ -60,7 +60,7 @@ class che_백성동원 extends Command\NationCommand{
|
||||
$this->minConditionConstraints=[
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn())
|
||||
ConstraintHelper::AvailableStrategicCommand()
|
||||
];
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class che_백성동원 extends Command\NationCommand{
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::OccupiedDestCity(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn())
|
||||
ConstraintHelper::AvailableStrategicCommand()
|
||||
];
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ class che_백성동원 extends Command\NationCommand{
|
||||
$logger->pushNationalHistoryLog("<L><b>【전략】</b></><D><b>{$nationName}</b></>{$josaYiNation} <G><b>{$destCityName}</b></>에 <M>백성동원</>을 하였습니다.");
|
||||
|
||||
$db->update('nation', [
|
||||
'strategic_cmd_limit' => 12
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
|
||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||
|
||||
@@ -60,7 +60,7 @@ class che_수몰 extends Command\NationCommand{
|
||||
$this->minConditionConstraints=[
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class che_수몰 extends Command\NationCommand{
|
||||
ConstraintHelper::NotNeutralDestCity(),
|
||||
ConstraintHelper::NotOccupiedDestCity(),
|
||||
ConstraintHelper::BattleGroundCity(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ class che_수몰 extends Command\NationCommand{
|
||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>에 <M>수몰</>을 발동");
|
||||
|
||||
$db->update('nation', [
|
||||
'strategic_cmd_limit' => 12
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
|
||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||
|
||||
@@ -50,7 +50,7 @@ class che_의병모집 extends Command\NationCommand
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::NotBeNeutral(),
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
ConstraintHelper::NotOpeningPart($relYear),
|
||||
];
|
||||
}
|
||||
@@ -232,7 +232,7 @@ class che_의병모집 extends Command\NationCommand
|
||||
$gameStor->npccount = $lastCreatGenIdx;
|
||||
$db->update('nation', [
|
||||
'gennum' => $db->sqleval('gennum + %i', $createGenCnt),
|
||||
'strategic_cmd_limit' => 12
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -70,7 +70,7 @@ class che_이호경식 extends Command\NationCommand
|
||||
$this->minConditionConstraints = [
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ class che_이호경식 extends Command\NationCommand
|
||||
[0, 1],
|
||||
'선포, 전쟁중인 상대국에게만 가능합니다.'
|
||||
),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ class che_이호경식 extends Command\NationCommand
|
||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>에 <M>{$commandName}</>{$josaUl} 발동");
|
||||
|
||||
$db->update('nation', [
|
||||
'strategic_cmd_limit' => 12
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
$db->update('diplomacy', [
|
||||
'term' => $db->sqleval('IF(`state`=0, %i, `term`+ %i)', 3, 3),
|
||||
|
||||
@@ -47,7 +47,7 @@ class che_필사즉생 extends Command\NationCommand{
|
||||
ConstraintHelper::AllowDiplomacyStatus($this->generalObj->getNationID(), [
|
||||
0
|
||||
], '전쟁중이 아닙니다.'),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn())
|
||||
ConstraintHelper::AvailableStrategicCommand()
|
||||
];
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class che_필사즉생 extends Command\NationCommand{
|
||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <M>필사즉생</>을 발동");
|
||||
|
||||
$db->update('nation', [
|
||||
'strategic_cmd_limit' => $this->getPostReqTurn()
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
|
||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||
|
||||
@@ -67,7 +67,7 @@ class che_허보 extends Command\NationCommand
|
||||
$this->minConditionConstraints = [
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class che_허보 extends Command\NationCommand
|
||||
[0, 1],
|
||||
'선포, 전쟁중인 상대국에게만 가능합니다.'
|
||||
),
|
||||
ConstraintHelper::AvailableStrategicCommand($this->getPreReqTurn()),
|
||||
ConstraintHelper::AvailableStrategicCommand(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class che_허보 extends Command\NationCommand
|
||||
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>에 <M>허보</>를 발동");
|
||||
|
||||
$db->update('nation', [
|
||||
'strategic_cmd_limit' => $this->getPostReqTurn()
|
||||
'strategic_cmd_limit' => $this->generalObj->onCalcStrategic($this->getName(), 'globalDelay', 9)
|
||||
], 'nation=%i', $nationID);
|
||||
|
||||
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
|
||||
|
||||
Reference in New Issue
Block a user