Counter, defend or dodge: give the defender a real choice, let nearby allies join in, and have one step in front to take the hit. A complete combat exchange that keeps your own damage formula.ENGLISHReaction & Assist System for SRPGIn most tactics games the unit being attacked is a spectator. This module gives it a say, and pulls the units standing around it into the fight.One exchange runs as: attack -> the defender's reaction -> allies joining in -> a guard stepping in front -> the counterattack. That whole flow is what you get.WHAT IT DOES- Reactions: the defender chooses to counter, defend or dodge. Defending cuts the damage, dodging lowers the attacker's hit chance, countering strikes back.- Reactions are data, not an enum. A reaction is one ScriptableObject with three numbers (incoming-damage multiplier, hit-chance modifier, whether it counters), so "parry" or "reflect" is added without writing code. Give different units different reaction sets and "heavy infantry cannot dodge" becomes a data decision.- Support attacks and counter assists: up to four nearby allies join in, on either side of the fight.- Guarding: an ally slides in front and takes the blow, with the defend reaction applied to it. It stays out for the follow-up blows and only then returns home - send it back right after the main attack and those blows sail straight past into the unit it was protecting.- A selection you can back out of: reaction, counter option, counter assists, guard. Stepping back is one call, and any stage that was skipped for having no choices is skipped on the way back too, so cancelling never strands the player on an empty screen.- A forecast before you commit: who strikes whom, at what chance, ready to feed a confirmation panel or an AI's cost/benefit check. The numbers shown and the numbers rolled come from the same code, so they cannot drift apart.- AI composition: guard, reaction, counter option and counter assists are composed automatically into the very same shape a hand-picked selection produces, so enemies, allied NPCs and auto-battle all travel one code path.IS IT CUSTOMIZABLE?Yes - in the two places that usually matter.Combat formula: implement IExchangeHitResolver and none of the asset's math runs. You borrow only the flow of reactions, guarding and assists, and keep the damage calculation you already wrote.Presentation: the asset ships no presentation at all. Every beat of the exchange arrives as an attack that has not been settled yet; call Commit() on the frame your animation lands and the damage settles exactly there. Cameras, motions and effects stay entirely yours.IS IT TIED TO ONE GENRE?It is built for square-grid tactics games. It touches your units only through one interface, knows nothing about your board implementation, reads no input, and imposes no UI - so it drops into an existing project rather than asking you to build around it.TRY IT IN TWO MINUTESA showcase scene is included. One menu click builds it; pressing Play auto-runs fourteen captioned scenes covering every feature, looping forever with no input. The demo contains no imported image, audio clip or font: every shape is generated in code. A self-check menu runs 102 checks in memory and prints the result to the Console.----------------------------------------------------------------JAPANESEReaction & Assist System for SRPG多くのタクティクスゲームでは、攻撃される側は見ているだけです。このモジュールは受け手に選択を与え、周囲に立っているユニットを戦闘に巻き込みます。1 回の交戦は「攻撃 → 受け手のリアクション → 仲間の加勢 → 庇い → 反撃」という流れで進みます。その一連をまるごと引き受けます。できること・リアクション: 受け手が反撃・防御・回避から選びます。防御は被ダメージを減らし、回避は相手の命中率を下げ、反撃は殴り返します。・リアクションは列挙型ではなくデータです。ScriptableObject 1 つに 3 つの数字(被ダメージ倍率・命中率補正・反撃の有無)を入れるだけなので、「パリィ」や「反射」をコードを書かずに追加できます。ユニットごとに別の一覧を持たせれば「重装兵は回避できない」もデータで表現できます。・支援攻撃/支援反撃: 周囲の仲間が最大 4 名まで加勢します。攻撃側にも防御側にも付きます。・庇い: 仲間が前に滑り込み、防御リアクションが適用された状態で身代わりになります。続く支援攻撃も受け切ってから持ち場に戻ります(主攻撃の直後に戻すと、後続の攻撃が守ったはずの相手へ素通りします)。・戻れる選択: リアクション → 反撃手段 → 支援反撃 → 庇い手。戻るのは 1 行で、選択肢が無くて飛ばされた段階は戻るときも飛ばされるため、キャンセルで詰みません。・交戦前の予測: 誰が誰を何%で殴るかを返します。確認パネルにも AI の損得計算にも使え、表示と実判定が同じ計算から来ているため食い違いません。・AI 自動編成: 庇い手・リアクション・反撃手段・支援反撃を自動で決め、手動選択とまったく同じ形に落とします。Q: カスタマイズできますかA: はい、要になる 2 箇所を差し替えられます。戦闘計算: IExchangeHitResolver を実装すれば本アセットの計算は一切使われません。既存のダメージ計算をそのまま使い、リアクション・庇い・連携の進行だけを借りる形になります。演出: 本アセットは演出を一切持ちません。各手は「まだ確定していない攻撃」として渡され、アニメーションの着弾フレームで Commit() を呼べばそこでダメージが確定します。カメラもモーションもエフェクトもあなたのものです。Q: 特定ジャンル専用ですかA: 四角形グリッドのタクティクス向けに作られています。ユニットには 1 つのインターフェース越しにしか触れず、盤面の実装を知らず、入力を読まず、UI を強制しません。既存プロジェクトに後から差し込める形です。実演シーンを同梱しています。メニュー 1 クリックで構築し、再生するだけで 14 場面が字幕付きで自動再生されます(操作不要・無限ループ)。デモには画像・音声・フォントを 1 つも含まず、図形はすべてコード生成です。自己診断メニューは 102 項目をメモリ上で検証して結果を Console に出力します。ENGLISHFeatures:- Reaction definitions as ScriptableObjects: incoming-damage multiplier, hit-chance modifier, counter enablement, availability conditions- Per-unit reaction sets, so different classes are offered different choices- Support attacks and counter assists, up to a configurable cap per side (default 4)- Guarding: target substitution, the guard's own reaction, and a return only after the follow-up blows- A four-stage defender selection state machine with backing out, and automatic skipping of stages that have no choices- An assist selection state machine: pick an ally, pick its option, undo, repeat to the cap- Candidate queries that filter by distance, spent-turn state, option availability, matchup and each option's minimum and maximum range- AI composition producing the identical exchange object a player selection produces- A forecast API returning one row per participant, sharing its math with the actual roll- An instant, presentation-free resolution path for AI look-ahead, auto-battle and balance simulation- A bundled default hit and damage resolver with a swappable random source for deterministic replays and testsExtensibility:- IExchangeHitResolver replaces the entire combat formula- IExchangePresenter supplies all presentation; each beat settles when you call Commit()- IUnitRegistry and IRelationResolver adapt unit enumeration and friend-or-foe rules- Distance metric selectable between Manhattan and Chebyshev- Presentation extension points are marked in the runner's timelineDependencies and compatibility:- Unity 2022.3 LTS or newer; no additional packages and no third-party plugins- Works with either input backend; the asset reads no input- 2D and 3D alike; the asset never touches your board implementation- Assembly definitions isolate runtime, samples, demo and demo editor codeIncluded:- Full C# source, 27 files- Four minimal samples: a unit implementation, a weapon implementation, the shortest integration, and an IMGUI selection menu- A showcase scene generated from one menu click, using no imported image, audio or font asset- A self-check menu running 102 checks and printing the result to the Console- Documentation in English and Japanese, including XML documentation comments and inspector tooltips in both languages----------------------------------------------------------------JAPANESE機能:・リアクション定義は ScriptableObject(被ダメージ倍率・命中率補正・反撃の有無・選択条件)・ユニットごとのリアクション一覧。兵種で提示内容を変えられます・支援攻撃/支援反撃。片側あたりの上限は設定可能(既定 4 名)・庇い: 攻撃対象の差し替え、庇い手自身へのリアクション適用、追撃を受け切ってからの帰還・受け手の 4 段階選択状態機械。1 つ前へ戻れ、選択肢の無い段階は自動で飛ばされます・加勢の選択状態機械: 仲間を選ぶ → 手段を選ぶ → 取り消す → 上限まで繰り返す・候補の絞り込み: 距離・行動済み・手段の使用可否・相性・各手段の最小/最大射程・AI 自動編成は、プレイヤー選択とまったく同じ交戦オブジェクトを生成します・予測 API は参加者ごとに 1 行を返し、実判定と同じ計算を共有します・演出を挟まない即時解決の経路(AI の先読み・オート戦闘・バランス調整用)・既定の命中/ダメージ計算を同梱。乱数源を差し替えれば決定的に再生できます拡張性:・IExchangeHitResolver で戦闘計算式を丸ごと置き換え・IExchangePresenter で演出を全面的に実装。各手は Commit() を呼んだ時点で確定します・IUnitRegistry / IRelationResolver でユニット列挙と敵味方判定を差し替え・距離はマンハッタン/チェビシェフから選択・実行役のタイムラインには演出拡張ポイントを明記しています依存と互換性:・Unity 2022.3 LTS 以降。追加パッケージ・外部プラグイン不要・どちらの入力バックエンドでも動作(入力を読みません)・2D / 3D 双方。盤面の実装には一切触れません・アセンブリ定義で本体・サンプル・デモ・デモ用エディタを分離収録:・フル C# ソース 27 ファイル・最小サンプル 4 本(ユニット実装/武器実装/導入の最短形/IMGUI の選択メニュー)・メニュー 1 クリックで生成される実演シーン(画像・音声・フォントの持ち込みゼロ)・102 項目の自己診断メニュー(結果は Console へ出力)・英語/日本語のドキュメント(XML コメント・インスペクタのツールチップも日英併記)AI (Claude by Anthropic) was utilized as an engineering assistant during the package creation process for the following tasks:1. Refactoring and modularizing C# code to ensure high quality, loose coupling, and framework-agnostic design.2. Generating documentation drafts, API reference guides, and English/Japanese README files.All system architecture, logic design, functional requirements, and final code reviews were explicitly defined and verified by human hands. The package has been thoroughly compiled and tested within Unity to guarantee stability and performance.




