Inheritance: MonoBehaviour
示例#1
0
 public void RemoveRune(Rune rune)
 {
     Runes.Remove(rune);
     CalculateStat();
     CreatureManager.Instance.Save();
     RuneManager.Instance.Save();
 }
    void OnLevelWasLoaded(int level)
    {
        enemySpawnPoint = GameObject.Find("SpawnPoint2").GetComponent<Transform>();
        if (GameObject.Find(spawnPointName) != null)
        {
            spawnPoint = GameObject.Find(spawnPointName).GetComponent<Transform>();
        }
        else
        {
            spawnPoint = GameObject.Find("SpawnPoint").GetComponent<Transform>();
        }
        if (PhotonNetwork.isMasterClient)
        {
            //PhotonNetwork.InstantiateSceneObject("Orc", enemySpawnPoint.position, enemySpawnPoint.rotation, 0, null);
        }
        player = PhotonNetwork.Instantiate("Elf", spawnPoint.position, spawnPoint.rotation, 0);
        combatManager = player.GetComponent<PlayerCombatManager>();
        combatManager.enabled = true;
        playerRunes = player.GetComponent<Runes>();
        playerRunes.enabled = true;
        //player.GetComponent<Health>().enabled = true;
        cameraFollow = Camera.main.GetComponent<CameraFollow>();
        cameraFollow.enabled = true;
        playerHealth = player.GetComponent<Health>();
        //playerHealth.enabled = true;

    }
示例#3
0
 public LoginPage()
 {
     InitializeComponent();
     SetupProperties();
     // GetNews(region);
     Client.Region         = region;
     Client.SQLiteDatabase = new SQLite.SQLiteConnection(Path.Combine(Client.ExecutingDirectory, Client.sqlite));
     Client.Champions      = (from s in Client.SQLiteDatabase.Table <champions>() orderby s.name select s).ToList();
     foreach (champions c in Client.Champions)
     {
         Console.WriteLine(Client.ExecutingDirectory);
         Console.Write(c.iconPath);
         var Source = new Uri(Path.Combine(Client.ExecutingDirectory, "Assets", "champions", c.iconPath), UriKind.Absolute);
         c.icon = new BitmapImage(Source);
         Console.WriteLine("Requesting : " + c.name + " champ");
         Champions.InsertExtraChampData(c);
     }
     Client.ChampionSkins     = (from s in Client.SQLiteDatabase.Table <championSkins>() orderby s.name select s).ToList();
     Client.ChampionAbilities = (from s in Client.SQLiteDatabase.Table <championAbilities>() orderby s.name select s).ToList();
     Client.SearchTags        = (from s in Client.SQLiteDatabase.Table <championSearchTags>() orderby s.id select s).ToList();
     Client.Keybinds          = (from s in Client.SQLiteDatabase.Table <keybindingEvents>() orderby s.id select s).ToList();
     Client.Items             = Items.PopulateItems();
     Client.Masteries         = Masteries.PopulateMasteries();
     Client.Runes             = Runes.PopulateRunes();
 }
示例#4
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (PlayerId != 0)
        {
            hash ^= PlayerId.GetHashCode();
        }
        if (UserName.Length != 0)
        {
            hash ^= UserName.GetHashCode();
        }
        if (Role != 0)
        {
            hash ^= Role.GetHashCode();
        }
        if (IsReady != false)
        {
            hash ^= IsReady.GetHashCode();
        }
        if (Runes != 0)
        {
            hash ^= Runes.GetHashCode();
        }
        if (Faction != 0)
        {
            hash ^= Faction.GetHashCode();
        }
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
示例#5
0
        public void RemoveRune(Item rune)
        {
            rune.EmbeddedOnItem   = null;
            rune.EquippedThisTurn = true;

            if (Owner == null || Owner.BotId == AIStatics.WuffieBotId)
            {
                rune.Owner          = null;
                rune.PvPEnabled     = (int)GameModeStatics.GameModes.Any;
                rune.dbLocationName = dbLocationName;
                rune.TimeDropped    = DateTime.Now;
            }
            else
            {
                rune.Owner      = Owner;
                rune.PvPEnabled = Owner.BotId == AIStatics.ActivePlayerBotId
                    ? Owner.GameMode
                    : (int)GameModeStatics.GameModes.Any;
                rune.dbLocationName = string.Empty;
            }

            if (rune.PvPEnabled == (int)GameModeStatics.GameModes.Superprotection)
            {
                rune.PvPEnabled = (int)GameModeStatics.GameModes.Protection;
            }

            Runes.Remove(rune);
        }
    public void SetRune(Runes aRune)
    {
        //if (aRune == _type)
        //{
        //    return;
        //}
        _type = aRune;
        switch (aRune)
        {
        case Runes.FIRE:
            _image.sprite = _fireRune;
            break;

        case Runes.STRENGTH:
            _image.sprite = _strengthRune;
            break;

        case Runes.OCCULT:
            _image.sprite = _occultRune;
            break;

        case Runes.ENERGY:
        default:
            _image.sprite = _energyRune;
            break;
        }
    }
示例#7
0
 /// <summary>
 /// Attach a rune on to this item
 /// </summary>
 /// <param name="rune"></param>
 public void AttachRune(Item rune)
 {
     Runes.Add(rune);
     rune.EmbeddedOnItem   = this;
     rune.Owner            = null;
     rune.dbLocationName   = string.Empty;
     rune.EquippedThisTurn = true;
 }
示例#8
0
 public void RemoveRunes()
 {
     foreach (var rune in Runes.ToList())
     {
         RemoveRune(rune);
     }
     Runes.Clear();
 }
示例#9
0
 public StaticData()
 {
     Items     = new Items();
     Runes     = new Runes();
     Champions = new Champions();
     Masteries = new MasteryList();
     Maps      = new MapData();
 }
示例#10
0
 public void testSample()
 {
     Assert.AreEqual(2, Runes.solveExpression("1+1=?"), "Answer for expression '1+1=?' ");
     Assert.AreEqual(6, Runes.solveExpression("123*45?=5?088"), "Answer for expression '123*45?=5?088' ");
     Assert.AreEqual(0, Runes.solveExpression("-5?*-1=5?"), "Answer for expression '-5?*-1=5?' ");
     Assert.AreEqual(-1, Runes.solveExpression("19--45=5?"), "Answer for expression '19--45=5?' ");
     Assert.AreEqual(5, Runes.solveExpression("??*??=302?"), "Answer for expression '??*??=302?' ");
     Assert.AreEqual(2, Runes.solveExpression("?*11=??"), "Answer for expression '?*11=??' ");
     Assert.AreEqual(2, Runes.solveExpression("??*1=??"), "Answer for expression '??*1=??' ");
     Assert.AreEqual(-1, Runes.solveExpression("??+??=??"), "Answer for expression '??+??=??' ");
 }
示例#11
0
        /// <summary>
        /// Initializes the runes model and gets available runepages.
        /// </summary>
        /// <param name="DialogCoordinator"></param>
        public RunesViewModel(IDialogCoordinator DialogCoordinator)
        {
            this._dialogCoordinator = DialogCoordinator;
            this._runes             = new Runes();

            // Load rune pages from the file (if any)
            if (this._runes.RunePagesExist())
            {
                this._runePages       = new ObservableCollection <RunePage>(this._runes.GetSavedRunePages());
                this.SelectedRunePage = this._runePages[0];
            }
        }
示例#12
0
                internal override void LoadData(JSONObject json)
                {
                    try {
                        summoner_name = json["summonerName"].string_value;
                        summoner_id   = json["summonerId"].string_value;
                        runes         = new Runes(json["perks"]);

                        found = true;
                    } catch (System.Exception e) {
                        found = false;
                    }
                }
示例#13
0
    public void EnchantRune(Rune rune)
    {
        int rune_node = Runes.FindIndex(r => r.RuneIdx == rune.RuneIdx);

        if (rune_node < 0)
        {
            return;
        }
        Runes[rune_node] = rune;
        CalculateStat();
        CreatureManager.Instance.Save();
        RuneManager.Instance.Save();
    }
示例#14
0
        public void RunesTest()
        {
            Assert.AreEqual(2, Runes.solveExpression("1+1=?"), "Answer for expression '1+1=?' ");
            Assert.AreEqual(6, Runes.solveExpression("123*45?=5?088"), "Answer for expression '123*45?=5?088' ");
            Assert.AreEqual(0, Runes.solveExpression("-5?*-1=5?"), "Answer for expression '-5?*-1=5?' ");
            Assert.AreEqual(-1, Runes.solveExpression("19--45=5?"), "Answer for expression '19--45=5?' ");
            Assert.AreEqual(5, Runes.solveExpression("??*??=302?"), "Answer for expression '??*??=302?' ");

            Assert.AreEqual(0, Runes.solveExpression("123?45+?=123?45"), "testAddition");
            Assert.AreEqual(0, Runes.solveExpression("123?45*?=?"), "testMultiplication");
            Assert.AreEqual(0, Runes.solveExpression("123?45-?=123?45"), "testSubtrastion");

            Assert.AreEqual(2, Runes.solveExpression("?*11=??"), "Answer for expression '?*11=??' ");
        }
示例#15
0
 public void AddRune(Runes aRune)
 {
     //Debug.Log(aRune);
     _currentSequence.Add(aRune);
     if (_currentSequence.Count > CSequenceManager.Inst.GetCurrentRuneCount())
     {
         _currentSequence = new List <Runes>();
     }
     else
     {
         CAudioManager.Inst.PlaySFX("Hammer", false, transform, false, .5f);
         _anim.SetTrigger("Hammer");
     }
     _ui.SetSequence(_currentSequence);
 }
示例#16
0
    public bool CheckRuneStoneCanUpgrade(int runeStoneID)
    {
        bool flag = this.CheckRuneStoneIsUnLock(runeStoneID);

        if (flag)
        {
            int   lv    = this.GetRuneStoneLV(runeStoneID);
            Runes runes = DataReader <Runes> .DataList.Find((Runes a) => a.id == runeStoneID && a.lv == lv + 1);

            if (runes != null)
            {
                return(true);
            }
        }
        return(false);
    }
示例#17
0
    void Awake()
    {
        Defines.self = gameObject.GetComponent <Defines>();
        GameObject go = new GameObject();

        go.name     = "emptyGO";
        xa.emptyGO  = go;
        go          = new GameObject();
        go.name     = "emptyGO2";
        xa.emptyGO2 = go;

        Lines.InitLines();
        Runes.InitRunes();
        Nodes.InitNodes();
        Manas.InitMana();
    }
示例#18
0
        public void CheckIfThereIsAnEqualRune()
        {
            var rune1 = new Rune("Conquistador", RuneType.Precision, RuneLevel.Level4, "After 4 seconds in combat, your first attack against an enemy champion grants you 6-35 attack damage, based on level, for 3 seconds, and converts 20% of your damage to champions to true damage.");
            var rune2 = new Rune("Triunfo", RuneType.Precision, RuneLevel.Level3, "Takedowns restore 12% of your missing health and grant an additional 20 gold.");
            var rune3 = new Rune("Linhagem", RuneType.Precision, RuneLevel.Level2, "Takedowns on enemies grant permanent Lifesteal.");
            var rune4 = new Rune("Golpe de misericordia", RuneType.Precision, RuneLevel.Level1, "Deal more damage to low health enemy champions.");

            var runes = new Runes();

            runes.AddRune(rune1);
            runes.AddRune(rune2);
            runes.AddRune(rune3);
            runes.AddRune(rune4);

            Assert.True(runes.ListRunes.Count == 4);
        }
示例#19
0
 /// <summary>
 /// Constructor for this class.
 /// </summary>
 /// <param name="target">The target that will use these settings.</param>
 /// <param name="count">Minimum count for creatures.</param>
 /// <param name="rune">The rune to use.</param>
 /// <param name="spell">Name of the spell to use.</param>
 /// <param name="fightMode">The fight mode to use.</param>
 /// <param name="fightStance">The fight stance to use.</param>
 /// <param name="range">Maxmimum range for this target.</param>
 /// <param name="distanceRange">Minimum range to keep distance at.</param>
 /// <param name="dangerLevel">Represents how dangerous this target is.</param>
 /// <param name="mustBeReachable">Will only choose this setting if the target is reachable.</param>
 /// <param name="mustBeShootable">Will only choose this setting if the target is shootable.</param>
 /// <param name="useThisSetting">Whether to use this setting or not.</param>
 public Setting(Target target, byte count = 0, Runes rune = Runes.None, string spell = "",
                Enums.FightMode fightMode = Enums.FightMode.Offensive, Enums.FightStance fightStance = Enums.FightStance.Follow,
                byte range           = 5, byte distanceRange = 3, byte dangerLevel = 0,
                bool mustBeReachable = true, bool mustBeShootable = false, bool useThisSetting = true)
 {
     this.Target          = target;
     this.Count           = count;
     this.Rune            = rune;
     this.Spell           = spell;
     this.FightMode       = fightMode;
     this.FightStance     = fightStance;
     this.Range           = range;
     this.DistanceRange   = distanceRange;
     this.DangerLevel     = dangerLevel;
     this.MustBeReachable = mustBeReachable;
     this.MustBeShootable = mustBeShootable;
     this.UseThisSetting  = useThisSetting;
 }
示例#20
0
                /// <summary>
                /// Constructor for this class.
                /// </summary>
                /// <param name="target">The target that will use these settings.</param>
                /// <param name="count">Minimum count for creatures.</param>
                /// <param name="rune">Name of the rune to use.</param>
                /// <param name="spell">Name of the spell to use.</param>
                /// <param name="fightMode">The fight mode to use.</param>
                /// <param name="fightStance">The fight stance to use.</param>
                /// <param name="range">Maxmimum range for this target.</param>
                /// <param name="distanceRange">Minimum range to keep distance at.</param>
                /// <param name="dangerLevel">Represents how dangerous this target is.</param>
                /// <param name="mustBeReachable">Will only choose this setting if the target is reachable.</param>
                /// <param name="mustBeShootable">Will only choose this setting if the target is shootable.</param>
                /// <param name="useThisSetting">Whether to use this setting or not.</param>
                public Setting(Target target, byte count, string rune = "", string spell = "",
                               Enums.FightMode fightMode = Enums.FightMode.Offensive, Enums.FightStance fightStance = Enums.FightStance.Follow,
                               byte range           = 5, byte distanceRange = 3, byte dangerLevel = 0,
                               bool mustBeReachable = true, bool mustBeShootable = false, bool useThisSetting = true)
                {
                    Runes r = Runes.None;

                    switch (rune.ToLower())
                    {
                    case "none":
                    default:
                        r = Runes.None;
                        break;

                    case "sd":
                    case "sudden death":
                        r = Runes.SuddenDeath;
                        break;

                    case "explosion":
                    case "explo":
                        r = Runes.Explosion;
                        break;

                    case "hmm":
                    case "heavy magic missile":
                        r = Runes.HeavyMagicMissile;
                        break;
                    }

                    this.Target          = target;
                    this.Count           = count;
                    this.Rune            = r;
                    this.Spell           = spell;
                    this.FightMode       = fightMode;
                    this.FightStance     = fightStance;
                    this.Range           = range;
                    this.DistanceRange   = distanceRange;
                    this.DangerLevel     = dangerLevel;
                    this.MustBeReachable = mustBeReachable;
                    this.MustBeShootable = mustBeShootable;
                    this.UseThisSetting  = useThisSetting;
                }
示例#21
0
        static void Main(string[] args)
        {
            var rune1 = new Rune("Conquistador", RuneType.Precision, RuneLevel.Level4, "After 4 seconds in combat, your first attack against an enemy champion grants you 6-35 attack damage, based on level, for 3 seconds, and converts 20% of your damage to champions to true damage.");
            var rune2 = new Rune("Triunfo", RuneType.Precision, RuneLevel.Level3, "Takedowns restore 12% of your missing health and grant an additional 20 gold.");
            var rune3 = new Rune("Linhagem", RuneType.Precision, RuneLevel.Level2, "Takedowns on enemies grant permanent Lifesteal.");
            var rune4 = new Rune("Golpe de misericordia", RuneType.Precision, RuneLevel.Level1, "Deal more damage to low health enemy champions.");

            var runes = new Runes();

            runes.AddRune(rune1);
            runes.AddRune(rune1);
            runes.AddRune(rune1);
            runes.AddRune(rune1);

            foreach (var r in runes.ListRunes)
            {
                System.Console.WriteLine(r.ToString());
            }
        }
        //VERIFICA A COMBINAÇÃO DE RUNAS E RETORNA A TORRE EQUIVALENTE A ELAS
        public TowerType parseCombination(Runes rune1, Runes rune2, Runes rune3)
        {
            for (int i = 0; i < 12; i++)
            {
                if (rune1 == recipeArray[i].rune1)
                {
                    if (rune2 == recipeArray[i].rune2)
                    {
                        if (rune3 == recipeArray[i].rune3)
                        {
                            //Console.WriteLine("1- " + rune1.ToString() + "2- " + rune2.ToString() + "3- " + rune3.ToString() + "  " + recipeArray[i].towerType.ToString());
                            RuneManager.OpenRecipe(i);
                            return recipeArray[i].towerType;
                        }
                    }
                }
            }

            return TowerType.INVALID;
        }
示例#23
0
    private void OnClickAddProtectBtn(GameObject go)
    {
        Runes runesCfgData = SkillRuneManager.Instance.GetRunesCfgData(this.currentSelectRuneStoneID);

        if (runesCfgData == null)
        {
            return;
        }
        int  templateId = runesCfgData.protect.get_Item(0);
        long num        = BackpackManager.Instance.OnGetGoodCount(templateId);

        if (num <= 0L)
        {
            return;
        }
        this.IsSelectAddProtectBtn = !this.IsSelectAddProtectBtn;
        this.SetAddProtectBtnState();
        int addRatio = (!this.IsSelectAddProtectBtn) ? 0 : runesCfgData.protect.get_Item(1);

        this.UpdateRuneStoneUpgradeSuccessRatio(runesCfgData.successRate, addRatio);
    }
示例#24
0
    private void RefreshSelectRuneStoneDesc(int runeID)
    {
        this.runeStoneNameText.set_text(string.Empty);
        this.runeStoneDescText.set_text(string.Empty);
        if (runeID <= 0)
        {
            return;
        }
        Runes runesCfgData = SkillRuneManager.Instance.GetRunesCfgData(runeID);

        if (runesCfgData != null)
        {
            this.runeStoneDescText.set_text(GameDataUtils.GetChineseContent(runesCfgData.desc, false));
        }
        Runes_basic runesBasicCfgData = SkillRuneManager.Instance.GetRunesBasicCfgData(runeID);

        if (runesBasicCfgData != null)
        {
            this.runeStoneNameText.set_text(GameDataUtils.GetChineseContent(runesBasicCfgData.name, false));
        }
    }
示例#25
0
    private void RefreshRuneDesc(int id, Artifact godData)
    {
        Runes runes = DataReader <Runes> .Get(id);

        Runes_basic runes_basic = DataReader <Runes_basic> .Get(id);

        if (runes_basic != null)
        {
            ResourceManager.SetSprite(this.mSkillIcon, GameDataUtils.GetIcon(runes_basic.icon));
            this.mTxSkillName.set_text(GameDataUtils.GetChineseContent(runes_basic.name, false));
            this.mTxSkillTitle.set_text("符文描述:");
            this.mTxSkillDesc.set_text(GameDataUtils.GetChineseContent(runes.desc, false));
            string text = GameDataUtils.GetChineseContent(godData.access, false);
            if (godData.activation == 1)
            {
                RenWuPeiZhi renWuPeiZhi = DataReader <RenWuPeiZhi> .Get(godData.activationParameter);

                if (renWuPeiZhi != null)
                {
                    text = string.Format(text, GameDataUtils.GetChineseContent(renWuPeiZhi.dramaIntroduce, false), renWuPeiZhi.lv + "级");
                }
            }
            else if (godData.activation == 2)
            {
                text = string.Format(text, godData.activationParameter);
            }
            else if (godData.activation == 4)
            {
                Artifact artifact = DataReader <Artifact> .Get(godData.activationParameter);

                if (artifact != null)
                {
                    text = string.Format(text, GameDataUtils.GetChineseContent(artifact.name, false), godData.lv);
                }
            }
            this.mTxGetDesc.set_text(text);
        }
    }
示例#26
0
    void Update()
    {
        Lines.UpdateLines();
        Manas.UpdateMana();
        Runes.UpdateRunes();

        Nodes.DisplayNodeDebug();


        if (Input.GetKeyDown(KeyCode.T))
        {
            if (Time.timeScale == 1)
            {
                Time.timeScale = 0.5f;
            }
            else if (Time.timeScale == 0.5f)
            {
                Time.timeScale = 0.1f;
            }
            else if (Time.timeScale == 0.1f)
            {
                Time.timeScale = 2f;
            }
            else if (Time.timeScale == 2)
            {
                Time.timeScale = 5f;
            }
            else if (Time.timeScale == 5)
            {
                Time.timeScale = 1f;
            }
            Debug.Log("TimeScale: " + Time.timeScale);
        }

        Lines.ClearTheDead();

        Lines.PrintInfo();
    }
示例#27
0
        public LoginPage()
        {
            InitializeComponent();
            Version.TextChanged += WaterTextbox_TextChanged;
            Version.Text         = Client.Version;

            WebClient client = new WebClient();

            //var MpFileName = client.DownloadString(new Uri("http://legendaryclient.com/update.html"));
            SoundPlayer.Source = new Uri(Path.Combine(Client.ExecutingDirectory, "aud.mp3"));
            SoundPlayer.Play();
            Sound.IsChecked = false;

            //VideoPlayer.Source = new Uri(Path.Combine(Client.ExecutingDirectory, "login.swf"));
            //VideoPlayer.Play();
            Video.IsChecked = false;

            //Get client data after patcher completed

            //Client.SQLiteDatabase = new SQLite.SQLiteConnection("gameStats_en_US.sqlite");
            Client.SQLiteDatabase = new SQLite.SQLiteConnection(Client.sqlite);
            Client.Champions      = (from s in Client.SQLiteDatabase.Table <champions>()
                                     orderby s.name
                                     select s).ToList();

            foreach (champions c in Client.Champions)
            {
                var Source = new Uri(Path.Combine(Client.ExecutingDirectory, "Assets", "champions", c.iconPath), UriKind.Absolute);
                c.icon = new BitmapImage(Source);
                Champions.InsertExtraChampData(c);
            }
            Client.ChampionSkins = (from s in Client.SQLiteDatabase.Table <championSkins>()
                                    orderby s.name
                                    select s).ToList();
            Client.ChampionAbilities = (from s in Client.SQLiteDatabase.Table <championAbilities>()
                                        orderby s.name
                                        select s).ToList();
            Client.SearchTags = (from s in Client.SQLiteDatabase.Table <championSearchTags>()
                                 orderby s.id
                                 select s).ToList();
            Client.Keybinds = (from s in Client.SQLiteDatabase.Table <keybindingEvents>()
                               orderby s.id
                               select s).ToList();
            Client.Items     = Items.PopulateItems();
            Client.Masteries = Masteries.PopulateMasteries();
            Client.Runes     = Runes.PopulateRunes();
            Client.StartHeartbeat();

            //Retrieve latest client version

            /*
             * SWFReader reader = new SWFReader("ClientLibCommon.dat");
             * foreach (Tag tag in reader.Tags)
             * {
             *  if (tag is DoABC)
             *  {
             *      DoABC abcTag = (DoABC)tag;
             *      if (abcTag.Name.Contains("riotgames/platform/gameclient/application/Version"))
             *      {
             *          var str = System.Text.Encoding.Default.GetString(abcTag.ABCData);
             *          //Ugly hack ahead - turn back now! (http://pastebin.com/yz1X4HBg)
             *          string[] firstSplit = str.Split((char)6);
             *          string[] secondSplit = firstSplit[0].Split((char)18);
             *          //Client.Version = secondSplit[1];
             *      }
             *  }
             * }*/

            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedUsername))
            {
                RememberUsernameCheckbox.IsChecked = true;
                LoginUsernameBox.Text = Properties.Settings.Default.SavedUsername;
            }
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedPassword))
            {
                RememberPasswordCheckbox.IsChecked = true;
                LoginPasswordBox.Password          = Properties.Settings.Default.SavedPassword;
            }
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.Region))
            {
                RegionComboBox.SelectedValue = Properties.Settings.Default.Region;
            }

            var uriSource = new Uri(Path.Combine(Client.ExecutingDirectory, "Assets", "champions", champions.GetChampion(Client.LatestChamp).splashPath), UriKind.Absolute);

            LoginImage.Source = new BitmapImage(uriSource);//*/
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedPassword) &&
                !String.IsNullOrWhiteSpace(Properties.Settings.Default.Region) &&
                Properties.Settings.Default.AutoLogin)
            {
                AutoLoginCheckBox.IsChecked = true;
                LoginButton_Click(null, null);
            }
        }
示例#28
0
 override protected List <pd_RuneData> CreateSaveData()
 {
     return(Runes.Select(c => c.CreateSaveData()).ToList());
 }
示例#29
0
 public void AddRune(Rune rune)
 {
     Runes.Add(rune);
     CalculateStat();
 }
示例#30
0
 /// <summary>
 /// Constructor for this class.
 /// </summary>
 /// <param name="target">The target that will use these settings.</param>
 /// <param name="count">Minimum count for creatures.</param>
 /// <param name="rune">The rune to use.</param>
 /// <param name="spell">Name of the spell to use.</param>
 /// <param name="fightMode">The fight mode to use.</param>
 /// <param name="fightStance">The fight stance to use.</param>
 /// <param name="range">Maxmimum range for this target.</param>
 /// <param name="distanceRange">Minimum range to keep distance at.</param>
 /// <param name="dangerLevel">Represents how dangerous this target is.</param>
 /// <param name="mustBeReachable">Will only choose this setting if the target is reachable.</param>
 /// <param name="mustBeShootable">Will only choose this setting if the target is shootable.</param>
 /// <param name="useThisSetting">Whether to use this setting or not.</param>
 public Setting(Target target, byte count = 0, Runes rune = Runes.None, string spell = "",
     Enums.FightMode fightMode = Enums.FightMode.Offensive, Enums.FightStance fightStance = Enums.FightStance.Follow,
     byte range = 5, byte distanceRange = 3, byte dangerLevel = 0,
     bool mustBeReachable = true, bool mustBeShootable = false, bool useThisSetting = true)
 {
     this.Target = target;
     this.Count = count;
     this.Rune = rune;
     this.Spell = spell;
     this.FightMode = fightMode;
     this.FightStance = fightStance;
     this.Range = range;
     this.DistanceRange = distanceRange;
     this.DangerLevel = dangerLevel;
     this.MustBeReachable = mustBeReachable;
     this.MustBeShootable = mustBeShootable;
     this.UseThisSetting = useThisSetting;
 }
        public LoginPage()
        {
            InitializeComponent();

            //Get client data after patcher completed
            Client.SQLiteDatabase = new SQLite.SQLiteConnection("gameStats_en_US.sqlite");
            Client.Champions      = (from s in Client.SQLiteDatabase.Table <champions>()
                                     orderby s.name
                                     select s).ToList();

            if (Properties.Settings.Default.FavouriteChamps == null)
            {
                Properties.Settings.Default.FavouriteChamps = new Int32[0];
            }

            foreach (champions c in Client.Champions)
            {
                string Source = Path.Combine(Client.ExecutingDirectory, "Assets", "champions", c.iconPath);
                c.icon = Client.GetImage(Source);
                Champions.InsertExtraChampData(c);
                if (Properties.Settings.Default.FavouriteChamps.Contains(c.id))
                {
                    c.IsFavourite = true;
                }
            }

            Client.ChampionSkins = (from s in Client.SQLiteDatabase.Table <championSkins>()
                                    orderby s.name
                                    select s).ToList();
            Client.SearchTags = (from s in Client.SQLiteDatabase.Table <championSearchTags>()
                                 orderby s.id
                                 select s).ToList();
            Client.Keybinds = (from s in Client.SQLiteDatabase.Table <keybindingEvents>()
                               orderby s.id
                               select s).ToList();
            Client.Items     = Items.PopulateItems();
            Client.Masteries = Masteries.PopulateMasteries();
            Client.Runes     = Runes.PopulateRunes();

            //Retrieve latest client version
            SWFReader reader = new SWFReader("ClientLibCommon.dat");

            foreach (Tag tag in reader.Tags)
            {
                if (tag is DoABC)
                {
                    DoABC abcTag = (DoABC)tag;
                    if (abcTag.Name.Contains("riotgames/platform/gameclient/application/Version"))
                    {
                        var str = System.Text.Encoding.Default.GetString(abcTag.ABCData);
                        //Ugly hack ahead - turn back now! (http://pastebin.com/yz1X4HBg)
                        string[] firstSplit  = str.Split((char)6);
                        string[] secondSplit = firstSplit[0].Split((char)18);
                        //Client.Version = secondSplit[1];
                    }
                }
            }

            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedUsername))
            {
                RememberUsernameCheckbox.IsChecked = true;
                LoginUsernameBox.Text = Properties.Settings.Default.SavedUsername;
            }
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedPassword))
            {
                RememberPasswordCheckbox.IsChecked = true;
                LoginPasswordBox.Password          = Properties.Settings.Default.SavedPassword;
            }
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.Region))
            {
                RegionComboBox.SelectedValue = Properties.Settings.Default.Region;
            }
            string uriSource = Path.Combine(Client.ExecutingDirectory, "Assets", "champions", champions.GetChampion(Client.LatestChamp).splashPath);

            LoginImage.Source = Client.GetImage(uriSource);
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedPassword) &&
                !String.IsNullOrWhiteSpace(Properties.Settings.Default.Region) &&
                Properties.Settings.Default.AutoLogin)
            {
                AutoLoginCheckBox.IsChecked = true;
                LoginButton_Click(null, null);
            }
        }
示例#32
0
        public LoginPage()
        {
            InitializeComponent();

            //Get client data after patcher completed
            string latestVersion = "0.0.0.0";
            string GameLocation  = Path.Combine("League of Legends", "RADS");

            if (Directory.Exists(GameLocation))
            {
                System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
                DirectoryInfo             dInfo    = new DirectoryInfo(Path.Combine(GameLocation, "projects", "lol_air_client", "releases"));
                DirectoryInfo[]           subdirs  = null;
                try
                {
                    subdirs = dInfo.GetDirectories();
                    foreach (DirectoryInfo info in subdirs)
                    {
                        latestVersion = GetGreaterVersion(latestVersion, info.Name);
                    }
                }
                catch (Exception er) { Console.WriteLine(er.Message); }
            }

            Client.SQLiteDatabase = new SQLite.SQLiteConnection(Path.Combine(GameLocation, "projects", "lol_air_client", "releases", latestVersion, "deploy", "assets", "data", "gameStats", "gameStats_en_US.sqlite"));
            Client.Champions      = (from s in Client.SQLiteDatabase.Table <champions>()
                                     orderby s.name
                                     select s).ToList();

            if (Properties.Settings.Default.FavouriteChamps == null)
            {
                Properties.Settings.Default.FavouriteChamps = new Int32[0];
            }

            foreach (champions c in Client.Champions)
            {
                string Source = Path.Combine(Client.ExecutingDirectory, "Assets", "champions", c.iconPath);
                c.icon = Client.GetImage(Source);
                Champions.InsertExtraChampData(c);
                if (Properties.Settings.Default.FavouriteChamps.Contains(c.id))
                {
                    c.IsFavourite = true;
                }
            }

            Client.ChampionSkins = (from s in Client.SQLiteDatabase.Table <championSkins>()
                                    orderby s.name
                                    select s).ToList();
            Client.SearchTags = (from s in Client.SQLiteDatabase.Table <championSearchTags>()
                                 orderby s.id
                                 select s).ToList();
            Client.Keybinds = (from s in Client.SQLiteDatabase.Table <keybindingEvents>()
                               orderby s.id
                               select s).ToList();
            Client.Items     = Items.PopulateItems();
            Client.Masteries = Masteries.PopulateMasteries();
            Client.Runes     = Runes.PopulateRunes();

            //Retrieve latest client version
            SWFReader reader = new SWFReader("ClientLibCommon.dat");

            foreach (Tag tag in reader.Tags)
            {
                if (tag is DoABC)
                {
                    DoABC abcTag = (DoABC)tag;
                    if (abcTag.Name.Contains("riotgames/platform/gameclient/application/Version"))
                    {
                        var str = System.Text.Encoding.Default.GetString(abcTag.ABCData);
                        //Ugly hack ahead - turn back now! (http://pastebin.com/yz1X4HBg)
                        string[] firstSplit  = str.Split((char)6);
                        string[] secondSplit = firstSplit[0].Split((char)19);
                        Client.Version = secondSplit[1];
                    }
                }
            }

            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedUsername))
            {
                RememberUsernameCheckbox.IsChecked = true;
                LoginUsernameBox.Text = Properties.Settings.Default.SavedUsername;
            }
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedPassword))
            {
                RememberPasswordCheckbox.IsChecked = true;
                LoginPasswordBox.Password          = Properties.Settings.Default.SavedPassword;
            }
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.Region))
            {
                RegionComboBox.SelectedValue = Properties.Settings.Default.Region;
            }
            champions champ     = champions.GetChampion(Client.LatestChamp);
            string    uriSource = Path.Combine(Client.ExecutingDirectory, "Assets", "champions", champ.splashPath);

            LoginImage.Source = Client.GetImage(uriSource);
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedPassword) &&
                !String.IsNullOrWhiteSpace(Properties.Settings.Default.Region) &&
                Properties.Settings.Default.AutoLogin)
            {
                AutoLoginCheckBox.IsChecked = true;
                LoginButton_Click(null, null);
            }
        }
示例#33
0
        public LoginPage()
        {
            InitializeComponent();
            Change();
            Client.donepatch     = true;
            Client.patching      = false;
            Version.TextChanged += WaterTextbox_TextChanged;
            bool x = Settings.Default.DarkTheme;

            if (!x)
            {
                var bc = new BrushConverter();
                HideGrid.Background = (Brush)bc.ConvertFrom("#B24F4F4F");
                LoggingInProgressRing.Foreground = (Brush)bc.ConvertFrom("#FFFFFFFF");
            }
            //#B2C8C8C8
            UpdateRegionComboBox.SelectedValue = Client.UpdateRegion;
            if (Client.UpdateRegion == "Garena" && !Client.Garena)
            {
                LoadGarena();
            }
            switch (Client.UpdateRegion)
            {
            case "PBE": RegionComboBox.ItemsSource = new[] { "PBE" };
                break;

            case "Live": RegionComboBox.ItemsSource = new[] { "BR", "EUNE", "EUW", "NA", "OCE", "RU", "LAS", "LAN", "TR", "CS" };
                break;

            case "Korea": RegionComboBox.ItemsSource = new[] { "KR" };
                break;

            case "Garena": RegionComboBox.ItemsSource = new[] { "PH", "SG", "SGMY", "TH", "TW", "VN" };
                break;
            }


            if (!Settings.Default.DisableLoginMusic)
            {
                SoundPlayer.Source = new Uri(Path.Combine(Client.ExecutingDirectory, "Client", "Login.mp3"));
                SoundPlayer.Play();
                Sound.IsChecked = false;
            }
            else
            {
                Sound.IsChecked = true;
            }

            if (!String.IsNullOrEmpty(Settings.Default.devKeyLoc))
            {
                if (Client.Authenticate(Settings.Default.devKeyLoc))
                {
                    Client.Dev          = true;
                    devKeyLabel.Content = "Dev";
                }
            }

            if (Settings.Default.LoginPageImage == "")
            {
                LoginPic.Source         = new Uri(Path.Combine(Client.ExecutingDirectory, "Client", "Login.mp4"));
                LoginPic.LoadedBehavior = MediaState.Manual;
                LoginPic.MediaEnded    += LoginPic_MediaEnded;
                SoundPlayer.MediaEnded += SoundPlayer_MediaEnded;
                LoginPic.Play();
            }
            else
            {
                if (
                    File.Exists(Path.Combine(Client.ExecutingDirectory, "Assets", "champions",
                                             Settings.Default.LoginPageImage.Replace("\r\n", ""))))
                {
                    LoginImage.Source =
                        new BitmapImage(
                            new Uri(
                                Path.Combine(Client.ExecutingDirectory, "Assets", "champions",
                                             Settings.Default.LoginPageImage), UriKind.Absolute));
                }
            }

            Video.IsChecked = false;

            //Get client data after patcher completed

            Client.SQLiteDatabase = new SQLiteConnection(Path.Combine(Client.ExecutingDirectory, Client.sqlite));
            Client.Champions      = (from s in Client.SQLiteDatabase.Table <champions>()
                                     orderby s.name
                                     select s).ToList();

            FreeToPlayChampions.GetInstance();

            foreach (champions c in Client.Champions)
            {
                var source = new Uri(Path.Combine(Client.ExecutingDirectory, "Assets", "champions", c.iconPath),
                                     UriKind.Absolute);
                c.icon = new BitmapImage(source);
                Debugger.Log(0, "Log", "Requesting :" + c.name + " champ");
                Debugger.Log(0, "", Environment.NewLine);

                try
                {
                    c.IsFreeToPlay = FreeToPlayChampions.GetInstance().IsFreeToPlay(c);
                    Champions.InsertExtraChampData(c);
                    //why was this ever here? all of the needed info is already in the sqlite file
                }
                catch
                {
                    Client.Log("error, file not found", "NotFound");
                }
            }
            Client.ChampionSkins = (from s in Client.SQLiteDatabase.Table <championSkins>()
                                    orderby s.name
                                    select s).ToList();
            Client.ChampionAbilities = (from s in Client.SQLiteDatabase.Table <championAbilities>()
                                        //Needs Fixed
                                        orderby s.name
                                        select s).ToList();
            Client.SearchTags = (from s in Client.SQLiteDatabase.Table <championSearchTags>()
                                 orderby s.id
                                 select s).ToList();
            Client.Keybinds = (from s in Client.SQLiteDatabase.Table <keybindingEvents>()
                               orderby s.id
                               select s).ToList();
            Client.Items     = Items.PopulateItems();
            Client.Masteries = Masteries.PopulateMasteries();
            Client.Runes     = Runes.PopulateRunes();
            BaseUpdateRegion updateRegion = BaseUpdateRegion.GetUpdateRegion(Client.UpdateRegion);
            var patcher = new RiotPatcher();

            string tempString = patcher.GetListing(updateRegion.AirListing);

            string[] packages = patcher.GetManifest(
                updateRegion.AirManifest + "releases/" + tempString + "/packages/files/packagemanifest");
            foreach (
                string usestring in
                packages.Select(package => package.Split(',')[0])
                .Where(usestring => usestring.Contains("ClientLibCommon.dat")))
            {
                new WebClient().DownloadFile(new Uri(updateRegion.BaseLink + usestring),
                                             Path.Combine(Client.ExecutingDirectory, "ClientLibCommon.dat"));
            }

            var reader = new SWFReader(Path.Combine(Client.ExecutingDirectory, "ClientLibCommon.dat"));

            foreach (var secondSplit in from abcTag in reader.Tags.OfType <DoABC>()
                     where abcTag.Name.Contains("riotgames/platform/gameclient/application/Version")
                     select Encoding.Default.GetString(abcTag.ABCData)
                     into str
                     select str.Split((char)6)
                     into firstSplit

                     select firstSplit[0].Split((char)18))
            {
                try
                {
                    Client.Version = secondSplit[1];
                }
                catch
                {
                    var thirdSplit = secondSplit[0].Split((char)19);
                    Client.Version = thirdSplit[1];
                }
            }


            Version.Text = Client.Version;

            if (!String.IsNullOrWhiteSpace(Settings.Default.SavedUsername))
            {
                RememberUsernameCheckbox.IsChecked = true;
                LoginUsernameBox.Text = Settings.Default.SavedUsername;
            }
            if (!String.IsNullOrWhiteSpace(Settings.Default.SavedPassword))
            {
                SHA1 sha = new SHA1CryptoServiceProvider();
                RememberPasswordCheckbox.IsChecked = true;
                LoginPasswordBox.Password          =
                    Settings.Default.SavedPassword.DecryptStringAES(
                        sha.ComputeHash(Encoding.UTF8.GetBytes(Settings.Default.Guid)).ToString());
            }
            if (!String.IsNullOrWhiteSpace(Settings.Default.Region))
            {
                RegionComboBox.SelectedValue = Settings.Default.Region;
            }

            invisibleLoginCheckBox.IsChecked = Settings.Default.incognitoLogin;

            /*var uriSource =
             *  new Uri(
             *      Path.Combine(Client.ExecutingDirectory, "Assets", "champions",
             *          champions.GetChampion(Client.LatestChamp).splashPath), UriKind.Absolute);
             * LoginImage.Source = new BitmapImage(uriSource);*/
            if (Client.Garena)
            {
                Client.PVPNet = null;
                Client.PVPNet = new PVPNetConnection();
                BaseRegion Garenaregion = BaseRegion.GetRegion(Client.args[1]);
                Client.PVPNet.garenaToken = Client.args[2];
                Client.PVPNet.Connect("", "", Garenaregion.PVPRegion, Client.Version);
                Client.Region                    = Garenaregion;
                HideGrid.Visibility              = Visibility.Hidden;
                ErrorTextBox.Visibility          = Visibility.Hidden;
                LoggingInLabel.Visibility        = Visibility.Visible;
                LoggingInProgressRing.Visibility = Visibility.Visible;
                Client.PVPNet.OnError           += PVPNet_OnError;
                Client.PVPNet.OnLogin           += PVPNet_OnLogin;
                Client.PVPNet.OnMessageReceived += Client.OnMessageReceived;
            }

            if (String.IsNullOrWhiteSpace(Settings.Default.SavedPassword) ||
                String.IsNullOrWhiteSpace(Settings.Default.Region) || !Settings.Default.AutoLogin)
            {
                return;
            }

            AutoLoginCheckBox.IsChecked = true;
            LoginButton_Click(null, null);
        }