병종 기본 설정 추가 수정
This commit is contained in:
@@ -11,7 +11,7 @@ class GameUnitDetail{
|
||||
public $cost;
|
||||
public $rice;
|
||||
public $recruitType;
|
||||
public $recruitPlace;
|
||||
public $recruitCondition;
|
||||
public $recruitFirst;
|
||||
|
||||
public function __construct(
|
||||
@@ -24,7 +24,7 @@ class GameUnitDetail{
|
||||
int $cost,
|
||||
int $rice,
|
||||
int $recruitType,
|
||||
int $recruitPlace,
|
||||
int $recruitCondition,
|
||||
bool $recruitFirst
|
||||
){
|
||||
$this->name = $name;
|
||||
@@ -35,7 +35,49 @@ class GameUnitDetail{
|
||||
$this->cost = $cost;
|
||||
$this->rice = $rice;
|
||||
$this->recruitType = $recruitType;
|
||||
$this->recruitPlace = $recruitPlace;
|
||||
$this->recruitCondition = $recruitCondition;
|
||||
$this->recruitFirst = $recruitFirst;
|
||||
}
|
||||
|
||||
public function isValid($ownCities, $ownRegions, $relativeYear, $tech){
|
||||
if($relativeYear < 3 && !$this->recruitFirst){
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->recruitType == 0){
|
||||
if($tech < $this->recruitCondition){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if($this->recruitType == 1){
|
||||
if(!key_exists($this->recruitCondition, $ownRegions)){
|
||||
return false;
|
||||
}
|
||||
if ($tech < 1000) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if($this->recruitType == 2){
|
||||
$cityLevel = CityConst::byID($id)->level;
|
||||
$cityLevel = CityConst::$regionMap[$cityLevel];
|
||||
|
||||
if(!key_exists($this->recruitCondition, $ownCities)){
|
||||
return false;
|
||||
}
|
||||
if($cityLevel == '특'){
|
||||
if ($tech < 3000) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{ //if($cityLevel == '이')
|
||||
if ($tech < 2000) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user