Overview
WCGASResistanceComponent is a per-actor ActorComponent that manages status effect immunity through the Gameplay Ability System. It maintains a container of immunity tags that block status effects via GAS's ApplicationBlockedTags mechanism. The component supports absorption systems (converting blocked damage into healing), diminishing returns systems (progressive resistance to repeated CC), event broadcasting for UI/gameplay integration, and save/load persistence.
Core Functionality
- Maintains a FGameplayTagContainer of immunity tags granted to the actor via a managed GameplayEffect
- Registers with UWCGASResistanceSubsystem which applies/refreshes the immunity GE as tags change
- Provides Blueprint-friendly APIs for adding/removing/querying immunity tags at runtime
- Supports absorption systems where blocked effects trigger counter-effects (e.g., Fire Demon absorbs fire → heals)
- Implements diminishing returns (DR) tracking for progressive resistance to repeated effect applications
- Broadcasts immunity change events via WCGASEventSubsystem for decoupled UI/gameplay responses
- Supports save/load persistence for immunity tags, DR history, and active full immunity timers
- Uses hierarchical tag matching (immune to "Effect.Element" also blocks "Effect.Element.Fire")
- Caches AbilitySystemComponent and subsystem references for performance
- Server-authoritative for all immunity state changes
Initialization Flow
Automatic Initialization (Default Behavior):
- Component reaches BeginPlay
- Caches references to WCGASStatusEffectSubsystem and WCGASEventSubsystem
- If
bAutoInitializeOnBeginPlay is true, calls InitializeResistanceComponent()