diff --git a/twe/sammo/Event/Action/ChangeCity.php b/twe/sammo/Event/Action/ChangeCity.php index bc60afa8..5e0230f6 100644 --- a/twe/sammo/Event/Action/ChangeCity.php +++ b/twe/sammo/Event/Action/ChangeCity.php @@ -18,14 +18,26 @@ class ChangeCity extends sammo\Event\Action{ const REGEXP_MATH = '/^([\+\-\/\*])(\d+(\.\d+)?)$/'; //+30 [1]=기호, [2]=float private $queries; - private $targetType; - private $targetArgs; - public function __construct(array $target = [], array $actions){ + private $targetType = 'all'; + private $targetArgs = []; + public function __construct(array $target = null, array $actions){ //values 포맷은 key, value로 - $this->targetType = $target[0]; - $this->targetArgs = array_slice($target, 1); + if(!$target){ + $this->targetType = 'all'; + } + else if(is_string($target)){ + $this->targetType = $target; + } + else if(is_array($target)){ + $this->targetType = $target[0]; + $this->targetArgs = array_slice($target, 1); + } + else{ + throw new \InvalidArgumentException('올바르지 않은 targetType 입니다.'); + } + $queries = []; foreach($actions as $key => $value){ diff --git a/twe/scenario/scenario_1.json b/twe/scenario/scenario_1.json index 20399849..1cc2770a 100644 --- a/twe/scenario/scenario_1.json +++ b/twe/scenario/scenario_1.json @@ -703,7 +703,25 @@ "●184년 1월:【황건적】전국 각지에서 황건적이 들고 일어서고 있습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_10.json b/twe/scenario/scenario_10.json index 6743dc0b..8dae3ceb 100644 --- a/twe/scenario/scenario_10.json +++ b/twe/scenario/scenario_10.json @@ -720,7 +720,25 @@ "●225년 1월:【이벤트】제갈량은 남만을 정벌하기 위해 출정합니다!" ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_11.json b/twe/scenario/scenario_11.json index 116e47e1..e9ef2384 100644 --- a/twe/scenario/scenario_11.json +++ b/twe/scenario/scenario_11.json @@ -717,7 +717,25 @@ "●228년 1월:【이벤트】조예는 이에 맞서 사마의를 보냅니다!" ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_12.json b/twe/scenario/scenario_12.json index db3729c9..9ebc2213 100644 --- a/twe/scenario/scenario_12.json +++ b/twe/scenario/scenario_12.json @@ -739,7 +739,25 @@ "●191년 1월:【시나리오】병주에는 유비가 합세한 공손찬이 위용을 뽐냅니다!" ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_2.json b/twe/scenario/scenario_2.json index 1ae8e850..8ca11e6f 100644 --- a/twe/scenario/scenario_2.json +++ b/twe/scenario/scenario_2.json @@ -771,7 +771,25 @@ "●190년 1월:【연합】공주가 연합에 참가했습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_3.json b/twe/scenario/scenario_3.json index 684345ed..f6f117b6 100644 --- a/twe/scenario/scenario_3.json +++ b/twe/scenario/scenario_3.json @@ -774,7 +774,25 @@ "●194년 1월:【이벤트】강동에서는 손책이 웅크리고 있습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_4.json b/twe/scenario/scenario_4.json index 1969f30c..5d5864da 100644 --- a/twe/scenario/scenario_4.json +++ b/twe/scenario/scenario_4.json @@ -751,7 +751,25 @@ "●196년 1월:【이벤트】회남원술은 황제가 될 기회를 노리고 있습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_5.json b/twe/scenario/scenario_5.json index b33f412e..8eb67126 100644 --- a/twe/scenario/scenario_5.json +++ b/twe/scenario/scenario_5.json @@ -726,7 +726,25 @@ "●200년 1월:【이벤트】관도에는 전운이 감돌고 있습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_6.json b/twe/scenario/scenario_6.json index 5bf368c0..e709b568 100644 --- a/twe/scenario/scenario_6.json +++ b/twe/scenario/scenario_6.json @@ -732,7 +732,25 @@ "●202년 1월:【이벤트】남쪽으로 피신한 유비는 유표에게 의지해 신야에 머무릅니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_7.json b/twe/scenario/scenario_7.json index 13e046dd..741c5d54 100644 --- a/twe/scenario/scenario_7.json +++ b/twe/scenario/scenario_7.json @@ -739,7 +739,25 @@ "●207년 1월:【이벤트】대군을 몰고 온 조조, 이에 맞서는 손권과 유비. 적벽은 피로 물들려 하고 있습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_8.json b/twe/scenario/scenario_8.json index e1645313..67de8b37 100644 --- a/twe/scenario/scenario_8.json +++ b/twe/scenario/scenario_8.json @@ -725,7 +725,25 @@ "●213년 1월:【이벤트】형주에 일었던 피바람은 익주에서 다시 불어오고 있습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[ diff --git a/twe/scenario/scenario_9.json b/twe/scenario/scenario_9.json index 8bb10c91..feca64ef 100644 --- a/twe/scenario/scenario_9.json +++ b/twe/scenario/scenario_9.json @@ -717,7 +717,25 @@ "●219년 1월:【이벤트】위, 오, 촉의 본격적인 삼국시대가 되었습니다." ], "initialEvents":[ - + [ + true, + ["ChangeCity", "free", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80 + }], + ["ChangeCity", "occupied", { + "pop":"70%", + "agri":"70%", + "comm":"70%", + "secu":"70%", + "rate":80, + "def":"70%", + "wall":"70%" + }] + ] ], "events":[