Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from BEAN-Tastic/juice
Browse files Browse the repository at this point in the history
Juice
  • Loading branch information
SamanthaVS-BBD authored Mar 14, 2024
2 parents ca35763 + 7395a79 commit 9ce539b
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 38 deletions.
6 changes: 5 additions & 1 deletion src/main/java/com/beantastic/Dialogue.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ public String getEnemyDeathDialogue(){
}

public String getRizzDialogue(){
int randomNumber = random.nextInt(5);
int randomNumber = random.nextInt(7);

return switch (randomNumber) {
case 0 -> "Are you a bean? Because you've bean on my mind all day.";
case 1 -> "Are you a coffee bean? Because you're brewing something strong in me.";
case 2 -> "Are you a refried bean? Because you're heating up my world";
case 3 -> "I peed my pants, can I get in yours?";
case 4 -> "You look like trash! Let me take you out";
case 5 -> "Do you work at Subway? Cause you just gave me a foot-long.";
case 6 -> "You slut drop holding eye contact";
default -> "Did you just fart? Because you blew me away!";
};
}
Expand All @@ -110,4 +112,6 @@ public String enemyIntroduction(int randomNum){
default -> "You hear something behind you....";
};
}


}
70 changes: 61 additions & 9 deletions src/main/java/com/beantastic/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public static void main(String[] args) throws IOException, InterruptedException
Scanner scanner = new Scanner(System.in);
Logger logger = new Logger(System.out);

printBean(logger);
ApitController apitController = new ApitController(accessToken);

LoadingAnimation(logger);
List<PlayerClass> playerClasses = apitController.getClasses();
PlayerManager playerManager = new PlayerManager(logger, scanner, playerClasses);

Expand Down Expand Up @@ -113,15 +115,6 @@ public static EnemyManager addEnemies(Random random) {
}

public boolean startGame() {
logger.println("""
____ _ _ _ _ _ \s
| _ \\ | | | | (_) /\\ | | | | \s
| |_) | ___ __ _ _ __ ______| |_ __ _ ___| |_ _ ___ / \\ __| |_ _____ _ __ | |_ _ _ _ __ ___ \s
| _ < / _ \\/ _` | '_ \\______| __/ _` / __| __| |/ __| / /\\ \\ / _` \\ \\ / / _ \\ '_ \\| __| | | | '__/ _ \\\s
| |_) | __/ (_| | | | | | || (_| \\__ \\ |_| | (__ / ____ \\ (_| |\\ V / __/ | | | |_| |_| | | | __/\s
|____/ \\___|\\__,_|_| |_| \\__\\__,_|___/\\__|_|\\___| /_/ \\_\\__,_| \\_/ \\___|_| |_|\\__|\\__,_|_| \\___|\
""");
if (!getStartInput()) {
logger.writeln("What a loser!");
return false;
Expand Down Expand Up @@ -166,4 +159,63 @@ public boolean gameOver(boolean won) {
new ChoiceOption<>("No!", () -> false)));
return playAgain.getChoice().outcome().get();
}

public static void LoadingAnimation(Logger logger) {

logger.print("Loading");
for (int i = 0; i < 10; i++) {
logger.print(".");
try {
Thread.sleep(600);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
logger.print("\n\n\n\n");

}

public static void printBean(Logger logger){
logger.println( """
@@@
@@@@
@@@@@@@@@@@@@@ @@@@
@@@@@@@@@@@@@@@@@@@@ @@@@
@@@@@@@ @@@@@@@ @@@@@
@@@@@@ @@@@@ @@@@@
@@@@@ @@@@@ @@@@@
@@@@@ @@ @@ @@@@ @@@@@@
@@@@@ @@@@ @@@@ @@@@ @@@@@@
@@@@@ @@ @@ @@@@@ @@@@@@
@@@@ @@@@@ @@@@@@@
@@@@ @@@@@@@ @@@@@ @@@@@@@@@
@@@@ @@@@@ @@@@@@@@@
@@@@ @@@@ @@@@
@@@@@ @@@@ @@@@@@@@@@@@@
@@@@ @@@@ @@@@@@@@@@@@@
@@@@@ @@@@ @@@@
@@@@ @@@@ @@@@
@@@@ @@@@@ @@@@
@@@@ @@@@@
@@@@@ @@@@@
@@@@@ @@@@@@
@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@
@@@@ @@@@
@@@@ @@@@
@@@@@@ @@@@@@
@@@@@@ @@@@@
""");
logger.println("""
____ _ _ _ _ _ \s
| _ \\ | | | | (_) /\\ | | | | \s
| |_) | ___ __ _ _ __ ______| |_ __ _ ___| |_ _ ___ / \\ __| |_ _____ _ __ | |_ _ _ _ __ ___ \s
| _ < / _ \\/ _` | '_ \\______| __/ _` / __| __| |/ __| / /\\ \\ / _` \\ \\ / / _ \\ '_ \\| __| | | | '__/ _ \\\s
| |_) | __/ (_| | | | | | || (_| \\__ \\ |_| | (__ / ____ \\ (_| |\\ V / __/ | | | |_| |_| | | | __/\s
|____/ \\___|\\__,_|_| |_| \\__\\__,_|___/\\__|_|\\___| /_/ \\_\\__,_| \\_/ \\___|_| |_|\\__|\\__,_|_| \\___|\
""");

}
}
26 changes: 0 additions & 26 deletions src/main/java/com/beantastic/api/SecurityConfiguration.java

This file was deleted.

4 changes: 4 additions & 0 deletions src/main/java/com/beantastic/event/CombatSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private ItemClass attack(){
logger.writeln(dialogue.getAttackDialogue());
enemy.takeDamage(player.damage());
logger.writeln("You deal " + player.damage() + " damage");
logger.writeln("%1$s health is %2$s".format(enemy.getName(), enemy.health()));

if(enemy.isDead()){
logger.writeln(dialogue.getEnemyDeathDialogue());
Expand All @@ -73,6 +74,7 @@ private ItemClass attack(){
logger.writeln(enemy.getName());
logger.writeln(enemy.getAttackDialogue());
logger.writeln("You take " + enemy.damage() + " damage");
logger.writeln("Your health " + player.health());
player.takeDamage(enemy.damage());

if(player.isDead()) {
Expand All @@ -88,6 +90,7 @@ private ItemClass attack(){
private ItemClass rizz(){
logger.writeln("%s:\t%s".formatted(player.getName(), dialogue.getRizzDialogue()));
if(player.rizz() > enemy.rizz()){
logger.writeln(enemy.getName() + ": " + dialogue.getRizzDialogue());
return rizzOptions();
}else{
//you cant rizz up the enemy, and they do 1/2 damage
Expand Down Expand Up @@ -125,6 +128,7 @@ private ItemClass rizzAndRun () {

}
private ItemClass rizzMore () {
logger.writeln("Something comes over you, you cant hold in the rizz anymore");
logger.writeln(dialogue.getRizzDialogue());
logger.writeln("""
There is something in the air... %1$s starts to look irresistible
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/com/beantastic/event/JourneyStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ private void panic(Player player){
private void keepWalking(){
UserChoice<Void> choices = new UserChoice<>(scanner, logger, "You move forward, looking for a way out",
List.of(
new ChoiceOption<>("Keep walking forward.", () -> null),
new ChoiceOption<>("Look around.", () -> null)
new ChoiceOption<>("Keep walking forward.", () -> {
logger.writeln("You slowly start walking. unsure of your steps... Your little bean legs shakey...");
return null;
}),
new ChoiceOption<>("Look around.", () -> {
logger.writeln("You look around the dark eary floor, eveyrthing new and unfamiliar... You start slowly walking... ");
return null;
})
));
choices.getChoice().outcome().get();
}
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/beantastic/player/PlayerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ private PlayerClass pickClass() {
%1$s
Description: %2$s"""
.formatted(playerClass.getName(), playerClass.getDescription()), () -> playerClass)).toList());
if(playerClassUserChoice.getChoice().outcome().get() == classList.get(1)){
String message = "418 I'm a teapot - refused to brew coffee";
int length = message.length();
String border = "+" + "-".repeat(length + 2) + "+";

logger.writeln(border);
logger.writeln("| " + message + " |");
logger.writeln(border);
}
return playerClassUserChoice.getChoice().outcome().get();
}

Expand Down

0 comments on commit 9ce539b

Please sign in to comment.