RevFramework — Status Effects • Movement¶
Lightweight movement sink used by Status Effects to modify actor speed
without coupling to any specific movement controller or character system.
Table of Contents¶
Overview¶
MovementSpeedScaler is a simple, stackable speed multiplier sink.
Your movement logic reads a single value (Factor) when computing velocity.
Status effects such as SlowStatus and HasteStatus push and pop multipliers onto this sink.
Key properties:
- No dependency on any movement controller or framework
- Safe to add or remove at runtime
- Supports multiple concurrent modifiers
- Designed for Status Effects but usable by any system
This keeps movement rules in your movement code, and modifiers in Status Effects.
Mental Model¶
MovementSpeedScaler is not a controller.
It does not: - Move characters - Decide movement rules - Clamp or validate input - Handle authority or networking
It answers one question only:
“What is the final speed multiplier right now?”
Everything else is your responsibility.
Quick Start¶
- Add
MovementSpeedScalerto your actor - Multiply your movement speed by
Factor - Apply Slow / Haste statuses
// Example movement logic
var scaler = GetComponent<MovementSpeedScaler>();
float speed = baseSpeed * (scaler ? scaler.Factor : 1f);
velocity = input.normalized * speed;
That’s it — no callbacks, no events, no coupling.
API¶
MovementSpeedScaler¶
public float Factor { get; } // Product of all active multipliers (default = 1)
public void PushMultiplier(float multiplier); // e.g. 0.6 for Slow, 1.3 for Haste
public void PopMultiplier(float multiplier); // Must match the pushed value exactly
Behaviour¶
- Internally tracks active modifiers and accumulated product
- Clamps
Factorto a safe range[0 .. 10] - Automatically resets to
1when all modifiers are removed - Robust against overlapping effects and dynamic add/remove
Integration with Status Effects¶
MovementSpeedScaler is used by:
SlowStatus— pushes< 1and pops on removalHasteStatus— pushes> 1and pops on removal (if used for movement speed)
Both effects:
- Bind to the scaler on apply
- Update live when potency changes (
IAdjustableMagnitude) - Clean up correctly on refresh or removal
// Apply a 40% slow for 3 seconds
ctrl.ApplyStatus(new SlowStatus(3f, 0.6f));
Potency Recompute¶
When potency changes (auras, debuffs, difficulty):
- The effect recalculates its effective multiplier
- The scaler is updated live (pop old → push new)
This keeps stacked modifiers and zones consistent.
Gotchas¶
- Always pop the exact multiplier you pushed — mismatched values cause drift
- Removing the scaler component mid-effect prevents proper cleanup
- Read
Factordynamically; don’t cache it if effects can change - If multiple systems affect movement, they should all use the scaler
- This component does not handle authority — pair with Status authority when networking
Extending¶
The same pattern works for other stats:
AttackSpeedScalerCastSpeedScalerTurnRateScalerJumpHeightScaler
Keep the rules simple: - Push on apply - Pop on remove - Read once per frame
See Also¶
Effects—SlowStatus,HasteStatusCore— controller & tickingAbstractions—IAdjustableMagnitude