RevFramework – Pickups • Effects¶
Folder: Runtime/Systems/Pickups/Effects
The Effects folder contains the concrete implementations of PickupEffect.
Each effect is a ScriptableObject that applies gameplay logic when triggered.
✔ Ready-to-use pickup behaviours
✔ Fully modular and decorator-compatible
✔ No hard dependencies on other RevFramework systems
✔ Clean reference implementations for custom effects
🎯 Purpose¶
Effects exist to:
- Provide a library of built-in pickup behaviours
- Demonstrate how to implement effects by subclassing
PickupEffect - Show clean integration patterns for optional systems like Health, Inventory, and Currency
All effects are authored as ScriptableObjects and executed through the unified effect pipeline.
📦 Built-in Effects (accurate to final code)¶
❤️ Healing¶
| Effect | Description |
|---|---|
| InstantHealEffect | Heals immediately (optional delay). Requires IHealthWriter. |
| RegenOverTimeEffect | Heals repeatedly over time using coroutine ticks. Requires IHealthWriter. |
⚠️
HealPickupEffecthas been removed (legacy).
UseInstantHealEffectorRegenOverTimeEffectinstead.
🛡 Shields¶
| Effect | Description |
|---|---|
| ShieldEffect | Applies a temporary shield via ShieldSystem. Supports duration and stacking rules. |
🧭 Movement / Animation¶
| Effect | Description |
|---|---|
| TeleportEffect | Teleports the actor and optionally clears Rigidbody / Rigidbody2D velocity. |
| AnimatorTriggerEffect | Fires an Animator trigger on the actor. |
🎒 Inventory / Economy¶
| Effect | Description |
|---|---|
| GiveItemEffect | Grants items using Inventory reflection bridges (InventoryResolve). |
| GiveCurrencyEffect | Grants currency via service resolution, relays, or reflection fallback. |
Both effects remain fully decoupled — no assembly references to Inventory or Currency.
✨ Visual / Misc¶
| Effect | Description |
|---|---|
| VfxBurstEffect | Spawns a one-shot visual effect. |
| CompositeEffect | Executes multiple effects sequentially. |
🚫 Null‑Damageable Support¶
Effects that do not require an IDamageable must implement:
IEffectAllowsNullDamageable
Correct examples:
TeleportEffectVfxBurstEffectGiveCurrencyEffectGiveItemEffectAnimatorTriggerEffect
Any effect that relies only on the context GameObject should implement this marker.
The pipeline checks this via:
effect.AllowsNullDamageable();
🔗 Integration Notes¶
Health Integration¶
InstantHealEffectandRegenOverTimeEffectrequireIHealthWriter- Dead actors (
IHealthReadonly.IsDead) are skipped - Shield-related behaviour uses
ShieldSystemdirectly - If the Health module is not installed:
- Effects no‑op safely
- No exceptions are thrown
Inventory Integration¶
Used only by GiveItemEffect.
Resolution flow:
- Resolve inventory service via:
InventoryResolve.ServiceFrom(Transform) - Construct an
ItemStackdynamically via reflection - Invoke:
GiveExact(GameObject owner, ItemStack stack, string containerKey) - If unavailable:
- Warn in the Editor
- Silent no‑op in builds
Currency Integration¶
Used only by GiveCurrencyEffect.
Resolution order:
CurrencyResolve.ServiceFrom(Transform)CurrencyServiceRelay(if present)- Known currency services via reflection fallback
Warnings are Editor‑only; player builds remain silent.
➕ Extending Effects¶
To write your own effect:
- Subclass
PickupEffect - Override
OnApply(IDamageable target, GameObject context) - Implement
IEffectAllowsNullDamageableif health is not required - Add serialized fields for designer control
Example¶
[CreateAssetMenu(menuName = "RevFramework/Pickups/Effects/Demo")]
public sealed class DemoEffect : PickupEffect, IEffectAllowsNullDamageable
{
public float magnitude = 1f;
protected override void OnApply(IDamageable target, GameObject ctx)
{
Debug.Log($"Applied demo effect ({magnitude}) to {ctx?.name}");
}
}
Your effect automatically participates in cooldowns, decorator wrapping, and null‑damageable validation.
📘 See Also¶
- Core — effect lifecycle, decorators, cooldowns
- Definitions — how definitions create effects
- Decorators — wrapping and extending effect behaviour