//requires irons_spells_js
PlayerEvents.spellOnCast(event => {
    let player = event.entity
    if (!player) return;
    let effects = get_all_effect(player)

    effects.forEach(effect => {
        let strategy = all_effect_spell_on_cast_strategies[effect.name] || all_effect_spell_on_cast_strategies.default;
        strategy(event, player, effect.level, effect.name, effect.efficiency);
    });

})
const all_effect_spell_on_cast_strategies = {
    //强效
    'cost_powerful': function (event, player, effectLevel, effectname, efficiency) {
        event.setSpellLevel(event.originalSpellLevel + effectLevel)
    },
    'default': function (event, player, effectLevel, effectname, efficiency) {
        return;
    }
};