fix: 2회 이상 연속 전투에 성벽 전투가 포함된 경우 대인 사살이 계산되지 않는 버그
This commit is contained in:
@@ -5,6 +5,8 @@ namespace sammo;
|
|||||||
class WarUnitGeneral extends WarUnit
|
class WarUnitGeneral extends WarUnit
|
||||||
{
|
{
|
||||||
protected $raw;
|
protected $raw;
|
||||||
|
protected $killedPerson = 0;
|
||||||
|
protected $deadPerson = 0;
|
||||||
|
|
||||||
function __construct(General $general, array $rawNation, bool $isAttacker)
|
function __construct(General $general, array $rawNation, bool $isAttacker)
|
||||||
{
|
{
|
||||||
@@ -271,6 +273,10 @@ class WarUnitGeneral extends WarUnit
|
|||||||
}
|
}
|
||||||
$this->addDex($this->oppose->getCrewType(), $addDex);
|
$this->addDex($this->oppose->getCrewType(), $addDex);
|
||||||
|
|
||||||
|
if($this->oppose instanceof WarUnitGeneral){
|
||||||
|
$this->deadPerson += $damage;
|
||||||
|
}
|
||||||
|
|
||||||
return $general->getVar('crew');
|
return $general->getVar('crew');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,6 +304,10 @@ class WarUnitGeneral extends WarUnit
|
|||||||
|
|
||||||
$this->killed += $damage;
|
$this->killed += $damage;
|
||||||
$this->killedCurr += $damage;
|
$this->killedCurr += $damage;
|
||||||
|
|
||||||
|
if($this->oppose instanceof WarUnitGeneral){
|
||||||
|
$this->killedPerson += $damage;
|
||||||
|
}
|
||||||
return $this->killed;
|
return $this->killed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,9 +363,11 @@ class WarUnitGeneral extends WarUnit
|
|||||||
$general->increaseRankVar('killcrew', $this->killed);
|
$general->increaseRankVar('killcrew', $this->killed);
|
||||||
$general->increaseRankVar('deathcrew', $this->dead);
|
$general->increaseRankVar('deathcrew', $this->dead);
|
||||||
|
|
||||||
if ($this->getOppose() instanceof WarUnitGeneral) {
|
if($this->killedPerson){
|
||||||
$general->increaseRankVar('killcrew_person', $this->killed);
|
$general->increaseRankVar('killcrew_person', $this->killedPerson);
|
||||||
$general->increaseRankVar('deathcrew_person', $this->dead);
|
}
|
||||||
|
if($this->deadPerson){
|
||||||
|
$general->increaseRankVar('deathcrew_person', $this->deadPerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
$general->updateVar('rice', Util::round($general->getVar('rice')));
|
$general->updateVar('rice', Util::round($general->getVar('rice')));
|
||||||
|
|||||||
Reference in New Issue
Block a user