Skip to content

Commit f936c7c

Browse files
committed
Add proper lose message, and fix me forgeting to program a part
1 parent 262e8f2 commit f936c7c

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/components/Game/InGame/ChooseOptions.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,26 @@ let statusText = computed(() => {
169169
}
170170
if (match.data.value.winner == 1) {
171171
if (match.data.value.flippedCoin) {
172-
return "coinflipped and won against";
172+
return " coinflipped and someone won ";
173173
}
174174
175-
return outcomes[match.data.value.player1choice -1].title.charAt(0).toUpperCase() +
176-
outcomes[match.data.value.player1choice -1].title.slice(1) + " " +
177-
outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb[0] + " " +
178-
outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() +
179-
outcomes[match.data.value.player2choice -1].title.slice(1) + " " +
180-
outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb.slice(1).join(' ');
175+
return outcomes[match.data.value.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option
176+
outcomes[match.data.value.player1choice -1].title.slice(1) + " " +
177+
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
178+
outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option
179+
outcomes[match.data.value.player2choice -1].title.slice(1) + " " +
180+
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
181181
} else if (match.data.value.winner == 2) {
182182
if (match.data.value.flippedCoin) {
183-
return "coinflipped and lost against"
183+
return " coinflipped and someone won "
184184
}
185185
186-
return outcomes[match.data.value.player1choice].title.charAt(0).toUpperCase() +
187-
outcomes[match.data.value.player1choice -1].title.slice(1) + " " +
188-
outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb[0] + " " +
189-
outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() +
190-
outcomes[match.data.value.player2choice -1].title.slice(1) + " " +
191-
outcomes[match.data.value.player1choice -1].compares.find((e) => e.other_gesture_id == match.data.value.player2choice).verb.slice(1).join(' ');
186+
return outcomes[match.data.value.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option
187+
outcomes[match.data.value.player2choice -1].title.slice(1) + " " +
188+
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
189+
outcomes[match.data.value.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option
190+
outcomes[match.data.value.player1choice -1].title.slice(1) + " " +
191+
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
192192
} else {
193193
return "VS."
194194
}
@@ -255,7 +255,7 @@ onMounted(async () => {
255255
console.log(2)
256256
if (opponentPlayerId == null) {
257257
// TODO: handle loss, this could also mean worse if they are still in.
258-
alert("you loose ig")
258+
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.")
259259
} else {
260260
console.log(3)
261261

src/components/Host/InGame/HostDeathmatchTourment.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,23 @@ function getComputedMatchStatus(match) {
322322
return "coinflipped and won against";
323323
}
324324
325-
return outcomes[match.player1choice -1].title.charAt(0).toUpperCase() +
325+
return outcomes[match.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option
326326
outcomes[match.player1choice -1].title.slice(1) + " " +
327-
outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb[0] + " " +
328-
outcomes[match.player2choice -1].title.charAt(0).toUpperCase() +
327+
outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb[0] + " " + // Gets the verb from player 1 beating player 2
328+
outcomes[match.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option
329329
outcomes[match.player2choice -1].title.slice(1) + " " +
330-
outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb.slice(1).join(' ');
330+
outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb.slice(1).join(' '); // Puts in any remaining verbs
331331
} else if (match.winner == 2) {
332332
if (match.flippedCoin) {
333333
return "coinflipped and lost against"
334334
}
335335
336-
return outcomes[match.player1choice].title.charAt(0).toUpperCase() +
337-
outcomes[match.player1choice -1].title.slice(1) + " " +
338-
outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb[0] + " " +
339-
outcomes[match.player2choice -1].title.charAt(0).toUpperCase() +
340-
outcomes[match.player2choice -1].title.slice(1) + " " +
341-
outcomes[match.player1choice -1].compares.find((e) => e.other_gesture_id == match.player2choice).verb.slice(1).join(' ');
336+
return outcomes[match.player2choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 2's option
337+
outcomes[match.player2choice -1].title.slice(1) + " " +
338+
outcomes[match.player2choice -1].compares.find((e) => e.other_gesture_id == match.player1choice).verb[0] + " " + // Gets the verb from player 2 beating player 1
339+
outcomes[match.player1choice -1].title.charAt(0).toUpperCase() + // Gets the capitalized name of player 1's option
340+
outcomes[match.player1choice -1].title.slice(1) + " " +
341+
outcomes[match.player2choice -1].compares.find((e) => e.other_gesture_id == match.player1choice).verb.slice(1).join(' '); // Puts in any remaining verbs
342342
} else {
343343
return "VS."
344344
}

0 commit comments

Comments
 (0)