fix : attempt to fix rampage
release-tag / release-image (push) Failing after 7s

This commit is contained in:
2024-12-21 10:21:00 +01:00
parent ed49a5603e
commit 0c167114da
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -2,6 +2,7 @@ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { CardFaction, CardRole, CardType } from './cards.types';
import mongoose, { Types } from 'mongoose';
import { Effect } from './effect.schema';
import { Game } from 'src/games/schemas/game.schema';
@Schema()
export class Card extends Types.ObjectId {
@@ -41,6 +42,10 @@ export class Card extends Types.ObjectId {
@Prop()
pack: string;
isLocked(game: Game) {
return game.currentTurn.cardsLocked.some((c) => this.equals(c));
}
}
export const CardSchema = SchemaFactory.createForClass(Card);
+2 -1
View File
@@ -265,8 +265,9 @@ export class TurnService {
target: Player,
session?: mongoose.mongo.ClientSession,
) {
const unlockedCards = target.board.cards.filter((c) => !c.isLocked(game));
if (
target.hand.cards.length >=
target.hand.cards.length + unlockedCards.length >=
target.fuckUMarkers + target.discardMarkers
) {
throw new HttpException(