02 — Crit, Execute, and Attacker Buffs¶
Goal:
Show how Critical Hits, Execute Damage, and Attacker Buffs modify the final damage through the rules pipeline.
🎓 What This Scene Teaches¶
- How critical hits multiply damage by chance and multiplier.
- How execute thresholds apply true damage and bypass shields when HP is low.
- How attacker-side buffs (e.g., Berserk) scale outgoing damage.
- How to preview the combined effect of all rules before applying a hit.
🧩 What’s in This Scene¶
| Object | Description |
|---|---|
| Player (Attacker) | Has an optional Berserk buff that increases outgoing damage ×1.25 by default. |
| Enemy (Victim) | Contains HealthSystem, DebugUI, and a DamageRuleHub with: |
- CritRule → Adjusts crit chance and multiplier. |
|
- ExecuteThresholdRule → Converts low-HP hits to true damage (bypasses shields). |
⚠️ Authority Note
This scene runs with Require Authority disabled by default.
Health mutations are allowed locally for demonstration purposes.Enabling an authority binder alone will not block mutations unless
Require Authority is enabled on the HealthSystem — this is intentional.Why Health works this way:
https://revandrab.github.io/RevFramework/authority/#health-opt-in-authority-gameplay-state
🕹️ How to Use¶
- Press Play.
- Open the overlay panel.
- Adjust the following controls live:
- Damage amount and tags (Melee/Ranged).
- Crit chance and Crit multiplier.
- Execute threshold for triggering true damage.
- Attacker buff multiplier (e.g. 1.25× for Berserk).
- Click Apply Hit to execute a damage event.
- Observe the Preview After Rules value before applying, and watch the post-rule damage output update in real time.
⚙️ Systems Demonstrated¶
| Component | Description |
|---|---|
| CritRule | Randomly applies a damage multiplier based on crit chance. |
| ExecuteThresholdRule | Converts hits below a threshold into true damage and sets BypassShields = true. |
| Attacker Buffs | Modify outgoing damage via a multiplier rule (e.g. BerserkBuff or custom IAttackerDamageModifier). |
💡 Key Concepts¶
-
Execute Damage:
When the victim’s HP is below a threshold, the hit is marked as True Damage — ignoring shields and resistances.
Perfect for "finisher" or "execution" style mechanics. -
Attacker Buffs:
Apply global or local multipliers on outgoing damage.
You can extend this behaviour using customIAttackerDamageModifiercomponents for granular control (e.g., elemental or conditional buffs).
🧠 Determinism (CritRule)¶
By default, CritRule uses RNG.
To ensure identical outcomes across multiplayer or deterministic runs:
- Set Rng Source = InternalSystem and specify a Seed (optional reseed on enable).
- Or set Rng Source = ExternalProvider and use an
IRngprovider (e.g. netcode RNG).
This ensures identical crit rolls across all clients or simulations.
🧩 Demo Notes¶
-
Panels or overlays may auto-add missing rules or buff components (e.g.,
AttackerDamageMultiplierRule) when triggered.
This is for convenience — in production you’d wire buffs and rules explicitly. -
The demo is UI-free — only the DebugUI (
F9) and this overlay are used.
No HUD or visual elements are required.
✅ Key Takeaway¶
This scene shows how attacker and victim rules interact in the same pipeline:
Attacker Buffs → CritRule → ExecuteThresholdRule → HealthSystem.
Each step modifies the damage progressively, giving you complete flexibility over how hits are processed and scaled.