대인 사살, 점령률 추가

This commit is contained in:
2020-05-30 03:05:03 +09:00
parent 962db6821f
commit 5947abf83d
5 changed files with 33 additions and 1 deletions
+11
View File
@@ -91,6 +91,7 @@ $types = [
}
return $v;
}],
["점 령", "int", function($v){$v['value'] = $v['occupied']; return $v; }],
["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }],
["살 상 률", "percent", function($v){
if($v['warnum'] < 10){
@@ -101,6 +102,16 @@ $types = [
}
return $v;
}],
["대 인 사 살", "int", function($v){$v['value'] = $v['killcrew_person']; return $v; }],
["대 인 살 상 률", "percent", function($v){
if($v['warnum'] < 10){
$v['value'] = 0;
}
else{
$v['value'] = $v['killcrew_person'] / max(1, $v['deathcrew_person']);
}
return $v;
}],
["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex1']; return $v; }],
["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex2']; return $v; }],
["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex3']; return $v; }],
+3
View File
@@ -90,8 +90,11 @@ $types = [
'warnum'=>['전 투 횟 수', 'int'],
'killnum'=>['승 리', 'int'],
'winrate'=>['승 률', 'percent'],
'occupied'=>['점 령', 'int'],
'killcrew'=>['사 살', 'int'],
'killrate'=>['살 상 률', 'percent'],
'killcrew_person'=>['대 인 사 살', 'int'],
'killrate_person'=>['대 인 살 상 률', 'percent'],
'dex1'=>['보 병 숙 련 도', 'int'],
'dex2'=>['궁 병 숙 련 도', 'int'],
'dex3'=>['기 병 숙 련 도', 'int'],
+7
View File
@@ -1336,8 +1336,11 @@ function CheckHall($no)
["warnum", 'rank'],
["killnum", 'rank'],
["winrate", 'calc'],
["occupied", 'rank'],
["killcrew", 'rank'],
["killrate", 'calc'],
["killcrew_person", 'rank'],
["killrate_person", 'calc'],
["dex1", 'natural'],
["dex2", 'natural'],
["dex3", 'natural'],
@@ -1380,6 +1383,9 @@ function CheckHall($no)
$kill = $generalObj->getRankVar('killcrew');
$death = Util::valueFit($generalObj->getRankVar('deathcrew'), 1);
$killPerson = $generalObj->getRankVar('killcrew_person');
$deathPerson = Util::valueFit($generalObj->getRankVar('deathcrew_person'), 1);
$tt = Util::valueFit($ttw + $ttd + $ttl, 1);
$tl = Util::valueFit($tlw + $tld + $tll, 1);
$ts = Util::valueFit($tsw + $tsd + $tsl, 1);
@@ -1393,6 +1399,7 @@ function CheckHall($no)
$calcVar['betrate'] = $betWinGold / $betGold;
$calcVar['winrate'] = $win / $war;
$calcVar['killrate'] = $kill / $death;
$calcVar['killrate_person'] = $killPerson / $deathPerson;
if ($generalObj instanceof DummyGeneral) {
return;
+1 -1
View File
@@ -46,7 +46,7 @@ class General implements iAction{
'tsw'=>1, 'tsd'=>1, 'tsl'=>1, 'tsg'=>1, 'tsp'=>1,
'tiw'=>1, 'tid'=>1, 'til'=>1, 'tig'=>1, 'tip'=>1,
'betwin'=>1, 'betgold'=>1, 'betwingold'=>1,
'kill_realcrew'=>1, 'death_realcrew'=>1,
'killcrew_person'=>1, 'deathcrew_person'=>1,
'occupied'=>1,
];
+11
View File
@@ -118,6 +118,12 @@ class WarUnitGeneral extends WarUnit{
function addWin(){
$general = $this->general;
$general->increaseRankVar('killnum', 1);
$oppose = $this->getOppose();
if($oppose instanceof WarUnitCity){
$general->increaseRankVar('occupied', 1);
}
$general->multiplyVarWithLimit('atmos', 1.1, null, GameConst::$maxAtmosByWar);
$this->addStatExp(1);
@@ -295,6 +301,11 @@ class WarUnitGeneral extends WarUnit{
$general->increaseRankVar('killcrew', $this->killed);
$general->increaseRankVar('deathcrew', $this->dead);
if($this->getOppose() instanceof WarUnitGeneral){
$general->increaseRankVar('killcrew_person', $this->killed);
$general->increaseRankVar('deathcrew_person', $this->dead);
}
$general->updateVar('rice', Util::round($general->getVar('rice')));
$general->updateVar('experience', Util::round($general->getVar('experience')));