From f936c7c988edcdfe19b20745fefb4a7cac37ba40 Mon Sep 17 00:00:00 2001 From: Logan <60761520+Preloading@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:34:50 -0700 Subject: [PATCH] Add proper lose message, and fix me forgeting to program a part --- src/components/Game/InGame/ChooseOptions.vue | 30 +++++++++---------- .../Host/InGame/HostDeathmatchTourment.vue | 20 ++++++------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/components/Game/InGame/ChooseOptions.vue b/src/components/Game/InGame/ChooseOptions.vue index 8f39fda..4a558d4 100644 --- a/src/components/Game/InGame/ChooseOptions.vue +++ b/src/components/Game/InGame/ChooseOptions.vue @@ -169,26 +169,26 @@ let statusText = computed(() => { } if (match.data.value.winner == 1) { if (match.data.value.flippedCoin) { - return "coinflipped and won against"; + return " coinflipped and someone won "; } - return outcomes[match.data.value.player1choice -1].title.charAt(0).toUpperCase() + - outcomes[match.data.value.player1choice -1].title.slice(1) + " " + - outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb[0] + " " + - outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() + - outcomes[match.data.value.player2choice -1].title.slice(1) + " " + - outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb.slice(1).join(' '); + return outcomes[match.data.value.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option + outcomes[match.data.value.player1choice -1].title.slice(1) + " " + + outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb[0] + " " + // Gets the verb from player 1 beating player 2 + outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option + outcomes[match.data.value.player2choice -1].title.slice(1) + " " + + outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb.slice(1).join(' '); // Puts in any remaining verbs } else if (match.data.value.winner == 2) { if (match.data.value.flippedCoin) { - return "coinflipped and lost against" + return " coinflipped and someone won " } - return outcomes[match.data.value.player1choice].title.charAt(0).toUpperCase() + - outcomes[match.data.value.player1choice -1].title.slice(1) + " " + - outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb[0] + " " + - outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() + - outcomes[match.data.value.player2choice -1].title.slice(1) + " " + - outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb.slice(1).join(' '); + return outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option + outcomes[match.data.value.player2choice -1].title.slice(1) + " " + + outcomes[match.data.value.player2choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player1choice).verb[0] + " " + // Gets the verb from player 2 beating player 1 + outcomes[match.data.value.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option + outcomes[match.data.value.player1choice -1].title.slice(1) + " " + + outcomes[match.data.value.player2choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player1choice).verb.slice(1).join(' '); // Puts in any remaining verbs } else { return "VS." } @@ -255,7 +255,7 @@ onMounted(async () => { console.log(2) if (opponentPlayerId == null) { // TODO: handle loss, this could also mean worse if they are still in. - alert("you loose ig") + alert("You lost (or I couldn't find the match). Please don't press OK if you lost (it will enter a bugged state) but if you are still in, press ok. This screen exists because I didn't have time to make a proper loss screen, nor proper lose logic.") } else { console.log(3) diff --git a/src/components/Host/InGame/HostDeathmatchTourment.vue b/src/components/Host/InGame/HostDeathmatchTourment.vue index f1e83b6..d4920a3 100644 --- a/src/components/Host/InGame/HostDeathmatchTourment.vue +++ b/src/components/Host/InGame/HostDeathmatchTourment.vue @@ -322,23 +322,23 @@ function getComputedMatchStatus(match) { return "coinflipped and won against"; } - return outcomes[match.player1choice -1].title.charAt(0).toUpperCase() + + return outcomes[match.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option outcomes[match.player1choice -1].title.slice(1) + " " + - outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb[0] + " " + - outcomes[match.player2choice -1].title.charAt(0).toUpperCase() + + outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb[0] + " " + // Gets the verb from player 1 beating player 2 + outcomes[match.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option outcomes[match.player2choice -1].title.slice(1) + " " + - outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb.slice(1).join(' '); + outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb.slice(1).join(' '); // Puts in any remaining verbs } else if (match.winner == 2) { if (match.flippedCoin) { return "coinflipped and lost against" } - return outcomes[match.player1choice].title.charAt(0).toUpperCase() + - outcomes[match.player1choice -1].title.slice(1) + " " + - outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb[0] + " " + - outcomes[match.player2choice -1].title.charAt(0).toUpperCase() + - outcomes[match.player2choice -1].title.slice(1) + " " + - outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb.slice(1).join(' '); + return outcomes[match.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option + outcomes[match.player2choice -1].title.slice(1) + " " + + outcomes[match.player2choice -1].compares.find((e) => e.other_gesture_id == match.player1choice).verb[0] + " " + // Gets the verb from player 2 beating player 1 + outcomes[match.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option + outcomes[match.player1choice -1].title.slice(1) + " " + + outcomes[match.player2choice -1].compares.find((e) => e.other_gesture_id == match.player1choice).verb.slice(1).join(' '); // Puts in any remaining verbs } else { return "VS." }