From c77e89ca0d4f9dfad7d94beab93306e0027f0e5a Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 22 Feb 2022 23:55:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=202=ED=9A=8C=20=EC=9D=B4=EC=83=81=20?= =?UTF-8?q?=EC=97=B0=EC=86=8D=20=EC=A0=84=ED=88=AC=EC=97=90=20=EC=84=B1?= =?UTF-8?q?=EB=B2=BD=20=EC=A0=84=ED=88=AC=EA=B0=80=20=ED=8F=AC=ED=95=A8?= =?UTF-8?q?=EB=90=9C=20=EA=B2=BD=EC=9A=B0=20=EB=8C=80=EC=9D=B8=20=EC=82=AC?= =?UTF-8?q?=EC=82=B4=EC=9D=B4=20=EA=B3=84=EC=82=B0=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EB=B2=84=EA=B7=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/WarUnitGeneral.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/WarUnitGeneral.php b/hwe/sammo/WarUnitGeneral.php index a11455e6..4c79cd39 100644 --- a/hwe/sammo/WarUnitGeneral.php +++ b/hwe/sammo/WarUnitGeneral.php @@ -5,6 +5,8 @@ namespace sammo; class WarUnitGeneral extends WarUnit { protected $raw; + protected $killedPerson = 0; + protected $deadPerson = 0; function __construct(General $general, array $rawNation, bool $isAttacker) { @@ -271,6 +273,10 @@ class WarUnitGeneral extends WarUnit } $this->addDex($this->oppose->getCrewType(), $addDex); + if($this->oppose instanceof WarUnitGeneral){ + $this->deadPerson += $damage; + } + return $general->getVar('crew'); } @@ -298,6 +304,10 @@ class WarUnitGeneral extends WarUnit $this->killed += $damage; $this->killedCurr += $damage; + + if($this->oppose instanceof WarUnitGeneral){ + $this->killedPerson += $damage; + } return $this->killed; } @@ -353,9 +363,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); + if($this->killedPerson){ + $general->increaseRankVar('killcrew_person', $this->killedPerson); + } + if($this->deadPerson){ + $general->increaseRankVar('deathcrew_person', $this->deadPerson); } $general->updateVar('rice', Util::round($general->getVar('rice')));