Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 58 additions & 40 deletions src/main/java/event/Event01.java
Original file line number Diff line number Diff line change
@@ -1,70 +1,88 @@
package event;

/**
* This and all the other event classes handle specific scenes and buttons
*/

import main.GameManager;

/**
* This class handles events related to specific scenes and buttons.
*/
public class Event01 {

GameManager gm;
private GameManager gm;

public Event01(GameManager gm) {
this.gm = gm;
}

// TODO: "Hee-hee! Let's make a helper method for setting message and playing sound."
// This helps to avoid repeating the same code in different parts. Don't stop 'til you get enough!
private void setMessageAndPlaySE(String message, String soundEffect) {
gm.ui.messageText.setText(message); // Set the message text
if (soundEffect != null) {
gm.playSE(soundEffect); // Play the sound effect if there is one
}
}

// TODO: "Shamon! You look at Jeramiah, baby!"
// Here we update the message when you look at Jeramiah.
public void lookJeramiah() {
gm.ui.messageText.setText("This is your tall handsome roommate Jeramiah. (He works on cars. Specifically Hondas)");
setMessageAndPlaySE("This is your tall handsome roommate Jeramiah. (He works on cars. Specifically Hondas)", null);
}

// TODO: "Hee-hee! Jeramiah talks and makes a sound."
// Talking to Jeramiah and playing a sound.
public void talkJeramiah() {
gm.ui.messageText.setText("Did you hear that noise outside son?");
gm.playSE(gm.engineNoise);
setMessageAndPlaySE("Did you hear that noise outside son?", gm.engineNoise);
}
public void restJeramiah() {

if(gm.player.playerLife != gm.player.playerMaxLife) {
gm.ui.messageText.setText("Come here my baka! \n*You lay in Jeramiah's strong arms*\n(Your life has been recovered)");
gm.player.playerLife++;
gm.player.updatePlayerStatus();
gm.playSE(gm.heal);
gm.playSE(gm.awSound);
}
else{
gm.ui.messageText.setText("(Your life is full)");
gm.playSE(gm.cannotSound);

// TODO: "Hee-hee! Rest with Jeramiah, baby!"
// Checking if player needs healing and rest with Jeramiah.
public void restJeramiah() {
if (gm.player.playerLife == gm.player.playerMaxLife) {
// TODO: "You got full life, baby! No need to rest."
setMessageAndPlaySE("(Your life is full)", gm.cannotSound);
return; // Early exit since life is full, no need to continue.
}

// TODO: "Get healed up, baby! Jeramiah's got you!"
gm.player.playerLife++; // Heal the player by 1 point
gm.player.updatePlayerStatus(); // Update player status
setMessageAndPlaySE("Come here my baka! \n*You lay in Jeramiah's strong arms*\n(Your life has been recovered)", gm.heal);
gm.playSE(gm.awSound); // Play a sound when healing happens
}

// TODO: "You look at the flashlight, baby!"
// Look at the flashlight. Simple message.
public void lookFlashlight() {
gm.ui.messageText.setText("This is a flashlight");
setMessageAndPlaySE("This is a flashlight", null);
}
public void grabFlashlight() {
if(gm.player.hasFlashlight == 0) {
gm.player.hasFlashlight = 1;
gm.ui.messageText.setText("(You obtained a flashlight)");

gm.player.updatePlayerStatus();
gm.playSE(gm.flashlightSwitch);
}
else{
gm.ui.messageText.setText("(You already have a flashlight)");
gm.playSE(gm.cannotSound);
// TODO: "Shamon! Grab that flashlight, baby!"
// Grab the flashlight, but only if you don't already have one.
public void grabFlashlight() {
if (gm.player.hasFlashlight == 1) {
// TODO: "You already got the flashlight, don't need to grab it again!"
setMessageAndPlaySE("(You already have a flashlight)", gm.cannotSound);
return; // Early exit because the player already has the flashlight.
}

// TODO: "You got the flashlight, baby! Time to shine!"
gm.player.hasFlashlight = 1; // Mark that the player has the flashlight
gm.player.updatePlayerStatus(); // Update player status
setMessageAndPlaySE("(You obtained a flashlight)", gm.flashlightSwitch); // Play sound when obtaining
}
public void restFlashlight() {
if(gm.player.hasFlashlight == 1) {
gm.player.hasFlashlight = 0;
gm.ui.messageText.setText("*You rest the flashlight back on the bed*");

gm.player.updatePlayerStatus();
}
else{
gm.ui.messageText.setText("(You don't have a flashlight)");
gm.playSE(gm.cannotSound);
// TODO: "Rest the flashlight, baby. It's time to put it down."
// Resting the flashlight. You put it back on the bed.
public void restFlashlight() {
if (gm.player.hasFlashlight == 0) {
// TODO: "You don't have the flashlight, baby. Can't rest it!"
setMessageAndPlaySE("(You don't have a flashlight)", gm.cannotSound);
return; // Early exit because the player doesn't have the flashlight
}

// TODO: "Put the flashlight back on the bed, baby."
gm.player.hasFlashlight = 0; // Mark that the player no longer has the flashlight
gm.player.updatePlayerStatus(); // Update player status
setMessageAndPlaySE("*You rest the flashlight back on the bed*", null); // No sound, just message
}
}
39 changes: 25 additions & 14 deletions src/main/java/event/Event02.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,40 @@

public class Event02 {

GameManager gm;
private final GameManager gm;

// TODO: Hee-hee! The constructor is setting up the game manager. All good here.
public Event02(GameManager gm) {

this.gm = gm;
}

// TODO: Shamone! A helper method to set the message text. Makes it easier later, so we don't repeat ourselves.
private void setMessage(String message) {
gm.ui.messageText.setText(message);
}

// TODO: Hee-hee! This is where we search Honda 1. Let the player know that nothing sus is going on.
public void search1Honda() {
gm.ui.messageText.setText("Nothing sus here");
setMessage("Nothing sus here");
}

// TODO: Shamone! This is Honda search 2. OH MY GYAT the engine is missing. The player should be shocked.
public void search2Honda() {
gm.ui.messageText.setText("OH MY GYAT MY ENGINE IS MISSING");
setMessage("OH MY GYAT MY ENGINE IS MISSING");
}
public void restHonda() {
if(gm.player.playerLife != gm.player.playerMaxLife) {
gm.ui.messageText.setText("*You rest on the hood of your car*\n(Your life has been recovered)");
gm.player.playerLife++;
gm.player.updatePlayerStatus();
gm.playSE(gm.heal);
}
else{
gm.ui.messageText.setText("(Your life is full)");
gm.playSE(gm.cannotSound);

// TODO: Hoo! Time to rest on the car's hood. If the player’s life isn’t full, they should heal up.
public void restHonda() {
// TODO: Hee-hee! Check if the player’s life is less than the max. If so, let them rest and recover.
if (gm.player.playerLife < gm.player.playerMaxLife) {
setMessage("*You rest on the hood of your car*\n(Your life has been recovered)");
gm.player.playerLife++; // Hoo! Increase the player’s life by one.
gm.player.updatePlayerStatus(); // Hoo! Update the player’s stats after the rest.
gm.playSE(gm.heal); // Shamone! Play a sound effect for healing.
} else {
// TODO: Hee-hee! If the player’s life is already full, just let them know.
setMessage("(Your life is full)");
gm.playSE(gm.cannotSound); // Hoo! Play a sound effect when the player can't heal.
}
}
}
31 changes: 20 additions & 11 deletions src/main/java/event/Event03.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@

public class Event03 {

GameManager gm;
// TODO: Hee-hee! This is where we declare the GameManager! So we can call it later. Yaa!
private GameManager gm;

// TODO: Shamone! This is the constructor! It makes the Event03 class ready to use by getting the GameManager.
public Event03(GameManager gm) {

this.gm = gm;
}
public void lookHondaur() {
gm.ui.messageText.setText("Its a Hondaur");
}
public void talkHondaur() {
gm.ui.messageText.setText("The Hondaur growls at you and revs his engine ");
this.gm = gm; // TODO: Hoo! We're saving the GameManager for later use! It's like putting your gloves in your pocket, huh!
}
public void attackHondaur() {
gm.ui.messageText.setText("*You start beating the shit out of the poor Hondaur*");

// TODO: Hee-hee! This is the method where we can talk to the Hondaur, look at the Hondaur, or attack it. Just tell it what to do!
public void interactWithHondaur(String action) {
// TODO: Shamone! We’re checking what action you want to do, it’s like picking a dance move! Hoo!
switch (action.toLowerCase()) { // TODO: Shamone! We want to make sure the action is in the right form (lowercase), so we can do it!
case "look": // TODO: Hee-hee! Looking at the Hondaur, that's the first move, baby!
gm.ui.messageText.setText("It's a Hondaur"); // TODO: Hee-hee! Displaying message when you look at the Hondaur. That's the message!
break;
case "talk": // TODO: Shamone! When you talk to the Hondaur, you hear a growl. It's like a smooth sound from the King of Pop!
gm.ui.messageText.setText("The Hondaur growls at you and revs its engine"); // TODO: Hoo! It's revving its engine – that's like music to your ears!
break;
case "attack": // TODO: Hoo! When you attack, the beat drops! You start punching!
gm.ui.messageText.setText("*You start beating the shit out of the poor Hondaur*"); // TODO: Hee-hee! You hit it hard – like a thriller night!
break;
default: // TODO: Shamone! What if the action isn't recognized? We’ve got to tell 'em what's up!
gm.ui.messageText.setText("Unknown action"); // TODO: Hee-hee! If they don’t know what to do, we let them know!
}
}
}
53 changes: 30 additions & 23 deletions src/main/java/event/Event04.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,46 @@

public class Event04 {

GameManager gm;
private final GameManager gm; // TODO: You got it! Declare gm as a final variable to prevent changes.

// TODO: The constructor sets up the GameManager (gm). It’s like a smooth criminal, handling things!
public Event04(GameManager gm) {
this.gm = gm; // TODO: You rock! We're setting the gm from the outside. Let's keep it strong, no changes allowed!
}

this.gm = gm;
// TODO: This method shows a message on screen, like a popstar showing up on stage! And it plays a sound.
private void showMessage(String message, String sound) {
gm.ui.messageText.setText(message); // TODO: Get the message to the player. They need to know what’s going down!
if (sound != null) {
gm.playSE(sound); // TODO: If there's a sound, let's play it! Don’t leave them hanging.
}
}

// TODO: When you look at Denzel, you're seeing the man, the myth, the legend. Let's show it!
public void lookDenzel() {
gm.ui.messageText.setText("This is Denzel. (He listens to Valorant music)");
showMessage("This is Denzel. (He listens to Valorant music)", null); // TODO: Just a message, no sound needed. We’re chill.
}
public void talkDenzel() {
if(gm.player.hasPistol == 0) {
gm.player.hasPistol = 1;
gm.ui.messageText.setText("My oh my I've been waiting for you heh. Here's a glock.\nI saw a monster running with an engine towards the casino!");

gm.player.updatePlayerStatus();
gm.playSE(gm.reload);
}
else{
gm.ui.messageText.setText("(You already have a glock)");
gm.playSE(gm.cannotSound);
// TODO: When talking to Denzel, if you don’t have a pistol, he’s got your back like a true friend.
public void talkDenzel() {
if (gm.player.hasPistol == 0) { // TODO: Uh oh! You don’t have a pistol. Time to change that!
gm.player.hasPistol = 1; // TODO: Here comes the glock! Denzel’s making sure you’re ready for the ride.
showMessage("My oh my I've been waiting for you heh. Here's a glock.\nI saw a monster running with an engine towards the casino!", gm.reload); // TODO: Give ‘em the glock and a message with the reload sound, baby!
gm.player.updatePlayerStatus(); // TODO: Update the player’s status like you just beat it!
} else { // TODO: You already got a pistol, don’t need no more.
showMessage("(You already have a glock)", gm.cannotSound); // TODO: Play the "nope" sound. You don’t get another one, buddy.
}
}

// TODO: When you rest, Denzel gives you a hug! You’ll be feeling fine, like you just can’t stop!
public void restDenzel() {
if(gm.player.playerLife != gm.player.playerMaxLife) {
gm.ui.messageText.setText("(Denzel has been lonely without his girlfriend)\n*Denzel runs up to you unexpectedly and gives you a hug*\n(Your life has been recovered)");
gm.player.playerLife++;
gm.player.updatePlayerStatus();
gm.playSE(gm.heal);
gm.playSE(gm.awSound);
}
else {
gm.ui.messageText.setText("(Your life is full)");
gm.playSE(gm.cannotSound);
if (gm.player.playerLife < gm.player.playerMaxLife) { // TODO: If your life is low, Denzel’s here to help.
gm.player.playerLife++; // TODO: Let’s heal you up, like a smooth dance move. One more life for you!
gm.player.updatePlayerStatus(); // TODO: Update your status after getting healed. We’re good to go!
showMessage("(Denzel has been lonely without his girlfriend)\n*Denzel runs up to you unexpectedly and gives you a hug*\n(Your life has been recovered)", gm.heal); // TODO: Give the hug and play the healing sound! It’s all love, baby!
gm.playSE(gm.awSound); // TODO: And the "aww" sound because who doesn’t love a hug from Denzel?
} else { // TODO: If you’re already at full life, we can’t heal you no more.
showMessage("(Your life is full)", gm.cannotSound); // TODO: Play the sound of "no healing" – too good to heal, you’re shining.
}
}
}
71 changes: 39 additions & 32 deletions src/main/java/event/Event05.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,58 @@

public class Event05 {

GameManager gm;
private GameManager gm;

public Event05(GameManager gm) {
this.gm = gm; // TODO: This line links the Event05 class with the GameManager. We need this to talk to other parts of the game, like the player's info.
}

// TODO: Let's create a method to check if the monsters are defeated. This will make things smoother for us later. Hee-hee!
private boolean areMonstersDefeated() {
return gm.theodoor.currentLife == 0 && gm.wheeler.currentLife == 0; // TODO: This checks if the monsters are already dead, like Thriller!
}

this.gm = gm;
// TODO: Here we centralize our message, so we don't have to repeat it everywhere. Don't stop 'til you get enough!
private void showMessage(String message) {
gm.ui.messageText.setText(message); // TODO: We're setting the message text here for the player to see, just like a smooth criminal!
}

public void lookHondaTrunk() {
if(gm.player.hasPistol == 1){
gm.ui.messageText.setText("IS THAT BRIAN FROM MARAUDER CODED!");
}
else{
gm.ui.messageText.setText("(You see Brian's dead body)");
if (gm.player.hasPistol == 1) { // TODO: Check if the player has a pistol. If they do, we get a cool message.
showMessage("IS THAT BRIAN FROM MARAUDER CODED!"); // TODO: We show a cool message if they have the pistol. Shamone!
} else {
showMessage("(You see Brian's dead body)"); // TODO: If they don't have a pistol, just show the dead body. Bad!
}
}

public void talkHondaTrunk() {
if(gm.theodoor.currentLife==0 && gm.wheeler.currentLife==0) {
if(gm.player.hasPistol == 1){
gm.ui.messageText.setText("Eughh Please... save... Julien and please end my misery");
}
else{
gm.ui.messageText.setText("(Brian is already dead!)");
}
if (!areMonstersDefeated()) { // TODO: If the monsters are still alive, we can't do anything. It's like trying to beat it when you're not ready. Woo!
showMessage("You must defeat the monsters first!"); // TODO: Tell the player to defeat the monsters before proceeding. Don't stop 'til you get enough!
gm.playSE(gm.cannotSound); // TODO: Play a sound effect to tell them they can't do it yet. Shamone!
return; // TODO: Exit the method here if monsters are alive, like a smooth criminal. Hee-hee!
}
else{
gm.ui.messageText.setText("You must defeat the monsters first!");
gm.playSE(gm.cannotSound);

if (gm.player.hasPistol == 1) { // TODO: If the player has a pistol, they can interact with Brian. It's a thriller night!
showMessage("Eughh Please... save... Julien and please end my misery"); // TODO: Brian needs help, and the player has a pistol to save him. Hoo!
} else {
showMessage("(Brian is already dead!)"); // TODO: If they don't have a pistol, Brian is already gone. Bad!
}
}
public void killHondaTrunk() {

if(gm.theodoor.currentLife == 0 && gm.wheeler.currentLife == 0) {
if(gm.player.hasPistol == 1){
gm.playSE(gm.pistolShot);
gm.ui.messageText.setText("(You ended Brian's misery)");
}
else{
gm.ui.messageText.setText("(You already ended his misery!)");
}
gm.player.hasPistol = 0;
gm.player.updatePlayerStatus();
}
else{
gm.ui.messageText.setText("You must defeat the monsters first!");
gm.playSE(gm.cannotSound);
public void killHondaTrunk() {
if (!areMonstersDefeated()) { // TODO: Again, check if the monsters are alive. You can't do this if they're still out there, hee-hee!
showMessage("You must defeat the monsters first!"); // TODO: Show the message telling the player to defeat the monsters. Hoo!
gm.playSE(gm.cannotSound); // TODO: Play the "can't do it yet" sound effect. Shamone!
return; // TODO: Exit early if the monsters are alive. It's just a bad, bad situation!
}

if (gm.player.hasPistol == 1) { // TODO: If the player has a pistol, they can end Brian's suffering. Woo!
gm.playSE(gm.pistolShot); // TODO: Play the sound of the pistol shot to end Brian's misery. Hoo!
showMessage("(You ended Brian's misery)"); // TODO: Display the message that they ended Brian's misery. Hee-hee!
gm.player.hasPistol = 0; // TODO: After using the pistol, make sure to update the player's status. The way you make me feel!
gm.player.updatePlayerStatus(); // TODO: Update the player's status in the game to reflect that they used the pistol. Shamone!
} else {
showMessage("(You already ended his misery!)"); // TODO: If the player doesn't have a pistol, show that they've already ended Brian's misery. Don't stop 'til you get enough!
}
}
}
Loading