示例#1
0
 public SpecialSpell(Champion _hero, SpellSlot slot, bool defaultvalue, int delay)
 {
     Slot = slot;
     Hero = _hero;
     DefaultValue = defaultvalue;
     Delay = delay;
 }
 public DangerousSpell(Champion champ, SpellSlot slot, bool stat, int bonusDelay = 0)
 {
     Slot = slot;
     Champion = champ;
     Stats = stat;
     BonusDelay = bonusDelay;
 }
示例#3
0
        public override void invokeEffect(Champion a_champion)
        {
            a_champion.damage(MathManager.randomInt(m_minDamage, m_maxDamage));
            if (m_turnsLeft-- <= 0) {

            }
        }
示例#4
0
 public TargetSpell(Obj_AI_Base target, Obj_AI_Base caster, Champion champ, SpellSlot slot)
 {
     Target = target;
     Caster = caster;
     Champ = champ;
     Slot = slot;
 }
示例#5
0
 public DangerousSpell(Champion hero, SpellSlot slot, bool defaultvalue = true, int delay = 0)
 {
     Slot = slot;
     Hero = hero;
     DefaultValue = defaultvalue;
     Delay = delay;
 }
示例#6
0
 private void OnLevelUp(Obj_AI_Hero champion, Champion.OnLevelUpEventAgrs agrs)
 {
     if (_menu.Item("AutoArrange").GetValue<bool>())
     {
         ResetTrigger();
     }
 }
示例#7
0
 public void revalidateButtons(Champion a_champion)
 {
     switch (m_buttonListType) {
         case ButtonListType.ChmpnMain:
             findButton("Move").p_state		= a_champion.p_hasMoved		? Button.State.Disabled : Button.State.Normal;
             findButton("Action").p_state	= a_champion.p_actionTaken	? Button.State.Disabled : Button.State.Normal;
             break;
         case ButtonListType.ChmpnAction:
             //TODO Kolla typ om en champion har silence eller något som gör så att de inte kan röra sig eller attackera
             break;
         case ButtonListType.ChmpnAbility:
             int l_currentMana = a_champion.getStat("CurrentMana");
             foreach (Ability l_ability in a_champion.getAbilities()) {
                 #if DEBUG
                 findButton(l_ability.getName()).p_state = l_currentMana <= l_ability.getCost() ? Button.State.Disabled : Button.State.Normal;
                 #else
                 try {
                     findButton(l_ability.getName()).p_state = l_currentMana <= l_ability.getCost() ? Button.State.Disabled : Button.State.Normal;
                 } catch (NullReferenceException) {
                     System.Console.WriteLine("Ability was found in champion ability list but not in menu when trying to revalidate buttons");
                 }
                 #endif
             }
             break;
     }
 }
示例#8
0
 public static List<Text> createStatsList(Champion a_champion)
 {
     List<Text> l_list = new List<Text>();
     foreach (KeyValuePair<string, int> l_kvPair in a_champion.getStats()) {
         l_list.Add(new Text(Vector2.Zero, l_kvPair.Key + ": " + l_kvPair.Value, "Arial", Color.Black, false));
     }
     return l_list;
 }
示例#9
0
 public static bool LoadSpells(Champion hero)
 {
     var type = Type.GetType("ControlerBuddy.Database" + hero);
     if(type == null) throw new NotSupportedException("Champion: " + hero + " Not Supported Yet!");
     var instance = (ISpellDatabase) Activator.CreateInstance(type);
     if(instance == null) throw new NullReferenceException("Champion type found, but could not create an instance.");
     SpellDatabase = instance;
     return true;
 }
示例#10
0
 public NotMissile(Vector3 start, Vector3 end, Obj_AI_Base caster, Champion champ, SpellSlot slot, string sname)
 {
     Start = start;
     End = end;
     Caster = caster;
     Champ = champ;
     Slot = slot;
     SName = sname;
 }
示例#11
0
 public void deselectChampion()
 {
     if (m_selectedChampion == null) {
         return;
     }
     m_selectedChampion.deselect();
     m_championInfo.Clear();
     m_selectedChampion = null;
     if (m_battleQueue != null) {
         m_battleQueue.Sort();
     }
 }
示例#12
0
 public void TestRequestBuilder()
 {
     var champ = new Champion(null, false);
     try
     {
         RequestBuilder.ExecuteAndReturn(champ);
         Assert.IsTrue(true);
     }
     catch (Exception e)
     {
         Assert.Fail(e.Message);
     }
 }
示例#13
0
 public void TestExecuteAndReturn()
 {
     var champ = new Champion((int) Region.NA, 1);
     try
     {
         List<ChampionInfoDto> list = RequestBuilder.ExecuteAndReturn(champ);
         Assert.IsTrue(true);
     }
     catch (Exception e)
     {
         Assert.Fail(e.Message);
     }
 }
示例#14
0
        private static List<ItemBuild> GetBuilds(Champion champion, HtmlDocument document)
        {
            var parsedBuilds = new List<ItemBuild>();
            var builds = document.DocumentNode.SelectNodes("//div[@data-build-id]");
            if (builds == null)
            {
                Errors.Add("Downloading Data For " + champion + "Failed!");
                RunningTasks--;
                return null;
            }
            foreach (var node in builds)
            {
                var buildId = int.Parse(node.GetAttributeValue("data-build-id", "0"));
                try
                {
                    var parsedBuild = new ItemBuild(buildId);

                    foreach (var section in node.Descendants().Where(x => x.Name == "section"))
                    {
                        if (section.GetAttributeValue("class", "") != "starting-items" &&
                            section.GetAttributeValue("class", "") != "core-items" &&
                            section.GetAttributeValue("class", "") != "final-items") continue;
                        foreach (
                            var item in
                                section.Descendants()
                                    .Where(x => x.Name == "small" && x.GetAttributeValue("style", null) == null))
                        {

                            var itemName =
                                item.LastChild.InnerText.Replace(' ', '_')
                                    .Replace("'", "")
                                    .Replace("(", "")
                                    .Replace(")", "")
                                    .Replace(".", "")
                                    .Replace('-', '_');
                            var itemId = (ItemId) Enum.Parse(typeof(ItemId), itemName);
                            parsedBuild.Items.Add(itemId);
                        }
                    }
                    parsedBuilds.Add(parsedBuild);
                }
                catch (ArgumentException ex)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Could Not Parse, Ignoring: " + ex.Message);
                    Errors.Add(string.Format("Could Not Parse Build (ID: {0}, Champion: {1}). Ignoring Build. \n Error: {2}", buildId, champion, ex.Message));
                    Console.ResetColor();
                }
            }
            return parsedBuilds;
        }
示例#15
0
 public SpellData(
     Champion champ,
     string champname,
     SpellSlot spellKey,
     bool enabled,
     string spellname
     )
 {
     this.champ = champ;
     this.champname = champname;
     this.spellKey = spellKey;
     this.enabled = enabled;
     this.spellname = spellname;
 }
        public void FixtureSetUp()
        {
            _transformer = new GameDefinitionSummaryViewModelBuilder(new Transformer(), new WeightTierCalculator());            

            List<PlayedGame> playedGames = new List<PlayedGame>();
            playedGames.Add(new PlayedGame()
                {
                    Id = 10
                });
            playedGames.Add(new PlayedGame()
            {
                Id = 11
            });
            _championPlayer = new Player
            {
                Name = _championName,
                Id = _championPlayerId
            };
            _previousChampionPlayer = new Player
            {
                Name = _previousChampionName,
                Id = _previousChampionPlayerId
            };
            _champion = new Champion
            {
                Player = _championPlayer,
            };
            _previousChampion = new Champion
            {
                Player = _previousChampionPlayer
            };
            _gameDefinitionSummary = new GameDefinitionSummary()
            {
                Id = 1,
                Name = "game definition name",
                Description = "game definition description",
                GamingGroupId = _gamingGroupid,
                GamingGroupName = "gaming group name",
                PlayedGames = playedGames,
                Champion = _champion,
                PreviousChampion = _previousChampion
            };
            _currentUser = new ApplicationUser()
            {
                CurrentGamingGroupId = _gamingGroupid
            };

            _viewModel = _transformer.Build(_gameDefinitionSummary, _currentUser);
        }
示例#17
0
        public static SpellBase GetSpells(Champion heroChampion)
        {
            Type championType = Type.GetType("Genesis.Library.Spells." + heroChampion);
            if (championType != null)
            {
                return Activator.CreateInstance(championType) as SpellBase;
            }

            else
            {
                Chat.Print(heroChampion + " is not supported.");
                //throw new NotImplementedException();
                return null;
            }
        }
示例#18
0
        /// <summary>
        /// Constructs a <see cref="UtilityAddon"/> using the parent menu supplied. Will not call Initialization if the champion is not supported.
        /// </summary>
        /// <param name="menu">The parent menu that this Utility's menu will be added to. Pass 'null' if this utility does not need a menu.</param>
        /// <param name="champion">The players champion name (If needed)</param>
        protected UtilityAddon(Menu menu, Champion? champion = null)
        {
            if (champion != null && !CheckSupported(champion.Value)) return;

            if (menu != null)
            {
                Menu = MakeMenu(menu);
                Value.MenuList.Add(Menu);
            }
            Init();
            Game.OnUpdate += Game_OnUpdate;
            Drawing.OnDraw += Drawing_OnDraw;
            Drawing.OnEndScene += Drawing_OnEndScene;
            Game.OnTick += Game_OnTick;
        }
        public void SetUp()
        {
            _autoMocker = new RhinoAutoMocker<ChampionRecalculator>();
            _applicationUser = new ApplicationUser();

            _gameDefinition = new GameDefinition
            {
                ChampionId = _previousChampionId
            };
            _autoMocker.Get<IDataContext>().Expect(mock => mock.FindById<GameDefinition>(_gameDefinitionId))
                .Return(_gameDefinition);
            _savedChampion = new Champion { Id = _newChampionId };
            _autoMocker.Get<IDataContext>().Expect(mock => mock.Save(Arg<Champion>.Is.Anything, Arg<ApplicationUser>.Is.Anything))
                .Return(_savedChampion);

        }
示例#20
0
        public virtual Champion RecalculateChampion(int gameDefinitionId, ApplicationUser applicationUser, bool allowedToClearExistingChampion = true)
        {
            GameDefinition gameDefinition = dataContext.FindById<GameDefinition>(gameDefinitionId);

            ChampionData championData = championRepository.GetChampionData(gameDefinitionId);

            if (championData is NullChampionData)
            {
                if (allowedToClearExistingChampion)
                {
                    ClearChampionId(applicationUser, gameDefinition);
                }

                return new NullChampion();
            }

            Champion existingChampion =
                dataContext.GetQueryable<Champion>()
                    .Include(champion => champion.GameDefinition)
                .FirstOrDefault(champion => champion.GameDefinitionId == gameDefinitionId && champion.GameDefinition.ChampionId == champion.Id);

            Champion newChampion = new Champion
            {
                WinPercentage = championData.WinPercentage,
                NumberOfGames = championData.NumberOfGames,
                NumberOfWins = championData.NumberOfWins,
                GameDefinitionId = gameDefinitionId,
                PlayerId = championData.PlayerId
            };

            Champion savedChampion;

            if (newChampion.SameChampion(existingChampion))
            {
                savedChampion = UpdateExistingChampionIfNecessary(applicationUser, existingChampion, newChampion);
            }
            else
            {
                savedChampion = dataContext.Save(newChampion, applicationUser);
                dataContext.CommitAllChanges();
                gameDefinition.PreviousChampionId = gameDefinition.ChampionId;
                gameDefinition.ChampionId = savedChampion.Id;
                dataContext.Save(gameDefinition, applicationUser);
            }

            return savedChampion;
        }
示例#21
0
文件: AIO.cs 项目: lolscripts/Otros
 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());
     }
 }
示例#22
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            Config = new Menu("Marksman", "Marksman", true);

            cClass = new Champion();
            if (ObjectManager.Player.BaseSkinName == "Ezreal")
                cClass = new Ezreal();

            if (ObjectManager.Player.BaseSkinName == "Jinx")
                cClass = new Jinx();

            if (ObjectManager.Player.BaseSkinName == "Sivir")
                cClass = new Sivir();

            cClass.Id = ObjectManager.Player.BaseSkinName;
            cClass.Config = Config;

            var orbwalking = Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
            cClass.Orbwalker = new Orbwalking.Orbwalker(orbwalking);

            var items = Config.AddSubMenu(new Menu("Items", "Items"));
            items.AddItem(new MenuItem("BOTRK", "BOTRK").SetValue(true));

            var combo = Config.AddSubMenu(new Menu("Combo", "Combo"));
            cClass.ComboMenu(combo);

            var harass = Config.AddSubMenu(new Menu("Harass", "Harass"));
            cClass.HarassMenu(harass);

            var misc = Config.AddSubMenu(new Menu("Misc", "Misc"));
            cClass.MiscMenu(misc);

            var drawing = Config.AddSubMenu(new Menu("Drawings", "Drawings"));
            cClass.DrawingMenu(drawing);

            cClass.MainMenu(Config);

            Config.AddToMainMenu();

            Game.OnGameUpdate += Game_OnGameUpdate;
        }
示例#23
0
        public ChampionSelectList(Champion a_champion, Vector2 a_position, ButtonListType a_listType)
        {
            m_buttonList = new List<Button>();
            m_buttonListType = a_listType;

            switch (m_buttonListType) {
                case ButtonListType.ChmpnMain:
                    m_buttonList.Add(new TextButton(a_position, "Move", "Arial"));
                    m_buttonList.Add(new TextButton(a_position + new Vector2(0, 20), "Action", "Arial"));
                    m_buttonList.Add(new TextButton(a_position + new Vector2(0, 40), "Wait", "Arial"));
                    break;
                case  ButtonListType.ChmpnAction:
                    m_buttonList.Add(new TextButton(a_position, "Attack", "Arial"));
                    m_buttonList.Add(new TextButton(a_position + new Vector2(0, 20), "Ability", "Arial"));
                    break;
                case ButtonListType.ChmpnAbility:
                    foreach (Ability l_ability in a_champion.getAbilities()) {
                        m_buttonList.Add(new TextButton(a_position, l_ability.getName() + ": " + l_ability.getCost(), "Arial"));
                    }
                    break;
            }
        }
示例#24
0
        public async Task RefreshMatch(string userName, bool refreshAll = false)
        {
            if (SemaphoreSlim.CurrentCount != 0)
            {
                SemaphoreSlim.Wait();
                using (var scope = scopeFactory.CreateScope()) {
                    var dbContext   = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>();
                    var userManager = scope.ServiceProvider.GetRequiredService <UserManager <AramIdentityUser> >();
                    var lolStatic   = scope.ServiceProvider.GetRequiredService <ILolStaticDataService>();
                    var options     = scope.ServiceProvider.GetRequiredService <IOptions <ApplicationConfiguration> >();
                    try
                    {
                        var riotIds = dbContext.Users.Select(u => u.riotId).ToList();

                        var matchIds = new List <long>();
                        using (var httpClient = new HttpClient())
                        {
                            var beginTime = DateTimeOffset.UtcNow.AddDays(-14).ToUnixTimeMilliseconds();
                            //var recentMatch = dbContext.LoginGames
                            //        .Include(lg => lg.Games)
                            //        .Where(g => g.AramIdentityUser.riotId == currentUser.riotId)
                            //        .OrderByDescending(x => x.Games.GameCreation).FirstOrDefault();
                            var begintime = $"&beginTime={beginTime}";
                            foreach (var riotId in riotIds)
                            {
                                var resp = await httpClient.GetAsync($"https://euw1.api.riotgames.com/lol/match/v4/matchlists/by-account/{riotId}?api_key={options.Value.ApiRiotKey}&queue={options.Value.QueueType}{begintime}");

                                if (resp.IsSuccessStatusCode)
                                {
                                    var matches = JsonConvert.DeserializeObject <ListMatchDto>(await resp.Content.ReadAsStringAsync());
                                    matchIds.AddRange(matches.matches.Select(x => x.gameId));
                                }
                            }

                            var matchCount = 1;
                            foreach (var matchId in matchIds)
                            {
                                matchCount++;
                                if (matchCount == 20)
                                {
                                    Thread.Sleep(1000);
                                    matchCount = 1;
                                }
                                var resp = await httpClient.GetAsync($"https://euw1.api.riotgames.com/lol/match/v4/matches/{matchId}?api_key={options.Value.ApiRiotKey}");

                                if (resp.IsSuccessStatusCode)
                                {
                                    var matchDto = JsonConvert.DeserializeObject <MatchDto>(await resp.Content.ReadAsStringAsync());
                                    var match    = dbContext.Games.FirstOrDefault(x => x.GameId == matchDto.gameId);
                                    if (match == null)
                                    {
                                        match = new Game
                                        {
                                            GameCreation = matchDto.gameCreation,
                                            GameDuration = matchDto.gameDuration,
                                            GameId       = matchDto.gameId
                                        };
                                    }
                                    dbContext.Attach(match);

                                    var allyTeamCode = 0;
                                    foreach (var participant in matchDto.participantIdentities)
                                    {
                                        var user = dbContext.Users.FirstOrDefault(x => x.riotId == participant.player.accountId);
                                        if (user != null)
                                        {
                                            var player = matchDto.participants.First(x => x.participantId == participant.participantId);
                                            var stats  = player.stats;
                                            if (allyTeamCode == 0)
                                            {
                                                allyTeamCode = player.teamId;
                                            }
                                            var test = !dbContext.LoginGames.Any(x => x.GamesId == match.Id && x.AramIdentityUserId == user.Id);
                                            if (!dbContext.LoginGames.Any(x => x.GamesId == match.Id && x.AramIdentityUserId == user.Id))
                                            {
                                                var champ = dbContext.Champions.FirstOrDefault(x => x.Id == player.championId);
                                                if (champ == null)
                                                {
                                                    var champData = await lolStatic.GetChampionAsync(player.championId);

                                                    champ = new Champion()
                                                    {
                                                        Icon = champData.image.full,
                                                        Key  = champData.id,
                                                        Id   = int.Parse(champData.key),
                                                        Name = champData.name
                                                    };
                                                    dbContext.Add(champ);
                                                    dbContext.SaveChanges();
                                                }
                                                var lastGame = dbContext.LoginGames.OrderByDescending(x => x.Games.GameCreation).FirstOrDefault(x => x.AramIdentityUserId == user.Id);

                                                var loginGame = new LoginGame
                                                {
                                                    Games            = match,
                                                    AramIdentityUser = user,
                                                    Assists          = stats.assists,
                                                    Kills            = stats.kills,
                                                    Deaths           = stats.deaths,
                                                    DoubleKills      = stats.doubleKills,
                                                    TripleKills      = stats.tripleKills,
                                                    QuadraKills      = stats.quadraKills,
                                                    PentaKills       = stats.pentaKills,
                                                    FirstBloodKill   = stats.firstBloodKill,
                                                    Win      = stats.win,
                                                    Level    = stats.champLevel,
                                                    Champion = champ
                                                };
                                                var elo = GetEloCalc(lastGame, loginGame);
                                                loginGame.WinStreak  = elo.winStreak;
                                                loginGame.LoseStreak = elo.loseStreak;
                                                loginGame.PointWin   = elo.pointWin;
                                                loginGame.PointLose  = elo.pointLose;
                                                loginGame.Score      = elo.score;
                                                var items = await GetItemsFromStatsAsync(dbContext, lolStatic, stats);

                                                foreach (var item in items)
                                                {
                                                    var lgItem = new LoginGameItem
                                                    {
                                                        Item      = item,
                                                        LoginGame = loginGame
                                                    };
                                                    await dbContext.AddAsync(lgItem);
                                                }
                                                dbContext.Add(loginGame);
                                                var runes = await GetRunesFromStatsAsync(dbContext, lolStatic, loginGame, stats);

                                                dbContext.AddRange(runes);
                                                var spells = await GetSpellsFromParticipantAsync(dbContext, lolStatic, loginGame, player);

                                                dbContext.AddRange(spells);
                                                dbContext.SaveChanges();
                                            }
                                        }
                                    }
                                    if (match.KillAlly == 0 && match.KillEnnemy == 0)
                                    {
                                        foreach (var participant in matchDto.participants)
                                        {
                                            if (participant.teamId == allyTeamCode)
                                            {
                                                match.KillAlly += participant.stats.kills;
                                            }
                                            else
                                            {
                                                match.KillEnnemy += participant.stats.kills;
                                            }
                                        }
                                    }
                                }
                                await dbContext.SaveChangesAsync();
                            }
                        }
                    }
                    finally
                    {
                        SemaphoreSlim.Release();
                    }
                }

                UpdateElo();
            }
        }
示例#25
0
        //public bool ItemBuyRequest(int itemId)
        //{
        //    var item = Item.Instantiate(itemId);
        //    if (item == null) return false;

        //    var recipeParts = _inventory.GetAvailableRecipeParts(item);
        //    var price = item.TotalPrice;
        //    Item i;

        //    if (recipeParts.Length == 0)
        //    {
        //        if (_owner.GetStats().getGold() < price)
        //        {
        //            return true;
        //        }

        //        i = _owner.getInventory().AddItem(item);

        //        if (i == null)
        //        {
        //            return false;
        //        }
        //    }
        //    else
        //    {
        //        foreach (var instance in recipeParts)
        //            price -= instance.TotalPrice;

        //        if (_owner.GetStats().getGold() < price)
        //            return false;


        //        foreach (var instance in recipeParts)
        //        {
        //            _owner.GetStats().unapplyStatMods(instance.getTemplate().getStatMods());
        //            PacketNotifier.notifyRemoveItem(_owner, instance.getSlot(), 0);
        //            _owner.getInventory().RemoveItem(instance.getSlot());
        //        }

        //        i = game.getPeerInfo(peer).getChampion().getInventory().addItem(itemTemplate);
        //    }

        //    _owner.GetStats().setGold(_owner.GetStats().getGold() - price);
        //    _owner.GetStats().applyStatMods(itemTemplate.getStatMods());
        //    PacketNotifier.notifyItemBought(game.getPeerInfo(peer).getChampion(), i);

        //    return true;
        //}

        public static Shop CreateShop(Champion owner)
        {
            return(new Shop(owner));
        }
示例#26
0
        public string GetDefaultSequence(Champion champ)
        {
            string ss = sequences.Split('\n').First(s => s.StartsWith(ObjectManager.Player.ChampionName));

            return(ss.Substring(ss.IndexOf('=') + 1));
        }
示例#27
0
 internal static bool ContainsSlot(Champion champion, SpellSlot slot)
 {
     return(ContainsChampion(champion) && Database[champion].ContainsKey(slot));
 }
 internal static ReturnMessage UpdateChampion(Champion source)
 {
     return(Facade.UpdateChampion(source));
 }
示例#29
0
        internal static string GetSpellDataChampName(Champion champion)
        {
            switch (champion)
            {
            // Spacing
            case Champion.AurelionSol:
                return("Aurelion Sol");

            case Champion.DrMundo:
                return("Dr Mundo");

            case Champion.JarvanIV:
                return("Jarvan IV");

            case Champion.LeeSin:
                return("Lee Sin");

            case Champion.MasterYi:
                return("Master Yi");

            case Champion.MissFortune:
                return("Miss Fortune");

            case Champion.TahmKench:
                return("Tahm Kench");

            case Champion.TwistedFate:
                return("Twisted Fate");

            case Champion.XinZhao:
                return("Xin Zhao");

            // Special characters
            case Champion.Chogath:
                return("Cho'Gath");

            case Champion.Khazix:
                return("Kha'Zix");

            case Champion.KogMaw:
                return("Kog'Maw");

            case Champion.RekSai:
                return("Rek'Sai");

            case Champion.Velkoz:
                return("Vel'Koz");

            // Capitalization
            case Champion.FiddleSticks:
                return("Fiddlesticks");

            case Champion.Leblanc:
                return("LeBlanc");

            // Totally different naming, rito pls
            case Champion.MonkeyKing:
                return("Wukong");

            // Same name
            default:
                return(champion.ToString());
            }
        }
示例#30
0
        public void UpdateDetailChampion(Champion _Champion)
        {
            if (_Champion != null)
            {
                //Attribue les informations
                this.Champion_Icon.Source = _Champion.GetIcon;
                this.Champion_Name.Text   = _Champion.GetName;
                this.ChampionHealth.Text  = _Champion.GetHealth;
                this.ChampionDamage.Text  = _Champion.GetDamage;

                this.Tier.Text = _Champion.GetTier.ToString();

                this.Classe_One.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_One}.png", UriKind.Relative));
                this.Classe_Two.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_Two}.png", UriKind.Relative));

                this.Classe_One_Name.Text = _Champion.GetClasse_One.ToString();
                this.Classe_Two_Name.Text = _Champion.GetClasse_Two.ToString();


                if (_Champion.GetClasse_Three.ToString().Contains("None"))
                {
                    this.Classe_Three.Source    = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Inivisible.png", UriKind.Relative));
                    this.Classe_Three_Name.Text = "";
                }
                else
                {
                    this.Classe_Three.Source    = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_Three}.png", UriKind.Relative));
                    this.Classe_Three_Name.Text = _Champion.GetClasse_Three.ToString();
                }

                //Rafraichi les items
                int Local_index = 1;

                foreach (Items Item in _Champion.MyItem)
                {
                    BitmapImage Local_Icon_Stuff      = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Empty.png", UriKind.Relative));
                    BitmapImage Local_Icon_StuffNeed1 = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Empty.png", UriKind.Relative));
                    BitmapImage Local_Icon_StuffNeed2 = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Empty.png", UriKind.Relative));

                    if (Item != null)
                    {
                        Local_Icon_Stuff = Item.GetIcon;

                        if (Item.GetNeeded_Type1 != Enums.Enum_Item.None)
                        {
                            Local_Icon_StuffNeed1 = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Items/{Item.GetNeeded_Type1}.png", UriKind.Relative));
                            Local_Icon_StuffNeed2 = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Items/{Item.GetNeeded_Type2}.png", UriKind.Relative));
                        }
                    }

                    switch (Local_index)
                    {
                    case 1:
                        this.Stuff1.Source       = Local_Icon_Stuff;
                        this.Stuff1_Need1.Source = Local_Icon_StuffNeed1;
                        this.Stuff1_Need2.Source = Local_Icon_StuffNeed2;
                        break;

                    case 2:
                        this.Stuff2.Source       = Local_Icon_Stuff;
                        this.Stuff2_Need1.Source = Local_Icon_StuffNeed1;
                        this.Stuff2_Need2.Source = Local_Icon_StuffNeed2;
                        break;

                    case 3:
                        this.Stuff3.Source       = Local_Icon_Stuff;
                        this.Stuff3_Need1.Source = Local_Icon_StuffNeed1;
                        this.Stuff3_Need2.Source = Local_Icon_StuffNeed2;
                        break;

                    default:
                        break;
                    }

                    Local_index++;
                }

                //Met la couleur par le tier
                this.Champion_Name.Foreground = TacheFond.GetColorTier(_Champion.GetTier);
                this.Tier.Foreground          = TacheFond.GetColorTier(_Champion.GetTier);
            }
        }
示例#31
0
 public ShieldSpell(Champion champ, SpellSlot slot)
 {
     Champ = champ;
     Slot  = slot;
 }
示例#32
0
 public static int attack(Champion a_attacker, Champion a_defender)
 {
     return Math.Max((a_attacker.getStat("attack") - a_defender.getStat("defense")), 0);
 }
示例#33
0
        public Tuple <List <Champion>, ReturnMessage> GetChampions()
        {
            try
            {
                if (repo.State != ConnectionState.Open)
                {
                    repo.Open();
                }
                List <Champion> outputList   = new List <Champion>();
                List <Ability>  abilityList  = GetAbilities().Item1;
                List <Resource> resourceList = GetResources().Item1;
                if (repo.State != ConnectionState.Open)
                {
                    repo.Open();
                }

                string         query = String.Format("SELECT * FROM dbo.{0}", tables[2]);
                SqlDataAdapter adapt = new SqlDataAdapter(query, repo);

                DataSet database = new DataSet();
                adapt.Fill(database, tables[2]);

                foreach (DataRow row in database.Tables[tables[2]].Rows)
                {
                    Champion reCreate = new Champion()
                    {
                        ID                         = (int)row["ID"],
                        Resource                   = resourceList.Find(x => x.ID == (int)row["ResourceID"]),
                        PassiveAbility             = abilityList.Find(x => x.ID == (int)row["PassiveID"]),
                        QAbility                   = abilityList.Find(x => x.ID == (int)row["QID"]),
                        WAbility                   = abilityList.Find(x => x.ID == (int)row["WID"]),
                        EAbility                   = abilityList.Find(x => x.ID == (int)row["EID"]),
                        RAbility                   = abilityList.Find(x => x.ID == (int)row["RID"]),
                        Name                       = row["Name"].ToString().Trim(' '),
                        HealthStart                = row["HealthStart"].ToString().Trim(' '),
                        HealthGrowth               = row["HealthGrowth"].ToString().Trim(' '),
                        HealthRegenStart           = row["HealthRegenStart"].ToString().Trim(' '),
                        HealthRegenGrowth          = row["HealthRegenGrowth"].ToString().Trim(' '),
                        ResourceStart              = row["ResourceStart"].ToString().Trim(' '),
                        ResourceGrowth             = row["ResourceGrowth"].ToString().Trim(' '),
                        ResourceRegenStart         = row["ResourceRegenStart"].ToString().Trim(' '),
                        ResourceRegenGrowth        = row["ResourceRegenGrowth"].ToString().Trim(' '),
                        AttackDamageStart          = row["AttackDamageStart"].ToString().Trim(' '),
                        AttackDamageGrowth         = row["AttackDamageGrowth"].ToString().Trim(' '),
                        AbilityPowerStart          = row["AbilityPowerStart"].ToString().Trim(' '),
                        AbilityPowerGrowth         = row["AbilityPowerGrowth"].ToString().Trim(' '),
                        AttackSpeedStart           = row["AttackSpeedStart"].ToString().Trim(' '),
                        AttackSpeedGrowth          = row["AttackSpeedGrowth"].ToString().Trim(' '),
                        RangeStart                 = row["RangeStart"].ToString().Trim(' '),
                        RangeGrowth                = row["RangeGrowth"].ToString().Trim(' '),
                        CriticalStrikeChanceStart  = row["CriticalStrikeChanceStart"].ToString().Trim(' '),
                        CriticalStrikeChanceGrowth = row["CriticalStrikeChanceGrowth"].ToString().Trim(' '),
                        ArmorStart                 = row["ArmorStart"].ToString().Trim(' '),
                        ArmorGrowth                = row["ArmorGrowth"].ToString().Trim(' '),
                        MagicResistStart           = row["MagicResistStart"].ToString().Trim(' '),
                        MagicResistGrowth          = row["MagicResistGrowth"].ToString().Trim(' '),
                        MoveSpeedStart             = row["MoveSpeedStart"].ToString().Trim(' '),
                        MoveSpeedGrowth            = row["MoveSpeedGrowth"].ToString().Trim(' ')
                    };

                    outputList.Add(reCreate);
                }

                ReturnMessage message = new ReturnMessage()
                {
                    WasSuccesful = true, Message = "No Problems", Where = "GetChampions", DBState = repo.State
                };

                return(new Tuple <List <Champion>, ReturnMessage>(outputList, message));
            }
            catch (Exception e)
            {
                ReturnMessage message = new ReturnMessage()
                {
                    WasSuccesful = false, Message = "Something went awry", Exception = e, Where = "GetChampions", DBState = repo.State
                };

                return(new Tuple <List <Champion>, ReturnMessage>(null, message));
            }
            finally
            {
                repo.Close();
            }
        }
 public DangerousSpell(Champion _hero, SpellSlot slot, bool defaultvalue)
 {
     Slot         = slot;
     Hero         = _hero;
     DefaultValue = defaultvalue;
 }
示例#35
0
 public void Clear()
 {
     Debug.Log("Destroying " + gameObject.name);
     Destroy(Champion.gameObject);
     Champion = null;
 }
示例#36
0
        public override void ApplyMove(List <Card> enemyCards, List <Card> friendlyCards, Champion enemyChamp, List <GameAction> actions)
        {
            var attackedCard = Attack(TargetedCards(enemyCards).FirstOrDefault());

            if (attackedCard != null)
            {
                actions.Add(new GameAction(this, new List <Character> {
                    attackedCard
                }));
            }
            else
            {
                Attack(enemyChamp);
                actions.Add(new GameAction(this, new List <Character> {
                    enemyChamp
                }));
            }
        }
    public static void Reset()
    {
        List <Champion> t_OwnedChampions = new List <Champion>(Champion.Filter(Champion.FilterType.Owned, Champion.GetSortedBy(Champion.SortValue.Name)));

        foreach (CreateChampionDropdown t_Element in m_UIElements)
        {
            if (t_Element.Value != null)
            {
                t_OwnedChampions.Remove(t_Element.Value);
            }
        }

        foreach (CreateChampionDropdown t_Element in m_UIElements)
        {
            t_Element.SetChampionList(t_OwnedChampions);
        }
    }
示例#38
0
        public async void RetrieveChampionTest()
        {
            Champion champion = await creepScore.RetrieveChampion(CreepScore.Region.NA, 48);

            Assert.True(champion.active);
        }
示例#39
0
 public static DamageLibraryManager.ChampionDamageDatabase GetChampionDamageDatabase(Champion source)
 {
     DamageLibraryManager.ChampionDamageDatabase db;
     return(DamageLibraryManager.TryGetChampion(source, out db) ? db : new DamageLibraryManager.ChampionDamageDatabase());
 }
示例#40
0
 public void OnFinishCasting(Champion owner, Spell spell, AttackableUnit target)
 {
 }
 internal static ReturnMessage DeleteChampion(Champion source)
 {
     return(Facade.DeleteChampion(source));
 }
示例#42
0
 public void ApplyEffects(Champion owner, AttackableUnit target, Spell spell, Projectile projectile)
 {
 }
 internal static ReturnMessage NewChampion(Champion source)
 {
     return(Facade.NewChampion(source));
 }
示例#44
0
 public void OnActivate(Champion owner)
 {
 }
示例#45
0
 internal static bool ContainsStage(Champion champion, SpellSlot slot, DamageLibrary.SpellStages stage)
 {
     return(ContainsSlot(champion, slot) && Database[champion][slot].ContainsKey(stage));
 }
示例#46
0
        private void updateBattle()
        {
            if (m_selectedChampion == null) {
                m_selectedChampion = m_battleQueue.First();
                m_selectedChampion.championsTurn();
            }
            int negativeSpeed = m_selectedChampion.p_speed;

            foreach (Champion l_champion in m_battleQueue) {
                l_champion.p_speed -= negativeSpeed;
            }
            m_battleQueue.Sort();
        }
示例#47
0
 public DangerousSpell(Champion _hero, SpellSlot slot, bool defaultvalue)
 {
     Slot = slot;
     Hero = _hero;
     DefaultValue = defaultvalue;
 }
示例#48
0
 public void removeChampion(Champion a_champion)
 {
     m_champions[a_champion.getName()].kill();
     m_champions.Remove(a_champion.getName());
 }
示例#49
0
 public Skin(Champion champ, List <string> skins)
 {
     Champ = champ;
     Skins = skins;
 }
示例#50
0
 internal static bool ContainsChampion(Champion champion)
 {
     return(Database.ContainsKey(champion));
 }
示例#51
0
        private void selectChampion(Champion a_champion)
        {
            deselectChampion();
            m_selectedChampion = a_champion;

            if (a_champion == null) {
                return;
            }

            m_selectedChampion.select();

            GuiListManager.setListPosition(m_championInfo, new Vector2(10, 10), new Vector2(0, 20));
            GuiListManager.loadList(m_championInfo);
        }
示例#52
0
 public static DamageLibraryManager.SpellDamageDatabase GetSpellDamageDatabase(Champion source, SpellSlot slot)
 {
     DamageLibraryManager.SpellDamageDatabase db;
     return(DamageLibraryManager.TryGetSlot(source, slot, out db) ? db : new DamageLibraryManager.SpellDamageDatabase());
 }
示例#53
0
 private Shop(Champion owner)
 {
     _owner     = owner;
     _inventory = _owner.Inventory;
 }
示例#54
0
 public CollisionCountOBJ(Champion champ, SpellSlot slot, int count)
 {
     Champion = champ;
     Slot     = slot;
     Count    = count;
 }
示例#55
0
 public BaseUlt(Menu menu, Champion champion)
     : base(menu, champion)
 {
 }
示例#56
0
        /*****************************/
        /*** Fonctions ***************/
        /*****************************/
        public void AddOrRemoveChampion(Champion _Champion, bool _ByUser)
        {
            this.ChampionOnSlot = _Champion;

            this.OrigineClasseOne   = null;
            this.OrigineClasseTwo   = null;
            this.OrigineClasseThree = null;

            int Local_Number = int.Parse(TacheFond.GetMainRef.GetSetActualNumber);

            if (_Champion != null)
            {
                if (_ByUser)
                {
                    Local_Number++;
                    TacheFond.GetMainRef.GetSetActualNumber = Local_Number.ToString();
                }

                this.Champion_Icon.Source = _Champion.GetIcon;
                this.Name_Champion.Text   = _Champion.GetName;

                this.Classe_1.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_One}.png", UriKind.Relative));
                this.Classe_2.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_Two}.png", UriKind.Relative));
                this.Classe_3.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_Three}.png", UriKind.Relative));

                //Recupere les Origines et Classes
                bool Local_MakeOne   = true;
                bool Local_MakeTwo   = true;
                bool Local_MakeThree = true;

                if (_Champion.GetClasse_One == Enums.Enum_Classe.None)
                {
                    Local_MakeOne = false;
                }

                if (_Champion.GetClasse_Two == Enums.Enum_Classe.None)
                {
                    Local_MakeTwo = false;
                }

                if (_Champion.GetClasse_Three == Enums.Enum_Classe.None)
                {
                    Local_MakeThree = false;
                }

                if (Local_MakeOne == true || Local_MakeTwo == true || Local_MakeThree == true)
                {
                    foreach (OrigineClasse item in TacheFond.ListOrigineClasse)
                    {
                        if (Local_MakeOne == true && _Champion.GetClasse_One == item.GetClasseType)
                        {
                            this.OrigineClasseOne = item;
                            Local_MakeOne         = false;
                        }
                        else if (Local_MakeTwo == true && _Champion.GetClasse_Two == item.GetClasseType)
                        {
                            this.OrigineClasseTwo = item;
                            Local_MakeTwo         = false;
                        }
                        else if (Local_MakeThree == true && _Champion.GetClasse_Three == item.GetClasseType)
                        {
                            this.OrigineClasseThree = item;
                            Local_MakeThree         = false;
                        }
                    }
                }

                //Met la couleur par le tier
                this.Name_Champion.Foreground = TacheFond.GetColorTier(_Champion.GetTier);
            }
            else
            {
                if (_ByUser)
                {
                    Local_Number--;
                    TacheFond.GetMainRef.GetSetActualNumber = Local_Number.ToString();
                }

                this.Champion_Icon.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Empty.png", UriKind.Relative));
                this.Name_Champion.Text   = "";

                this.Classe_1.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Invisible.png", UriKind.Relative));
                this.Classe_2.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Invisible.png", UriKind.Relative));
                this.Classe_3.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Invisible.png", UriKind.Relative));

                this.Name_Champion.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#8C9095"));
            }
        }
示例#57
0
 public static bool IsAutoHarassEnabledFor(Champion hero) => MenuManager.MenuValues["Plugins.Corki.MiscMenu.AutoHarassEnabled." + hero];
示例#58
0
 public static bool IsEnabledFor(Champion championName) => MenuManager.MenuValues["Plugins.Tristana.ComboMenu.UseEOn." + championName];
示例#59
0
 public RandomUlt(Menu menu, Champion? champion)
     : base(menu, champion)
 {
 }
示例#60
0
        public void FixtureSetUp()
        {
            autoMocker = new RhinoAutoMocker <GameDefinitionDetailsViewModelBuilder>();
            autoMocker.PartialMockTheClassUnderTest();

            expectedPlayerSummary1 = new PlayerSummaryViewModel();
            expectedPlayerSummary2 = new PlayerSummaryViewModel();

            List <PlayedGame> playedGames = new List <PlayedGame>();

            playedGames.Add(new PlayedGame
            {
                Id = 10
            });
            playedGameDetailsViewModel1 = new PlayedGameDetailsViewModel();
            playedGames.Add(new PlayedGame
            {
                Id = 11
            });
            playedGameDetailsViewModel2 = new PlayedGameDetailsViewModel();
            championPlayer = new Player
            {
                Name = championName,
                Id   = championPlayerId
            };
            previousChampionPlayer = new Player
            {
                Name = previousChampionName,
                Id   = previousChampionPlayerId
            };
            champion = new Champion
            {
                Player        = championPlayer,
                WinPercentage = championWinPercentage,
                NumberOfGames = championNumberOfGames,
                NumberOfWins  = championNumberOfWins
            };
            previousChampion = new Champion
            {
                Player = previousChampionPlayer
            };
            playerWinRecord1 = new PlayerWinRecord
            {
                GamesWon      = 1,
                GamesLost     = 2,
                PlayerName    = "player name",
                WinPercentage = 33,
                PlayerId      = 3
            };
            playerWinRecord2 = new PlayerWinRecord();

            autoMocker.Get <ITransformer>().Expect(mock => mock.Transform <PlayerWinRecord, PlayerSummaryViewModel>(playerWinRecord1))
            .Return(expectedPlayerSummary1);
            autoMocker.Get <ITransformer>().Expect(mock => mock.Transform <PlayerWinRecord, PlayerSummaryViewModel>(playerWinRecord2))
            .Return(expectedPlayerSummary2);

            gameDefinitionSummary = new GameDefinitionSummary
            {
                Id                            = 1,
                Name                          = "game definition name",
                Description                   = "game definition description",
                GamingGroupId                 = gamingGroupid,
                GamingGroupName               = "gaming group name",
                PlayedGames                   = playedGames,
                TotalNumberOfGamesPlayed      = 3,
                AveragePlayersPerGame         = 2.2M,
                BoardGameGeekGameDefinitionId = 123,
                Champion                      = champion,
                PreviousChampion              = previousChampion,
                PlayerWinRecords              = new List <PlayerWinRecord>
                {
                    playerWinRecord1,
                    playerWinRecord2
                }
            };
            currentUser = new ApplicationUser
            {
                CurrentGamingGroupId = gamingGroupid
            };
            autoMocker.Get <IPlayedGameDetailsViewModelBuilder>().Expect(mock => mock.Build(gameDefinitionSummary.PlayedGames[0], currentUser))
            .Return(playedGameDetailsViewModel1);
            autoMocker.Get <IPlayedGameDetailsViewModelBuilder>().Expect(mock => mock.Build(gameDefinitionSummary.PlayedGames[1], currentUser))
            .Return(playedGameDetailsViewModel2);

            viewModel = autoMocker.ClassUnderTest.Build(gameDefinitionSummary, currentUser);
        }