card-game
ما الذي تفعله
ترشد هذه المهارة بناء ألعاب الورق التي تنتقل فيها الأوراق بين المجموعة واليد ومنطقة اللعب ومكوّم التخلص. وهي لمطوري ألعاب بناء المجموعات وألعاب الورق القابلة للجمع وألعاب الروغ لايت (Roguelite).
متى تستخدمها
- ✓عندما تبني لعبة بناء مجموعات أو لعبة ورق قابلة للجمع.
- ✓عندما تحتاج إلى قواعد السحب والخلط وإعادة الخلط التي تعمل بشكل صحيح.
- ✓عندما تريد أن تُحل تأثيرات الأوراق بترتيب واضح ومتوقع.
رابط المهارة
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/card-game/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أصنع لعبة بناء مجموعات. هل تجهز مجموعة الأوراق واليد ومكوّمات التخلص، وتجعل ترتيب الدور يعمل؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يعامل الوكيل الأوراق كبيانات فيها تكاليف وتأثيرات، ويجهز مناطق للمجموعة واليد ومنطقة اللعب والتخلص، ويكتب ترتيب الدور. ويحل كل تأثير بتسلسل ثابت حتى تكون النتائج متوقعة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Card Game
A playbook for card games — card data, the deck/hand/discard zones, the turn structure, and how card effects resolve. This is a compositional skill: it models cards as data and wires them to UI. It does not re-teach data assets or UI nodes; it defines the zone model, the draw machinery, and the effect-resolution rules that keep a card game correct and bug-free.
When to use
- Use when building any game where the core objects are cards moving between zones (deck → hand → play → discard): deckbuilder, TCG/CCG, solitaire, roguelike deckbuilder.
- Use when designing draw/shuffle/reshuffle, turn structure, card costs, or how effects resolve.
When not to use: board/tile state with matching rules → puzzle. RPG with an
incidental card battler → start from rpg. For defining cards as assets, use godot-resources
/ unity-scriptableobjects; for the hand/drag UI, use godot-ui-control.
Core loop
Draw to your hand → spend resources to play cards → effects resolve and change the board → end the turn (cleanup/discard) → opponent/next phase → repeat until a win condition. Depth comes from the combinations a hand allows; the engine's job is to resolve them unambiguously.
Must-have systems
- Card data — id, name, cost, type, text, and an effect spec (data, not code).
- Zones — deck (draw pile), hand, play/board, discard, exile/removed; cards live in exactly one.
- Draw + shuffle + reshuffle — draw from deck to hand; reshuffle discard into deck when empty.
- Turn structure — phases (untap/draw/main/combat/end) as a state machine.
- Resource system — mana/energy/actions that gate how much you do per turn.
- Effect resolution — apply a card's effects in a defined order; handle targets and triggers.
- Win/loss condition — life total, deck-out, objective.
- UI — hand layout, drag/drop or tap-to-play, zone counts, targeting affordances.
Design knobs
| Knob | Effect | Notes |
|---|---|---|
| Starting hand / draw-per-turn | tempo, consistency | More draw = less variance. |
| Hand size limit | hoarding vs. use | Discard down at end of turn. |
| Deck size (min) | consistency | Smaller = more reliable combos. |
| Resource curve | what's playable when | "Mana curve" paces power. |
| Card rarity / power budget | balance | Stronger cards cost more / are rarer. |
| Determinism vs. randomness | skill vs. swing | Shuffle + random effects add variance. |
| Reshuffle rules | deck-out, fatigue | Reshuffle discard, or punish empty deck. |
| Removal / answers | counterplay | Every threat needs an answer in the pool. |
Patterns
1. Zones + draw with automatic reshuffle
# Pseudocode. A card is in exactly one zone at a time; moving = remove here, add there.
def draw(n):
for _ in range(n):
if not deck:
if not discard: # truly empty: deck-out (lose, or take fatigue)
on_deck_out(); return
deck.extend(discard) # reshuffle discard into deck
discard.clear()
shuffle(deck, rng) # use a seeded RNG (see save-systems for replays)
hand.append(deck.pop())
2. Card as data + effect resolution
# Pseudocode. Effects are a data list interpreted by the engine — not bespoke code per card.
card = {
"id": "fireball", "cost": 3, "type": "spell",
"effects": [ {"op": "damage", "amount": 6, "target": "chosen_enemy"} ],
}
def play(card, caster, chosen_targets):
# Validate everything first; a failed check must leave zones and resources untouched.
if resources[caster] < card.cost: return False # can't afford
if not targets_legal(card, chosen_targets): return False
resources[caster] -= card.cost # commit: pay, then move, then resolve
move(card, from_zone=hand, to_zone=play_or_discard(card))
for fx in card.effects:
resolve_effect(fx, caster, chosen_targets) # one interpreter handles every card
return True
3. Turn structure as a phase machine
# Pseudocode. Fixed phases keep timing windows (triggers, priority) unambiguous.
PHASES = ["untap", "draw", "main", "combat", "end"]
def take_turn(player):
for phase in PHASES:
enter_phase(player, phase) # fire "on_phase" triggers here
if phase == "draw": draw(1)
if phase == "main": await player_plays_cards()
if phase == "combat": resolve_combat()
if pha
الأسئلة الشائعة
هل تكون تأثيرات الأوراق شيفرة أم بيانات؟
تقول المهارة إن التأثيرات تُعرَّف كبيانات، وهذا يجعل الأوراق أسهل في الموازنة والتغيير.
هل تغطي واجهة سحب الورق؟
واجهة اليد والسحب تغطيها مهارة واجهة المحرك، وهذه المهارة تحيل إليها.
ما أنواع ألعاب الورق التي تناسبها؟
تناسب ألعاب بناء المجموعات وألعاب TCG وCCG، والسوليتير، وألعاب بناء المجموعات الروغ لايت.
التفاصيل
الوصف الأصلي من المؤلف
Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution. Use for a deckbuilder, TCG/CCG, or roguelike deckbuilder.
الشعبية
- نجوم GitHub
- 6.6k
- الترتيب
- #13807
- الترخيص
- Apache-2.0
- آخر تحديث
- 28/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
router
6.6kيساعد وكيلك على اختيار مهارة تطوير الألعاب المناسبة لطلبك، بعد التعرف على المحرك ونوع المهمة التي تحتاجها.
ai-behavior-trees-utility-ai
6.6kيساعد وكيلك على بناء شجرة سلوك ونظام ذكاء اصطناعي بالتقييم لأعداء اللعبة والشخصيات، فتختار الإجراء حسب الأولوية والنقاط.
audio-design
6.6kيعلّم وكيلك مزج صوت اللعبة: المسارات، والديسيبل، وخفض الموسيقى تحت الحوار، والموسيقى المتكيفة، وتنويع المؤثرات الصوتية.
camera-systems
6.6kيساعد وكيلك على بناء كاميرات للألعاب تتبع اللاعب بسلاسة، وتبقى داخل حدود المرحلة، وتدور حول الشخصية أو تنظر حولها في ثلاثة أبعاد.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.