59 lines
2.5 KiB
Markdown
59 lines
2.5 KiB
Markdown
# BPC_ShieldDefenseSystem — Actor Component
|
||
|
||
**File:** [`Content/Framework/Weapons/BPC_ShieldDefenseSystem`](Content/Framework/Weapons/BPC_ShieldDefenseSystem.uasset)
|
||
**Parent Class:** `UActorComponent`
|
||
**Dependencies:** [`BPC_DamageReceptionSystem`](BPC_DamageReceptionSystem.md), [`BPC_StaminaSystem`](../02-player/09_BPC_StaminaSystem.md)
|
||
|
||
**Purpose:** Manages defensive tools: shields, blocking, parrying. Works in both melee and ranged defense contexts.
|
||
|
||
---
|
||
|
||
## Variables
|
||
|
||
| Name | Type | Description |
|
||
|------|------|-------------|
|
||
| `bIsBlocking` | Bool | Block active |
|
||
| `BlockDamageReduction` | Float | % reduction while blocking (0.0–1.0) |
|
||
| `ParryWindow` | Float | Perfect parry timing window in seconds |
|
||
| `ShieldDurability` | Float | Current shield durability (0 = broken) |
|
||
| `MaxShieldDurability` | Float | Maximum durability |
|
||
| `BlockAngle` | Float | Max angle from forward vector for block to cover |
|
||
| `StaminaCostPerBlock` | Float | Stamina drain per blocked hit |
|
||
| `bCanParry` | Bool | Whether parry mechanic is enabled |
|
||
|
||
## Functions / Events
|
||
|
||
| Name | Inputs | Outputs | What it does |
|
||
|------|--------|---------|--------------|
|
||
| `BeginBlock` | — | — | Raises shield, starts blocking |
|
||
| `EndBlock` | — | — | Lowers shield, ends blocking |
|
||
| `ProcessHit` | Damage: S_DamageEvent | Bool (blocked) | Evaluates if hit was blocked or parried |
|
||
| `TryParry` | — | Bool | Checks if parry window is active |
|
||
| `BreakShield` | — | — | Reduces durability to 0, triggers break anim |
|
||
|
||
## Event Dispatchers
|
||
|
||
| Name | Parameters | Fired when |
|
||
|------|-----------|-----------|
|
||
| `OnBlockStarted` | — | Shield raised |
|
||
| `OnBlockEnded` | — | Shield lowered |
|
||
| `OnHitBlocked` | Damage: S_DamageEvent | Incoming hit blocked |
|
||
| `OnHitParried` | Instigator: Actor | Perfect parry executed |
|
||
| `OnShieldBroken` | — | Durability reaches 0 |
|
||
|
||
---
|
||
|
||
## Communications With
|
||
|
||
| Target System | Method | Why |
|
||
|---------------|--------|-----|
|
||
| `BPC_DamageReceptionSystem` | Interface hook | Intercepts incoming damage |
|
||
| `BPC_StaminaSystem` | Direct `ConsumeStamina` | Stamina cost per block |
|
||
| `BPC_HitReactionSystem` | Direct | Triggers parry follow-up window |
|
||
| `ABP_PlayerBody` | Animation Notify | Block/parry animation states |
|
||
|
||
## Reuse Notes
|
||
|
||
- ParryWindow drives a perfect-parry mechanic; set to 0 to disable parries
|
||
- BlockDamageReduction is per-shield from DA_WeaponData or DA_EquipmentConfig
|
||
- Shield durability adds wear mechanic; set MaxShieldDurability to 0 for indestructible shields |