From 4ca1ad991dc4a9c61b08c88833133bf3cf16d67a Mon Sep 17 00:00:00 2001 From: Yazan Alaamer Date: Fri, 20 Jan 2023 23:48:41 +0100 Subject: [PATCH] added attack guard system --- src/main/java/game/StartDarkSoulsGame.java | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/game/StartDarkSoulsGame.java b/src/main/java/game/StartDarkSoulsGame.java index a4d91f7..5032638 100644 --- a/src/main/java/game/StartDarkSoulsGame.java +++ b/src/main/java/game/StartDarkSoulsGame.java @@ -177,7 +177,20 @@ public class StartDarkSoulsGame { choice3.setText(""); choice4.setText(""); } - + public void attackGuard() { + position = "attackGuard"; + mainTextArea.setText("Guard: I can see your soul at the edges of your eyes. " + + "It's corrosive, like acid. \n You got a demon, little man.\n " + + "Guard fought back with sowrd of ashina " + + "\n(you recieve 3 damage) "); + playerHP = playerHP -3; + hpLabelNumber.setText(""+ playerHP); + choice1.setText(">"); + choice2.setText(""); + choice3.setText(""); + choice4.setText(""); + + } public class TitelScreenHandler implements ActionListener{ public void actionPerformed(ActionEvent event) { @@ -192,7 +205,7 @@ public class StartDarkSoulsGame { case "townGate": switch(yourChoice) { case "c1": talkGuard(); break; - case "c2": break; + case "c2": attackGuard(); break; case "c3": break; } break; @@ -201,6 +214,12 @@ public class StartDarkSoulsGame { case"c1": townGate();break; } break; + case "attackGuard":// commit (26) attack guard + switch(yourChoice) {// commit (26) attack guard + case "c1": townGate();// commit (26) attack guard + break;// commit (26) attack guard + } + break; } }