Player ability logic inventory¶
Historical working record: The details below describe decisions and source state at the time they were written, including superseded plans and verification status. For current scope use the playable-game roadmap; for implemented hook usage use the hook reference; for observed checks use the CLI report and playable-path report.
Source review, 2026-10-29. After this review, most listed hit effects and weapon attack-preparation subscriptions moved into ability scripts; Proto Barrier impact calculation and Sky Ying Sword marking have also moved to their abilities; Sky Ying Sword summoning and upgrade paths still remain. The table below is historical; see working authoring notes. This inventory identifies concrete starting points for the ability-system redesign; it is not proof of runtime behavior or a complete inventory of every ability, indirect caller, serialized callback, enemy component or asset. References below point to the current organization. No tests, compilation, Unity import or gameplay were run. A named ability check, per-attack flag, formula and generic player condition are different things; they should not all automatically become events.
Attack impact: ability behavior still in the attack¶
PlayerAttack.OnTriggerEnter2D first validates enemy, duplicate hit, active-damage state and invulnerability. It then records the collision, applies base damage within the hit limit, handles the hit limit and visuals, and runs the following branches. Their existing order is the row order. The proposed stage is a candidate, not a final design.
| Ability or effect | Current behavior in PlayerAttack | Candidate participation and required context |
|---|---|---|
| Proto Barrier | Varies base hit damage by enemy type. | Ordered damage calculation before applying hit; attack payload, enemy type and damage. |
| Freezing Pendant | Freezes hit enemy when flagged. | Hit reaction; enemy and per-attack flag. |
| Concussive Impact | Stuns hit enemy when flagged. | Hit reaction; enemy and per-attack flag. |
| Emergency Barrier | Applies a freeze when flagged. | Hit reaction; enemy and per-attack flag; trace barrier attack creation. |
| War Cry | Applies a freeze when flagged. | Hit reaction; enemy and per-attack flag; trace its attack producer. |
| Exploding Enchantment | Spawns configured explosion at enemy hit position, sets magic damage from captured SpellAmp, propagates poison/freeze/concussive flags. Its AB currently only marks weapon and companion attacks. | Hit reaction plus attack preparation; prefab binding, captured data, source ownership and propagated payload. |
| Ricochet | On first collision finds a nearby enemy, creates a bounce attack, copies selected payload flags. Sky sword and priestess branches adjust projectile and speed. | First-hit stage and child-projectile construction; target, source/child payload and character interactions. |
| Shrapnel | First-hit branch contains a comment but no effect. | Investigate intended behavior and enemy-side handling; do not invent functionality. |
| Hydra Barrage | On first hit finds a nearby enemy and creates multiple child projectiles, with level-dependent count and selected flag copies. | First-hit stage, target selection, level, child payload and pooling. |
| Poison Vial | Applies poison using SpellAmp and player owner. | Hit reaction with attack snapshot and owner. |
| Vacuum effect | Applies poison and freeze using level and SpellAmp when IsVacuumed is set. |
Hit reaction; trace producer and distinguish Vacuum Dodge from generic vacuum effects before assigning ownership. |
| Eclipse | Applies poison and freeze using current health, maximum health and missing-health multiplier. | Hit reaction with live player state; trace Transcend/Eclipse producers and PlayerAOE. |
| Vampiric | Heals based on damage and vampiric power, unless Sudden Death is present. | Hit reaction and healing eligibility; identify whether ownership belongs to an ability, common vampiric system or both. |
| Sky sword lightning | Marks enemy via TakeHeavenlySkySwordMark. |
Hit reaction; track enemy-side mark separately, without redesigning enemy systems in this pass. |
IsTranscend and other payload flags exist without a matching branch in this method; inspect their producers and consumers instead of assuming behavior. ReturnPool only clears certain flags: projectile reset, child copying, owner assignment, prefab bindings, and what happens to an already-created projectile after ability removal need explicit design. An effect-specific per-attack snapshot may be necessary; a live player subscription alone can disappear before impact.
Weapon firing and attack preparation¶
PlayerWeapon still contains direct Sky Ying Sword and Abyss Orb checks that suppress normal firing and set character attack flags. Sudden Death participates directly in critical selection. Those are candidates for ability-owned fire admission and attack/critical participation; suppression must be able to stop firing, not just send a notification. Ground Breaker and Rebuke already participate through different critical hooks, with distinct behavior. Preserve critical roll order, modifiers and conditions when designing the stage.
Existing runtime-forwarded stages include weapon fire, charge, reload, extra shots, base damage, post-critical damage, attack construction, critical resolution and weapon lifecycle. Some attack-construction ranges have actual operations between them: character flags, SpellAmp assignment, critical roll and damage calculation. Do not merge all ranges into one event without identifying those boundaries. Candidate channels need notification, veto/short-circuit and ordered value-modification forms; abilities can use multiple stages.
Damage, survival and health recovery¶
PlayerDamageResolver orders reflection before immunity, then shield absorption, health damage, reactions, lethal handling and invulnerability. PlayerDamageHooks forwards multiple ordered ranges and directly checks Last Stand before subtracting health. Shield and lethal stages can stop processing; health damage modifies a value; reactions notify participants. Preserve these distinctions and reentry implications when designing hooks. Consecutive range calls are candidates for simplification only where no intervening gameplay operation or snapshot distinction is needed.
Player.RegenerateHealth directly checks Sudden Death and Last Stand to block recovery, adds Failed Vitamin, True Vitamin, Petrified Skin/De-Petrify and Survival Instinct contributions, and reads Meditate state. Candidate stages: recovery eligibility and ordered recovery contribution. Confirm whether overlapping Petrified Skin and De-Petrify intentionally produce one combined +2 before replacing the || branch. Common health and potion handling remains player/resource responsibility.
Dash and movement¶
PlayerDashExecutor sets base stamina cost, checks pause, applies cost modifiers, checks available stamina, invokes before-dash effects and launches movement. PlayerDashHooks calls two before-dash ranges and still writes AbilityHolder dash fields. Player computes dash direction, while both the scene route and PlayerDashController route invoke the ability. Candidate stages: cost modification and before-dash notification; launch, completion and cancellation are movement lifecycle responsibilities. Preserve both route interactions while replacing, then remove obsolete routes rather than retaining fallback.
Existing before-dash abilities include Band Aid Roll, Unyielding Malice, Curse of Malice, Tactical Fire, Run and Gun, Focus Dodge, Bomb Roll, Vacuum Dodge, Airstrike, Tidal Veil and Frenzy. Survival Fitness modifies cost. Some launch timed or ongoing work; event subscription removal and work cancellation are distinct.
Stats and pickups¶
PlayerModifier directly reads named behavior state (for example Flee Boots, Jet Propulsion, Meditate, Sure Fire, Neo Sword, Frenzy and others) and constructs PlayerStatProjection inputs/effects. The projection contains ability-specific formulas for Tactical Fire, Run and Gun, Berserker Blood, Blood Thirst, Focus Dodge, Demon Pact, Sniper, Survival Instinct, Final Form, Enrage, C Combo and more. Investigate ability-owned stat contributions against the owner's goal of an inspectable central calculation: preserve operation order, additive versus multiplicative factors, sampled versus live values and dependencies. Do not assume a generic notification is adequate or move common base-stat math into individual abilities.
PlayerCollectItem already forwards collectible count, chest, coin, potion-collected and potion-applied stages. Potion flags and timed potion effects still use AbilityHolder and AbilityFunction; these are shared consumable state, not automatically individual abilities. Trace Alchemist Touch, Stalwart Body, Invigorate, Super Magnet and their stages alongside base pickup effects and potion capacity.
Character abilities, companions and upgrades¶
At the time of this scan, AbilityHolder started Sky Ying Sword and Abyss Orb, spawned their companions, handled Multishoot additions, stored sword/orb configuration and dispatched sword marking. CompanionOrb read orb count, orbit state and projectile bonuses from it. CircularWeapon read sword damage multiplier; PlayerAttackCarrier read the soaring-sword lightning setting. WeaponEvoData and UpgradeFunction mutated these paths and included named ability checks. The holder was later replaced; consult current source before using this historical inventory.
Companion already dispatches attack construction; companion-specific attack timing and owner/revive paths also need inventory. PlayerLifeCycle uses SpawnedDrone on revival. These are not all ability hooks: companion movement, targeting and ownership remain gameplay responsibilities.
Other boundaries and next investigation¶
- Ability UI and status displays read runtime state and holder references; replacing the holder requires a read-only player-owned ability view and presentation bindings, not moving UI into ability behavior.
- Upgrade/evolution code contains direct checks for Adept Learner, Mage Apparentice, Multishoot and character abilities; retain these in the inventory even where redesign is deferred. Inspect actual asset callbacks and identity before changing them.
- Global
AbilityFunctionstill owns potion/effect services; separate those services from obsolete ability execution rather than removing every call as if it were an ability check. - Scan AB scripts and serialized assets, enemy hit/mark code, projectile creation outside PlayerWeapon, companions, pooled reset and GameManager integration for indirect paths before calling this inventory complete. Source searches cannot establish runtime reachability or gameplay equivalence.
Implications for the new design¶
Provide typed player-local stages for notification, value modification and stop/allow decisions, with explicit publication at gameplay moments and ability-owned subscriptions. Preserve priority-group ordering (0–99; 99 last), with a deterministic tie rule. Attack effects may need a payload captured per projectile rather than only a live subscription. Lifecycle, attack ownership, event timing, stat operation order, cancellation and serialized prefab references are first-class design inputs. Do not turn every observed flag or condition into a separate hook.