void AutoEscape() { //Avoid interrupting our assasination attempt if (jumpManager.MidAssasination) { return; } if (Config.GetBool("Safety.autoescape") && !IsHealthy) { if (Khazix.CountEnemiesInRange(500) > 0) { var ally = HeroList.FirstOrDefault(h => h.HealthPercent > 40 && h.CountEnemiesInRange(400) == 0 && !h.ServerPosition.PointUnderEnemyTurret()); if (ally != null && ally.IsValid) { E.Cast(ally.ServerPosition.To2D()); return; } } var underTurret = EnemyTurrets.Any(x => x.IsValid && !x.IsDead && x.IsValid && Khazix.Distance(x.Position) <= 900f); if (underTurret || Khazix.CountEnemiesInRange(500) >= 1) { var bestposition = Khazix.ServerPosition.Extend(NexusPosition, E.Range).To2D(); E.Cast(bestposition); return; } } }
void DoubleJump(EventArgs args) { if (!E.IsReady() || !EvolvedE || !Config.GetBool("djumpenabled") || Khazix.IsDead || Khazix.IsRecalling() || jumpManager.MidAssasination) { return; } var Targets = HeroList.Where(x => x.IsValidTarget() && !x.IsInvulnerable && !x.IsZombie); if (Q.IsReady() && E.IsReady()) { var CheckQKillable = Targets.FirstOrDefault(x => Vector3.Distance(Khazix.ServerPosition, x.ServerPosition) < Q.Range - 25 && GetQDamage(x) > x.Health); if (CheckQKillable != null) { Jumping = true; Jumppoint1 = GetDoubleJumpPoint(CheckQKillable); E.Cast(Jumppoint1.To2D()); Q.Cast(CheckQKillable); var oldpos = Khazix.ServerPosition; Utility.DelayAction.Add(Config.GetSlider("JEDelay") + Game.Ping, () => { if (E.IsReady()) { Jumppoint2 = GetDoubleJumpPoint(CheckQKillable, false); E.Cast(Jumppoint2.To2D()); } Jumping = false; }); } } }
private bool LoadSaveGameData(GameSaveData saveData) { if (saveData == null) { return(false); } // create scene json files and save them in the temp directory for (int i = 0; i < saveData.scenes.Length; i++) { string path = Application.temporaryCachePath + "/HeroScenes/" + saveData.scenes[i].sceneName + ".json"; string jsonSceneText = JsonUtility.ToJson(saveData.scenes[i]); File.WriteAllText(path, jsonSceneText); } // load the global variables HeroList globals = HeroKitDatabase.globals; HeroKitCommonScene.AddVariables(globals.ints.items, saveData.globalInts); HeroKitCommonScene.AddVariables(globals.floats.items, saveData.globalFloats); HeroKitCommonScene.AddVariables(globals.bools.items, saveData.globalBools); HeroKitCommonScene.AddVariables(globals.strings.items, saveData.globalStrings); HeroKitDatabase.globals = globals; // load the scene that was last opened Vector3 defaultCoords = new Vector3(-999999, -999999, -999999); HeroKitCommonScene.LoadScene(saveData.lastScene, false, false, defaultCoords, defaultCoords); return(true); }
public void AddNewCharacter(Character character) { HeroList.Add(character.hero); CharacterList.Add(character); SaveAllCharacters(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("CharacterList")); }
void Start() { playerList = PlayerList.GetPlayerList(); heroList = HeroList.GetHeroList(); turn = 1; Debug.Log("Starting Turn: " + turn); }
// Use this for initialization void Start() { rom = this.gameObject.GetComponent <CatmullRom> (); targetPos = this.transform.position; pathfind = new AStar(this.transform.position.y); HeroList.AddToHeroes(this); }
void DoubleJump(EventArgs args) { if (!E.IsReady() || !EvolvedE || !getCheckBoxItem(djump, "djumpenabled") || Khazix.IsDead || Khazix.IsRecalling()) { return; } var Targets = HeroList.Where(x => x.IsValidTarget() && !x.IsInvulnerable && !x.IsZombie); if (Q.IsReady() && E.IsReady()) { var CheckQKillable = Targets.FirstOrDefault(x => Vector3.Distance(Khazix.ServerPosition, x.ServerPosition) < Q.Range - 25 && GetQDamage(x) > x.Health); if (CheckQKillable != null) { Jumping = true; Jumppoint1 = GetJumpPoint(CheckQKillable); E.Cast(Jumppoint1); Q.Cast(CheckQKillable); var oldpos = Khazix.ServerPosition; LeagueSharp.Common.Utility.DelayAction.Add(getSliderItem(djump, "JEDelay") + Game.Ping, () => { if (E.IsReady()) { Jumppoint2 = GetJumpPoint(CheckQKillable, false); E.Cast(Jumppoint2); } Jumping = false; }); } } }
private void FilterHeroes() { if (string.IsNullOrWhiteSpace(_filter)) { _filter = string.Empty; } var lowerCaseFilter = Filter.ToLowerInvariant().Trim(); var result = _heroList.Where(d => d.Localized_Name.ToLowerInvariant() .StartsWith(lowerCaseFilter)) .ToList(); var toRemove = HeroList.Except(result).ToList(); foreach (var x in toRemove) { HeroList.Remove(x); } var resultCount = result.Count; for (int i = 0; i < resultCount; i++) { var resultItem = result[i]; if (i + 1 > HeroList.Count || !HeroList[i].Equals(resultItem)) { HeroList.Insert(i, resultItem); } } }
IEnumerator GetRequest(string uri) { using (UnityWebRequest webRequest = UnityWebRequest.Get(uri)) { // Request and wait for the desired page. yield return(webRequest.SendWebRequest()); string[] pages = uri.Split('/'); int page = pages.Length - 1; if (webRequest.isNetworkError) { Debug.Log(pages[page] + ": Error: " + webRequest.error); } else { Debug.Log(pages[page] + ":\nReceived: " + webRequest.downloadHandler.text); heroList = JsonUtility.FromJson <HeroList>("{\"list\":" + webRequest.downloadHandler.text + "}"); for (int i = 0; i < heroList.list.Count; i++) { heroList.list[i].heroImageId = GetHeroImageId(); } ReloadData(); } } }
public HeroState() { connection = new HubConnectionBuilder() .WithUrl("https://localhost:44314/HeroHub") .WithAutomaticReconnect() .Build(); connection.On <Hero>("ReceiveUpdatedHero", (updatedHero) => { HeroList[HeroList.FindIndex(hero => hero.Id == updatedHero.Id)] = updatedHero; Hero oldHero = TopHeroes.Find(hero => hero.Id == updatedHero.Id); if (oldHero != null) { TopHeroes.Remove(oldHero); TopHeroes.Add(updatedHero); } else { TopHeroes.RemoveAt(0); TopHeroes.Add(updatedHero); } OnStateChanged?.Invoke(); }); Task.Run(() => connection.StartAsync()); }
public static HeroList getInstance() { if (instance == null) { instance = new HeroList(); } return(instance); }
private void SetValueText(HeroAnyValue value, int indent, ListViewItem item) { string text = ""; item.Tag = value; switch (value.Type.Type) { case HeroTypes.Id: { text = (value as HeroID).ValueText; HeroID oid = value as HeroID; if (GOM.Instance.Definitions.ContainsKey(oid.Id)) { object obj2 = text; text = string.Concat(new object[] { obj2, " (", GOM.Instance.Definitions[oid.Id], ")" }); } break; } case HeroTypes.Integer: { text = (value as HeroInt).ValueText; HeroInt num = value as HeroInt; if (GOM.Instance.Definitions.ContainsKey((ulong)num.Value)) { object obj3 = text; text = string.Concat(new object[] { obj3, " (", GOM.Instance.Definitions[(ulong)num.Value], ")" }); } break; } case HeroTypes.List: { HeroList list = value as HeroList; this.AddList(list, indent + 1); break; } case HeroTypes.LookupList: { HeroLookupList list2 = value as HeroLookupList; this.AddLookupList(list2, indent + 1); break; } case HeroTypes.Class: { HeroClass class2 = value as HeroClass; this.AddVariables(class2.Variables, indent + 1); break; } default: text = value.ValueText; break; } item.SubItems.Add(text); }
public SistersOfSigmarWarband() { HeroList.Add(new SigmariteMatriarch()); HeroList.Add(new SisterSuperior()); HeroList.Add(new Augur()); HenchMenList.Add(new SigmariteSister()); HenchMenList.Add(new Novice()); }
public JsonResult Post([FromBody] Hero value) { int id = HeroList.getInstance().genId(); value.Id = id; HeroList.getInstance().addHero(value); Console.WriteLine("Added " + value.Name); return(Json(value)); }
public SkavenWarband() { HeroList.Add(new AssassinAdept()); HeroList.Add(new BlackSkaven()); HeroList.Add(new EshinSorcerer()); HeroList.Add(new NightRunner()); HenchMenList.Add(new Verminkin()); HenchMenList.Add(new GaintRat()); HenchMenList.Add(new RatOgre()); }
public UndeadWarband() { HeroList.Add(new Vampire()); HeroList.Add(new Necromancer()); HeroList.Add(new Dreg()); HenchMenList.Add(new Zombie()); HenchMenList.Add(new Ghoul()); HenchMenList.Add(new DireWolf()); }
public CultOfThePossessedWarband() { HeroList.Add(new Magister()); HeroList.Add(new Possessed()); HeroList.Add(new Mutant()); HenchMenList.Add(new DarkSoul()); HenchMenList.Add(new Brethren()); HenchMenList.Add(new BeastMan()); }
public WitchHuntersWarband() { HeroList.Add(new WitchHunterCaptain()); HeroList.Add(new WarriorPriest()); HeroList.Add(new WitchHunter()); HenchMenList.Add(new Flagellant()); HenchMenList.Add(new Zealot()); HenchMenList.Add(new Warhound()); }
public void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput && !string.IsNullOrWhiteSpace(sender.Text)) { sender.ItemsSource = HeroList.Select(x => x.Localized_Name); } else { sender.ItemsSource = null; } }
public void Setup(Hero currentHero, HeroList currentList) { hero = currentHero; heroName.text = hero.name; heroClass.text = hero.GetActiveClass().className; classLevel.text = "Level: " + hero.GetActiveClass().classLevel; heroImage.sprite = Resources.Load <Sprite>(hero.portraitSpriteName); heroList = currentList; }
/// <summary> /// Constructor. /// </summary> /// <param name="list">The hero list to construct.</param> public HeroList(HeroList list) { visible = list.visible; ints = (list.ints == null) ? new IntList() : list.ints.Clone(list.ints); floats = (list.floats == null) ? new FloatList() : list.floats.Clone(list.floats); bools = (list.bools == null) ? new BoolList() : list.bools.Clone(list.bools); strings = (list.strings == null) ? new StringList() : list.strings.Clone(list.strings); gameObjects = (list.gameObjects == null) ? new GameObjectList() : list.gameObjects.Clone(list.gameObjects); heroObjects = (list.heroObjects == null) ? new HeroObjectList() : list.heroObjects.Clone(list.heroObjects); unityObjects = (list.unityObjects == null) ? new UnityObjectList() : list.unityObjects.Clone(list.unityObjects); }
public MiddenheimWarband() { HeroList.Add(new MiddenheimMercenaryCaptain()); HeroList.Add(new MiddenheimChampion()); HeroList.Add(new MiddenheimYoungBlood()); HenchMenList.Add(new MiddenheimWarrior()); HenchMenList.Add(new MiddenheimMarksmen()); HenchMenList.Add(new MiddenheimSwordmen()); RacialAdvantages = new MiddenheimAdvantage(); }
public ReiklandWarband() { HeroList.Add(new ReiklandMercenaryCaptain()); HeroList.Add(new ReiklandChampion()); HeroList.Add(new ReiklandYoungBlood()); HenchMenList.Add(new ReiklandWarrior()); HenchMenList.Add(new ReiklandMarksmen()); HenchMenList.Add(new ReiklandSwordmen()); RacialAdvantages = new ReiklandWarbandAdvantage(); }
public MarienburgWarband() { HeroList.Add(new MarienburgMercenaryCaptain()); HeroList.Add(new MarienburgChampion()); HeroList.Add(new MarienburgYoungBlood()); HenchMenList.Add(new MarienburgWarrior()); HenchMenList.Add(new MarienburgMarksmen()); HenchMenList.Add(new MarienburgSwordmen()); RacialAdvantages = new MarienburgAdvantage(); }
public void DeleteCharacter(Character character) { foreach (var item in character.Items) { DeleteItem(item); } foreach (var perk in character.Perks) { DeletePerk(perk.perk); } HeroList.Remove(character.hero); CharacterList.Remove(character); database.Delete(character.hero); }
// setup the button to display in the crafting list public void Setup(Hero currentHero, HeroList currentList) { hero = currentHero; heroName.text = hero.name; strength.text = "Str: " + hero.strength; dexterity.text = "Dex: " + hero.dexterity; intelligence.text = "Int: " + hero.intelligence; heroClass.text = hero.GetActiveClass().className; heroImage.sprite = Resources.Load <Sprite>(hero.portraitSpriteName); goldCost.text = "Cost: " + hero.goldCost; heroList = currentList; }
/// <summary> /// Clone the hero list, remove references. /// </summary> /// <param name="field">The hero list to clone.</param> /// <returns>The cloned hero list.</returns> public HeroList Clone(HeroList field) { HeroList temp = new HeroList(); temp.visible = field.visible; temp.ints = (field.ints == null) ? new IntList() : field.ints.Clone(field.ints); temp.floats = (field.floats == null) ? new FloatList() : field.floats.Clone(field.floats); temp.bools = (field.bools == null) ? new BoolList() : field.bools.Clone(field.bools); temp.strings = (field.strings == null) ? new StringList() : field.strings.Clone(field.strings); temp.gameObjects = (field.gameObjects == null) ? new GameObjectList() : field.gameObjects.Clone(field.gameObjects); temp.heroObjects = (field.heroObjects == null) ? new HeroObjectList() : field.heroObjects.Clone(field.heroObjects); temp.unityObjects = (field.unityObjects == null) ? new UnityObjectList() : field.unityObjects.Clone(field.unityObjects); return(temp); }
void onNotifyHeroList(HeroList pMsg) { foreach (var id in pMsg.heroid) { var heroInfo = ConfigReader.HeroSelectXmlInfoDict[(int)id]; heroInfoList.Add(heroInfo); if (heroInfo != null) { LoadSelectHero(heroInfo.HeroSelectHead, heroInfo.HeroSelectNum, heroInfo.HeroSelectNameCh); } string path = "Monsters" + "/" + ConfigReader.HeroSelectXmlInfoDict[(int)id].HeroSelectName; LoadModel((int)id, path); } }
// setup the button to display in the hero list public void Setup(Hero currentHero, HeroList currentList) { hero = currentHero; heroName.text = hero.name; HP.text = "HP: " + hero.HP; MP.text = "MP: " + hero.MP; strength.text = "Str: " + hero.strength; dexterity.text = "Dex: " + hero.dexterity; intelligence.text = "Int: " + hero.intelligence; heroClass.text = hero.GetActiveClass().className; classLevel.text = hero.GetActiveClass().classLevel.ToString(); heroImage.sprite = Resources.Load <Sprite>(hero.portraitSpriteName); heroList = currentList; }
public MainWindow() { InitializeComponent(); ShadowFiend shadowFiend = new ShadowFiend(); ListBoxItem menuSFItem = new ListBoxItem(); menuSFItem.Content = shadowFiend.Name; HeroList.Add(shadowFiend); HeroListView.Items.Add(menuSFItem); Pudge pudge = new Pudge(); ListBoxItem menuPudgeItem = new ListBoxItem(); menuPudgeItem.Content = pudge.Name; HeroList.Add(pudge); HeroListView.Items.Add(menuPudgeItem); ImageBox_Copy1.Source = new BitmapImage(new Uri("https://static.wikia.nocookie.net/dota2_gamepedia/images/5/56/Flying_Courier_Dire_model.png/revision/latest/scale-to-width-down/250?cb=20160315185440")); }
private void AddList(HeroList list, int indent) { int num = 1; foreach (HeroVarId id in list.Data) { string str2; string text = string.Format("{0}", num); ListViewItem item = this.listViewVariables.Items.Add(text); item.IndentCount = indent; num++; if (list.Type.Values != null) { str2 = list.Type.Values.ToString(); } else { str2 = ""; } item.SubItems.Add(str2); this.SetValueText(id.Value, indent, item); } }