Feat : add Prepare token
This commit is contained in:
@@ -223,4 +223,42 @@ export class TurnService {
|
||||
);
|
||||
await game.save({ session });
|
||||
}
|
||||
|
||||
@WithTransaction
|
||||
async makeDiscard(
|
||||
game: Document<Game> & Game,
|
||||
token: Effect,
|
||||
target: Player,
|
||||
session?: mongoose.mongo.ClientSession,
|
||||
) {
|
||||
target.fuckUMarkers++;
|
||||
const index = game.currentTurn.tokens.findIndex((t) =>
|
||||
t._id.equals(token._id),
|
||||
);
|
||||
if (index == -1) {
|
||||
throw new Error('Token not found');
|
||||
}
|
||||
game.currentTurn.tokens.splice(index, 1);
|
||||
|
||||
await game.save({ session });
|
||||
}
|
||||
|
||||
@WithTransaction
|
||||
async useToken(
|
||||
game: Document<Game> & Game,
|
||||
token: Effect,
|
||||
target: Card,
|
||||
session?: mongoose.mongo.ClientSession,
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
@WithTransaction
|
||||
async useTokenOnEnemyBoard(
|
||||
game: Document<Game> & Game,
|
||||
targetPlayer: Player,
|
||||
token: Effect,
|
||||
target: Card,
|
||||
session?: mongoose.mongo.ClientSession,
|
||||
) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user