토너먼트값, 전투, 계략값을 분리

This commit is contained in:
2020-03-29 05:03:49 +09:00
parent 6f47e92050
commit 0561cc3320
59 changed files with 858 additions and 640 deletions
+2 -4
View File
@@ -33,10 +33,8 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
$city = new WarUnitCity($rawDefenderCity, $rawDefenderNation, $year, $month, $cityRate);
$defenderList = [];
foreach ($db->query('SELECT no,name,nation,turntime,personal,special,special2,crew,crewtype,atmos,train,intel,intel_max,book,strength,strength_max,weapon,injury,leadership,leadership_max,horse,item,explevel,experience,dedication,level,gold,rice,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,defence_train FROM general WHERE nation=%i AND city=%i AND nation!=0 and crew > 0 and rice>(crew/100) and train>=defence_train and atmos>=defence_train', $city->getVar('nation'), $city->getVar('city')) as $rawGeneral){
$defenderList[] = new General($rawGeneral, $rawDefenderCity, $year, $month);
}
$defenderIDList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND city=%i AND nation!=0 and crew > 0 and rice>(crew/100) and train>=defence_train and atmos>=defence_train', $city->getVar('nation'), $city->getVar('city'));
$defenderList = General::createGeneralObjListFromDB($defenderIDList, null, 2);
usort($defenderList, function(General $lhs, General $rhs){
return -(extractBattleOrder($lhs) <=> extractBattleOrder($rhs));