Exemplo n.º 1
0
        /// <summary>
        ///     Gets the mana cost of a spell using the ManaCostArray.
        /// </summary>
        /// <param name="slot">
        ///     The spellslot.
        /// </param>
        /// <returns>
        ///     The mana cost.
        /// </returns>
        public static int GetManaCost(this SpellSlot slot)
        {
            var spell = ChampionBase.GetSpellFromSlot(slot);

            if (spell == null || spell.Level == 0)
            {
                return(0);
            }

            return((int)spell.Cost());
        }
Exemplo n.º 2
0
        /// <summary>
        ///     The minimum mana needed to cast the Spell from the 'slot' SpellSlot.
        /// </summary>
        public static int GetNeededMana(SpellSlot slot, MenuComponent menuComponent)
        {
            var ignoreManaManagerMenu = General.IgnoreManaManagerBlue;

            if (ignoreManaManagerMenu != null &&
                LocalPlayer.Instance.HasBuff("crestoftheancientgolem") &&
                ignoreManaManagerMenu.Enabled)
            {
                return(0);
            }

            var cost = ChampionBase.GetSpellFromSlot(slot).Cost();

            return((int)(menuComponent.Value + cost / LocalPlayer.Instance.MaxMP * 100));
        }
Exemplo n.º 3
0
 public static void LoadChampion(Champion champion)
 {
     try
     {
         if (SupportedChampions.Contains(champion))
         {
             CurrentChampion = (ChampionBase)Activator.CreateInstance(Assembly.GetExecutingAssembly().GetTypes().First(type => type.Name.Equals(champion.ToString().Replace(" ", ""))));
             foreach (var action in Initializers)
             {
                 action();
             }
             Initialized = true;
         }
     }
     catch (Exception e)
     {
         WriteInConsole(e.ToString());
     }
 }
Exemplo n.º 4
0
        public void OnLoadingComplete()
        {
            // Do not allow multiple calling of this method
            if (FinishedLoading)
            {
                return;
            }
            FinishedLoading = true;

            // Check if this addon supports the current champion
            if (!SupportedChampions.ContainsKey(Player.Instance.Hero))
            {
                // Do not load further as we don't support the champion
                return;
            }

            // Initialize properties
            Menu = MainMenu.AddMenu("The Support", "leSupport" + Player.Instance.ChampionName, "The Support - " + Player.Instance.ChampionName);
            ModeHandler = new ModeHandler(this);

            // Create a new instance of the played champion
            PlayedChampion = SupportedChampions[Player.Instance.Hero](this);

            // Register spells for the champion
            PlayedChampion.RegisterSpells(ModeHandler);

            // Finalize champion init
            PlayedChampion.OnPostInit();

            // Listen to required events
            Game.OnTick += OnTick;

            // Notify successfull loading
            Notifications.Show(new SimpleNotification(
                "TheSupport by Hellsing",
                string.Format("TheSupport has successfully loaded the champion '{0}' for you! Have fun playing!", Player.Instance.ChampionName)),
                15000);
        }
Exemplo n.º 5
0
        /// <summary>
        ///     The minimum health needed to cast the Spell from the 'slot' SpellSlot.
        /// </summary>
        public static int GetNeededHealth(SpellSlot slot, MenuComponent value)
        {
            var cost = ChampionBase.GetSpellFromSlot(slot).Cost();

            return((int)(value.Value + cost / LocalPlayer.Instance.MaxHP * 100));
        }