Skip to content

Commit

Permalink
Merge pull request #26 from OUCC/#2-BattleSystemの作成
Browse files Browse the repository at this point in the history
終了したときの処理の修正
  • Loading branch information
haku-noir authored Jun 24, 2023
2 parents 68f2b1f + 68b743c commit 87814f1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Assets/Scripts/BattleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,19 @@ public async UniTask<BattleData> 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);

enemy.Hp = enemyHp;

if(playerHp==0&&enemyHp==0)
{
playerHp = player.Hp;
}

player.Hp = playerHp;

//バトル終了判定
int battleJudge = BattleJudge(player.Hp, enemy.Hp);
Expand Down

0 comments on commit 87814f1

Please sign in to comment.