private void OnAbilityUpgradeButtonClicked(UIMouseEvent evt, UIElement element) { DoTariaPlayer dotariaPlayer = DoTariaPlayer.Get(Main.LocalPlayer); UIAbilityButton upgradeButton = element as UIAbilityButton; if (upgradeButton == null) { Main.NewText("Upgrade button was null ?"); return; } if (!_upgradeButtonsForAbilityDefinitions.ContainsKey(upgradeButton)) { Main.NewText("Upgrade button was clicked when it shouldn't be accessible."); return; } AbilityDefinition ability = _upgradeButtonsForAbilityDefinitions[upgradeButton]; if (!CanUpgradeAbility(dotariaPlayer, ability)) { Main.NewText("Tried leveling an ability without meeting the requirements."); return; } dotariaPlayer.AcquireOrLevelUp(ability); }
public override void OnAbilityLeveledUp(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) { for (int i = 0; i < shadowrazes.Length; i++) { if (shadowrazes[i] != this) { dotariaPlayer.AcquireOrLevelUp(shadowrazes[i], false); } } }