From fd6405ea97e8cb0ae4ac35dde165d902a3faa867 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Thu, 11 May 2023 01:58:16 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=84=B1=EB=B2=BD=20=EC=84=A0=EC=A0=9C?= =?UTF-8?q?=EA=B0=80=20=ED=98=B8=EC=B6=9C=EC=A1=B0=EC=B0=A8=20=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_converter.php | 2 +- hwe/j_simulate_battle.php | 2 +- hwe/process_war.php | 2 +- hwe/sammo/ActionCrewType/None.php | 12 ++++++++++++ hwe/sammo/GameUnitConstBase.php | 4 ++-- hwe/sammo/GameUnitDetail.php | 2 +- 6 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 hwe/sammo/ActionCrewType/None.php diff --git a/hwe/func_converter.php b/hwe/func_converter.php index a688bc75..8015975f 100644 --- a/hwe/func_converter.php +++ b/hwe/func_converter.php @@ -328,7 +328,7 @@ function buildGeneralSpecialWarClass(?string $type):BaseSpecial{ function getActionCrewTypeClass(?string $type){ if($type === null || $type === ''){ - $type = GameConst::$defaultSpecialWar; + $type = 'None'; } static $basePath = __NAMESPACE__.'\\ActionCrewType\\'; diff --git a/hwe/j_simulate_battle.php b/hwe/j_simulate_battle.php index 38bb2019..1e4ea6a4 100644 --- a/hwe/j_simulate_battle.php +++ b/hwe/j_simulate_battle.php @@ -409,7 +409,7 @@ function simulateBattle( ); } - if(count($defenderList) == 0 && extractBattleOrder($city, $attacker) > 0){ + if(count($defenderList) && extractBattleOrder($city, $attacker) > 0){ $defenderList[] = $city; } diff --git a/hwe/process_war.php b/hwe/process_war.php index c53482e9..8453c92a 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -51,7 +51,7 @@ function processWar(string $warSeed, General $attackerGeneral, array $rawAttacke $defenderList[] = $defenderCandidate; } - if(count($defenderList) == 0 && extractBattleOrder($city, $attacker) > 0){ + if(count($defenderList) && extractBattleOrder($city, $attacker) > 0){ $defenderList[] = $city; } diff --git a/hwe/sammo/ActionCrewType/None.php b/hwe/sammo/ActionCrewType/None.php new file mode 100644 index 00000000..ae86970e --- /dev/null +++ b/hwe/sammo/ActionCrewType/None.php @@ -0,0 +1,12 @@ +1.25, self::T_ARCHER=>1.25, self::T_CAVALRY=>1.25, self::T_WIZARD=>1.25, self::T_CASTLE=>1.8, 1106=>1.112], [self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2, 1106=>1.067], ['상대에게 돌덩이를 날립니다.'], - ['che_성벽부상무효'], ['che_선제사격시도', 'che_선제사격발동'], null + ['che_성벽부상무효'], ['che_선제사격시도', 'che_선제사격발동'], ['che_성벽선제'] ], [ 1503, self::T_SIEGE, '목우', @@ -343,7 +343,7 @@ class GameUnitConstBase{ [self::T_FOOTMAN=>1, self::T_ARCHER=>1, self::T_CAVALRY=>1, self::T_WIZARD=>1, self::T_CASTLE=>1.8], [self::T_FOOTMAN=>1, self::T_ARCHER=>1, self::T_CAVALRY=>1, self::T_WIZARD=>1, 1106=>1], ['상대를 저지하는 특수병기입니다.'], - ['che_성벽부상무효'], ['che_저지시도', 'che_저지발동'], ['che_성벽선제'] + ['che_성벽부상무효'], ['che_저지시도', 'che_저지발동'], null ] ]; diff --git a/hwe/sammo/GameUnitDetail.php b/hwe/sammo/GameUnitDetail.php index 6e524c95..2e63da15 100644 --- a/hwe/sammo/GameUnitDetail.php +++ b/hwe/sammo/GameUnitDetail.php @@ -70,7 +70,7 @@ class GameUnitDetail implements iAction $this->initSkillTrigger = $initSkillTrigger; $this->phaseSkillTrigger = $phaseSkillTrigger; $this->iActionList = []; - foreach($iActionList as $rawAction){ + foreach($iActionList ?? [] as $rawAction){ $action = buildActionCrewTypeClass($rawAction); if(!$action){ continue;