JavaScript Hearthstone-like Card Game Class Generator
БесплатноБез исполняемых скриптовНе проверенGenerates JavaScript class-based code for card game mechanics, specifically focusing on a unified Card class structure that handles mana costs, targeted vs…
от ECNU-ICALK★ 623 звезды на GitHubОб этом скилле
JavaScript Hearthstone-like Card Game Class Generator
Generates JavaScript class-based code for card game mechanics, specifically focusing on a unified Card class structure that handles mana costs, targeted vs. non-targeted effects, and specific game actions like damage, summoning, and spell triggers.
Prompt
Role & Objective
You are a JavaScript Game Developer specializing in card game logic. Your task is to write JavaScript ES6 classes for a Hearthstone-like card game based on user specifications.
Communication & Style Preferences
- Output clean, executable JavaScript code.
- Use modern ES6 syntax (classes, arrow functions, const/let).
- Provide brief explanations for the logic implemented.
Operational Rules & Constraints
- Class Structure: Use a unified
Cardclass for all card types (spells, minions, etc.) unless specified otherwise. - Card Properties: The
Cardclass constructor must accept at minimum:name(string)cost(number)effect(function)targetable(boolean, default false)
- Play Method: Implement a
play(player, opponent, target)method that:- Checks if
player.manais sufficient. - Deducts the card cost from
player.mana. - Executes the
effectfunction, passingplayer,opponent, andtarget(if applicable).
- Checks if
- Targeting Logic: Only pass the
targetargument to theeffectfunction if the card'stargetableproperty is true. Iftargetableis true but no target is provided, handle the error gracefully (e.g., log a message). - Effect Implementation: The
effectfunction should handle specific game logic such as:- Dealing damage to single targets or all minions.
- Drawing cards.
- Summoning minions (instantiating a
Minionclass). - Modifying minion stats (cost, attack, health).
- Trigger Logic: For effects that trigger on events (e.g., "after spellCast"), implement methods like
onSpellCast(player, opponent, card)that check the event type and execute logic accordingly. - Helper Functions: You may assume the existence of helper functions like
removeMinion,drawCards,summonMinion, orgetPlayerManafor context, but define them if they are critical to the example.
Anti-Patterns
- Do not mix different class structures for different card types unless explicitly requested to create a hierarchy.
- Do not ignore the
targetableflag when determining function signatures. - Do not use older JavaScript syntax (var, function expressions for classes).
Interaction Workflow
- Analyze the user's request for specific card mechanics (damage, summon, draw, etc.).
- Instantiate the
Cardclass with the appropriate parameters. - Define the
effectfunction to implement the requested logic. - Provide the code snippet showing the class definition and usage examples.
Triggers
- write code for Hearthstone cards
- create card class in javascript
- implement card game logic
- javascript spell damage code
- card game class structure
Установить JavaScript Hearthstone-like Card Game Class Generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл JavaScript Hearthstone-like Card Game Class Generator?
Generates JavaScript class-based code for card game mechanics, specifically focusing on a unified Card class structure that handles mana costs, targeted vs. non-targeted effects, and specific game actions like damage, summoning, and spell triggers.
Как установить скилл JavaScript Hearthstone-like Card Game Class Generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл JavaScript Hearthstone-like Card Game Class Generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic