병종 기본 설정 추가 수정

This commit is contained in:
2018-03-31 04:45:12 +09:00
parent a1d37e5697
commit c976e55d72
3 changed files with 70 additions and 59 deletions
+25 -19
View File
@@ -45,20 +45,20 @@ class GameUnitConst{
}
$list = [
[ 0, '보병', 100, 150, 7, 10, 9, 9, 0, '', true],
[ 0, '보병', 100, 150, 7, 10, 9, 9, 0, 0, true],
[ 1, '청주병', 100, 200, 7, 10, 10, 11, 1, '중원', true],
[ 2, '수병', 150, 150, 7, 10, 11, 10, 1, '오월', true],
[ 3, '자객병', 100, 150, 7, 20, 10, 10, 2, '저', true],
[ 4, '근위병', 150, 200, 7, 10, 12, 12, 2, '낙양', true],
[ 5, '등갑병', 100, 250, 7, 5, 13, 10, 1, '남중', true],
[10, '궁병', 100, 100, 7, 20, 10, 10, 0, '', true],
[10, '궁병', 100, 100, 7, 20, 10, 10, 0, 0, true],
[11, '궁기병', 100, 100, 8, 30, 11, 12, 1, '동이', true],
[12, '연노병', 150, 100, 8, 20, 12, 11, 1, '서촉', true],
[13, '강궁병', 150, 150, 7, 20, 13, 13, 2, '양양', true],
[14, '석궁병', 200, 100, 7, 20, 13, 13, 2, '건업', true],
[20, '기병', 150, 100, 7, 5, 11, 11, 0, '', true],
[20, '기병', 150, 100, 7, 5, 11, 11, 0, 0, true],
[21, '백마병', 200, 100, 7, 5, 12, 13, 1, '하북', true],
[22, '중장기병', 150, 150, 7, 5, 13, 12, 1, '서북', true],
[23, '돌격기병', 200, 100, 8, 5, 13, 11, 2,'흉노', true],
@@ -67,20 +67,20 @@ class GameUnitConst{
[26, '맹수병', 250, 200, 6, 0, 16, 16, 2, '남만', true],
[27, '호표기병', 200, 150, 7, 5, 14, 14, 2, '허창', true],
[30, '귀병', 80, 80, 7, 5, 9, 9, 0, '', true],
[30, '귀병', 80, 80, 7, 5, 9, 9, 0, 0, true],
[31, '신귀병', 80, 80, 7, 20, 10, 10, 1,'초', true],
[32, '백귀병', 80, 130, 7, 5, 9, 11, 2, '오환', true],
[33, '흑귀병', 130, 80, 7, 5, 11, 9, 2, '왜', true],
[34, '악귀병', 130, 130, 7, 0, 12, 12, 2, '장안', true],
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, '', false],
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 0, false],
[36, '황귀병', 110, 110, 7, 0, 13, 10, 2, '낙양', true],
[37, '천귀병', 80, 130, 7, 15, 11, 12, 2, '성도', true],
[38, '마귀병', 130, 80, 7, 15, 12, 11, 2, '업', true],
[40, '정란', 100, 100, 6, 0, 15, 5, 0, '', true],
[41, '충차', 150, 100, 6, 0, 20, 5, 0, '', false],
[42, '벽력거', 200, 100, 6, 0, 25, 5, 2, '업', true],
[43, '목우', 50, 200, 5, 0, 30, 5, 2, '성도', true]
[40, '정란', 100, 100, 6, 0, 15, 5, 0, 0, false],
[41, '충차', 150, 100, 6, 0, 20, 5, 0, 1000, false],
[42, '벽력거', 200, 100, 6, 0, 25, 5, 2, '업', false],
[43, '목우', 50, 200, 5, 0, 30, 5, 2, '성도', false]
];
$constID = [];
@@ -99,13 +99,19 @@ class GameUnitConst{
$cost,
$rice,
$recruitType,
$recruitPlace,
$recruitCondition,
$recruitFirst
) = $rawUnit;
$recruitPlace = CityConst::$regionMap[$recruitPlace];
//0인 경우는 기술치이다.
if($recruitType == 1){
$recruitCondition = CityConst::byName($recruitCondition)->id;
}
else if($recruitType == 2){
$recruitCondition = CityConst::$regionMap[$recruitCondition]->id;
}
$unit = new GameUniDetail(
$unit = new GameUnitDetail(
$id,
$name,
$attack,
@@ -115,23 +121,23 @@ class GameUnitConst{
$cost,
$rice,
$recruitType,
$recruitPlace,
$recruitCondition,
$recruitFirst
);
$constID[$id] = $unit;
$constName[$name] = $unit;
if($recruitType == 1){
if(!key_exists($recruitPlace, $constRegion)){
$constRegion[$recruitPlace] = [];
if(!key_exists($recruitCondition, $constRegion)){
$constRegion[$recruitCondition] = [];
}
$constRegion[$recruitPlace][] = $unit;
$constRegion[$recruitCondition][] = $unit;
}
if($recruitType == 2){
if(!key_exists($recruitPlace, $constCity)){
$constCity[$recruitPlace] = [];
if(!key_exists($recruitCondition, $constCity)){
$constCity[$recruitCondition] = [];
}
$constCity[$recruitPlace][] = $unit;
$constCity[$recruitCondition][] = $unit;
}
}
+45 -3
View File
@@ -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;
}
}
-37
View File
@@ -402,43 +402,6 @@ create table game (
bet8 int(8) default 0, bet9 int(8) default 0, bet10 int(8) default 0, bet11 int(8) default 0,
bet12 int(8) default 0, bet13 int(8) default 0, bet14 int(8) default 0, bet15 int(8) default 0,
att0 int(3) default 0, def0 int(3) default 0, spd0 int(3) default 0, avd0 int(3) default 0, ric0 int(3) default 0, cst0 int(3) default 0,
att1 int(3) default 0, def1 int(3) default 0, spd1 int(3) default 0, avd1 int(3) default 0, ric1 int(3) default 0, cst1 int(3) default 0,
att2 int(3) default 0, def2 int(3) default 0, spd2 int(3) default 0, avd2 int(3) default 0, ric2 int(3) default 0, cst2 int(3) default 0,
att3 int(3) default 0, def3 int(3) default 0, spd3 int(3) default 0, avd3 int(3) default 0, ric3 int(3) default 0, cst3 int(3) default 0,
att4 int(3) default 0, def4 int(3) default 0, spd4 int(3) default 0, avd4 int(3) default 0, ric4 int(3) default 0, cst4 int(3) default 0,
att5 int(3) default 0, def5 int(3) default 0, spd5 int(3) default 0, avd5 int(3) default 0, ric5 int(3) default 0, cst5 int(3) default 0,
att10 int(3) default 0, def10 int(3) default 0, spd10 int(3) default 0, avd10 int(3) default 0, ric10 int(3) default 0, cst10 int(3) default 0,
att11 int(3) default 0, def11 int(3) default 0, spd11 int(3) default 0, avd11 int(3) default 0, ric11 int(3) default 0, cst11 int(3) default 0,
att12 int(3) default 0, def12 int(3) default 0, spd12 int(3) default 0, avd12 int(3) default 0, ric12 int(3) default 0, cst12 int(3) default 0,
att13 int(3) default 0, def13 int(3) default 0, spd13 int(3) default 0, avd13 int(3) default 0, ric13 int(3) default 0, cst13 int(3) default 0,
att14 int(3) default 0, def14 int(3) default 0, spd14 int(3) default 0, avd14 int(3) default 0, ric14 int(3) default 0, cst14 int(3) default 0,
att20 int(3) default 0, def20 int(3) default 0, spd20 int(3) default 0, avd20 int(3) default 0, ric20 int(3) default 0, cst20 int(3) default 0,
att21 int(3) default 0, def21 int(3) default 0, spd21 int(3) default 0, avd21 int(3) default 0, ric21 int(3) default 0, cst21 int(3) default 0,
att22 int(3) default 0, def22 int(3) default 0, spd22 int(3) default 0, avd22 int(3) default 0, ric22 int(3) default 0, cst22 int(3) default 0,
att23 int(3) default 0, def23 int(3) default 0, spd23 int(3) default 0, avd23 int(3) default 0, ric23 int(3) default 0, cst23 int(3) default 0,
att24 int(3) default 0, def24 int(3) default 0, spd24 int(3) default 0, avd24 int(3) default 0, ric24 int(3) default 0, cst24 int(3) default 0,
att25 int(3) default 0, def25 int(3) default 0, spd25 int(3) default 0, avd25 int(3) default 0, ric25 int(3) default 0, cst25 int(3) default 0,
att26 int(3) default 0, def26 int(3) default 0, spd26 int(3) default 0, avd26 int(3) default 0, ric26 int(3) default 0, cst26 int(3) default 0,
att27 int(3) default 0, def27 int(3) default 0, spd27 int(3) default 0, avd27 int(3) default 0, ric27 int(3) default 0, cst27 int(3) default 0,
att30 int(3) default 0, def30 int(3) default 0, spd30 int(3) default 0, avd30 int(3) default 0, ric30 int(3) default 0, cst30 int(3) default 0,
att31 int(3) default 0, def31 int(3) default 0, spd31 int(3) default 0, avd31 int(3) default 0, ric31 int(3) default 0, cst31 int(3) default 0,
att32 int(3) default 0, def32 int(3) default 0, spd32 int(3) default 0, avd32 int(3) default 0, ric32 int(3) default 0, cst32 int(3) default 0,
att33 int(3) default 0, def33 int(3) default 0, spd33 int(3) default 0, avd33 int(3) default 0, ric33 int(3) default 0, cst33 int(3) default 0,
att34 int(3) default 0, def34 int(3) default 0, spd34 int(3) default 0, avd34 int(3) default 0, ric34 int(3) default 0, cst34 int(3) default 0,
att35 int(3) default 0, def35 int(3) default 0, spd35 int(3) default 0, avd35 int(3) default 0, ric35 int(3) default 0, cst35 int(3) default 0,
att36 int(3) default 0, def36 int(3) default 0, spd36 int(3) default 0, avd36 int(3) default 0, ric36 int(3) default 0, cst36 int(3) default 0,
att37 int(3) default 0, def37 int(3) default 0, spd37 int(3) default 0, avd37 int(3) default 0, ric37 int(3) default 0, cst37 int(3) default 0,
att38 int(3) default 0, def38 int(3) default 0, spd38 int(3) default 0, avd38 int(3) default 0, ric38 int(3) default 0, cst38 int(3) default 0,
att40 int(3) default 0, def40 int(3) default 0, spd40 int(3) default 0, avd40 int(3) default 0, ric40 int(3) default 0, cst40 int(3) default 0,
att41 int(3) default 0, def41 int(3) default 0, spd41 int(3) default 0, avd41 int(3) default 0, ric41 int(3) default 0, cst41 int(3) default 0,
att42 int(3) default 0, def42 int(3) default 0, spd42 int(3) default 0, avd42 int(3) default 0, ric42 int(3) default 0, cst42 int(3) default 0,
att43 int(3) default 0, def43 int(3) default 0, spd43 int(3) default 0, avd43 int(3) default 0, ric43 int(3) default 0, cst43 int(3) default 0,
PRIMARY KEY (no)
) ENGINE=INNODB ROW_FORMAT=DYNAMIC DEFAULT CHARSET=UTF8;