balance: 유니크 아이템을 얻을 수 있는 커맨드 증가
- 강행, 거병, 견문, 군량매매, 귀환, 등용, 물자조달, 이동, 장비매매, 증여, 헌납
This commit is contained in:
@@ -13,6 +13,7 @@ use \sammo\LastTurn;
|
|||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
use function \sammo\printCitiesBasedOnDistance;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -161,6 +162,8 @@ class che_강행 extends Command\GeneralCommand
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -16,13 +16,12 @@ use \sammo\Constraint\ConstraintHelper;
|
|||||||
use sammo\CityConst;
|
use sammo\CityConst;
|
||||||
use function sammo\refreshNationStaticInfo;
|
use function sammo\refreshNationStaticInfo;
|
||||||
use function sammo\getAllNationStaticInfo;
|
use function sammo\getAllNationStaticInfo;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
|
|
||||||
class che_거병 extends Command\GeneralCommand{
|
class che_거병 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '거병';
|
static protected $actionName = '거병';
|
||||||
|
|
||||||
protected function argTest():bool{
|
protected function argTest():bool{
|
||||||
$this->arg = [];
|
$this->arg = [];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -38,7 +37,7 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
$this->setNation();
|
$this->setNation();
|
||||||
|
|
||||||
$relYear = $env['year'] - $env['startyear'];
|
$relYear = $env['year'] - $env['startyear'];
|
||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::BeNeutral(),
|
ConstraintHelper::BeNeutral(),
|
||||||
ConstraintHelper::BeOpeningPart($relYear+1),
|
ConstraintHelper::BeOpeningPart($relYear+1),
|
||||||
@@ -49,7 +48,7 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -93,15 +92,15 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
DB::db()->insert('nation', [
|
DB::db()->insert('nation', [
|
||||||
'name'=>$nationName,
|
'name'=>$nationName,
|
||||||
'color'=>'#330000',
|
'color'=>'#330000',
|
||||||
'gold'=>0,
|
'gold'=>0,
|
||||||
'rice'=>GameConst::$baserice,
|
'rice'=>GameConst::$baserice,
|
||||||
'rate'=>20,
|
'rate'=>20,
|
||||||
'bill'=>100,
|
'bill'=>100,
|
||||||
'strategic_cmd_limit'=>12,
|
'strategic_cmd_limit'=>12,
|
||||||
'surlimit'=>72,
|
'surlimit'=>72,
|
||||||
'secretlimit'=>$secretlimit,
|
'secretlimit'=>$secretlimit,
|
||||||
'type'=>GameConst::$neutralNationType,
|
'type'=>GameConst::$neutralNationType,
|
||||||
'gennum'=>1
|
'gennum'=>1
|
||||||
]);
|
]);
|
||||||
$nationID = DB::db()->insertId();
|
$nationID = DB::db()->insertId();
|
||||||
@@ -114,7 +113,7 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
if($nationID == $destNationID){
|
if($nationID == $destNationID){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$diplomacyInit[] = [
|
$diplomacyInit[] = [
|
||||||
'me'=>$destNationID,
|
'me'=>$destNationID,
|
||||||
'you'=>$nationID,
|
'you'=>$nationID,
|
||||||
@@ -132,9 +131,9 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
if($diplomacyInit){
|
if($diplomacyInit){
|
||||||
$db->insert('diplomacy', $diplomacyInit);
|
$db->insert('diplomacy', $diplomacyInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$turnRows = [];
|
$turnRows = [];
|
||||||
foreach([12, 11] as $chiefLevel){
|
foreach([12, 11] as $chiefLevel){
|
||||||
foreach(Util::range(GameConst::$maxChiefTurn) as $turnIdx){
|
foreach(Util::range(GameConst::$maxChiefTurn) as $turnIdx){
|
||||||
@@ -147,7 +146,7 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
'brief'=>'휴식',
|
'brief'=>'휴식',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$db->insert('nation_turn', $turnRows);
|
$db->insert('nation_turn', $turnRows);
|
||||||
|
|
||||||
@@ -172,10 +171,12 @@ class che_거병 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -14,10 +14,11 @@ use \sammo\Constraint\Constraint;
|
|||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use \sammo\TextDecoration\SightseeingMessage;
|
use \sammo\TextDecoration\SightseeingMessage;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_견문 extends Command\GeneralCommand{
|
class che_견문 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '견문';
|
static protected $actionName = '견문';
|
||||||
|
|
||||||
protected function argTest():bool{
|
protected function argTest():bool{
|
||||||
$this->arg = null;
|
$this->arg = null;
|
||||||
return true;
|
return true;
|
||||||
@@ -41,7 +42,7 @@ class che_견문 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -111,10 +112,12 @@ class che_견문 extends Command\GeneralCommand{
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -16,6 +16,8 @@ use \sammo\Constraint\Constraint;
|
|||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\MustNotBeReachedException;
|
use sammo\MustNotBeReachedException;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_군량매매 extends Command\GeneralCommand{
|
class che_군량매매 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '군량매매';
|
static protected $actionName = '군량매매';
|
||||||
static public $reqArg = true;
|
static public $reqArg = true;
|
||||||
@@ -57,7 +59,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
$general = $this->generalObj;
|
$general = $this->generalObj;
|
||||||
|
|
||||||
$this->setCity();
|
$this->setCity();
|
||||||
$this->setNation();
|
$this->setNation();
|
||||||
|
|
||||||
$this->minConditionConstraints=[
|
$this->minConditionConstraints=[
|
||||||
ConstraintHelper::ReqCityTrader($general->getNPCType()),
|
ConstraintHelper::ReqCityTrader($general->getNPCType()),
|
||||||
@@ -69,7 +71,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
protected function initWithArg()
|
protected function initWithArg()
|
||||||
{
|
{
|
||||||
$general = $this->generalObj;
|
$general = $this->generalObj;
|
||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::ReqCityTrader($general->getNPCType()),
|
ConstraintHelper::ReqCityTrader($general->getNPCType()),
|
||||||
ConstraintHelper::OccupiedCity(true),
|
ConstraintHelper::OccupiedCity(true),
|
||||||
@@ -87,7 +89,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -120,7 +122,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
else{
|
else{
|
||||||
$tradeRate /= 100;
|
$tradeRate /= 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($buyRice){
|
if($buyRice){
|
||||||
$buyKey = 'rice';
|
$buyKey = 'rice';
|
||||||
$sellKey = 'gold';
|
$sellKey = 'gold';
|
||||||
@@ -153,7 +155,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
else{
|
else{
|
||||||
$logger->pushGeneralActionLog("군량 <C>{$sellAmountText}</>을 팔아 자금 <C>{$buyAmountText}</>을 얻었습니다. <1>$date</>");
|
$logger->pushGeneralActionLog("군량 <C>{$sellAmountText}</>을 팔아 자금 <C>{$buyAmountText}</>을 얻었습니다. <1>$date</>");
|
||||||
}
|
}
|
||||||
|
|
||||||
$general->increaseVar($buyKey, $buyAmount);
|
$general->increaseVar($buyKey, $buyAmount);
|
||||||
$general->increaseVarWithLimit($sellKey, -$sellAmount, 0);
|
$general->increaseVarWithLimit($sellKey, -$sellAmount, 0);
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$exp = 30;
|
$exp = 30;
|
||||||
$ded = 50;
|
$ded = 50;
|
||||||
|
|
||||||
$incStat = Util::choiceRandomUsingWeight([
|
$incStat = Util::choiceRandomUsingWeight([
|
||||||
'leadership_exp'=>$general->getLeadership(false, false, false, false),
|
'leadership_exp'=>$general->getLeadership(false, false, false, false),
|
||||||
'strength_exp'=>$general->getStrength(false, false, false, false),
|
'strength_exp'=>$general->getStrength(false, false, false, false),
|
||||||
@@ -176,6 +178,8 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -199,5 +203,5 @@ class che_군량매매 extends Command\GeneralCommand{
|
|||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -14,7 +14,7 @@ use \sammo\Constraint\Constraint;
|
|||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\CityConst;
|
use sammo\CityConst;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_귀환 extends Command\GeneralCommand{
|
class che_귀환 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '귀환';
|
static protected $actionName = '귀환';
|
||||||
@@ -33,7 +33,7 @@ class che_귀환 extends Command\GeneralCommand{
|
|||||||
$this->setNation();
|
$this->setNation();
|
||||||
|
|
||||||
[$reqGold, $reqRice] = $this->getCost();
|
[$reqGold, $reqRice] = $this->getCost();
|
||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::NotWanderingNation(),
|
ConstraintHelper::NotWanderingNation(),
|
||||||
@@ -49,7 +49,7 @@ class che_귀환 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class che_귀환 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$exp = 70;
|
$exp = 70;
|
||||||
$ded = 100;
|
$ded = 100;
|
||||||
|
|
||||||
$general->setVar('city', $destCityID);
|
$general->setVar('city', $destCityID);
|
||||||
|
|
||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
@@ -95,10 +95,12 @@ class che_귀환 extends Command\GeneralCommand{
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ use \sammo\{
|
|||||||
use function \sammo\getAllNationStaticInfo;
|
use function \sammo\getAllNationStaticInfo;
|
||||||
use function \sammo\getNationStaticInfo;
|
use function \sammo\getNationStaticInfo;
|
||||||
use function \sammo\newColor;
|
use function \sammo\newColor;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -64,7 +65,7 @@ class che_등용 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->minConditionConstraints=[
|
$this->minConditionConstraints=[
|
||||||
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
ConstraintHelper::SuppliedCity(),
|
ConstraintHelper::SuppliedCity(),
|
||||||
];
|
];
|
||||||
@@ -80,7 +81,7 @@ class che_등용 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
ConstraintHelper::SuppliedCity(),
|
ConstraintHelper::SuppliedCity(),
|
||||||
ConstraintHelper::ExistsDestGeneral(),
|
ConstraintHelper::ExistsDestGeneral(),
|
||||||
@@ -110,7 +111,7 @@ class che_등용 extends Command\GeneralCommand{
|
|||||||
) * 10;
|
) * 10;
|
||||||
return [$reqGold, 0];
|
return [$reqGold, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -141,7 +142,7 @@ class che_등용 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$destGeneralName = $this->destGeneralObj->getName();
|
$destGeneralName = $this->destGeneralObj->getName();
|
||||||
$destGeneralID = $this->destGeneralObj->getID();
|
$destGeneralID = $this->destGeneralObj->getID();
|
||||||
|
|
||||||
|
|
||||||
$msg = ScoutMessage::buildScoutMessage($general->getID(), $destGeneralID, $reason, new \DateTime($general->getTurnTime()));
|
$msg = ScoutMessage::buildScoutMessage($general->getID(), $destGeneralID, $reason, new \DateTime($general->getTurnTime()));
|
||||||
if($msg){
|
if($msg){
|
||||||
@@ -164,6 +165,8 @@ class che_등용 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst,
|
GameConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -13,6 +13,7 @@ use \sammo\{
|
|||||||
|
|
||||||
use function \sammo\getDomesticExpLevelBonus;
|
use function \sammo\getDomesticExpLevelBonus;
|
||||||
use function \sammo\CriticalScoreEx;
|
use function \sammo\CriticalScoreEx;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -33,9 +34,9 @@ class che_물자조달 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setCity();
|
$this->setCity();
|
||||||
$this->setNation();
|
$this->setNation();
|
||||||
|
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints=[
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::NotWanderingNation(),
|
ConstraintHelper::NotWanderingNation(),
|
||||||
ConstraintHelper::OccupiedCity(),
|
ConstraintHelper::OccupiedCity(),
|
||||||
ConstraintHelper::SuppliedCity()
|
ConstraintHelper::SuppliedCity()
|
||||||
@@ -50,7 +51,7 @@ class che_물자조달 extends Command\GeneralCommand{
|
|||||||
public function getCost():array{
|
public function getCost():array{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -84,11 +85,11 @@ class che_물자조달 extends Command\GeneralCommand{
|
|||||||
'normal'=>0.6
|
'normal'=>0.6
|
||||||
]);
|
]);
|
||||||
$score *= CriticalScoreEx($pick);
|
$score *= CriticalScoreEx($pick);
|
||||||
|
|
||||||
|
|
||||||
$score = Util::round($score);
|
$score = Util::round($score);
|
||||||
$scoreText = number_format($score, 0);
|
$scoreText = number_format($score, 0);
|
||||||
|
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
if($pick == 'fail'){
|
if($pick == 'fail'){
|
||||||
@@ -120,10 +121,12 @@ class che_물자조달 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ use \sammo\LastTurn;
|
|||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
use function \sammo\printCitiesBasedOnDistance;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -169,6 +170,8 @@ class che_이동 extends Command\GeneralCommand
|
|||||||
$general->increaseVar('leadership_exp', 1);
|
$general->increaseVar('leadership_exp', 1);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace sammo\Command\General;
|
|||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB, Util, JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst, GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
@@ -13,6 +13,7 @@ use \sammo\{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use function \sammo\buildItemClass;
|
use function \sammo\buildItemClass;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -97,14 +98,14 @@ class che_장비매매 extends Command\GeneralCommand{
|
|||||||
if(!$this->isArgValid){
|
if(!$this->isArgValid){
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemCode = $this->arg['itemCode'];
|
$itemCode = $this->arg['itemCode'];
|
||||||
$itemObj = buildItemClass($itemCode);
|
$itemObj = buildItemClass($itemCode);
|
||||||
|
|
||||||
$reqGold = $itemObj->getCost();
|
$reqGold = $itemObj->getCost();
|
||||||
return [$reqGold, 0];
|
return [$reqGold, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn():int{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -176,6 +177,7 @@ class che_장비매매 extends Command\GeneralCommand{
|
|||||||
$general->addExperience($exp);
|
$general->addExperience($exp);
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -208,7 +210,7 @@ $('#customSubmit').click(function(){
|
|||||||
현재 구입 불가능한 것은 <font color=red>붉은색</font>으로 표시됩니다.<br>
|
현재 구입 불가능한 것은 <font color=red>붉은색</font>으로 표시됩니다.<br>
|
||||||
현재 도시 치안 : <?=$citySecu?> 현재 자금 : <?=$gold?><br>
|
현재 도시 치안 : <?=$citySecu?> 현재 자금 : <?=$gold?><br>
|
||||||
장비 : <select class='formInput' name="itemCode" id="itemCode" onchange='updateItemType();' size='1' style='color:white;background-color:black;'>
|
장비 : <select class='formInput' name="itemCode" id="itemCode" onchange='updateItemType();' size='1' style='color:white;background-color:black;'>
|
||||||
<?php foreach(GameConst::$allItems as $itemType=>$itemCategories):
|
<?php foreach(GameConst::$allItems as $itemType=>$itemCategories):
|
||||||
//매각
|
//매각
|
||||||
$typeName = static::$itemMap[$itemType];
|
$typeName = static::$itemMap[$itemType];
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use \sammo\Command;
|
|||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_증여 extends Command\GeneralCommand
|
class che_증여 extends Command\GeneralCommand
|
||||||
{
|
{
|
||||||
@@ -168,6 +169,8 @@ class che_증여 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
$destGeneral->applyDB($db);
|
$destGeneral->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use \sammo\Command;
|
|||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_헌납 extends Command\GeneralCommand
|
class che_헌납 extends Command\GeneralCommand
|
||||||
{
|
{
|
||||||
@@ -144,6 +145,8 @@ class che_헌납 extends Command\GeneralCommand
|
|||||||
|
|
||||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||||
$general->checkStatChange();
|
$general->checkStatChange();
|
||||||
|
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user