From fb63bb56483d641f007dc42fa94a8de206395099 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 17:16:52 +0800 Subject: [PATCH 1/8] c. --- Main/Combat.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Main/Combat.java b/Main/Combat.java index b8c79d4..c9cedee 100644 --- a/Main/Combat.java +++ b/Main/Combat.java @@ -2,8 +2,12 @@ public class Combat { //Battle mechanics + //Damage calculations + //Battle UI + //Victory/defeat conditions + //Skill cooldown and mana management } \ No newline at end of file From 57a5a6f411f70d4f6b308b210a462dd458ab4ed0 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 19:46:52 +0800 Subject: [PATCH 2/8] ok --- Main/{ => .github}/Combat.java | 2 +- Main/MechaBeast.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename Main/{ => .github}/Combat.java (94%) diff --git a/Main/Combat.java b/Main/.github/Combat.java similarity index 94% rename from Main/Combat.java rename to Main/.github/Combat.java index c9cedee..aec2974 100644 --- a/Main/Combat.java +++ b/Main/.github/Combat.java @@ -2,7 +2,7 @@ public class Combat { //Battle mechanics - + //Damage calculations //Battle UI diff --git a/Main/MechaBeast.java b/Main/MechaBeast.java index 306a97a..ed57d26 100644 --- a/Main/MechaBeast.java +++ b/Main/MechaBeast.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -public class MechaBeast { +public class MechaBeast { private final String name; private final ElementType type; private final String henshin; From b0dee149586fe2f37d2bd23f73e3ffae74e6b7d7 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 19:46:52 +0800 Subject: [PATCH 3/8] ok --- Main/{ => .github}/Combat.java | 4 +- Main/Main.java | 281 +++++++-------------------------- Main/MechaBeast.java | 2 +- 3 files changed, 61 insertions(+), 226 deletions(-) rename Main/{ => .github}/Combat.java (94%) diff --git a/Main/Combat.java b/Main/.github/Combat.java similarity index 94% rename from Main/Combat.java rename to Main/.github/Combat.java index c9cedee..18e9f86 100644 --- a/Main/Combat.java +++ b/Main/.github/Combat.java @@ -2,11 +2,11 @@ public class Combat { //Battle mechanics - + //Damage calculations //Battle UI - + //Victory/defeat conditions //Skill cooldown and mana management diff --git a/Main/Main.java b/Main/Main.java index 60d70a5..d137fec 100644 --- a/Main/Main.java +++ b/Main/Main.java @@ -1,229 +1,64 @@ package Main;// Game.DigiWorldGame.java - Main Entry Point import java.util.*; - -public class Main { +public class Main{ + public static void displayTitle() { + System.out.println("════════════════════════════════════════════════════════════════════════"); + System.out.println("╔══════════════════════════════════════════════════════════════════════╗"); + System.out.println("║ ║"); + System.out.println("║ **** *** ***** *** * * ***** **** * **** ║"); + System.out.println("║ * * * * * * * * * * * * * * ║"); + System.out.println("║ * * * * * * * * * * * * * * ║"); + System.out.println("║ * * * * *** * * * * * * **** * * * ║"); + System.out.println("║ * * * * * * * * * * * * * * * * ║"); + System.out.println("║ * * * * * * ** ** * * * * * * * ║"); + System.out.println("║ **** *** ***** *** * * ***** * * *** **** ║"); + System.out.println("║ ║"); + System.out.println("║ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ║"); + System.out.println("║ ~ Digital Adventure Awaits ~ ║"); + System.out.println("║ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ║"); + System.out.println("║ ║"); + System.out.println("╚══════════════════════════════════════════════════════════════════════╝"); + System.out.println("════════════════════════════════════════════════════════════════════════"); + } public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - - // Welcome, Banner - System.out.println("╔════════════════════════════════════════╗"); - System.out.println("║ WELCOME TO DIGIWORLD RPG ║"); - System.out.println("║ ║"); - System.out.println("║ A Terminal-Based Adventure Game ║"); - System.out.println("║ Fuse. Battle. Conquer. ║"); - System.out.println("╚════════════════════════════════════════╝"); + Scanner sc = new Scanner(System.in); + System.out.println("\n=== WELCOME TO ==="); + displayTitle(); + System.out.println("\nGame initializing..."); System.out.println(); - - // Game.Player Initialization - System.out.print("Enter your champion name: "); - String playerName = scanner.nextLine().trim(); - if (playerName.isEmpty()) { - playerName = "Champion"; - } - - Player player = new Player(playerName); - System.out.println("\nWelcome, " + playerName + "!"); - System.out.println("Preparing your journey...\n"); - System.out.println("[Press ENTER to continue]"); - scanner.nextLine(); - - // Story Manager Initialization - StoryManager storyManager = new StoryManager(player); - - // Introduction - storyManager.playIntroduction(); - - // Beast Selection - System.out.println("\n╔════════════════════════════════════════╗"); - System.out.println("║ SELECT YOUR MECHA BEASTS ║"); - System.out.println("╚════════════════════════════════════════╝"); - - System.out.println("\nProfessor Ai-P: Choose 3 Mecha Beasts to accompany you!"); - System.out.println("Choose wisely - different types have advantages and weaknesses.\n"); - - List availableBeasts = MechaBeastFactory.getAllStarterBeasts(); - - // Display Beast Selection Table - System.out.println("┌────┬─────────────┬──────────┬──────┬───────┬───────┐"); - System.out.println("│ # │ Name │ Type │ HP │ Speed │ Mana │"); - System.out.println("├────┼─────────────┼──────────┼──────┼───────┼───────┤"); - - for (int i = 0; i < 8; i++) { - MechaBeast beast = availableBeasts.get(i); - System.out.printf("│ %-2d │ %-11s │ %-8s │ %-4d │ %-5d │ %-5d │%n", - (i + 1), - beast.getName(), - beast.getType().getDisplayName(), - beast.getMaxHp(), - beast.getSpeed(), - beast.getMaxMana() - ); - } - - System.out.println("│ 9 │ ??? │ ??? │ ???? │ ??? │ ??? │"); - System.out.println("└────┴─────────────┴──────────┴──────┴───────┴───────┘"); - - System.out.println("\n💡 TIP: Balance your team with different types!"); - System.out.println(" High HP = Tank | High Speed = First Strike | High Mana = Powerful Skills"); - System.out.println(" ⚠️ Option 9 is a hidden beast... try it if you dare!"); - - // Select 3 Beasts - { - System.out.println("\n╔══ SELECTION " + (1) + "/3 ══╗"); - System.out.print("Choose Mecha Beast " + (1) + " (1-8 or 9 for ???): "); - - int choice = -1; - while (choice < 1 || choice > 9) { - try { - String input = scanner.nextLine().trim(); - choice = Integer.parseInt(input); - if (choice < 1 || choice > 9) { - System.out.print("Please enter a number between 1 and 9: "); - } - } catch (NumberFormatException e) { - System.out.print("Invalid input. Please enter a number: "); - } - } - - MechaBeast selectedBeast = availableBeasts.get(choice - 1); - - if (choice == 9) { - System.out.println("\n⚠️ SECRET UNLOCKED! ⚠️"); - System.out.println("✓ Kingmantis (OVERPOWERED CHARACTER) added to your team!"); - System.out.println(" HP: " + selectedBeast.getMaxHp() + - " | Speed: " + selectedBeast.getSpeed() + - " | Mana: " + selectedBeast.getMaxMana()); - System.out.println(" This is a CHEAT beast with incredible stats!"); - } else { - System.out.println("✓ " + selectedBeast.getName() + " (" + - selectedBeast.getType().getDisplayName() + ") added to your team!"); - System.out.println(" HP: " + selectedBeast.getMaxHp() + - " | Speed: " + selectedBeast.getSpeed() + - " | Mana: " + selectedBeast.getMaxMana()); - } - - player.addMechaBeast(selectedBeast.copy()); - } - { - System.out.println("\n╔══ SELECTION " + (1 + 1) + "/3 ══╗"); - System.out.print("Choose Mecha Beast " + (1 + 1) + " (1-8 or 9 for ???): "); - - int choice = -1; - while (choice < 1 || choice > 9) { - try { - String input = scanner.nextLine().trim(); - choice = Integer.parseInt(input); - if (choice < 1 || choice > 9) { - System.out.print("Please enter a number between 1 and 9: "); - } - } catch (NumberFormatException e) { - System.out.print("Invalid input. Please enter a number: "); - } - } - - MechaBeast selectedBeast = availableBeasts.get(choice - 1); - - if (choice == 9) { - System.out.println("\n⚠️ SECRET UNLOCKED! ⚠️"); - System.out.println("✓ Kingmantis (OVERPOWERED CHARACTER) added to your team!"); - System.out.println(" HP: " + selectedBeast.getMaxHp() + - " | Speed: " + selectedBeast.getSpeed() + - " | Mana: " + selectedBeast.getMaxMana()); - System.out.println(" This is a CHEAT beast with incredible stats!"); - } else { - System.out.println("✓ " + selectedBeast.getName() + " (" + - selectedBeast.getType().getDisplayName() + ") added to your team!"); - System.out.println(" HP: " + selectedBeast.getMaxHp() + - " | Speed: " + selectedBeast.getSpeed() + - " | Mana: " + selectedBeast.getMaxMana()); - } - - player.addMechaBeast(selectedBeast.copy()); - } - { - System.out.println("\n╔══ SELECTION " + (2 + 1) + "/3 ══╗"); - System.out.print("Choose Mecha Beast " + (2 + 1) + " (1-8 or 9 for ???): "); - - int choice = -1; - while (choice < 1 || choice > 9) { - try { - String input = scanner.nextLine().trim(); - choice = Integer.parseInt(input); - if (choice < 1 || choice > 9) { - System.out.print("Please enter a number between 1 and 9: "); - } - } catch (NumberFormatException e) { - System.out.print("Invalid input. Please enter a number: "); - } - } - - MechaBeast selectedBeast = availableBeasts.get(choice - 1); - - if (choice == 9) { - System.out.println("\n⚠️ SECRET UNLOCKED! ⚠️"); - System.out.println("✓ Kingmantis (OVERPOWERED CHARACTER) added to your team!"); - System.out.println(" HP: " + selectedBeast.getMaxHp() + " | Speed: " + selectedBeast.getSpeed() + - " | Mana: " + selectedBeast.getMaxMana()); - System.out.println(" This is a CHEAT beast with incredible stats!"); - } else { - System.out.println("✓ " + selectedBeast.getName() + " (" + - selectedBeast.getType().getDisplayName() + ") added to your team!"); - System.out.println(" HP: " + selectedBeast.getMaxHp() + " | Speed: " + selectedBeast.getSpeed() + - " | Mana: " + selectedBeast.getMaxMana()); - } - - player.addMechaBeast(selectedBeast.copy()); - } - - System.out.println("\n╔════════════════════════════════════════╗"); - System.out.println("║ YOUR TEAM IS READY! ║"); - System.out.println("╚════════════════════════════════════════╝"); - - System.out.println("\nYour team:"); - for (int i = 0; i < player.getMechaBeasts().size(); i++) { - MechaBeast beast = player.getMechaBeasts().get(i); - System.out.printf("%d. %s (%s)%n", (i + 1), beast.getName(), beast.getType().getDisplayName()); - } - - System.out.println("\nProfessor Ai-P: Excellent choices! Now let's begin the test!"); - System.out.println("\n[Press ENTER to continue]"); - scanner.nextLine(); - - // Stage 1: Alpha Village - storyManager.playStage1AlphaVillage(); - - // Stage 2: Beta City - storyManager.playStage2BetaCity(); - - // Stage 3: The Collapse - storyManager.playStage3Collapse(); - - // Game Complete Display Statistics - System.out.println("\n╔════════════════════════════════════════╗"); - System.out.println("║ FINAL STATISTICS ║"); - System.out.println("╚════════════════════════════════════════╝"); - - System.out.println("\nChampion: " + player.getName()); - System.out.println("\nYour Final Team:"); - for (int i = 0; i < player.getMechaBeasts().size(); i++) { - MechaBeast beast = player.getMechaBeasts().get(i); - String status; - if (beast.isAlive()) { - status = "✓ ALIVE"; - } else { - status = "✗ FAINTED"; - } - System.out.printf("%d. %-15s (%s) - %s%n", (i + 1), beast.getName(), beast.getType().getDisplayName(), status); - } - - System.out.println("\n╔════════════════════════════════════════╗"); - System.out.println("║ Stages Completed: 3/3 ║"); - System.out.println("║ Rank: LEGENDARY CHAMPION ║"); - System.out.println("║ Status: GAME SAVED ║"); - System.out.println("╚════════════════════════════════════════╝"); - - System.out.println("\nThank you for testing DigiWorld!"); - System.out.println("Your feedback will help shape the future of gaming!"); - + //story + System.out.println("You are a gaming prodigy and a 10-time world champion in different games, and you have been \nchosen to test the new revolutionary game “DigiWorld” created by the government.To keep \nyour legacy going you agreed. You will be transported into a digital world full of elemental \nMecha Beasts, where you fuse with them and battle challengers."); + System.out.println(); + System.out.print("Enter the name of your character: "); + String name = sc.nextLine(); + System.out.println(); + System.out.println("Professor Ai-P: Hello and welcome Mr. gaming prodigy and 10-time world champion "+name+" \nto the gaming lab where you will be testing our new revolutionary game “DigiWorld”. Oh, where \nare my manners!? I’m Professor Ai-P, and I’m in charge in developing this game. You will be \ntransported into a world full of creatures called “Mecha Beasts”, fuse with them, create a bond and battle together. "); + System.out.println(); + System.out.println(name+": Thanks for the explanation, Professor, but may I know what is the reason the government funded to create this game?"); + System.out.println(); + System.out.println("General Edrian: I shall be the one to answer that question Mr. (name), I was actually intrigued \nby gaming. Seeing players think like they’re chess masters or generals and coordinate their \nupper body in tapping their devices to win, it gave me an idea. What if we create a game where \nyou become the character and fight but in a digital world? This way gamers could play digital \ngames while still being physically active, and they will be able to experience the feeling of being \ntheir character. This could create a new legacy for “Gamers”."); + System.out.println(); + System.out.println(name+": That doesn’t fully answer my question but oh well. Let’s get this started."); + System.out.println(); + System.out.println("Professor Ai-P: Excellent! Now before we transport you, you will need this G-Watch, M-Belt and\nBeast.Beast-Card. Choose 3 out of these 10 Mecha Beasts:"); + //choose character + System.out.print("1.\tFire Beast.Beast: Solflare\n" + + "2.\tWater Beast.Beast: Nokami \n" + + "3.\tGrass Beast.Beast: Vineratops\n" + + "4.\tElectric Beast.Beast: Voltchu\n" + + "5.\tEarth Beast.Beast: Zyuugor\n" + + "6.\tWind Beast.Beast: Pirrot\n" + + "7.\tFighting Beast.Beast: Gekuma\n" + + "8.\tPsychic Beast.Beast: Mindowl\n" + + "9.\tDark Beast.Beast: Shadefox\n" + + "10.\tSteel Beast.Beast: Mantiron\n"); + System.out.print("Choose your first character: "); + int character1 = sc.nextInt(); + System.out.print("Choose your second character: "); + int character2 = sc.nextInt(); + System.out.print("Choose your third character: "); + int character3 = sc.nextInt(); + System.out.print("Hello"); } + } \ No newline at end of file diff --git a/Main/MechaBeast.java b/Main/MechaBeast.java index 306a97a..ed57d26 100644 --- a/Main/MechaBeast.java +++ b/Main/MechaBeast.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -public class MechaBeast { +public class MechaBeast { private final String name; private final ElementType type; private final String henshin; From 5a8487c150dbccddc99fc3492a6b78a3b20366f6 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 20:12:05 +0800 Subject: [PATCH 4/8] pls --- Main/Main.java | 281 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 223 insertions(+), 58 deletions(-) diff --git a/Main/Main.java b/Main/Main.java index d137fec..60d70a5 100644 --- a/Main/Main.java +++ b/Main/Main.java @@ -1,64 +1,229 @@ package Main;// Game.DigiWorldGame.java - Main Entry Point import java.util.*; -public class Main{ - public static void displayTitle() { - System.out.println("════════════════════════════════════════════════════════════════════════"); - System.out.println("╔══════════════════════════════════════════════════════════════════════╗"); - System.out.println("║ ║"); - System.out.println("║ **** *** ***** *** * * ***** **** * **** ║"); - System.out.println("║ * * * * * * * * * * * * * * ║"); - System.out.println("║ * * * * * * * * * * * * * * ║"); - System.out.println("║ * * * * *** * * * * * * **** * * * ║"); - System.out.println("║ * * * * * * * * * * * * * * * * ║"); - System.out.println("║ * * * * * * ** ** * * * * * * * ║"); - System.out.println("║ **** *** ***** *** * * ***** * * *** **** ║"); - System.out.println("║ ║"); - System.out.println("║ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ║"); - System.out.println("║ ~ Digital Adventure Awaits ~ ║"); - System.out.println("║ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ◊ ◇ ║"); - System.out.println("║ ║"); - System.out.println("╚══════════════════════════════════════════════════════════════════════╝"); - System.out.println("════════════════════════════════════════════════════════════════════════"); - } + +public class Main { public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - System.out.println("\n=== WELCOME TO ==="); - displayTitle(); - System.out.println("\nGame initializing..."); - System.out.println(); - //story - System.out.println("You are a gaming prodigy and a 10-time world champion in different games, and you have been \nchosen to test the new revolutionary game “DigiWorld” created by the government.To keep \nyour legacy going you agreed. You will be transported into a digital world full of elemental \nMecha Beasts, where you fuse with them and battle challengers."); - System.out.println(); - System.out.print("Enter the name of your character: "); - String name = sc.nextLine(); - System.out.println(); - System.out.println("Professor Ai-P: Hello and welcome Mr. gaming prodigy and 10-time world champion "+name+" \nto the gaming lab where you will be testing our new revolutionary game “DigiWorld”. Oh, where \nare my manners!? I’m Professor Ai-P, and I’m in charge in developing this game. You will be \ntransported into a world full of creatures called “Mecha Beasts”, fuse with them, create a bond and battle together. "); - System.out.println(); - System.out.println(name+": Thanks for the explanation, Professor, but may I know what is the reason the government funded to create this game?"); - System.out.println(); - System.out.println("General Edrian: I shall be the one to answer that question Mr. (name), I was actually intrigued \nby gaming. Seeing players think like they’re chess masters or generals and coordinate their \nupper body in tapping their devices to win, it gave me an idea. What if we create a game where \nyou become the character and fight but in a digital world? This way gamers could play digital \ngames while still being physically active, and they will be able to experience the feeling of being \ntheir character. This could create a new legacy for “Gamers”."); - System.out.println(); - System.out.println(name+": That doesn’t fully answer my question but oh well. Let’s get this started."); + Scanner scanner = new Scanner(System.in); + + // Welcome, Banner + System.out.println("╔════════════════════════════════════════╗"); + System.out.println("║ WELCOME TO DIGIWORLD RPG ║"); + System.out.println("║ ║"); + System.out.println("║ A Terminal-Based Adventure Game ║"); + System.out.println("║ Fuse. Battle. Conquer. ║"); + System.out.println("╚════════════════════════════════════════╝"); System.out.println(); - System.out.println("Professor Ai-P: Excellent! Now before we transport you, you will need this G-Watch, M-Belt and\nBeast.Beast-Card. Choose 3 out of these 10 Mecha Beasts:"); - //choose character - System.out.print("1.\tFire Beast.Beast: Solflare\n" + - "2.\tWater Beast.Beast: Nokami \n" + - "3.\tGrass Beast.Beast: Vineratops\n" + - "4.\tElectric Beast.Beast: Voltchu\n" + - "5.\tEarth Beast.Beast: Zyuugor\n" + - "6.\tWind Beast.Beast: Pirrot\n" + - "7.\tFighting Beast.Beast: Gekuma\n" + - "8.\tPsychic Beast.Beast: Mindowl\n" + - "9.\tDark Beast.Beast: Shadefox\n" + - "10.\tSteel Beast.Beast: Mantiron\n"); - System.out.print("Choose your first character: "); - int character1 = sc.nextInt(); - System.out.print("Choose your second character: "); - int character2 = sc.nextInt(); - System.out.print("Choose your third character: "); - int character3 = sc.nextInt(); - System.out.print("Hello"); - } + // Game.Player Initialization + System.out.print("Enter your champion name: "); + String playerName = scanner.nextLine().trim(); + if (playerName.isEmpty()) { + playerName = "Champion"; + } + + Player player = new Player(playerName); + System.out.println("\nWelcome, " + playerName + "!"); + System.out.println("Preparing your journey...\n"); + System.out.println("[Press ENTER to continue]"); + scanner.nextLine(); + + // Story Manager Initialization + StoryManager storyManager = new StoryManager(player); + + // Introduction + storyManager.playIntroduction(); + + // Beast Selection + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ SELECT YOUR MECHA BEASTS ║"); + System.out.println("╚════════════════════════════════════════╝"); + + System.out.println("\nProfessor Ai-P: Choose 3 Mecha Beasts to accompany you!"); + System.out.println("Choose wisely - different types have advantages and weaknesses.\n"); + + List availableBeasts = MechaBeastFactory.getAllStarterBeasts(); + + // Display Beast Selection Table + System.out.println("┌────┬─────────────┬──────────┬──────┬───────┬───────┐"); + System.out.println("│ # │ Name │ Type │ HP │ Speed │ Mana │"); + System.out.println("├────┼─────────────┼──────────┼──────┼───────┼───────┤"); + + for (int i = 0; i < 8; i++) { + MechaBeast beast = availableBeasts.get(i); + System.out.printf("│ %-2d │ %-11s │ %-8s │ %-4d │ %-5d │ %-5d │%n", + (i + 1), + beast.getName(), + beast.getType().getDisplayName(), + beast.getMaxHp(), + beast.getSpeed(), + beast.getMaxMana() + ); + } + + System.out.println("│ 9 │ ??? │ ??? │ ???? │ ??? │ ??? │"); + System.out.println("└────┴─────────────┴──────────┴──────┴───────┴───────┘"); + + System.out.println("\n💡 TIP: Balance your team with different types!"); + System.out.println(" High HP = Tank | High Speed = First Strike | High Mana = Powerful Skills"); + System.out.println(" ⚠️ Option 9 is a hidden beast... try it if you dare!"); + + // Select 3 Beasts + { + System.out.println("\n╔══ SELECTION " + (1) + "/3 ══╗"); + System.out.print("Choose Mecha Beast " + (1) + " (1-8 or 9 for ???): "); + + int choice = -1; + while (choice < 1 || choice > 9) { + try { + String input = scanner.nextLine().trim(); + choice = Integer.parseInt(input); + if (choice < 1 || choice > 9) { + System.out.print("Please enter a number between 1 and 9: "); + } + } catch (NumberFormatException e) { + System.out.print("Invalid input. Please enter a number: "); + } + } + + MechaBeast selectedBeast = availableBeasts.get(choice - 1); + + if (choice == 9) { + System.out.println("\n⚠️ SECRET UNLOCKED! ⚠️"); + System.out.println("✓ Kingmantis (OVERPOWERED CHARACTER) added to your team!"); + System.out.println(" HP: " + selectedBeast.getMaxHp() + + " | Speed: " + selectedBeast.getSpeed() + + " | Mana: " + selectedBeast.getMaxMana()); + System.out.println(" This is a CHEAT beast with incredible stats!"); + } else { + System.out.println("✓ " + selectedBeast.getName() + " (" + + selectedBeast.getType().getDisplayName() + ") added to your team!"); + System.out.println(" HP: " + selectedBeast.getMaxHp() + + " | Speed: " + selectedBeast.getSpeed() + + " | Mana: " + selectedBeast.getMaxMana()); + } + + player.addMechaBeast(selectedBeast.copy()); + } + { + System.out.println("\n╔══ SELECTION " + (1 + 1) + "/3 ══╗"); + System.out.print("Choose Mecha Beast " + (1 + 1) + " (1-8 or 9 for ???): "); + + int choice = -1; + while (choice < 1 || choice > 9) { + try { + String input = scanner.nextLine().trim(); + choice = Integer.parseInt(input); + if (choice < 1 || choice > 9) { + System.out.print("Please enter a number between 1 and 9: "); + } + } catch (NumberFormatException e) { + System.out.print("Invalid input. Please enter a number: "); + } + } + + MechaBeast selectedBeast = availableBeasts.get(choice - 1); + + if (choice == 9) { + System.out.println("\n⚠️ SECRET UNLOCKED! ⚠️"); + System.out.println("✓ Kingmantis (OVERPOWERED CHARACTER) added to your team!"); + System.out.println(" HP: " + selectedBeast.getMaxHp() + + " | Speed: " + selectedBeast.getSpeed() + + " | Mana: " + selectedBeast.getMaxMana()); + System.out.println(" This is a CHEAT beast with incredible stats!"); + } else { + System.out.println("✓ " + selectedBeast.getName() + " (" + + selectedBeast.getType().getDisplayName() + ") added to your team!"); + System.out.println(" HP: " + selectedBeast.getMaxHp() + + " | Speed: " + selectedBeast.getSpeed() + + " | Mana: " + selectedBeast.getMaxMana()); + } + + player.addMechaBeast(selectedBeast.copy()); + } + { + System.out.println("\n╔══ SELECTION " + (2 + 1) + "/3 ══╗"); + System.out.print("Choose Mecha Beast " + (2 + 1) + " (1-8 or 9 for ???): "); + + int choice = -1; + while (choice < 1 || choice > 9) { + try { + String input = scanner.nextLine().trim(); + choice = Integer.parseInt(input); + if (choice < 1 || choice > 9) { + System.out.print("Please enter a number between 1 and 9: "); + } + } catch (NumberFormatException e) { + System.out.print("Invalid input. Please enter a number: "); + } + } + + MechaBeast selectedBeast = availableBeasts.get(choice - 1); + + if (choice == 9) { + System.out.println("\n⚠️ SECRET UNLOCKED! ⚠️"); + System.out.println("✓ Kingmantis (OVERPOWERED CHARACTER) added to your team!"); + System.out.println(" HP: " + selectedBeast.getMaxHp() + " | Speed: " + selectedBeast.getSpeed() + + " | Mana: " + selectedBeast.getMaxMana()); + System.out.println(" This is a CHEAT beast with incredible stats!"); + } else { + System.out.println("✓ " + selectedBeast.getName() + " (" + + selectedBeast.getType().getDisplayName() + ") added to your team!"); + System.out.println(" HP: " + selectedBeast.getMaxHp() + " | Speed: " + selectedBeast.getSpeed() + + " | Mana: " + selectedBeast.getMaxMana()); + } + + player.addMechaBeast(selectedBeast.copy()); + } + + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ YOUR TEAM IS READY! ║"); + System.out.println("╚════════════════════════════════════════╝"); + + System.out.println("\nYour team:"); + for (int i = 0; i < player.getMechaBeasts().size(); i++) { + MechaBeast beast = player.getMechaBeasts().get(i); + System.out.printf("%d. %s (%s)%n", (i + 1), beast.getName(), beast.getType().getDisplayName()); + } + + System.out.println("\nProfessor Ai-P: Excellent choices! Now let's begin the test!"); + System.out.println("\n[Press ENTER to continue]"); + scanner.nextLine(); + + // Stage 1: Alpha Village + storyManager.playStage1AlphaVillage(); + + // Stage 2: Beta City + storyManager.playStage2BetaCity(); + + // Stage 3: The Collapse + storyManager.playStage3Collapse(); + + // Game Complete Display Statistics + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ FINAL STATISTICS ║"); + System.out.println("╚════════════════════════════════════════╝"); + + System.out.println("\nChampion: " + player.getName()); + System.out.println("\nYour Final Team:"); + for (int i = 0; i < player.getMechaBeasts().size(); i++) { + MechaBeast beast = player.getMechaBeasts().get(i); + String status; + if (beast.isAlive()) { + status = "✓ ALIVE"; + } else { + status = "✗ FAINTED"; + } + System.out.printf("%d. %-15s (%s) - %s%n", (i + 1), beast.getName(), beast.getType().getDisplayName(), status); + } + + System.out.println("\n╔════════════════════════════════════════╗"); + System.out.println("║ Stages Completed: 3/3 ║"); + System.out.println("║ Rank: LEGENDARY CHAMPION ║"); + System.out.println("║ Status: GAME SAVED ║"); + System.out.println("╚════════════════════════════════════════╝"); + + System.out.println("\nThank you for testing DigiWorld!"); + System.out.println("Your feedback will help shape the future of gaming!"); + + } } \ No newline at end of file From f2ed309b924c6059b8525bd7876b1062e292c444 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 22:10:18 +0800 Subject: [PATCH 5/8] cummit --- Main/.github/Combat.java | 13 ------ Main/Combat.java | 86 ++++++++++++++++++++++++++++++++++++++++ Main/Main.java | 5 ++- Main/MechaBeast.java | 12 +++++- Main/Player.java | 4 ++ Main/StoryManager.java | 48 +++++++++++++--------- 6 files changed, 134 insertions(+), 34 deletions(-) delete mode 100644 Main/.github/Combat.java create mode 100644 Main/Combat.java diff --git a/Main/.github/Combat.java b/Main/.github/Combat.java deleted file mode 100644 index 18e9f86..0000000 --- a/Main/.github/Combat.java +++ /dev/null @@ -1,13 +0,0 @@ -package Main; - -public class Combat { - //Battle mechanics - - //Damage calculations - - //Battle UI - - //Victory/defeat conditions - - //Skill cooldown and mana management -} \ No newline at end of file diff --git a/Main/Combat.java b/Main/Combat.java new file mode 100644 index 0000000..bcc5b4e --- /dev/null +++ b/Main/Combat.java @@ -0,0 +1,86 @@ +package Main; +import java.util.Random; +import java.util.Scanner; + +public class Combat { + // initialize participants + private MechaBeast player; + private MechaBeast enemy; + private boolean playerWon; + + private Scanner sc = new Scanner(System.in); + private Random rand = new Random(); + + public Combat(MechaBeast player, MechaBeast enemy) { + this.player = player; + this.enemy = enemy; + } + + public boolean getOutcome() { + return playerWon; + } + + //Battle mechanics + public void begin() { + System.out.println("\n ╔════════════════════════════════════════╗"); + System.out.println("║ BATTLE START ║"); + System.out.println("╚════════════════════════════════════════╝"); + + int round = 1; + while (player.isAlive() && enemy.isAlive()) { + System.out.println("\n=== ROUND " + round++ + "! ==="); + playerTurn(); + if (!enemy.isAlive()) { + break; + } + enemyTurn(); + if (!player.isAlive()) { + break; + } + }ss + + checkOutcome(); + } + + //Damage calculations + private int calculateDamage(MechaBeast attacker, MechaBeast defender) { + // example ra ni since wla pay skills + int minPower = 500, maxPower = 1000; + int baseDamage = rand.nextInt(maxPower - minPower + 1) + minPower; + double mult = attacker.getType().getEffectivenessAgainst(defender.getType()); + + return (int) (baseDamage * mult); + } + + //Battle UIs + private void playerTurn() { + System.out.println("\nYOUR BEAST!"); + + takeDamage(enemy, calculateDamage(player, enemy)); + + } + + private void enemyTurn() { + System.out.println("\nENEMY'S TURN!"); + int randomSkill = rand.nextInt(3) + 1; // 1–3 + } + + public void takeDamage(MechaBeast beast, int damage) { + beast.setCurrentHp(beast.getCurrentHp() - damage); + System.out.println(beast.getName() + " took " + damage + " damage! (HP: " + beast.getCurrentHp() + "/" + beast.getMaxHp() + ")"); + if (beast.getCurrentHp() < 0) { + beast.setCurrentHp(0); + } +} + + + //Victory/defeat conditions + private void checkOutcome() { + if (player.isAlive()) { + playerWon = true; + } else { + playerWon = false; + } + } + + //Skill cooldown and mana management diff --git a/Main/Main.java b/Main/Main.java index 60d70a5..4b7b1a8 100644 --- a/Main/Main.java +++ b/Main/Main.java @@ -33,6 +33,7 @@ public static void main(String[] args) { // Introduction storyManager.playIntroduction(); + /* // Beast Selection System.out.println("\n╔════════════════════════════════════════╗"); System.out.println("║ SELECT YOUR MECHA BEASTS ║"); @@ -43,6 +44,7 @@ public static void main(String[] args) { List availableBeasts = MechaBeastFactory.getAllStarterBeasts(); + // Display Beast Selection Table System.out.println("┌────┬─────────────┬──────────┬──────┬───────┬───────┐"); System.out.println("│ # │ Name │ Type │ HP │ Speed │ Mana │"); @@ -179,12 +181,13 @@ public static void main(String[] args) { System.out.println("║ YOUR TEAM IS READY! ║"); System.out.println("╚════════════════════════════════════════╝"); + System.out.println("\nYour team:"); for (int i = 0; i < player.getMechaBeasts().size(); i++) { MechaBeast beast = player.getMechaBeasts().get(i); System.out.printf("%d. %s (%s)%n", (i + 1), beast.getName(), beast.getType().getDisplayName()); } - + */ System.out.println("\nProfessor Ai-P: Excellent choices! Now let's begin the test!"); System.out.println("\n[Press ENTER to continue]"); scanner.nextLine(); diff --git a/Main/MechaBeast.java b/Main/MechaBeast.java index ed57d26..ddc749a 100644 --- a/Main/MechaBeast.java +++ b/Main/MechaBeast.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -public class MechaBeast { +public class MechaBeast { private final String name; private final ElementType type; private final String henshin; @@ -32,6 +32,14 @@ public void addSkill(Skill skill) { } } + // setter & getter for currentHp (since no Skill class yet) + public void setCurrentHp(int hp) { + this.currentHp = hp; + } + public int getCurrentHp() { + return currentHp; + } + public String getName() { return name; } @@ -153,6 +161,8 @@ public double getEffectivenessAgainst(ElementType defenderType) { if (defenderType == DARK || defenderType == ELECTRIC) return 2.0; if (defenderType == FIRE || defenderType == EARTH) return 0.5; break; + default: + break; } return 1.0; diff --git a/Main/Player.java b/Main/Player.java index bf0fd30..2576098 100644 --- a/Main/Player.java +++ b/Main/Player.java @@ -29,6 +29,10 @@ public List getMechaBeasts() { return mechaBeasts; } + public MechaBeast getActiveBeast() { + return mechaBeasts.get(0); // For simplicity, always return the first beast + } + //progression //Player.Player statistics diff --git a/Main/StoryManager.java b/Main/StoryManager.java index 3260e4c..22e304c 100644 --- a/Main/StoryManager.java +++ b/Main/StoryManager.java @@ -107,17 +107,19 @@ public void playStage1AlphaVillage() { System.out.println("You encountered a Mecha Beast!"); // Tutorial battle sequence - //condition if madaug sa tutorial - /* + // Initialize player's MechaBeast to Kingmantis + Combat fight = new Combat(MechaBeastFactory.createKingmantis(), MechaBeastFactory.createVineratops()); - if () { + fight.begin(); + + if (fight.getOutcome()) { System.out.println("\nAnnouncer: You have successfully completed the tutorial."); System.out.println("You may now continue."); System.out.println(player.getName() + " (catching breath): That... felt too real."); playAlphaBossBattle(); } - */ + } @@ -139,10 +141,13 @@ private void playAlphaBossBattle() { pressEnterToContinue(); System.out.println("\nBoss battle begins..."); + // Alpha Boss Battle - //condition if madaug sa alpha boss - /* - if () { + Combat fight = new Combat(MechaBeastFactory.createKingmantis(), MechaBeastFactory.createGekuma()); + + fight.begin(); + + if (fight.getOutcome()) { System.out.println("\nAltair falls to one knee..."); System.out.println(); System.out.println("Altair (breathing heavily): You... you lack bond with your beasts,"); @@ -223,9 +228,11 @@ private void playAceTrainerBattle() { pressEnterToContinue(); // Ace Trainer Battle - //condition if madaug sa ace jazz - /* - if () { + Combat fight = new Combat(MechaBeastFactory.createKingmantis(), MechaBeastFactory.createPirrot()); + + fight.begin(); + + if (fight.getOutcome()) { System.out.println("\nAce Jazz: You've surpassed us all. Take this Challenge Ticket,"); System.out.println("you've earned it. With it, you're worthy of the Tournament Trial."); System.out.println(); @@ -234,7 +241,7 @@ private void playAceTrainerBattle() { System.out.println("You may now attempt the Tournament Trial!"); pressEnterToContinue(); } - */ + } @@ -263,9 +270,11 @@ private void playTournamentTrial() { pressEnterToContinue(); // Tournament Trial Battle - //condition if madaug sa trialmaster - /* - if () { + Combat fight = new Combat(MechaBeastFactory.createKingmantis(), MechaBeastFactory.createVoltchu()); + + fight.begin(); + + if (fight.getOutcome()) { System.out.println("\nTrialmaster: You have beaten me. You are qualified for the tournament!"); System.out.println("And I suppose I'll answer some of your questions."); System.out.println(); @@ -290,7 +299,7 @@ private void playTournamentTrial() { pressEnterToContinue(); } - */ + } public void playStage3Collapse() { @@ -348,13 +357,14 @@ private void playFinalBoss() { System.out.println("╚════════════════════════════════════════╝"); // Final Glitch Battle - //condition if madaug sa final boss - /* - if () { + Combat fight = new Combat(MechaBeastFactory.createKingmantis(), MechaBeastFactory.createWoltrix()); + + fight.begin(); + + if (fight.getOutcome()) { playEnding(); } - */ } private void playEnding() { From d9e20741badadfa208b74e5925b9496165a962d3 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 22:10:41 +0800 Subject: [PATCH 6/8] c --- Main/Combat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main/Combat.java b/Main/Combat.java index bcc5b4e..a0ef84b 100644 --- a/Main/Combat.java +++ b/Main/Combat.java @@ -37,7 +37,7 @@ public void begin() { if (!player.isAlive()) { break; } - }ss + } checkOutcome(); } From a406cb17c229982f13568b62f491050ff97a87f4 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 22:13:18 +0800 Subject: [PATCH 7/8] c --- Main/Combat.java | 6 ++---- Main/StoryManager.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Main/Combat.java b/Main/Combat.java index a0ef84b..f2b3b56 100644 --- a/Main/Combat.java +++ b/Main/Combat.java @@ -1,6 +1,5 @@ package Main; import java.util.Random; -import java.util.Scanner; public class Combat { // initialize participants @@ -8,7 +7,6 @@ public class Combat { private MechaBeast enemy; private boolean playerWon; - private Scanner sc = new Scanner(System.in); private Random rand = new Random(); public Combat(MechaBeast player, MechaBeast enemy) { @@ -55,14 +53,13 @@ private int calculateDamage(MechaBeast attacker, MechaBeast defender) { //Battle UIs private void playerTurn() { System.out.println("\nYOUR BEAST!"); - takeDamage(enemy, calculateDamage(player, enemy)); } private void enemyTurn() { System.out.println("\nENEMY'S TURN!"); - int randomSkill = rand.nextInt(3) + 1; // 1–3 + takeDamage(enemy, calculateDamage(player, enemy)); } public void takeDamage(MechaBeast beast, int damage) { @@ -84,3 +81,4 @@ private void checkOutcome() { } //Skill cooldown and mana management +} \ No newline at end of file diff --git a/Main/StoryManager.java b/Main/StoryManager.java index 22e304c..84afc70 100644 --- a/Main/StoryManager.java +++ b/Main/StoryManager.java @@ -169,7 +169,7 @@ private void playAlphaBossBattle() { playStage1Ending(); } - */ + } private void playStage1Ending() { From 4394864aa2004e6967e1cb46b3d36b0394232892 Mon Sep 17 00:00:00 2001 From: igitgud33 Date: Tue, 7 Oct 2025 22:16:29 +0800 Subject: [PATCH 8/8] c --- Main/Main.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main/Main.java b/Main/Main.java index 4b7b1a8..f325466 100644 --- a/Main/Main.java +++ b/Main/Main.java @@ -33,7 +33,7 @@ public static void main(String[] args) { // Introduction storyManager.playIntroduction(); - /* + // Beast Selection System.out.println("\n╔════════════════════════════════════════╗"); System.out.println("║ SELECT YOUR MECHA BEASTS ║"); @@ -187,7 +187,7 @@ public static void main(String[] args) { MechaBeast beast = player.getMechaBeasts().get(i); System.out.printf("%d. %s (%s)%n", (i + 1), beast.getName(), beast.getType().getDisplayName()); } - */ + System.out.println("\nProfessor Ai-P: Excellent choices! Now let's begin the test!"); System.out.println("\n[Press ENTER to continue]"); scanner.nextLine();