public override void OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { cost_to_pay = -1; if (!CanBeUsedOn(evt.Spell, evt.AbilityData)) { return; } cost_to_pay = calculate_cost(this.Owner.Unit); evt.AddMetamagic(Metamagic); if (increase_spell_dc > 0) { evt.AddBonusDC(increase_spell_dc); } }
public void OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { spell_level = -1; int cost = 1 + evt.SpellLevel; if (this.resource == null || this.Owner.Resources.GetResourceAmount((BlueprintScriptableObject)this.resource) < cost) { return; } if (evt.Spell == null || evt.Spellbook == null || evt.Spell.Type != AbilityType.Spell) { return; } evt.AddBonusCasterLevel(bonus); evt.AddBonusDC(bonus); current_spell = evt.Spell; spell_level = evt.SpellLevel; }