From c831d539b6410aecb455e8479a034981fb45124c Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 28 Apr 2020 02:02:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=99=EB=A0=A8=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/js/battle_simulator.js | 10 +++++----- hwe/sammo/WarUnit.php | 18 ++++++------------ hwe/sammo/WarUnitCity.php | 4 ++++ hwe/sammo/WarUnitGeneral.php | 4 ++++ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/hwe/js/battle_simulator.js b/hwe/js/battle_simulator.js index c2feaa7b..7b6f7f32 100644 --- a/hwe/js/battle_simulator.js +++ b/hwe/js/battle_simulator.js @@ -223,11 +223,11 @@ jQuery(function($){ atmos:getInt('.form_atmos'), train:getInt('.form_train'), - dex1:getInt('.form_dex0'), - dex2:getInt('.form_dex10'), - dex3:getInt('.form_dex20'), - dex4:getInt('.form_dex30'), - dex5:getInt('.form_dex40'), + dex1:getInt('.form_dex1'), + dex2:getInt('.form_dex2'), + dex3:getInt('.form_dex3'), + dex4:getInt('.form_dex4'), + dex5:getInt('.form_dex5'), defence_train:getInt('.form_defence_train'), }; } diff --git a/hwe/sammo/WarUnit.php b/hwe/sammo/WarUnit.php index 08bbdde9..28f93ac4 100644 --- a/hwe/sammo/WarUnit.php +++ b/hwe/sammo/WarUnit.php @@ -237,19 +237,9 @@ class WarUnit{ $warPower *= $this->getComputedAtmos(); $warPower /= $oppose->getComputedTrain(); - if($this instanceof WarUnitGeneral){ - $genDexAtt = $general->getDex($this->getCrewType()); - } - else{ - $genDexAtt = ($this->cityRate - 60) * 7200; - } + $genDexAtt = $this->getDex($this->getCrewType()); - if($this instanceof WarUnitGeneral){ - $oppDexDef = $opposeGeneral->getDex($this->getCrewType()); - } - else{ - $oppDexDef = ($this->cityRate - 60) * 7200; - } + $oppDexDef = $oppose->getDex($this->getCrewType()); $warPower *= getDexLog($genDexAtt, $oppDexDef); @@ -300,6 +290,10 @@ class WarUnit{ function addLose(){ } + function getDex(GameUnitDetail $crewType){ + throw new NotInheritedMethodException(); + } + function finishBattle(){ throw new NotInheritedMethodException(); } diff --git a/hwe/sammo/WarUnitCity.php b/hwe/sammo/WarUnitCity.php index 8cc10ec2..1a051513 100644 --- a/hwe/sammo/WarUnitCity.php +++ b/hwe/sammo/WarUnitCity.php @@ -68,6 +68,10 @@ class WarUnitCity extends WarUnit{ return $this->hp; } + function getDex(GameUnitDetail $crewType){ + return ($this->cityRate - 60) * 7200; + } + function decreaseHP(int $damage):int{ $damage = min($damage, $this->hp); $this->dead += $damage; diff --git a/hwe/sammo/WarUnitGeneral.php b/hwe/sammo/WarUnitGeneral.php index 9fa9dabe..9196a6e5 100644 --- a/hwe/sammo/WarUnitGeneral.php +++ b/hwe/sammo/WarUnitGeneral.php @@ -74,6 +74,10 @@ class WarUnitGeneral extends WarUnit{ $this->general->increaseVarWithLimit('atmos', $atmos, 0, GameConst::$maxAtmosByWar); } + function getDex(GameUnitDetail $crewType){ + return $this->general->getDex($crewType); + } + function getComputedTrain(){ $train = $this->general->getVar('train'); $train = $this->general->onCalcStat($this->general, 'bonusTrain', $train);