game: 저지시 쌀을 소모하도록 변경

- 오르는 숙련 대비 0.25배
- 즉, 일반 공격력 대비 0.9 * 0.25만큼
This commit is contained in:
2023-05-10 00:39:10 +09:00
parent 77fc38c899
commit 4eac86da58
2 changed files with 20 additions and 6 deletions
+11 -4
View File
@@ -262,11 +262,8 @@ class WarUnitGeneral extends WarUnit
return $general->getVar('crew');
}
function increaseKilled(int $damage): int
function calcRiceConsumption(int $damage): float
{
$general = $this->general;
$this->addLevelExp($damage / 50);
$rice = $damage / 100;
if (!$this->isAttacker) {
$rice *= 0.8;
@@ -279,6 +276,16 @@ class WarUnitGeneral extends WarUnit
$rice *= getTechCost($this->getNationVar('tech'));
$rice = $this->general->onCalcStat($this->general, 'killRice', $rice);
return $rice;
}
function increaseKilled(int $damage): int
{
$general = $this->general;
$this->addLevelExp($damage / 50);
$rice = $this->calcRiceConsumption($damage);
$general->increaseVarWithLimit('rice', -$rice, 0);
$addDex = $damage;