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