부대장은 기술연구, 전투시 기술 상승에 영향을 주지 않도록 변경
This commit is contained in:
+18
-9
@@ -369,17 +369,26 @@ function process_3(&$general) {
|
|||||||
$exp = CharExperience($exp, $general['personal']);
|
$exp = CharExperience($exp, $general['personal']);
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
$ded = CharDedication($ded, $general['personal']);
|
||||||
|
|
||||||
// 부드러운 기술 제한
|
|
||||||
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $score = intdiv($score, 4); }
|
|
||||||
|
|
||||||
//장수수 구함
|
//장수수 구함
|
||||||
$query = "select no from general where nation='{$general['nation']}'";
|
$gencount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i', $general['nation']);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$gencnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $general['nation']);
|
||||||
$gencount = MYDB_num_rows($result);
|
if ($gencnt_eff < GameConst::$initialNationGenLimit) {
|
||||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
$gencount = GameConst::$initialNationGenLimit;
|
||||||
|
$gencnt_eff = GameConst::$initialNationGenLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($gencount != $gencnt_eff){
|
||||||
|
$score *= $gencount / $gencnt_eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 부드러운 기술 제한
|
||||||
|
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $score /= 4; }
|
||||||
|
|
||||||
// 내정 상승
|
// 내정 상승
|
||||||
$query = "update nation set totaltech=totaltech+'$score',tech=totaltech/'$gencount' where nation='{$general['nation']}'";
|
$db->update('nation', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'totaltech'=>$db->sqleval('totaltech + %i', Util::round($score)),
|
||||||
|
'tech'=>$db->sqleval('totaltech / %i', $gencount)
|
||||||
|
], 'nation=%i', $general['nation']);
|
||||||
// 자금 하락, 경험치 상승 // 공헌도, 명성 상승 = $score * 10
|
// 자금 하락, 경험치 상승 // 공헌도, 명성 상승 = $score * 10
|
||||||
$general['gold'] -= $admin['develcost'];
|
$general['gold'] -= $admin['develcost'];
|
||||||
|
|
||||||
|
|||||||
+26
-2
@@ -111,6 +111,30 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
|
|||||||
$attackerIncTech = $attacker->getDead() * 0.01 * getNationTechMultiplier($rawAttackerNation['type']);
|
$attackerIncTech = $attacker->getDead() * 0.01 * getNationTechMultiplier($rawAttackerNation['type']);
|
||||||
$defenderIncTech = $attacker->getKilled() * 0.01 * getNationTechMultiplier($rawDefenderNation['type']);
|
$defenderIncTech = $attacker->getKilled() * 0.01 * getNationTechMultiplier($rawDefenderNation['type']);
|
||||||
|
|
||||||
|
$attackerGenCnt = $rawAttackerNation['gennum'];
|
||||||
|
$defenderGenCnt = $rawDefenderNation['gennum'];
|
||||||
|
$attackerGenCnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $rawAttackerNation['nation']);
|
||||||
|
$defenderGenCnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $rawDefenderNation['nation']);
|
||||||
|
|
||||||
|
if($attackerGenCnt_eff < GameConst::$initialNationGenLimit){
|
||||||
|
$attackerGenCnt = GameConst::$initialNationGenLimit;
|
||||||
|
$attackerGenCnt_eff = GameConst::$initialNationGenLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($defenderGenCnt_eff < GameConst::$initialNationGenLimit){
|
||||||
|
$defenderGenCnt = GameConst::$initialNationGenLimit;
|
||||||
|
$defenderGenCnt_eff = GameConst::$initialNationGenLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($attackerGenCnt != $attackerGenCnt_eff){
|
||||||
|
$attackerIncTech *= $attackerGenCnt / $attackerGenCnt_eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($defenderGenCnt != $defenderGenCnt_eff){
|
||||||
|
$defenderIncTech *= $defenderGenCnt / $defenderGenCnt_eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(TechLimit($startYear, $year, $rawAttackerNation['tech'])){
|
if(TechLimit($startYear, $year, $rawAttackerNation['tech'])){
|
||||||
$attackerIncTech /= 4;
|
$attackerIncTech /= 4;
|
||||||
}
|
}
|
||||||
@@ -124,8 +148,8 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
|
|||||||
$updateAttackerNation['totaltech'] = Util::round($attackerTotalTech);
|
$updateAttackerNation['totaltech'] = Util::round($attackerTotalTech);
|
||||||
$updateDefenderNation['totaltech'] = Util::round($defenderTotalTech);
|
$updateDefenderNation['totaltech'] = Util::round($defenderTotalTech);
|
||||||
|
|
||||||
$updateAttackerNation['tech'] = Util::round($attackerTotalTech / max(GameConst::$initialNationGenLimit, $rawAttackerNation['gennum']));
|
$updateAttackerNation['tech'] = Util::round($attackerTotalTech / $attackerGenCnt);
|
||||||
$updateDefenderNation['tech'] = Util::round($defenderTotalTech / max(GameConst::$initialNationGenLimit, $rawDefenderNation['gennum']));
|
$updateDefenderNation['tech'] = Util::round($defenderTotalTech / $defenderGenCnt);
|
||||||
|
|
||||||
$db->update('nation', $updateAttackerNation, 'nation=%i', $attackerNationID);
|
$db->update('nation', $updateAttackerNation, 'nation=%i', $attackerNationID);
|
||||||
$db->update('nation', $updateDefenderNation, 'nation=%i', $defenderNationID);
|
$db->update('nation', $updateDefenderNation, 'nation=%i', $defenderNationID);
|
||||||
|
|||||||
Reference in New Issue
Block a user