From f4df0665e5a62cd82cac0192dcec971182cf3053 Mon Sep 17 00:00:00 2001 From: watanabe4869 <105962248+watanabe4869@users.noreply.github.com> Date: Sat, 24 Jun 2023 18:54:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E7=B5=82=E4=BA=86=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=AE=E5=87=A6=E7=90=86=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/BattleSystem.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/BattleSystem.cs b/Assets/Scripts/BattleSystem.cs index 2f557bc..7405936 100644 --- a/Assets/Scripts/BattleSystem.cs +++ b/Assets/Scripts/BattleSystem.cs @@ -31,7 +31,19 @@ public async UniTask BattleProcessAsync(int playerAction) (player.DamageValue, enemy.DamageValue, player.CounterJudge, enemy.CounterJudge) = Damage(player.ActionType, enemy.ActionType); //HP計算 - (player.Hp, enemy.Hp) = HpCalculate(player.Hp, player.ActionType, player.DamageValue, enemy.Hp, enemy.ActionType, enemy.DamageValue); + int playerHp = player.Hp; + int enemyHp = enemy.Hp; + + (playerHp, enemyHp) = HpCalculate(playerHp, player.ActionType, player.DamageValue, enemyHp, enemy.ActionType, enemy.DamageValue); + + player.Hp = playerHp; + + if(playerHp==0&&enemyHp==0) + { + enemyHp = enemy.Hp; + } + + enemy.Hp = enemyHp; //バトル終了判定 int battleJudge = BattleJudge(player.Hp, enemy.Hp); From 68b743c42758c13d617eef213419ab765f500686 Mon Sep 17 00:00:00 2001 From: watanabe4869 <105962248+watanabe4869@users.noreply.github.com> Date: Sat, 24 Jun 2023 19:00:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/BattleSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/BattleSystem.cs b/Assets/Scripts/BattleSystem.cs index 7405936..b676e68 100644 --- a/Assets/Scripts/BattleSystem.cs +++ b/Assets/Scripts/BattleSystem.cs @@ -36,14 +36,14 @@ public async UniTask BattleProcessAsync(int playerAction) (playerHp, enemyHp) = HpCalculate(playerHp, player.ActionType, player.DamageValue, enemyHp, enemy.ActionType, enemy.DamageValue); - player.Hp = playerHp; + enemy.Hp = enemyHp; if(playerHp==0&&enemyHp==0) { - enemyHp = enemy.Hp; + playerHp = player.Hp; } - enemy.Hp = enemyHp; + player.Hp = playerHp; //バトル終了判定 int battleJudge = BattleJudge(player.Hp, enemy.Hp);