public void OnEventDidTrigger(RuleCastSpell evt) { if (remaining_uses <= 0) { return; } for (int i = 0; i < abilities.Length; i++) { if (abilities[i] == evt.Spell?.Blueprint && !used_groups[groups[i]]) { if (remaining_uses == num_uses) { command_type = evt.Spell.Blueprint.ActionType; is_full_round = evt.Spell.Blueprint.IsFullRoundAction; } else if (!Aux.isNotSlower(evt.Spell.Blueprint.ActionType, evt.Spell.Blueprint.IsFullRoundAction, command_type, is_full_round)) { return; } used_groups[groups[i]] = true; remaining_uses--; if (remaining_uses == 0) { this.Buff.Remove(); } return; } } }
public override bool canUseOnAbility(AbilityData ability, CommandType actual_action_type) { if (remaining_uses <= 0) { return(false); } if (remaining_uses == num_uses) { return(false); } for (int i = 0; i < abilities.Length; i++) { if (abilities[i] == ability?.Blueprint) { if (used_groups[groups[i]]) { return(false); } if (num_uses == remaining_uses) { return(true); } else { return(Aux.isNotSlower(ability.Blueprint.ActionType, ability.Blueprint.IsFullRoundAction, command_type, is_full_round)); } } } return(false); }