ข้อมูลการ์ดและฟังก์ชันช่วยเหลือสำหรับเกมการ์ดสะสม Battle of Talinchan
โปรเจกต์นี้จัดทำขึ้นโดยแฟนคลับ (Fan-made) เพื่อรวบรวมข้อมูลการ์ดเท่านั้น ไม่มีความเกี่ยวข้อง สนับสนุน หรือได้รับอนุญาตอย่างเป็นทางการจาก บริษัท พสุโลล จำกัด / บริษัท ไลอ้อน เฮ้าส์ จำกัด รูปภาพและข้อความบนการ์ดเป็นลิขสิทธิ์ของ © บริษัท พสุโลล จำกัด / บริษัท ไลอ้อน เฮ้าส์ จำกัด ซอร์สโค้ดของโปรเจกต์นี้อยู่ภายใต้สัญญาอนุญาตแบบ MIT License
เรายินดีต้อนรับการมีส่วนร่วมจากทุกคน! หากคุณต้องการเพิ่มหรืออัปเดตข้อมูลการ์ด กรุณาดำเนินการดังนี้:
- เปิด Issue: ก่อนเริ่มทำงาน กรุณาเปิด issue ใหม่พร้อมกับ tag ที่เหมาะสม (เช่น
card-data,new-card,update-card,bug-fix) เพื่อแจ้งให้ทีมทราบว่าคุณกำลังจะทำอะไร - อธิบายรายละเอียด: ใน issue กรุณาระบุ:
- การ์ดที่ต้องการเพิ่มหรืออัปเดต
- รหัสการ์ด (print code) หรือเซ็ตที่เกี่ยวข้อง
- ข้อมูลที่ต้องการเปลี่ยนแปลง (ถ้ามี)
- รอการอนุมัติ: รอให้ maintainer ตรวจสอบและอนุมัติก่อนเริ่มทำงาน
- สร้าง Pull Request: หลังจากที่ได้รับการอนุมัติแล้ว สร้าง pull request พร้อมกับอ้างอิงถึง issue ที่เกี่ยวข้อง
สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับรูปแบบข้อมูลการ์ดและขั้นตอนการมีส่วนร่วม กรุณาอ่าน CONTRIBUTING.md
This project uses pnpm as the package manager.
- Node.js (recommended version v18 or higher)
- pnpm (install globally:
npm install -g pnpm)
- Install dependencies:
pnpm install- Build the project (optional):
pnpm buildimport {
getAllCards,
getCardsBySet,
searchCards,
filterCards,
getCardByPrint,
getUniqueCards,
getAvailableSetCodes,
} from './src/utils/cardHelpers';Returns all cards from all sets.
const allCards = getAllCards();
console.log(`Total cards: ${allCards.length}`);Retrieves cards from the specified set.
Parameters:
setCode- Set code (e.g., 'BT01', 'BT02', 'SD01')
Returns: Array of cards from the specified set
const bt01Cards = getCardsBySet('BT01');
console.log(`BT01 has ${bt01Cards.length} cards`);Searches for cards by name (case-insensitive, supports partial matching).
Parameters:
query- Search query
Returns: Array of cards matching the search query
const results = searchCards('นนทก');
console.log(`Found ${results.length} cards`);Filters cards based on various criteria.
Filter Options:
type?: CardType | CardType[]- Filter by card type ('Avatar', 'Magic', 'Life', 'Construct')color?: CardColor | CardColor[]- Filter by color ('แดง', 'ฟ้า', 'เขียว', 'ม่วง', 'ไม่มีสี')rarity?: Rarity | Rarity[]- Filter by rarity ('SR', 'UR', 'PR', 'CBR', 'C', 'SCR', 'R', 'USEC')symbol?: Symbol | Symbol[]- Filter by symbolcost?: number | { min?: number; max?: number }- Filter by cost (specify value or range)gem?: number | { min?: number; max?: number }- Filter by gem (specify value or range)power?: number | { min?: number; max?: number }- Filter by power (specify value or range)setCode?: string | string[]- Filter by set codename?: string- Filter by name (supports partial matching)
Returns: Array of cards matching all filter criteria
// Filter by type
const avatarCards = filterCards({ type: 'Avatar' });
// Filter by color
const redCards = filterCards({ color: 'แดง' });
// Filter by cost range
const midCostCards = filterCards({ cost: { min: 2, max: 4 } });
// Filter by multiple criteria
const complexFilter = filterCards({
type: 'Avatar',
color: 'แดง',
cost: 3,
});Retrieves a specific card by its print code.
Parameters:
printCode- Card print code (e.g., 'BT01-001')
Returns: Card matching the print code, or undefined if not found
const card = getCardByPrint('BT01-001');
if (card) {
console.log(card.name);
}Retrieves unique cards (removes duplicate cards by name/print code, keeping only one instance).
Returns: Array of unique cards
const uniqueCards = getUniqueCards();
console.log(`Unique cards: ${uniqueCards.length}`);Retrieves all available set codes.
Returns: Array of set codes
const setCodes = getAvailableSetCodes();
console.log('Available sets:', setCodes);This project includes example scripts demonstrating how to use the helper functions.
# Run search example
pnpm example:search
# Run filter example
pnpm example:filter
# Run set example
pnpm example:set
# Run all examples
pnpm example:allexamples/search-example.ts- Demonstrates searching cards by name and retrieving cards by print codeexamples/filter-example.ts- Demonstrates filtering cards by various criteriaexamples/set-example.ts- Demonstrates working with card sets
Cards are organized by set:
- BT01-BT08: Booster sets
- SD01-SD07: Structure decks
- CC01-CC02: Collection sets
- ODY1: Odyssey set
- PRE0: Pre-release set
- PRMO: Promotion set
- SL01: Special set
Each card has the following structure:
interface Card {
name: string;
type: 'Avatar' | 'Magic' | 'Life' | 'Construct';
print: string; // e.g., 'BT01-001'
rare: Rarity;
soi: number;
mainEffect: string;
// ... additional fields based on card type
}