Capture enemy units and recruit them: data-driven surround rules, capture rates with a full breakdown, bosses and uncatchables, counters on failure, three fates, commit timing, a collection.ENGLISHCapture & Recruit SystemCaptured pieces changing sides, persuading an enemy mid-battle, collecting monsters: "catch it instead of defeating it" is a staple of tactics and RPG design. Built by hand, though, the surround check, the capture rate, what a failure does, the clean-up on the board and whether a capture survives a retreat end up scattered across the codebase, and sooner or later the screen says one thing while the rules do another. This package is that whole mechanism in one flow, tuned with data.WHAT IT DOES- Surrounds are data. Four sides, all eight, a pincer from opposite sides, or "at least five of eight" - chosen in the inspector, per target if you like. Walls and the edge of the board can count as a side, so driving a target into a corner becomes a tactic. Hex grids are supported.- It tells you what is missing. Every surround check returns how many more allies are needed and which cells they should step into, so lighting up the missing sides is immediate.- The rate comes with its breakdown. HP-tier base rate, allies taking part in the surround, the capturer's gear, the build-up of failed attempts and your own modifiers arrive as separate lines - "base 35% + surround 15% + gear 15% = 65%" - ready for your UI. The confirmation screen and the roll go through the same function, so they can never disagree.- Some targets refuse. A boss on a fixed rate that ignores gear and HP, a machine that can never be caught, a creature only a tamer can catch: one setting each. The reason a capture cannot go ahead is returned as data rather than text, so the wording and its translation stay yours.- Failure is handled. A failed attempt returns a counterattack cue for your combat code, the rate can grow with every failure, and a target can start resisting after too many tries.- Three fates. A captured unit stays on the board as an obstacle, leaves it, or changes sides on the spot and fights for the capturer - and then helps surround the next one.- You choose when a capture becomes final: immediately (kept even if you retreat), at the end unless defeated, or on victory only.- Holding back. One line at the end of your damage formula stops the damage at 1 HP for capture targets only, so the unit you wanted is never finished off by accident.- Capture guidance returns the best targets and the cells to step into - a hint for the player, or the thinking of an enemy AI or an auto-battle.- A collection records what was caught, how often and when first, with a "first capture" flag.- A mid-battle save is a single string, and restoring it never hands a confirmed capture over a second time.IS IT CUSTOMIZABLE?Yes, in the places that decide whether a package can enter a project that already exists.It does not know your board. Answer four questions - who stands on this cell, is it on the board, is it a wall, are these teams friends - and a Tilemap, a 2D array or your own grid class all work.It does not know your characters. Implement one small interface and your existing unit class becomes capturable; a thin adapter is enough where you would rather not touch it. What a captured unit joins your side as is a plain string id for you to look up in your own data.It has no UI and no combat maths. The command button, the breakdown display, the success effect and the counterattack damage are the character of your game. The package returns verdicts and numbers; the dice are swappable, and custom rate modifiers plug in through an interface.It is not tied to one genre. Tactics RPGs, monster-collecting games and board-game-like captures are all served by the same rules.TRY IT IN TWO MINUTESA showcase scene is included, ready to open. Pressing Play auto-runs twelve captioned scenes covering every feature, looping forever with no input. Surrounds are drawn as green and red frames on the cells, the rate as a breakdown and a roll gauge, and the result as a stamp over the target, so any single frame explains itself. The demo contains no imported image, audio clip or font. A self-check menu runs 251 checks in memory and prints the result to the Console.----------------------------------------------------------------JAPANESECapture & Recruit System将棋の持ち駒、SRPG の説得や勧誘、モンスター収集。「倒すかわりに捕まえて自分の戦力にする」仕組みは定番ですが、自作すると包囲の判定・成功率・失敗時の扱い・盤上での後始末・撤退したときに持ち帰れるかがそれぞれ別の場所に散らばり、いつか画面と実際の処理が食い違います。このアセットは、その仕組み全体を 1 本の流れにまとめ、データで調整できる形で提供します。できること・包囲はデータで決めます。四方・八方・向かい合う 2 マス(挟み撃ち)・「8 方向のうち 5 以上」をインスペクターで選べ、対象ごとに変えることもできます。壁や盤端を一辺に数えれば、角へ追い詰める戦術が生まれます。六角マスにも対応しています。・足りないマスがわかります。包囲の判定は「あと何人・どのマスへ」を返すので、足りない辺を光らせる UI がすぐ作れます。・成功率は内訳ごと返ります。HP 段階の基本率・包囲の味方・捕獲する側の装備・失敗の積み重ね・独自補正が行ごとに返り、「基本 35%+包囲 15%+装備 15%=65%」をそのまま表示できます。確認画面と実際の判定が同じ関数を通るため、数字は食い違いません。・捕まえられない相手。装備も HP も効かない固定率のボス、捕獲不可の兵器、調教師にしか捕まらない相手——どれも設定 1 つです。押せない理由は文章ではなくデータで返るので、文面と多言語化は購入者の自由です。・失敗の扱い。失敗すると反撃の合図を返し(戦闘処理は購入者のコード)、失敗するほど成功率が上がる設定や、一定回数で抵抗して捕まらなくなる設定も使えます。・捕獲後の 3 つの結末。障害物として残る/盤面から去る/その場で寝返って味方として戦う(そのまま次の包囲にも加わります)。・確定のタイミングを選べます。即時(撤退しても持ち帰れる)/敗北しなければ/勝利したときだけ。・手加減。ダメージ計算の最後に 1 行挟むだけで、捕獲対象だけ HP 1 で止まります。・捕獲の手引きが狙い目と入るべきマスを返します。プレイヤーへのヒントにも、敵 AI やオート戦闘の思考にも使えます。・図鑑が何を・何回・いつ初めて捕まえたかを記録します(初捕獲の判定つき)。・戦闘途中のセーブは文字列 1 本。復元しても確定済みの捕獲が二重に渡ることはありません。Q: カスタマイズできますかA: はい。既存プロジェクトに入れられるかを決める箇所で可能です。盤面の形を知りません。「そのマスに誰が居るか・盤内か・壁か・味方どうしか」の 4 つに答えれば、Tilemap でも二次元配列でも自前のグリッドでも動きます。キャラクターの形を知りません。小さなインターフェースを 1 つ実装すれば既存のユニットがそのまま捕獲対象になり、触りたくない場合は薄いアダプタで十分です。捕獲後に何として仲間になるかは素の文字列 ID で渡るので、自分のデータへ引き当ててください。UI も戦闘計算も持ちません。コマンドのボタン・内訳の表示・成功演出・反撃のダメージはゲームの個性です。本アセットは判定結果と数字を返し、乱数は差し替え可能、独自の成功率補正もインターフェースで追加できます。特定のジャンル専用ではありません。タクティクス RPG・モンスター収集・盤上ゲーム風の捕獲に、同じ仕組みで対応します。実演シーンを同梱しています。シーンを開いて再生するだけで 12 場面が字幕付きで自動再生されます(操作不要・無限ループ)。包囲はマス上の緑と赤の枠、成功率は内訳と判定ゲージ、結果は対象の上のスタンプで表示され、どの瞬間を切り取っても何が起きているか分かります。デモには画像・音声・フォントを 1 つも含みません。自己診断メニューは 251 項目をメモリ上で検証し、結果を Console に出力します。ENGLISHFeatures:- Surround rules as ScriptableObjects: four, eight or six (hex) neighbours; all sides, at least N, or an opposite pair; walls, obstacles and the board edge optionally counting; capturer adjacency and a minimum number of actual allies- Surround status per cell (ally, wall, edge, obstacle, empty, blocked) with the number of allies still needed and the cells to fill- Capture profiles as ScriptableObjects: eligibility, required capturer tags, per-target surround rule, base rate, any number of HP tiers, bonuses per supporting ally and per failed attempt, fixed rate, limits, failure response, attempt limit, fate and recruit id or asset- Capture rate breakdown by source (base, HP tier, surround, capturer, persistence, custom, fixed) with clamping reported- Capture check returning whether to show the command, whether it can be pressed, and the reason as an enum- Capture session covering checks, rolls, fates, three commit timings, battle end by victory, retreat or defeat, events, reset, and JSON save and restore without double grants- Non-lethal damage policy: off, capture targets only, or always- Capture guidance ranking targets by allies still needed and rate, plus a what-if check for a single cell- Collection with counts, first-capture time and highest level, behind stores for memory, PlayerPrefs and a JSON file- A ready-made rectangular board for prototypes and testsExtensibility:- ICaptureUnit and ICaptureField adapt the units and board you already have- ICaptureRateModifier adds your own rate adjustments as breakdown lines- ICaptureBonusSource lets a capturer contribute gear or skill bonuses- ICaptureRecruitHandler receives confirmed captures, leaving the roster to you- The random source can be injected, making every roll reproducible- Allied factions are supported through the board's team relationDependencies and compatibility:- Unity 2022.3 LTS or newer; no additional packages and no third-party plugins- No networking of any kind- Works with either input backend; the asset reads no input- 2D and 3D alike; the asset draws nothing- Assembly definitions isolate runtime, samples, demo and demo editor codeIncluded:- Full C# source- Six integration samples: unit adapter, board adapter, recruit handler, a custom level-gap modifier, and the flow inside a battle- A ready-to-play showcase scene (also rebuildable from one menu click), using no imported image, audio or font asset- A self-check menu running 251 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(四方/八方/六角・すべて/指定数以上/向かい合う 2 マス・壁/障害物/盤端を一辺に数えるか・捕獲者の隣接・最低限の味方人数)・包囲の状況をマスごとに返す(味方/壁/盤端/障害物/空き/埋まらない)。あと何人・どのマスかも返る・捕獲設定は ScriptableObject(捕獲可否・捕獲者に必要なタグ・対象ごとの包囲ルール・基本率・HP 段階(いくつでも)・包囲の味方と失敗 1 回あたりの加算・固定率・上下限・失敗時の反応・挑戦回数上限・捕獲後の処遇・仲間になるときの ID/アセット)・成功率の内訳を由来ごとに返す(基本・HP 段階・包囲・捕獲者・粘り・独自・固定)。上下限で切られたかも返る・捕獲の可否判定(コマンドを出すか・押せるか・理由を列挙型で)・捕獲の進行管理(判定・抽選・処遇・確定タイミング 3 種・勝利/撤退/敗北での戦闘終了・イベント・リセット・二重付与なしの JSON 保存と復元)・手加減の方針(なし/捕獲対象のみ/常に)・捕獲の手引き(必要人数と成功率で狙い目を並べる・1 マスの仮定判定)・図鑑(回数・初捕獲日時・最高レベル)。保存先はメモリ/PlayerPrefs/JSON ファイル・プロトタイプやテスト用の長方形の盤面拡張性:・ICaptureUnit と ICaptureField で既存のユニットと盤面を接続・ICaptureRateModifier で独自の成功率補正を内訳の行として追加・ICaptureBonusSource で捕獲者の装備やスキルを反映・ICaptureRecruitHandler が確定した捕獲を受け取り、仲間リストは購入者側・乱数源を注入可能。すべての判定を再現できます・盤面の陣営関係で同盟軍にも対応依存と互換性:・Unity 2022.3 LTS 以降。追加パッケージ・外部プラグイン不要・通信機能を一切持ちません・どちらの入力バックエンドでも動作(入力を読みません)・2D / 3D 双方(描画を行いません)・アセンブリ定義で本体・サンプル・デモ・デモ用エディタを分離収録:・フル C# ソース・組み込み例 6 本(ユニットのアダプタ・盤面のアダプタ・仲間への受け渡し・レベル差の独自補正・戦闘への組み込みの流れ)・開いて再生するだけの実演シーン(メニュー 1 クリックで再生成も可能・画像/音声/フォントの持ち込みゼロ)・251 項目の自己診断メニュー(結果は 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.




