From 679450110981efb3b049c99bf0c1430d96ea6ad2 Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Thu, 16 Jun 2022 17:15:59 +0200 Subject: [PATCH] ok end battle --- src/Game/Battle.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Game/Battle.java b/src/Game/Battle.java index c49545c..7bc172f 100644 --- a/src/Game/Battle.java +++ b/src/Game/Battle.java @@ -42,7 +42,8 @@ public class Battle { System.out.println("pv enemy : " +pvEnemy); System.out.println("xp player : " + xpPlayer); System.out.println("xp win " + newXp); - + + if(getLineSpeech() == 4){ FinishSpeech(); } @@ -52,11 +53,14 @@ public class Battle { } else if(0 < getLineSpeech() && getLineSpeech() < 4){ checkAnswer(answer); + + if(pvEnemy <= 0){ + FinishSpeech(); + } } else{ readNextLine(); } - } //check the choice answer @@ -98,15 +102,16 @@ public class Battle { public void FinishSpeech(){ if(pvEnemy>0){ //alive (speechline = 6) - lineSpeech += 2; + lineSpeech = 6; System.out.println("enemy alive"); } else{ //dead (speechline = 5) - lineSpeech += 1; + lineSpeech = 5; System.out.println("enemy dead"); } } + public void finish(){ screenBattleOn = false;