forked from devsam/core
game: 저지시 쌀을 소모하도록 변경
- 오르는 숙련 대비 0.25배 - 즉, 일반 공격력 대비 0.9 * 0.25만큼
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -9,6 +9,8 @@ use sammo\Util;
|
||||
use sammo\ObjectTrigger;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
use function sammo\getTechCost;
|
||||
|
||||
class che_저지발동 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST; //최우선 순위
|
||||
|
||||
@@ -25,10 +27,15 @@ class che_저지발동 extends BaseWarUnitTrigger{
|
||||
$self->getLogger()->pushGeneralBattleDetailLog("상대를 <C>저지</>했다!", ActionLogger::PLAIN);
|
||||
$oppose->getLogger()->pushGeneralBattleDetailLog("저지</>당했다!", ActionLogger::PLAIN);
|
||||
|
||||
$calcDamage = $oppose->getWarPower() * 0.9;
|
||||
|
||||
$self->getGeneral()->addDex($oppose->getCrewType(), $oppose->getWarPower() * 0.9);
|
||||
$self->getGeneral()->addDex($self->getCrewType(), $self->getWarPower() * 0.9);
|
||||
$self->getGeneral()->addDex($self->getCrewType(), $calcDamage);
|
||||
if($self instanceof WarUnitGeneral){
|
||||
$self->addLevelExp($self->getWarPower() * 0.9 / 50);
|
||||
$self->addLevelExp($calcDamage / 50);
|
||||
$rice = $self->calcRiceConsumption($calcDamage);
|
||||
$rice *= 0.25;
|
||||
$self->getGeneral()->increaseVarWithLimit('rice', -$rice, 0);
|
||||
}
|
||||
|
||||
$self->setWarPowerMultiply(0);
|
||||
|
||||
Reference in New Issue
Block a user