Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e551c360ef | ||
|
|
ce6bbf7cb5 | ||
|
|
e7a18f3a25 | ||
|
|
449e8afb4c | ||
|
|
b72985cb6b |
Regular → Executable
+154
-129
@@ -1,12 +1,129 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
|
function getGame($connect) {
|
||||||
|
$query = "select * from game where no='1'";
|
||||||
|
return MYDB_fetch_array(MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""));
|
||||||
|
}
|
||||||
|
function getOriginCity($connect, $general) {
|
||||||
|
$query = "select city, level from city where city='$general[city]'";
|
||||||
|
return MYDB_fetch_array(MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNation($connect, $general) {
|
||||||
|
$query = "select nation,level,name,history,capital,tech,type from nation where nation='$general[nation]'";
|
||||||
|
return MYDB_fetch_array(MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDestination($connect, $city) {
|
||||||
|
$query = "select nation,level,name,history,rice,capital,tech,type from nation where nation='$city[nation]'";
|
||||||
|
return MYDB_fetch_array(MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGeneralCount($connect, $nation) {
|
||||||
|
$query = "select no from general where nation='$nation'";
|
||||||
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
$generalCount = MYDB_num_rows($result);
|
||||||
|
if($generalCount < 10) {
|
||||||
|
$generalCount = 10;
|
||||||
|
}
|
||||||
|
return $generalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOpposeCount($connect, $city) {
|
||||||
|
// 목표 도시내에 목표 국가 소속 장수 중, 병사가 있는 능력치합+병사수 순으로 훈,사 60, 80 이상
|
||||||
|
$query = "select no,name,turntime,personal,special2,crew,crewtype,atmos,train,intel,intel2,book,power,power2,weap,injury,leader,leader2,horse,item,explevel,level,rice,leader+power+intel+weap+horse+book+crew/100 as sum,dex0,dex10,dex20,dex30,dex40 from general where city='$city[city]' and nation='$city[nation]' and nation!=0 and crew>'0' and rice>round(crew/100) and ((train>=60 and atmos>=60 and mode=1) or (train>=80 and atmos>=80 and mode=2)) order by sum desc";
|
||||||
|
return MYDB_num_rows(MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBonusAtmosBasedOnItem($connect, $general) {
|
||||||
|
$bonusAtmos = 0;
|
||||||
|
if($general[item] == 3) {
|
||||||
|
//탁주 사용
|
||||||
|
$bonusAtmos += 3;
|
||||||
|
$query = "update general set item=0 where no='$general[no]'";
|
||||||
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!";
|
||||||
|
$general[item] = 0;
|
||||||
|
} elseif($general[item] >= 14 && $general[item] <= 16) {
|
||||||
|
//의적주, 두강주, 보령압주 사용
|
||||||
|
$bonusAtmos += 5;
|
||||||
|
} elseif($general[item] >= 19 && $general[item] <= 20) {
|
||||||
|
//춘화첩, 초선화 사용
|
||||||
|
$bonusAtmos += 7;
|
||||||
|
}
|
||||||
|
return $bonusAtmos;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBonusTrainBasedOnItem($connect, $general) {
|
||||||
|
$bonusTrain = 0;
|
||||||
|
if($general[item] == 4) {
|
||||||
|
//청주 사용
|
||||||
|
$bonusTrain += 3;
|
||||||
|
$query = "update general set item=0 where no='$general[no]'";
|
||||||
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!";
|
||||||
|
$general[item] = 0;
|
||||||
|
} elseif($general[item] >= 12 && $general[item] <= 13) {
|
||||||
|
//과실주, 이강주 사용
|
||||||
|
$bonusTrain += 5;
|
||||||
|
} elseif($general[item] >= 17 && $general[item] <= 18) {
|
||||||
|
//철벽서, 단결도 사용
|
||||||
|
$bonusTrain += 7;
|
||||||
|
}
|
||||||
|
return $bonusTrain;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBonusAtmosBasedOnCity($connect, $city, $nation) {
|
||||||
|
$bonusAtmos = 0;
|
||||||
|
// 수도 보정
|
||||||
|
if($nation[capital] == $city[city]) {
|
||||||
|
$bonusAtmos += 5;
|
||||||
|
}
|
||||||
|
// 출병도시가 진이면 공격자 공격보정
|
||||||
|
if($city[level] == 2) {
|
||||||
|
$bonusAtmos += 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
return bonusAtmos;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBonusTrainBasedOnCity($connect, $city) {
|
||||||
|
$bonusTrain = 0;
|
||||||
|
// 방어도시가 수진이면 방어자 방어보정
|
||||||
|
if($city[level] == 1) {
|
||||||
|
$bonusTrain += 5;
|
||||||
|
}
|
||||||
|
// 방어도시가 관이면 방어자 방어보정
|
||||||
|
if($city[level] == 3) {
|
||||||
|
$bonusTrain += 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
return bonusTrain;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateTechBasedOnDeath($deathCount, $nation, $game, $genCount, $connect) {
|
||||||
|
// 죽은수 기술로 누적
|
||||||
|
$num = round($deathCount * 0.01);
|
||||||
|
|
||||||
|
// 국가보정
|
||||||
|
if($nation[type] == 3 || $nation[type] == 13) {
|
||||||
|
$num *= 1.1;
|
||||||
|
}
|
||||||
|
if($nation[type] == 5 || $nation[type] == 6 || $nation[type] == 7 || $nation[type] == 8 || $nation[type] == 12) {
|
||||||
|
$num *= 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 부드러운 기술 제한
|
||||||
|
if(TechLimit($game[startyear], $game[year], $nation[tech])) { $num = floor($num/4); }
|
||||||
|
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$genCount' where nation='$nation[nation]'";
|
||||||
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
}
|
||||||
|
|
||||||
function processWar($connect, $general, $city) {
|
function processWar($connect, $general, $city) {
|
||||||
global $_armperphase, $_maximumatmos, $_maximumtrain, $_dexLimit, $_basegold, $_baserice;
|
global $_armperphase, $_maximumatmos, $_maximumtrain, $_dexLimit, $_basegold, $_baserice;
|
||||||
$date = substr($general[turntime],11,5);
|
|
||||||
|
|
||||||
$query = "select * from game where no='1'";
|
$date = substr($general[turntime],11,5);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$game = getGame($connect);
|
||||||
$game = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$deadAmount[att] = 0;
|
$deadAmount[att] = 0;
|
||||||
$deadAmount[def] = 0;
|
$deadAmount[def] = 0;
|
||||||
@@ -16,83 +133,26 @@ function processWar($connect, $general, $city) {
|
|||||||
// 특기보정 : 돌격
|
// 특기보정 : 돌격
|
||||||
if($general[special2] == 60) { $warphase += 1; }
|
if($general[special2] == 60) { $warphase += 1; }
|
||||||
|
|
||||||
$genAtmos = 0;
|
$genAtmos = getBonusAtmosBasedOnItem($connect, $general);
|
||||||
if($general[item] == 3) {
|
$genAtmos += getBonusAtmosBasedOnCity($connect, $originCity, $nation);
|
||||||
//탁주 사용
|
|
||||||
$genAtmos += 3;
|
$genTrain = getBonusTrainBasedOnItem($connect, $general);
|
||||||
$query = "update general set item=0 where no='$general[no]'";
|
$oppTrain = getBonusTrainBasedOnCity($connect, $city);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!";
|
|
||||||
$general[item] = 0;
|
|
||||||
} elseif($general[item] >= 14 && $general[item] <= 16) {
|
|
||||||
//의적주, 두강주, 보령압주 사용
|
|
||||||
$genAtmos += 5;
|
|
||||||
} elseif($general[item] >= 19 && $general[item] <= 20) {
|
|
||||||
//춘화첩, 초선화 사용
|
|
||||||
$genAtmos += 7;
|
|
||||||
}
|
|
||||||
$genTrain = 0;
|
|
||||||
if($general[item] == 4) {
|
|
||||||
//청주 사용
|
|
||||||
$genTrain += 3;
|
|
||||||
$query = "update general set item=0 where no='$general[no]'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!";
|
|
||||||
$general[item] = 0;
|
|
||||||
} elseif($general[item] >= 12 && $general[item] <= 13) {
|
|
||||||
//과실주, 이강주 사용
|
|
||||||
$genTrain += 5;
|
|
||||||
} elseif($general[item] >= 17 && $general[item] <= 18) {
|
|
||||||
//철벽서, 단결도 사용
|
|
||||||
$genTrain += 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 우선 스케일링
|
// 우선 스케일링
|
||||||
$city[def] *= 10;
|
$city[def] *= 10;
|
||||||
$city[wall] *= 10;
|
$city[wall] *= 10;
|
||||||
|
|
||||||
$query = "select level from city where city='$general[city]'";
|
$originCity = getOriginCity($connect, $general);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$nation = getNation($connect, $general);
|
||||||
$originCity = MYDB_fetch_array($result);
|
$destnation = getDestination($connect, $city);
|
||||||
|
|
||||||
$query = "select nation,level,name,history,capital,tech,type from nation where nation='$general[nation]'";
|
$gencount = getGeneralCount($connect, $nation[nation]);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$destgencount = getGeneralCount($connect, $destnation[nation]);
|
||||||
$nation = MYDB_fetch_array($result);
|
$opposecount = getOpposeCount($connect, $city);
|
||||||
|
|
||||||
$query = "select nation,level,name,history,rice,capital,tech,type from nation where nation='$city[nation]'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$destnation = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
//장수수 구함
|
|
||||||
$query = "select no from general where nation='$general[nation]'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gencount = MYDB_num_rows($result);
|
|
||||||
if($gencount < 10) $gencount = 10;
|
|
||||||
//장수수 구함
|
|
||||||
$query = "select no from general where nation='$destnation[nation]'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$destgencount = MYDB_num_rows($result);
|
|
||||||
if($destgencount < 10) $destgencount = 10;
|
|
||||||
|
|
||||||
$genAtmosBonus = 0; $genTrainBonus = 0;
|
|
||||||
$oppAtmosBonus = 0; $oppTrainBonus = 0;
|
|
||||||
//공격자 수도보정
|
|
||||||
if($nation[capital] == $general[city]) { $genAtmosBonus += 5; }
|
|
||||||
//방어자 수도보정
|
|
||||||
//if($destnation[capital] == $city[city]) { $oppTrainBonus += 5; }
|
|
||||||
//관,진,수진 보정
|
|
||||||
if($city[level] == 1) { $oppTrainBonus += 5; } // 방어도시가 수진이면 방어자 방어보정
|
|
||||||
if($originCity[level] == 2) { $genAtmosBonus += 5; } // 출병도시가 진이면 공격자 공격보정
|
|
||||||
if($city[level] == 3) { $oppTrainBonus += 5; } // 방어도시가 관이면 방어자 방어보정
|
|
||||||
|
|
||||||
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<D><b>$nation[name]</b></>의 <Y>$general[name]</>(이)가 <G><b>$city[name]</b></>(으)로 진격합니다.";
|
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<D><b>$nation[name]</b></>의 <Y>$general[name]</>(이)가 <G><b>$city[name]</b></>(으)로 진격합니다.";
|
||||||
$log[count($log)] = "<C>●</>{$game[month]}월:<G><b>$city[name]</b></>(으)로 <M>진격</>합니다. <1>$date</>";
|
$log[count($log)] = "<C>●</>{$game[month]}월:<G><b>$city[name]</b></>(으)로 <M>진격</>합니다. <1>$date</>";
|
||||||
// $history[count($history)] = "<C>●</>{$game[year]}년 {$game[month]}월:<O><b>【전투】</b></><D><b>$nation[name]</b></>(이)가 <D><b>$destnation[name]</b></>의 <G><b>$city[name]</b></>(으)로 <M>진격</>합니다.";
|
|
||||||
|
|
||||||
// 목표 도시내에 목표 국가 소속 장수 중, 병사가 있는 능력치합+병사수 순으로 훈,사 60, 80 이상
|
|
||||||
$query = "select no,name,turntime,personal,special2,crew,crewtype,atmos,train,intel,intel2,book,power,power2,weap,injury,leader,leader2,horse,item,explevel,level,rice,leader+power+intel+weap+horse+book+crew/100 as sum,dex0,dex10,dex20,dex30,dex40 from general where city='$city[city]' and nation='$city[nation]' and nation!=0 and crew>'0' and rice>round(crew/100) and ((train>=60 and atmos>=60 and mode=1) or (train>=80 and atmos>=80 and mode=2)) order by sum desc";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$opposecount = MYDB_num_rows($result);
|
|
||||||
|
|
||||||
$exp = 0; //병사 소진 시킨 만큼
|
$exp = 0; //병사 소진 시킨 만큼
|
||||||
$opexp = 0;
|
$opexp = 0;
|
||||||
@@ -160,8 +220,8 @@ function processWar($connect, $general, $city) {
|
|||||||
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
|
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
|
||||||
|
|
||||||
//훈련 사기따라
|
//훈련 사기따라
|
||||||
$myCrew = getCrew($myCrew, $game[city_rate]+$oppAtmosBonus, CharTrain($general[train]+$genTrain+$genTrainBonus, $general[personal]));
|
$myCrew = getCrew($myCrew, $game[city_rate], CharTrain($general[train]+$genTrain, $general[personal]));
|
||||||
$cityCrew = getCrew($cityCrew, CharAtmos($general[atmos]+$genAtmos+$genAtmosBonus, $general[personal]), $game[city_rate]+$oppTrainBonus);
|
$cityCrew = getCrew($cityCrew, CharAtmos($general[atmos]+$genAtmos, $general[personal]), $game[city_rate]+$oppTrain);
|
||||||
//숙련도 따라
|
//숙련도 따라
|
||||||
$genDexAtt = getGenDex($general, $general[crewtype]);
|
$genDexAtt = getGenDex($general, $general[crewtype]);
|
||||||
$genDexDef = getGenDex($general, 40);
|
$genDexDef = getGenDex($general, 40);
|
||||||
@@ -407,36 +467,19 @@ function processWar($connect, $general, $city) {
|
|||||||
// 숙련도 증가
|
// 숙련도 증가
|
||||||
addGenDex($connect, $general[no], $general[atmos], $general[train], $general[crewtype], $mykillnum);
|
addGenDex($connect, $general[no], $general[atmos], $general[train], $general[crewtype], $mykillnum);
|
||||||
addGenDex($connect, $general[no], $general[atmos], $general[train], 40, $mydeathnum);
|
addGenDex($connect, $general[no], $general[atmos], $general[train], 40, $mydeathnum);
|
||||||
// 죽은수 기술로 누적
|
|
||||||
$num = round($mydeathnum * 0.01);
|
updateTechBasedOnDeath($mydeathnum, $nation, $game, $genCount, $connect);
|
||||||
// 국가보정
|
updateTechBasedOnDeath($mykillnum, $destnation, $game, $destGenCount, $connect);
|
||||||
if($nation[type] == 3 || $nation[type] == 13) { $num *= 1.1; }
|
|
||||||
if($nation[type] == 5 || $nation[type] == 6 || $nation[type] == 7 || $nation[type] == 8 || $nation[type] == 12) { $num *= 0.9; }
|
|
||||||
// 부드러운 기술 제한
|
|
||||||
if(TechLimit($game[startyear], $game[year], $nation[tech])) { $num = floor($num/4); }
|
|
||||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='$nation[nation]'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 죽은수 기술로 누적
|
|
||||||
$num = round($mykillnum * 0.01);
|
|
||||||
// 국가보정
|
|
||||||
if($destnation[type] == 3 || $destnation[type] == 13) { $num *= 1.1; }
|
|
||||||
if($destnation[type] == 5 || $destnation[type] == 6 || $destnation[type] == 7 || $destnation[type] == 8 || $destnation[type] == 12) { $num *= 0.9; }
|
|
||||||
// 부드러운 기술 제한
|
|
||||||
if(TechLimit($game[startyear], $game[year], $destnation[tech])) { $num = floor($num/4); }
|
|
||||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='$destnation[nation]'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
//양국 평균 기술가격
|
|
||||||
//$techRatio = (getTechCost($nation[tech]) + getTechCost($destnation[tech])) / 2;
|
|
||||||
$techRatio = 1.0;
|
|
||||||
// 죽은수 도시 재정으로 누적 60%
|
// 죽은수 도시 재정으로 누적 60%
|
||||||
$num = round(($mykillnum+$mydeathnum) * 0.6 * $techRatio);
|
$num = round(($mykillnum+$mydeathnum) * 0.6);
|
||||||
// 국가보정
|
// 국가보정
|
||||||
if($destnation[type] == 1) { $num *= 1.1; }
|
if($destnation[type] == 1) { $num *= 1.1; }
|
||||||
if($destnation[type] == 9 || $destnation[type] == 10) { $num *= 0.9; }
|
if($destnation[type] == 9 || $destnation[type] == 10) { $num *= 0.9; }
|
||||||
$query = "update city set dead=dead+'$num',def='$city[def]',wall='$city[wall]',agri='$city[agri]',comm='$city[comm]',secu='$city[secu]' where city='$city[city]'";
|
$query = "update city set dead=dead+'$num',def='$city[def]',wall='$city[wall]',agri='$city[agri]',comm='$city[comm]',secu='$city[secu]' where city='$city[city]'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 죽은수 도시 재정으로 누적 40%
|
// 죽은수 도시 재정으로 누적 40%
|
||||||
$num = round(($mykillnum+$mydeathnum) * 0.4 * $techRatio);
|
$num = round(($mykillnum+$mydeathnum) * 0.4);
|
||||||
// 국가보정
|
// 국가보정
|
||||||
if($nation[type] == 1) { $num *= 1.1; }
|
if($nation[type] == 1) { $num *= 1.1; }
|
||||||
if($nation[type] == 9 || $nation[type] == 10) { $num *= 0.9; }
|
if($nation[type] == 9 || $nation[type] == 10) { $num *= 0.9; }
|
||||||
@@ -502,6 +545,7 @@ function processWar($connect, $general, $city) {
|
|||||||
//춘화첩, 초선화 사용
|
//춘화첩, 초선화 사용
|
||||||
$oppAtmos += 7;
|
$oppAtmos += 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oppTrain = 0;
|
$oppTrain = 0;
|
||||||
if($oppose[item] == 4) {
|
if($oppose[item] == 4) {
|
||||||
//청주 사용
|
//청주 사용
|
||||||
@@ -537,9 +581,8 @@ function processWar($connect, $general, $city) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!";
|
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!";
|
||||||
$general[item] = 0;
|
$general[item] = 0;
|
||||||
} elseif($general[weap] == 10 || $general[weap] == 14 || $general[weap] == 18 || $general[weap] == 22) {
|
|
||||||
// $log[count($log)] = "<C>●</><C>".getWeapName($general[weap])."</>(을)를 사용!";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$log[count($log)] = "<C>●</>상대를 <C>저격</>했다!";
|
$log[count($log)] = "<C>●</>상대를 <C>저격</>했다!";
|
||||||
$batlog[count($batlog)] = "<C>●</>상대를 <C>저격</>했다!";
|
$batlog[count($batlog)] = "<C>●</>상대를 <C>저격</>했다!";
|
||||||
$opplog[count($opplog)] = "<C>●</>상대에게 <R>저격</>당했다!";
|
$opplog[count($opplog)] = "<C>●</>상대에게 <R>저격</>당했다!";
|
||||||
@@ -609,8 +652,8 @@ function processWar($connect, $general, $city) {
|
|||||||
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
|
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
|
||||||
if($opCrew <= 0) { $opCrew = rand() % 90 + 10; }
|
if($opCrew <= 0) { $opCrew = rand() % 90 + 10; }
|
||||||
//훈련 사기따라
|
//훈련 사기따라
|
||||||
$myCrew = getCrew($myCrew, CharAtmos($oppose[atmos]+$oppAtmos+$oppAtmosBonus, $oppose[personal]), CharTrain($general[train]+$genTrain+$genTrainBonus, $general[personal]));
|
$myCrew = getCrew($myCrew, CharAtmos($oppose[atmos]+$oppAtmos, $oppose[personal]), CharTrain($general[train]+$genTrain, $general[personal]));
|
||||||
$opCrew = getCrew($opCrew, CharAtmos($general[atmos]+$genAtmos+$genAtmosBonus, $general[personal]), CharTrain($oppose[train]+$oppTrain+$oppTrainBonus, $oppose[personal]));
|
$opCrew = getCrew($opCrew, CharAtmos($general[atmos]+$genAtmos, $general[personal]), CharTrain($oppose[train]+$oppTrain, $oppose[personal]));
|
||||||
//숙련도 따라
|
//숙련도 따라
|
||||||
$genDexAtt = getGenDex($general, $general[crewtype]);
|
$genDexAtt = getGenDex($general, $general[crewtype]);
|
||||||
$genDexDef = getGenDex($general, $oppose[crewtype]);
|
$genDexDef = getGenDex($general, $oppose[crewtype]);
|
||||||
@@ -906,8 +949,8 @@ function processWar($connect, $general, $city) {
|
|||||||
// 특기보정: 돌격
|
// 특기보정: 돌격
|
||||||
if($oppose[crewtype] == 43 && $general[special2] != 60) { // 목우
|
if($oppose[crewtype] == 43 && $general[special2] != 60) { // 목우
|
||||||
$r = 0;
|
$r = 0;
|
||||||
$r += $oppose[atmos] + $oppAtmos + $oppAtmosBonus;
|
$r += $oppose[atmos] + $oppAtmos;
|
||||||
$r += $oppose[train] + $oppTrain + $oppTrainBonus;
|
$r += $oppose[train] + $oppTrain;
|
||||||
$ratio = rand() % 400; // 최대 50% 저지
|
$ratio = rand() % 400; // 최대 50% 저지
|
||||||
if($ratio < $r && $opAvoid == 1) {
|
if($ratio < $r && $opAvoid == 1) {
|
||||||
$batlog[count($batlog)] = "<C>●</><R>저지</>당했다!</>";
|
$batlog[count($batlog)] = "<C>●</><R>저지</>당했다!</>";
|
||||||
@@ -1248,15 +1291,8 @@ function processWar($connect, $general, $city) {
|
|||||||
// 숙련도 증가
|
// 숙련도 증가
|
||||||
addGenDex($connect, $oppose[no], $oppose[atmos], $oppose[train], $oppose[crewtype], $opkillnum * 0.9);
|
addGenDex($connect, $oppose[no], $oppose[atmos], $oppose[train], $oppose[crewtype], $opkillnum * 0.9);
|
||||||
addGenDex($connect, $oppose[no], $oppose[atmos], $oppose[train], $general[crewtype], $opdeathnum * 0.9);
|
addGenDex($connect, $oppose[no], $oppose[atmos], $oppose[train], $general[crewtype], $opdeathnum * 0.9);
|
||||||
// 죽은수 기술로 누적
|
|
||||||
$num = round($mydeathnum * 0.01);
|
updateTechBasedOnDeath($mydeathnum, $nation, $game, $genCount, $connect);
|
||||||
// 국가보정
|
|
||||||
if($nation[type] == 3 || $nation[type] == 13) { $num *= 1.1; }
|
|
||||||
if($nation[type] == 5 || $nation[type] == 6 || $nation[type] == 7 || $nation[type] == 8 || $nation[type] == 12) { $num *= 0.9; }
|
|
||||||
// 부드러운 기술 제한
|
|
||||||
if(TechLimit($game[startyear], $game[year], $nation[tech])) { $num = floor($num/4); }
|
|
||||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='$nation[nation]'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
// 장수 부상
|
// 장수 부상
|
||||||
$ratio = rand() % 100;
|
$ratio = rand() % 100;
|
||||||
@@ -1271,27 +1307,18 @@ function processWar($connect, $general, $city) {
|
|||||||
// 숙련도 증가
|
// 숙련도 증가
|
||||||
addGenDex($connect, $general[no], $general[atmos], $general[train], $general[crewtype], $mykillnum);
|
addGenDex($connect, $general[no], $general[atmos], $general[train], $general[crewtype], $mykillnum);
|
||||||
addGenDex($connect, $general[no], $general[atmos], $general[train], $oppose[crewtype], $mydeathnum);
|
addGenDex($connect, $general[no], $general[atmos], $general[train], $oppose[crewtype], $mydeathnum);
|
||||||
// 죽은수 기술로 누적
|
|
||||||
$num = round($opdeathnum * 0.01);
|
updateTechBasedOnDeath($opdeathnum, $destnation, $game, $destGenCount, $connect);
|
||||||
// 국가보정
|
|
||||||
if($destnation[type] == 3 || $destnation[type] == 13) { $num *= 1.1; }
|
|
||||||
if($destnation[type] == 5 || $destnation[type] == 6 || $destnation[type] == 7 || $destnation[type] == 8 || $destnation[type] == 12) { $num *= 0.9; }
|
|
||||||
// 부드러운 기술 제한
|
|
||||||
if(TechLimit($game[startyear], $game[year], $destnation[tech])) { $num = floor($num/4); }
|
|
||||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='$destnation[nation]'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
//양국 평균 기술가격
|
|
||||||
//$techRatio = (getTechCost($nation[tech]) + getTechCost($destnation[tech])) / 2;
|
|
||||||
$techRatio = 1.0;
|
|
||||||
// 죽은수 도시 재정으로 누적 60%
|
// 죽은수 도시 재정으로 누적 60%
|
||||||
$num = round(($mykillnum+$mydeathnum) * 0.6 * $techRatio);
|
$num = round(($mykillnum+$mydeathnum) * 0.6);
|
||||||
// 국가보정
|
// 국가보정
|
||||||
if($destnation[type] == 1) { $num *= 1.1; }
|
if($destnation[type] == 1) { $num *= 1.1; }
|
||||||
if($destnation[type] == 9 || $destnation[type] == 10) { $num *= 0.9; }
|
if($destnation[type] == 9 || $destnation[type] == 10) { $num *= 0.9; }
|
||||||
$query = "update city set dead=dead+'$num' where city='$city[city]'";
|
$query = "update city set dead=dead+'$num' where city='$city[city]'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 죽은수 도시 재정으로 누적 40%
|
// 죽은수 도시 재정으로 누적 40%
|
||||||
$num = round(($mykillnum+$mydeathnum) * 0.4 * $techRatio);
|
$num = round(($mykillnum+$mydeathnum) * 0.4);
|
||||||
// 국가보정
|
// 국가보정
|
||||||
if($nation[type] == 1) { $num *= 1.1; }
|
if($nation[type] == 1) { $num *= 1.1; }
|
||||||
if($nation[type] == 9 || $nation[type] == 10) { $num *= 0.9; }
|
if($nation[type] == 9 || $nation[type] == 10) { $num *= 0.9; }
|
||||||
@@ -1381,8 +1408,6 @@ function processWar($connect, $general, $city) {
|
|||||||
unset($opplog);
|
unset($opplog);
|
||||||
unset($oppbatlog);
|
unset($oppbatlog);
|
||||||
unset($oppbatres);
|
unset($oppbatres);
|
||||||
// $alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>(이)가 }<G>$city[name]</> 공략에 실패했습니다. <1>$date</>";
|
|
||||||
// $log[count($log)] = "<C>●</> <G>$city[name]</> 공략에 실패했습니다. <1>$date</>";
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
// 무승부일때 로그 남김
|
// 무승부일때 로그 남김
|
||||||
|
|||||||
Reference in New Issue
Block a user