Fix : sacrifice in Discard
This commit is contained in:
@@ -279,6 +279,7 @@ export class TurnController {
|
||||
CardEffects.RESTACK_DISCARDED_ACTION,
|
||||
CardEffects.RESTACK_DISCARDED_CARD,
|
||||
CardEffects.RESTACK_DISCARDED_CHAMPION,
|
||||
CardEffects.SACRIFICE,
|
||||
];
|
||||
|
||||
let targetCard: Card;
|
||||
@@ -302,6 +303,12 @@ export class TurnController {
|
||||
);
|
||||
}
|
||||
|
||||
if (!targetCard && token.effect == CardEffects.SACRIFICE) {
|
||||
targetCard = currentPlayer.board.cards.find((c) =>
|
||||
c._id.equals(useTokenDto.cardId),
|
||||
);
|
||||
}
|
||||
|
||||
if (token.effect != CardEffects.DRAW_AND_DISCARD) {
|
||||
if (currentPlayer.discardMarkers || currentPlayer.fuckUMarkers) {
|
||||
throw new HttpException(
|
||||
|
||||
@@ -8,6 +8,7 @@ import mongoose from 'mongoose';
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
app.enableCors({ origin: 'http://localhost:3000', credentials: true });
|
||||
app.setGlobalPrefix(process.env.API_PREFIX);
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Heron Game')
|
||||
.setDescription('Heron')
|
||||
|
||||
@@ -26,7 +26,8 @@ export class UsersService {
|
||||
client_secret: process.env.DISCORD_CLIENTSECRET,
|
||||
code,
|
||||
grant_type: 'authorization_code',
|
||||
redirect_uri: process.env.API_ENDPOINT + '/login',
|
||||
redirect_uri:
|
||||
process.env.API_ENDPOINT + process.env.API_PREFIX + '/login',
|
||||
});
|
||||
} else if (refresh_token) {
|
||||
body = new URLSearchParams({
|
||||
|
||||
Reference in New Issue
Block a user