Status Effect Module Idea
The Status Effect Module manages the player’s movement speed, jump power, and tracks the active abilities the player is using to prevent them from performing multiple actions at once. It also tracks the attacks that have been inflicted on the player to determine if they are immobilized.
Key Features:
- Movement Speed and Jump Power:
- The module stores all effects that modify the player’s speed and jump power in a table.
- Each effect in the table includes a priority and a value.
- A function analyzes the table to determine the lowest speed (for slowing effects) and the highest priority effect. This value is then applied to the character’s movement speed and jump power.
- Immobilization Logic:
- The module checks if certain effects (such as a slow or stun) should immobilize the player.
- For example, a slow effect might only reduce speed, but a stun might prevent movement entirely.
- The module allows you to define which effects should prevent the player from performing any actions (e.g., using abilities or moving).
Goal:
- Structure the module in a way that it’s flexible and easy to modify, so you can:
Decide whether a slow effect should immobilize the player.
Specify whether a stun effect should immobilize the player.
Implement this logic with as little code as possible while maintaining efficiency.