버그 수정
This commit is contained in:
+18
-6
@@ -1288,7 +1288,7 @@ function CheckHall($no) {
|
||||
["firenum", 'rank'],
|
||||
["warnum", 'rank'],
|
||||
["killnum", 'rank'],
|
||||
["winrate", 'rank'],
|
||||
["winrate", 'calc'],
|
||||
["killcrew", 'rank'],
|
||||
["killrate", 'calc'],
|
||||
["dex1", 'natural'],
|
||||
@@ -1298,7 +1298,7 @@ function CheckHall($no) {
|
||||
["dex5", 'natural'],
|
||||
["ttrate", 'calc'],
|
||||
["tlrate", 'calc'],
|
||||
["tprate", 'calc'],
|
||||
["tsrate", 'calc'],
|
||||
["tirate", 'calc'],
|
||||
["betgold", 'rank'],
|
||||
["betwin", 'rank'],
|
||||
@@ -1324,16 +1324,28 @@ function CheckHall($no) {
|
||||
$tid = $generalObj->getRankVar('tid');
|
||||
$til = $generalObj->getRankVar('til');
|
||||
|
||||
$tt = max($ttw+$ttd+$ttl, 1);
|
||||
$tl = max($tlw+$tld+$tll, 1);
|
||||
$ts = max($tsw+$tsd+$tsl, 1);
|
||||
$ti = max($tiw+$tid+$til, 1);
|
||||
$betWinGold = $generalObj->getRankVar('betwingold');
|
||||
$betGold = Util::valueFit($generalObj->getRankVar('betgold'), 1);
|
||||
|
||||
$win = $generalObj->getRankVar('killnum');
|
||||
$war = Util::valueFit($generalObj->getRankVar('warnum'), 1);
|
||||
|
||||
$kill = $generalObj->getRankVar('killcrew');
|
||||
$death = Util::valueFit($generalObj->getRankVar('deathcrew'), 1);
|
||||
|
||||
$tt = Util::valueFit($ttw+$ttd+$ttl, 1);
|
||||
$tl = Util::valueFit($tlw+$tld+$tll, 1);
|
||||
$ts = Util::valueFit($tsw+$tsd+$tsl, 1);
|
||||
$ti = Util::valueFit($tiw+$tid+$til, 1);
|
||||
|
||||
$calcVar = [];
|
||||
$calcVar['ttrate'] = $ttw/$tt;
|
||||
$calcVar['tlrate'] = $tlw/$tl;
|
||||
$calcVar['tsrate'] = $tsw/$ts;
|
||||
$calcVar['tirate'] = $tiw/$ti;
|
||||
$calcVar['betrate'] = $betWinGold/$betGold;
|
||||
$calcVar['winrate'] = $win/$war;
|
||||
$calcVar['killrate'] = $kill/($kill+$death);
|
||||
|
||||
if($generalObj instanceof DummyGeneral){
|
||||
return;
|
||||
|
||||
@@ -330,16 +330,13 @@ function preUpdateMonthly() {
|
||||
$rate = Util::round(($admin['year'] - $admin['startyear']) / 1.5) + 60;
|
||||
if($rate > 100) $rate = 100;
|
||||
|
||||
$ratio = 100;
|
||||
// 20 ~ 140원
|
||||
$develcost = ($admin['year'] - $admin['startyear'] + 10) * 2;
|
||||
$gameStor->gold_rate = $ratio;
|
||||
$gameStor->rice_rate = $ratio;
|
||||
$gameStor->city_rate = $rate;
|
||||
$gameStor->develcost = $develcost;
|
||||
|
||||
//매달 사망자 수입 결산
|
||||
processWarIncome($ratio);
|
||||
processWarIncome();
|
||||
|
||||
//계략, 전쟁표시 해제
|
||||
$db->update('city', [
|
||||
|
||||
@@ -48,7 +48,7 @@ function processGoldIncome() {
|
||||
|
||||
$nationList = $db->query('SELECT name,nation,capital,gold,level,rate_tmp,bill,type from nation');
|
||||
$cityListByNation = Util::arrayGroupBy($db->query('SELECT * FROM city'), 'nation');
|
||||
$generalRawListByNation = Util::arrayGroupBy($db->query('SELECT no,name,nation,gold,officer_level,dedication,city FROM general'), 'nation');
|
||||
$generalRawListByNation = Util::arrayGroupBy($db->query('SELECT no,name,nation,gold,officer_level,dedication,city FROM general WHERE npc != 5'), 'nation');
|
||||
|
||||
//국가별 처리
|
||||
foreach($nationList as $nation) {
|
||||
|
||||
+2
-2
@@ -153,11 +153,11 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
|
||||
$db->update('nation', $updateDefenderNation, 'nation=%i', $defenderNationID);
|
||||
|
||||
$db->update('diplomacy', [
|
||||
'dead'=>$db->sqleval('dead + %i', $attacker->getDead() * getTechCost($rawAttackerNation['tech']))
|
||||
'dead'=>$db->sqleval('dead + %i', $attacker->getDead())
|
||||
], 'me = %i and you = %i', $attackerNationID, $defenderNationID);
|
||||
|
||||
$db->update('diplomacy', [
|
||||
'dead'=>$db->sqleval('dead + %i', $attacker->getKilled() * getTechCost($rawDefenderNation['tech']))
|
||||
'dead'=>$db->sqleval('dead + %i', $attacker->getKilled())
|
||||
], 'me = %i and you = %i', $defenderNationID, $attackerNationID);
|
||||
|
||||
if(!$conquerCity){
|
||||
|
||||
@@ -35,7 +35,9 @@ class che_징병 extends Command\GeneralCommand{
|
||||
static protected $defaultAtmos;
|
||||
|
||||
protected $reqCrew = 0;
|
||||
/** @var \sammo\GameUnitDetail */
|
||||
protected $reqCrewType;
|
||||
/** @var \sammo\GameUnitDetail */
|
||||
protected $currCrewType;
|
||||
|
||||
static protected $isInitStatic = false;
|
||||
|
||||
@@ -145,7 +145,7 @@ class che_포상 extends Command\NationCommand{
|
||||
|
||||
$logger = $general->getLogger();
|
||||
|
||||
$destGeneral->increaseVarWithLimit($resKey, $amount);
|
||||
$destGeneral->increaseVar($resKey, $amount);
|
||||
$db->update('nation', [
|
||||
$resKey=>$db->sqleval('%b - %i', $resKey, $amount)
|
||||
], 'nation=%i', $nationID);
|
||||
|
||||
@@ -681,6 +681,7 @@ class General implements iAction{
|
||||
$this->rankVarSet = [];
|
||||
|
||||
$this->getLogger()->flush();
|
||||
$this->flushUpdateValues();
|
||||
return $db->affectedRows() > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3326,6 +3326,31 @@ class GeneralAI
|
||||
];
|
||||
}
|
||||
|
||||
protected function newChoosePromotion(){
|
||||
$db = DB::db();
|
||||
|
||||
$nation = $this->nation;
|
||||
$nationID = $nation['nation'];
|
||||
$minChiefLevel = getNationChiefLevel($nation['level']);
|
||||
|
||||
$userChiefCnt = 0;
|
||||
|
||||
$strengthSort = [];
|
||||
$intelSort = [];
|
||||
|
||||
foreach(Util::range($minChiefLevel, 12) as $chiefLevel){
|
||||
if(!key_exists($chiefLevel, $this->chiefGenerals)){
|
||||
continue;
|
||||
}
|
||||
$chief = $this->chiefGenerals[$chiefLevel];
|
||||
if($chief->getVar('npc') < 2){
|
||||
$userChiefCnt[$chiefLevel] = $chief;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function choosePromotion()
|
||||
{
|
||||
$db = DB::db();
|
||||
|
||||
@@ -136,4 +136,12 @@ trait LazyVarUpdater{
|
||||
}
|
||||
return $updateVals;
|
||||
}
|
||||
|
||||
function flushUpdateValues():void {
|
||||
$this->updatedVar = [];
|
||||
if(key_exists('auxVar', $this->raw)){
|
||||
$this->auxUpdated = false;
|
||||
unset($this->raw['auxVar']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,8 +241,6 @@ class ResetHelper{
|
||||
'maxgeneral'=>GameConst::$defaultMaxGeneral,
|
||||
'maxnation'=>GameConst::$defaultMaxNation,
|
||||
'conlimit'=>30000,
|
||||
'gold_rate'=>100,
|
||||
'rice_rate'=>100,
|
||||
'develcost'=>$develcost,
|
||||
'turntime'=>$turntime,
|
||||
'starttime'=>$starttime,
|
||||
|
||||
@@ -80,6 +80,10 @@ class WarUnit{
|
||||
function getUpdatedValues():array {
|
||||
return $this->general->getUpdatedValues();
|
||||
}
|
||||
|
||||
function flushUpdateValues():void {
|
||||
$this->general->flushUpdateValues();
|
||||
}
|
||||
|
||||
protected function clearActivatedSkill(){
|
||||
foreach($this->activatedSkill as $skillName=>$state){
|
||||
|
||||
@@ -154,6 +154,7 @@ class WarUnitCity extends WarUnit{
|
||||
}
|
||||
|
||||
$db->update('city', $updateVals, 'city=%i', $this->raw['city']);
|
||||
$this->flushUpdateValues();
|
||||
return $db->affectedRows() > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user