첫 화면 띄우기 성공
This commit is contained in:
@@ -10,17 +10,33 @@ use function sammo\getItemCost2;
|
||||
//XXX:임시용!
|
||||
class che_Dummy extends \sammo\BaseItem{
|
||||
|
||||
static $id;
|
||||
static $name;
|
||||
static $info;
|
||||
static $cost;
|
||||
static $consumable = false;
|
||||
protected $_id;
|
||||
protected $_name;
|
||||
protected $_info;
|
||||
protected $_cost;
|
||||
protected $_consumable = false;
|
||||
|
||||
function getID(){
|
||||
return $this->_id;
|
||||
}
|
||||
function getName(){
|
||||
return $this->_name;
|
||||
}
|
||||
function getInfo(){
|
||||
return $this->_info;
|
||||
}
|
||||
function getCost(){
|
||||
return $this->_cost;
|
||||
}
|
||||
function isConsumable(){
|
||||
return $this->_consumable;
|
||||
}
|
||||
|
||||
public function __construct(int $itemCode)
|
||||
{
|
||||
$this->id = $itemCode = true;
|
||||
[$this->name, $this->info] = getItemInfo($itemCode);
|
||||
$this->cost = getItemCost2($itemCode);
|
||||
$this->consumable = isConsumable($itemCode);
|
||||
$this->_id = $itemCode = true;
|
||||
[$this->_name, $this->_info] = getItemInfo($itemCode);
|
||||
$this->_cost = getItemCost2($itemCode);
|
||||
$this->_consumable = isConsumable($itemCode);
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ use \sammo\General;
|
||||
|
||||
class che_계략_삼략 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 22;
|
||||
static $name = '삼략(계략)';
|
||||
static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 22;
|
||||
protected static $name = '삼략(계략)';
|
||||
protected static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
|
||||
@@ -5,11 +5,11 @@ use \sammo\General;
|
||||
|
||||
class che_계략_육도 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 21;
|
||||
static $name = '육도(계략)';
|
||||
static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 21;
|
||||
protected static $name = '육도(계략)';
|
||||
protected static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
|
||||
@@ -5,11 +5,11 @@ use \sammo\General;
|
||||
|
||||
class che_계략_이추 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 5;
|
||||
static $name = '이추(계략)';
|
||||
static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p';
|
||||
static $cost = 1000;
|
||||
static $consumable = true;
|
||||
protected static $id = 5;
|
||||
protected static $name = '이추(계략)';
|
||||
protected static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p';
|
||||
protected static $cost = 1000;
|
||||
protected static $consumable = true;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
|
||||
@@ -5,11 +5,11 @@ use \sammo\General;
|
||||
|
||||
class che_계략_향낭 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 5;
|
||||
static $name = '항냥(계략)';
|
||||
static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
static $cost = 3000;
|
||||
static $consumable = true;
|
||||
protected static $id = 5;
|
||||
protected static $name = '항냥(계략)';
|
||||
protected static $info = '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p';
|
||||
protected static $cost = 3000;
|
||||
protected static $consumable = true;
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
if($turnType == '계략'){
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_의술_청낭서 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 23;
|
||||
static $name = '청낭서(의술)';
|
||||
static $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 23;
|
||||
protected static $name = '청낭서(의술)';
|
||||
protected static $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_의술_태평청령 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 24;
|
||||
static $name = '태평청령(의술)';
|
||||
static $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 24;
|
||||
protected static $name = '태평청령(의술)';
|
||||
protected static $info = '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_치료_도소연명 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 9;
|
||||
static $name = '도소연명(치료)';
|
||||
static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 9;
|
||||
protected static $name = '도소연명(치료)';
|
||||
protected static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_치료_무후행군 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 8;
|
||||
static $name = '무후행군(치료)';
|
||||
static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 8;
|
||||
protected static $name = '무후행군(치료)';
|
||||
protected static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_치료_오석산 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 7;
|
||||
static $name = '오석산(치료)';
|
||||
static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 7;
|
||||
protected static $name = '오석산(치료)';
|
||||
protected static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_치료_정력견혈 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 11;
|
||||
static $name = '정력견혈(치료)';
|
||||
static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 11;
|
||||
protected static $name = '정력견혈(치료)';
|
||||
protected static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_치료_칠엽청점 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 10;
|
||||
static $name = '칠엽청점(치료)';
|
||||
static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
static $cost = 200;
|
||||
static $consumable = false;
|
||||
protected static $id = 10;
|
||||
protected static $name = '칠엽청점(치료)';
|
||||
protected static $info = '[군사] 턴 실행 전 부상 회복.';
|
||||
protected static $cost = 200;
|
||||
protected static $consumable = false;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -7,11 +7,11 @@ use \sammo\GeneralTriggerCaller;
|
||||
|
||||
class che_치료_환약 extends \sammo\BaseItem{
|
||||
|
||||
static $id = 1;
|
||||
static $name = '환약(치료)';
|
||||
static $info = '[군사] 턴 실행 전 부상 회복. 1회용';
|
||||
static $cost = 100;
|
||||
static $consumable = true;
|
||||
protected static $id = 1;
|
||||
protected static $name = '환약(치료)';
|
||||
protected static $info = '[군사] 턴 실행 전 부상 회복. 1회용';
|
||||
protected static $cost = 100;
|
||||
protected static $consumable = true;
|
||||
|
||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
||||
return new GeneralTriggerCaller([
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_대의 implements iAction{
|
||||
class che_왕좌 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 0;
|
||||
|
||||
+21
-5
@@ -7,11 +7,27 @@ use \sammo\General;
|
||||
class BaseItem implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 0;
|
||||
static $name = '-';
|
||||
static $info = '';
|
||||
static $cost = null;
|
||||
static $consumable = false;
|
||||
protected static $id = 0;
|
||||
protected static $name = '-';
|
||||
protected static $info = '';
|
||||
protected static $cost = null;
|
||||
protected static $consumable = false;
|
||||
|
||||
function getID(){
|
||||
return $this->id;
|
||||
}
|
||||
function getName(){
|
||||
return $this->name;
|
||||
}
|
||||
function getInfo(){
|
||||
return $this->info;
|
||||
}
|
||||
function getCost(){
|
||||
return $this->cost;
|
||||
}
|
||||
function isConsumable(){
|
||||
return $this->consumable;
|
||||
}
|
||||
|
||||
function isValidTurnItem(string $actionType, string $command):bool{
|
||||
return false;
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace sammo\Command;
|
||||
|
||||
use \sammo\{
|
||||
Util, JosaUtil, DB,
|
||||
General,
|
||||
General, GameConst,
|
||||
ActionLogger
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ abstract class BaseCommand{
|
||||
|
||||
protected $alternative = null;
|
||||
|
||||
static private $isInitStatic = false;
|
||||
static protected $isInitStatic = false;
|
||||
protected static function initStatic(){
|
||||
|
||||
}
|
||||
@@ -62,7 +62,7 @@ abstract class BaseCommand{
|
||||
$this->logger = $generalObj->getLogger();
|
||||
$this->env = $env;
|
||||
$this->arg = $arg;
|
||||
if ($this->argTest()) {
|
||||
if (!$this->argTest()) {
|
||||
return;
|
||||
}
|
||||
$this->isArgValid = true;
|
||||
@@ -102,7 +102,8 @@ abstract class BaseCommand{
|
||||
if($hasArgs){
|
||||
return;
|
||||
}
|
||||
$this->city = $db->queryFirstRow('SELECT %lb FROM city WHERE city=%i', $args, $this->generalObj->getVar('city'));
|
||||
|
||||
$this->city = $db->queryFirstRow('SELECT %l FROM city WHERE city=%i', Util::formatListOfBackticks($args), $this->generalObj->getVar('city'));
|
||||
if($this->generalObj->getRawCity() === null){
|
||||
$this->generalObj->setRawCity($this->city);
|
||||
}
|
||||
@@ -115,6 +116,12 @@ abstract class BaseCommand{
|
||||
return;
|
||||
}
|
||||
|
||||
$nationID = $this->generalObj->getNationID();
|
||||
if($nationID == 0){
|
||||
$this->nation = $this->generalObj->getStaticNation();
|
||||
return;
|
||||
}
|
||||
|
||||
$defaultArgs = ['nation', 'name', 'color', 'type', 'level', 'capital'];
|
||||
$args = array_unique(array_merge($defaultArgs, $args));
|
||||
if($args == $defaultArgs){
|
||||
@@ -135,8 +142,10 @@ abstract class BaseCommand{
|
||||
'gennum'=>1
|
||||
];
|
||||
|
||||
|
||||
|
||||
$db = DB::db();
|
||||
$destNation = $db->queryFirstRow('SELECT %lb FROM nation WHERE nation=%i', $args, $nationNo);
|
||||
$destNation = $db->queryFirstRow('SELECT %l FROM nation WHERE nation=%i', Util::formatListOfBackticks($args), $nationID);
|
||||
if($destNation === null){
|
||||
$destNation = [];
|
||||
foreach($args as $arg){
|
||||
@@ -163,13 +172,13 @@ abstract class BaseCommand{
|
||||
$this->destCity = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $cityNo);
|
||||
return;
|
||||
}
|
||||
$this->destCity = $db->queryFirstRow('SELECT %lb FROM city WHERE city=%i', $args, $cityNo);
|
||||
$this->destCity = $db->queryFirstRow('SELECT %l FROM city WHERE city=%i', Util::formatListOfBackticks($args), $cityNo);
|
||||
}
|
||||
|
||||
protected function setDestNation(int $nationNo, ?array $args = null){
|
||||
protected function setDestNation(int $nationID, ?array $args = null){
|
||||
$this->resetTestCache();
|
||||
if($args === null || $args === []){
|
||||
$this->destNation = getNationStaticInfo($nationNo);
|
||||
$this->destNation = getNationStaticInfo($nationID);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -190,7 +199,7 @@ abstract class BaseCommand{
|
||||
];
|
||||
|
||||
$db = DB::db();
|
||||
$destNation = $db->queryFirstRow('SELECT %lb FROM nation WHERE nation=%i', $args, $nationNo);
|
||||
$destNation = $db->queryFirstRow('SELECT %l FROM nation WHERE nation=%i', Util::formatListOfBackticks($args), $nationID);
|
||||
if($destNation === null){
|
||||
$destNation = [];
|
||||
foreach($args as $arg){
|
||||
@@ -287,7 +296,11 @@ abstract class BaseCommand{
|
||||
}
|
||||
|
||||
public function isReservable():bool{
|
||||
if($this->reservable !== null){
|
||||
return $this->reservable;
|
||||
}
|
||||
|
||||
return $this->testReservable() === null;
|
||||
}
|
||||
|
||||
public function isArgValid():bool{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -18,6 +18,9 @@ class che_NPC능동 extends Command\GeneralCommand{
|
||||
static protected $actionName = 'NPC능동';
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('optionText', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -26,6 +26,9 @@ class che_강행 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('destCityID', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -38,10 +38,6 @@ class che_거병 extends Command\GeneralCommand{
|
||||
$this->setCity();
|
||||
$this->setNation();
|
||||
|
||||
if(!key_exists($colorType, GetNationColors())){
|
||||
return false;
|
||||
}
|
||||
|
||||
$relYear = $env['year'] - $env['startyear'];
|
||||
|
||||
$this->runnableConstraints=[
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -29,6 +29,9 @@ class che_건국 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
$nationName = $this->arg['nationName']??null;
|
||||
$nationType = $this->arg['nationType']??null;
|
||||
$colorType = $this->arg['colorType']??null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
//TODO: 아이템 클래스 재확정 후 재 구현!
|
||||
|
||||
@@ -36,6 +36,9 @@ class che_군량매매 extends Command\GeneralCommand{
|
||||
];
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
$buyRice = $this->arg['buyRice']??null;
|
||||
if(!is_bool($buyRice)){
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
class che_농지개간 extends che_상업투자{
|
||||
static protected $cityKey = 'agri';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -28,6 +28,9 @@ class che_등용 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
//NOTE: 사망 직전에 '등용' 턴을 넣을 수 있으므로, 존재하지 않는 장수여도 argTest에서 바로 탈락시키지 않음
|
||||
if(!key_exists('destGeneralID', $this->arg)){
|
||||
return false;
|
||||
@@ -74,7 +77,7 @@ class che_등용 extends Command\GeneralCommand{
|
||||
];
|
||||
|
||||
if($this->destGeneralObj->getVar('level') == 12){
|
||||
$this->runnableConstraints[] = ['AlwaysFail', '군주에게는 등용장을 보낼 수 없습니다.'];
|
||||
$this->runnableConstraints[] = ConstraintHelper::AlwaysFail('군주에게는 등용장을 보낼 수 없습니다.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil, TimeUtil,
|
||||
@@ -27,7 +27,9 @@ class che_랜덤임관 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
$destNationIDList = $this->arg['destNationIDList']??null;
|
||||
//null은 에러, []는 정상
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -21,8 +21,8 @@ use function \sammo\{
|
||||
use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
|
||||
class che_모반 extends Command\GeneralCommand{
|
||||
static protected $actionName = '모반';
|
||||
class che_모반시도 extends Command\GeneralCommand{
|
||||
static protected $actionName = '모반시도';
|
||||
|
||||
protected function argTest():bool{
|
||||
$this->arg = null;
|
||||
@@ -34,9 +34,6 @@ class che_모반 extends Command\GeneralCommand{
|
||||
$general = $this->generalObj;
|
||||
|
||||
$this->setNation();
|
||||
|
||||
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], 1);
|
||||
$this->setDestGeneral($destGeneral);
|
||||
|
||||
$this->runnableConstraints=[
|
||||
ConstraintHelper::NotBeNeutral(),
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -49,7 +49,8 @@ class che_사기진작 extends Command\GeneralCommand{
|
||||
}
|
||||
|
||||
public function getCost():array{
|
||||
return [Util::round($this->getVar('crew')/100), 0];
|
||||
$general = $this->generalObj;
|
||||
return [Util::round($general->getVar('crew')/100), 0];
|
||||
}
|
||||
|
||||
public function getPreReqTurn():int{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -36,7 +36,7 @@ class che_상업투자 extends Command\GeneralCommand{
|
||||
'power'=>'무력경험',
|
||||
'intel'=>'지력경험',
|
||||
];
|
||||
$statType = $statType[static::$statKey];
|
||||
$statType = $statTypeBase[static::$statKey];
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
|
||||
$title = "{$name}({$statType}";
|
||||
@@ -79,7 +79,7 @@ class che_상업투자 extends Command\GeneralCommand{
|
||||
|
||||
public function getCost():array{
|
||||
$develCost = $this->env['develcost'];
|
||||
$reqGold = $general->onCalcDomestic(static::$actionKey, 'cost', $develCost);
|
||||
$reqGold = $this->generalObj->onCalcDomestic(static::$actionKey, 'cost', $develCost);
|
||||
$reqRice = 0;
|
||||
|
||||
return [$reqGold, $reqRice];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -27,6 +27,9 @@ class che_선양 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
//NOTE: 사망 직전에 '선양' 턴을 넣을 수 있으므로, 존재하지 않는 장수여도 argTest에서 바로 탈락시키지 않음
|
||||
if(!key_exists('destGeneralID', $this->arg)){
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
class che_성벽보수 extends che_상업투자{
|
||||
static protected $cityKey = 'wall';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
class che_수비강화 extends che_상업투자{
|
||||
static protected $cityKey = 'def';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -26,6 +26,9 @@ class che_이동 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('destCityID', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -47,7 +47,7 @@ class che_인재탐색 extends Command\GeneralCommand{
|
||||
];
|
||||
|
||||
$relYear = $env['year'] - $env['startyear'];
|
||||
if($relYear < 3 && $this->nation['gennum'] >= GameConst::$initialNationGenLimit){
|
||||
if($this->nation['nation'] != 0 && $relYear < 3 && $this->nation['gennum'] >= GameConst::$initialNationGenLimit){
|
||||
$nationName = $this->nation['name'];
|
||||
$josaUn = JosaUtil::pick($nationName, '은');
|
||||
$this->runnableConstraints[] = ConstraintHelper::AlwaysFail("현재 <D>{$nationName}</>{$josaUn} 탐색이 제한되고 있습니다.");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -26,6 +26,9 @@ class che_임관 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
$destNationID = $this->arg['destNationID']??null;
|
||||
$destGeneralID = $this->arg['destGeneralID']??null;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
//TODO: 아이템 클래스 재확정 후 재 구현!
|
||||
|
||||
@@ -35,6 +35,9 @@ class che_장비매매 extends Command\GeneralCommand{
|
||||
];
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
$itemType = $this->arg['itemType']??null;
|
||||
if(!in_array($itemType, array_keys(static::$itemMap))){
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -58,7 +58,7 @@ class che_정착장려 extends Command\GeneralCommand{
|
||||
public function getCost():array{
|
||||
$develCost = $this->env['develcost'] * 2;
|
||||
$reqGold = 0;
|
||||
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $develCost);
|
||||
$reqRice = $this->generalObj->onCalcDomestic(static::$actionKey, 'cost', $develCost);
|
||||
|
||||
return [$reqGold, $reqRice];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -58,7 +58,7 @@ class che_주민선정 extends Command\GeneralCommand{
|
||||
public function getCost():array{
|
||||
$develCost = $this->env['develcost'] * 2;
|
||||
$reqGold = 0;
|
||||
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $develCost);
|
||||
$reqRice = $this->generalObj->onCalcDomestic(static::$actionKey, 'cost', $develCost);
|
||||
|
||||
return [$reqGold, $reqRice];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -27,6 +27,9 @@ class che_증여 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
//NOTE: 사망 직전에 '증여' 턴을 넣을 수 있으므로, 존재하지 않는 장수여도 argTest에서 바로 탈락시키지 않음
|
||||
if(!key_exists('isGold', $this->arg)){
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -35,7 +35,6 @@ class che_집합 extends Command\GeneralCommand{
|
||||
|
||||
$this->setCity();
|
||||
$this->setNation();
|
||||
$this->setDestCity($this->arg['destCityID'], []);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -42,6 +42,9 @@ class che_징병 extends Command\GeneralCommand{
|
||||
}
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('crewType', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
@@ -111,7 +114,7 @@ class che_징병 extends Command\GeneralCommand{
|
||||
return [0, 0];
|
||||
}
|
||||
$reqGold = $this->reqCrewType->costWithTech($this->nation['tech'], $this->reqCrew);
|
||||
$reqGold = $general->onCalcDomestic('징병', 'cost', $reqGold, ['armType'=>$this->reqCrewType->armType]);
|
||||
$reqGold = $this->generalObj->onCalcDomestic('징병', 'cost', $reqGold, ['armType'=>$this->reqCrewType->armType]);
|
||||
$reqGold *= static::$costOffset;
|
||||
$reqRice = $this->reqCrew / 100;
|
||||
return [$reqGold, $reqRice];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -27,6 +27,9 @@ class che_첩보 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('destCityID', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -27,6 +27,9 @@ class che_출병 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('destCityID', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
class che_치안강화 extends che_상업투자{
|
||||
static protected $cityKey = 'secu';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -40,12 +40,6 @@ class che_해산 extends Command\GeneralCommand{
|
||||
$this->setCity();
|
||||
$this->setNation(['gennum']);
|
||||
|
||||
if(!key_exists($colorType, GetNationColors())){
|
||||
return false;
|
||||
}
|
||||
|
||||
$relYear = $env['year'] - $env['startyear'];
|
||||
|
||||
$this->runnableConstraints=[
|
||||
ConstraintHelper::BeLord(),
|
||||
ConstraintHelper::WanderingNation(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -27,6 +27,9 @@ class che_헌납 extends Command\GeneralCommand{
|
||||
static public $reqArg = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('isGold', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
@@ -29,6 +29,9 @@ class che_화계 extends Command\GeneralCommand{
|
||||
static protected $injuryGeneral = true;
|
||||
|
||||
protected function argTest():bool{
|
||||
if($this->arg === null){
|
||||
return false;
|
||||
}
|
||||
if(!key_exists('destCityID', $this->arg)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo\GeneralCommand;
|
||||
namespace sammo\Command\General;
|
||||
|
||||
use \sammo\{
|
||||
DB, Util, JosaUtil,
|
||||
|
||||
@@ -140,6 +140,11 @@ class GameConstBase
|
||||
'che_안전', 'che_유지', 'che_재간', 'che_출세', 'che_할거', 'che_정복',
|
||||
'che_패권', 'che_의협', 'che_대의', 'che_왕좌'
|
||||
];
|
||||
/** @var array 존재하는 모든 성향 */
|
||||
public static $allPersonality = [
|
||||
'che_안전', 'che_유지', 'che_재간', 'che_출세', 'che_할거', 'che_정복',
|
||||
'che_패권', 'che_의협', 'che_대의', 'che_왕좌', 'che_은둔', 'None'
|
||||
];
|
||||
|
||||
/** @var array[string] 선택 가능한 커맨드 */
|
||||
public static $availableGeneralCommand = [
|
||||
|
||||
@@ -547,7 +547,7 @@ class General implements iAction{
|
||||
'leader', 'leader2', 'power', 'power2', 'intel', 'intel2', 'weap', 'book', 'horse', 'item',
|
||||
'experience', 'dedication', 'level', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime',
|
||||
'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'belong',
|
||||
'personal', 'special', 'special2', 'term', 'mode', 'npc', 'npc_org', 'deadyear', 'npcmsg',
|
||||
'personal', 'special', 'special2', 'mode', 'npc', 'npc_org', 'deadyear', 'npcmsg',
|
||||
'dex0', 'dex10', 'dex20', 'dex30', 'dex40',
|
||||
'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew', 'recwar', 'last_turn'
|
||||
];
|
||||
@@ -562,7 +562,7 @@ class General implements iAction{
|
||||
$column = array_unique(array_merge($minimumColumn, $column));
|
||||
}
|
||||
|
||||
$rawGeneral = $db->queryFirstRow('SELECT $lb FROM general WHERE no = %i', $generalID);
|
||||
$rawGeneral = $db->queryFirstRow('SELECT %l FROM general WHERE no = %i', Util::formatListOfBackticks($column), $generalID);
|
||||
if(!$rawGeneral){
|
||||
return new DummyGeneral($constructMode > 0);
|
||||
}
|
||||
|
||||
@@ -203,10 +203,10 @@ class NPC{
|
||||
}
|
||||
|
||||
if($this->ego == null || $isFictionMode){
|
||||
$ego = mt_rand(0, 9);//TODO: 나중에 성격을 따로 분리할 경우 클래스를 참조.
|
||||
$ego = Util::choiceRandom(GameConst::$availablePersonality);
|
||||
}
|
||||
else{
|
||||
$ego = \sammo\CharCall($this->ego);
|
||||
$ego = Util::getClassName(\sammo\getPersonalityClass($this->ego));
|
||||
}
|
||||
|
||||
$affinity = $this->affinity;
|
||||
|
||||
Reference in New Issue
Block a user