I think you are fighting the hypothetical. You are going to implement not only a basic magic framework but specific spells to drain and reflect magic as part of your base game? Even though the base game will not include magic of any sort?
The person who wrote the drain spell didn’t necessarily do anything wrong. They wrote their mod for a basic API that only takes one effect per event. It might be something like this in the monster mod:
fn drain(&mut self, target: &mut Entity)
{
use EventTypes::*; // string constant DAMAGE
use HitpointType::Mana; // as opposed to Health, Energy, etc
if let Some(delta) = send_event(
Damage, (Mana),
&mut target, &mut self,
20_i32
)
{
send_event(Damage, (Mana), &mut self, &mut self, delta * -1);
}
}
Whereas the reflect mod might only intercept “SPELL” events, and a compat mod wraps each DAMAGE event affecting Mana into a dummy SPELL event. If this was not done, none of the mods written for the basic magic system would be compatible with the spell system at all.
~Max