Agent skill
battle-system
バトルシステムの設計と実装ガイド。バトル関連の変更時に参照。
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/battle-system
SKILL.md
Battle System
構成
BattleService(エントリーポイント)
↓
BattleTurnEngine(ターン処理)
↓
BattleContext(戦闘状態コンテナ)
ファイル構成
BattleTurnEngineは責務ごとに拡張ファイルに分割:
| ファイル | 責務 |
|---|---|
BattleTurnEngine.swift |
エントリーポイント |
+TurnLoop.swift |
ターンループ制御 |
+PhysicalAttack.swift |
物理攻撃 |
+Magic.swift |
魔法攻撃・回復 |
+Damage.swift |
ダメージ計算 |
+StatusEffects.swift |
状態異常 |
+Reactions.swift |
反撃・パリィ |
+Targeting.swift |
ターゲット選択 |
+TurnEnd.swift |
ターン終了処理 |
+Logging.swift |
ログ出力 |
設計方針
BattleContext
戦闘ごとに独立したインスタンスを生成。並行実行でも安全。
- 参照データ(不変): マスターデータへの参照
- 戦闘状態(可変): プレイヤー、敵、ターン数など
新機能追加時のルール
- 状態はBattleContextに持たせる - 静的変数禁止
- 乱数はcontext.randomを使う - 再現性確保
- ログはcontext.appendAction()で記録
- 関連処理は適切な拡張ファイルに追加
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?