Commit a2b4f873 authored by nanahira's avatar nanahira

dont block unknown deck as athletic

parent c920254a
......@@ -43,8 +43,11 @@ class AthleticChecker {
}
async checkAthletic(deck) {
try {
const athleticDecks = await this.getAthleticDecks();
const deckType = await this.getDeckType(deck);
if (deckType === '迷之卡组') {
return { success: true, athletic: 0, message: null };
}
const athleticDecks = await this.getAthleticDecks();
const athletic = athleticDecks.findIndex(d => d === deckType) + 1;
return { success: true, athletic, message: null };
}
......
......@@ -61,8 +61,11 @@ export class AthleticChecker {
}
async checkAthletic(deck: Deck): Promise<ReturnMessage> {
try {
const athleticDecks = await this.getAthleticDecks();
const deckType = await this.getDeckType(deck);
if (deckType === '迷之卡组') {
return { success: true, athletic: 0, message: null };
}
const athleticDecks = await this.getAthleticDecks();
const athletic = athleticDecks.findIndex(d => d === deckType) + 1;
return { success: true, athletic, message: null };
} catch (e) {
......
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
......
......@@ -1710,6 +1710,7 @@ class Room
log.warn("GET ATHLETIC FAIL", player.name, using_athletic.message)
else if using_athletic.athletic
ygopro.stoc_send_chat_to_room(room, "#{player.name}${using_athletic_deck}", ygopro.constants.COLORS.BABYBLUE)
return
))
await return
......
......@@ -2309,9 +2309,9 @@
side: side
}));
if (!using_athletic.success) {
return log.warn("GET ATHLETIC FAIL", player.name, using_athletic.message);
log.warn("GET ATHLETIC FAIL", player.name, using_athletic.message);
} else if (using_athletic.athletic) {
return ygopro.stoc_send_chat_to_room(room, `${player.name}\${using_athletic_deck}`, ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send_chat_to_room(room, `${player.name}\${using_athletic_deck}`, ygopro.constants.COLORS.BABYBLUE);
}
}));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment