CityConst에서 참고 가능한 자료들은 CityConst를 이용하도록 수정

Scenario에서 __construct에서 꼭 다 할 필요는 없는 코드들을 뒤로 미룸.
This commit is contained in:
2018-03-31 18:25:56 +09:00
parent 6fe744f2c1
commit d09c71c729
9 changed files with 79 additions and 274 deletions
+6 -5
View File
@@ -35,9 +35,9 @@ function RegGeneral($init,$life,$fiction,$turnterm,$startyear,$year,$gencount,$a
//$name = "ⓝ".$name;
$npc = 2;
if($city == "-") {
$city = rand() % 94 + 1;
$city = rand(1, count(CityConst::all()));
} else {
$city = CityCall($city);
$city = CityConst::byName($city)->id;
}
if($affinity == 0 || $fiction == 1) { $affinity = rand() % 150 + 1; }
if($life == 1) { $bornyear = 160; $deadyear = 300; }
@@ -1069,6 +1069,7 @@ function processAI($connect, $no) {
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
function RegNation($name, $color, $gold, $rice, $scoutmsg, $tech, $gencount, $type, $level) {
//TODO: 삭제
$type = NationCharCall($type);
$totaltech = $tech * $gencount;
@@ -1093,11 +1094,11 @@ function RegNation($name, $color, $gold, $rice, $scoutmsg, $tech, $gencount, $ty
}
function RegCity($nation, $name, $cap=0) {
$city = CityCall($name);
//TODO: 삭제
$city = CityConst::byName($name)->id;
DB::db()->update('city', [
'nation'=>$nation,
'city'=>$city
]);
], 'city=%i',$city);
if($cap > 0){
DB::db()->update('nation', ['capital'=>city], 'nation = %i', $nation);