static bool Prefix(SpellSpecializationParametrized __instance, RuleCalculateAbilityParams evt) { var spell = (__instance.Fact as Feature)?.Param.Blueprint as BlueprintAbility; if (SpellDuplicates.isDuplicate(spell, evt.Spell) || SpellDuplicates.isDuplicate(spell, evt.Spell?.Parent)) { evt.AddBonusCasterLevel(2); } return(false); }
public override void OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { cost_to_pay = 0; if (!CanBeUsedOn(evt.Spell, evt.AbilityData)) { return; } cost_to_pay = calculate_cost(this.Owner.Unit); evt.AddMetamagic(Metamagic); }
public void OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { var spellbook = evt.Spellbook; if (spellbook == null) { return; } int bonus = GetBonus(spellbook); Log.Write($"Increase caster level of {evt.Spell?.name} by {bonus}"); evt.AddBonusCasterLevel(bonus); }
void IRulebookHandler <RuleCalculateAbilityParams> .OnEventAboutToTrigger(RuleCalculateAbilityParams evt) { if (evt.Spellbook?.Blueprint != spellbook) { return; } var center_self = evt.Initiator.Get <UnitPartCenterSelf>(); if (center_self != null && center_self.active()) { return; } evt.AddBonusConcentration(-10); }
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; }
public void OnEventDidTrigger(RuleCalculateAbilityParams evt) { }
void IRulebookHandler <RuleCalculateAbilityParams> .OnEventDidTrigger(RuleCalculateAbilityParams evt) { }