public void Load() { Q = new Spell(SpellSlot.Q, 600); W = new Spell(SpellSlot.W, 2500); E = new Spell(SpellSlot.E, 760); R = new Spell(SpellSlot.R, 3500); W.SetSkillshot(0.75f, 40, float.MaxValue, false, SkillshotType.SkillshotLine); E.SetSkillshot(1.3f, 200, 1600, false, SkillshotType.SkillshotCircle); R.SetSkillshot(0.2f, 80, 5000, false, SkillshotType.SkillshotLine); foreach (var hero in ObjectManager.Get <Obj_AI_Hero>()) { if (hero.IsEnemy) { Enemies.Add(hero); } if (hero.IsAlly) { Allies.Add(hero); } } Entry.PrintChat("<font color=\"#66CCFF\" >Jhin</font>"); }
public FighterEntry GetNearestAlly(Func <FighterEntry, bool> filter = null) { MapPoint charMp = MapPoint.FromCellId(PlayedFighter.CellId), allyMp; int distance = -1, tempDistance; FighterEntry ally = null; foreach (var allyEntry in filter == null ? Allies : Allies.Where(f => filter(f))) { if (!allyEntry.Alive) { continue; } allyMp = MapPoint.FromCellId(allyEntry.CellId); tempDistance = charMp.DistanceToCell(allyMp); if (distance == -1 || tempDistance < distance) { distance = tempDistance; ally = allyEntry; } } return(ally); }
public void CustomInterrupter_OnInterruptableTarget(AIHeroClient sender, CustomInterrupter.InterruptableTargetEventArgs args) { if (sender == null || !sender.IsValidTarget()) { return; } if (Utils.TickCount - LastWCast < 2000) { return; } if (Menu.Item("WInterrupter").IsActive() && W.CanCast(sender) && W.CastOnUnit(sender)) { return; } if (!Menu.Item("RInterrupter").IsActive() || !R.IsReady()) { return; } if ( Allies.OrderBy(h => h.Distance(sender)) .Any(h => h.IsValidTarget(R.Range, false) && h.Distance(sender) < RRadius && R.CastOnUnit(h))) { } }
private static bool Saver() { if (Player.InFountain()) { return(false); } var useE = getCheckBoxItem(eMenu, "EAuto") && E.IsReady(); var useR = getCheckBoxItem(rMenu, "RAuto") && R.IsReady(); if (!useE && !useR) { return(false); } foreach (var ally in Allies.Where(h => h.LSIsValidTarget(R.Range, false) && h.LSCountEnemiesInRange(300) > 0)) { var hp = ally.GetPredictedHealthPercent(); if (useE && E.IsInRange(ally) && hp <= getSliderItem(eMenu, ally.NetworkId + "EPriority")) { E.CastOnUnit(ally); } if (useR && hp <= getSliderItem(rMenu, ally.NetworkId + "RPriority") && R.CastOnUnit(ally)) { return(true); } } return(false); }
public void AddAlliedShip(PlayerShip ally, string tag, bool load = false, bool linkWithGameObjectManager = true) { //ally.OnSelect += AddSelectedShipUI; //ally.OnDeselect += RemoveSelectedShipUI; AddGameObject(ally, tag, load, linkWithGameObjectManager); Allies.Add(tag, ally); }
public void AddAllie(Kingdom allie) { if (this != allie) { Allies.Add(allie); } }
private static void OnPhaseEnd() { for (int i = 0; i < Players.Count; i++) { if (Players[i] == null) { Players.RemoveAt(i); } } for (int i = 0; i < Allies.Count; i++) { if (Allies[i] == null) { Allies.RemoveAt(i); } } for (int i = 0; i < Enemies.Count; i++) { if (Enemies[i] == null) { Enemies.RemoveAt(i); } } for (int i = 0; i < Neutrals.Count; i++) { if (Neutrals[i] == null) { Neutrals.RemoveAt(i); } } }
private static bool Saver() { if (Player.InFountain()) { return(false); } var useE = Menu.Item("EAuto").IsActive() && E.IsReady(); var useR = Menu.Item("RAuto").IsActive() && R.IsReady(); if (!useE && !useR) { return(false); } foreach (var ally in Allies.Where(h => h.IsValidTarget(R.Range, false) && h.CountEnemiesInRange(300) > 0)) { var hp = ally.GetPredictedHealthPercent(); if (useE && E.IsInRange(ally) && hp <= Menu.Item(ally.ChampionName + "EPriority").GetValue <Slider>().Value) { E.CastOnUnit(ally); } if (useR && hp <= Menu.Item(ally.ChampionName + "RPriority").GetValue <Slider>().Value&& R.CastOnUnit(ally)) { return(true); } } return(false); }
public void Load() { Q = new Spell(SpellSlot.Q, 1170); Q2 = new Spell(SpellSlot.Q, 1170); W = new Spell(SpellSlot.W, 5000); E = new Spell(SpellSlot.E, 1000); R = new Spell(SpellSlot.R, 1500f); Q.SetSkillshot(0.1f, 40f, 2400f, true, SkillshotType.SkillshotLine); Q2.SetSkillshot(0.1f, 40f, 2400f, false, SkillshotType.SkillshotLine); foreach (var hero in ObjectManager.Get <Obj_AI_Hero>()) { if (hero.IsEnemy) { Enemies.Add(hero); } if (hero.IsAlly) { Allies.Add(hero); } } Entry.PrintChat("<font color=\"#66CCFF\" >Kalista</font>"); }
public static void Kill(Fighter f) { if (f.Unit.alignment == Unit.Alignment.Player && PhaseManager.instance.currentPhase != PhaseManager.Phase.Player) { Players.Remove(f); } if (f.Unit.alignment == Unit.Alignment.Allied && PhaseManager.instance.currentPhase != PhaseManager.Phase.Allied) { Allies.Remove(f); } if (f.Unit.alignment == Unit.Alignment.Enemy && PhaseManager.instance.currentPhase != PhaseManager.Phase.Enemy) { Enemies.Remove(f); } if (f.Unit.alignment == Unit.Alignment.Neutral && PhaseManager.instance.currentPhase != PhaseManager.Phase.Neutral) { Neutrals.Remove(f); } Map.UnitTile(f).unitInTile = null; if (f != null) { if (GameSettings.DoBattleAnimation) { PhaseManager.instance.StartCoroutine(_Kill(f)); } else { Object.Destroy(f.gameObject); } } }
/// <summary> /// Fired when the game is updated. /// </summary> /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> private static void GameOnOnUpdate(EventArgs args) { var enemies = Enemies.Where(x => x.IsValidTarget(CalculateRange)).ToArray(); var allies = Allies.Where(x => x.IsValidTarget(CalculateRange, false)).ToArray(); if (!enemies.Any()) { Status = CalcStatus.NoEnemies; return; } var spellReadyCheck = Menu.Item("SpellReadyCheck").IsActive(); allyDamage = CalculateDamage(allies.ToList(), spellReadyCheck); enemyDamage = CalculateDamage(enemies.ToList(), spellReadyCheck); allyHealth = allies.Sum(x => x.Health); enemyHealth = enemies.Sum(x => x.Health); var result = allyHealth - enemyDamage > enemyHealth - allyDamage ? GreenBitmap : RedBitmap; if (LastResult != result) { IndicatorSprite.Remove(); IndicatorSprite.UpdateTextureBitmap((Bitmap)result.Clone()); IndicatorSprite.Add(); } LastResult = result; Status = CalcStatus.Calculated; }
//secondly update the remain decision time and allies' detail public void BroadcastDecisionTime(int decisionTime, Allies allies) { Boolean isChange = false; decision_Time.Content = "" + decisionTime; //check whether allies' detail has changed if (allies.alliesList.Count == alliesNameList.Count) { for (int i = 0; i < alliesNameList.Count; i++) { if (alliesNameList[i] != allies.alliesList[i].name) { isChange = true; } } } else { isChange = true; } //if it is change update the allies' detail if (isChange) { alliesNameList = new List <String>(); for (int j = 0; j < allies.alliesList.Count; j++) { alliesNameList.Add(allies.alliesList[j].name); } lvAllies.ItemsSource = allies.alliesList; } }
private void ApplyFullStatus(Allies actor, int status) { const int manipStatus = 0b_00000000_1000000_00000000_00000000; if ((status & manipStatus) == manipStatus) // If have manip { status ^= manipStatus; // remove manip } for (int attemptCount = 0; attemptCount < 26; attemptCount++) { if (attemptCount % 2 == 0) { WriteStatus(actor, status + manipStatus); } else { WriteStatus(actor, status); int trueStatus = GetTrueStatus(actor); if (trueStatus == status) { break; } } Thread.Sleep(100); } }
public void SetActorStatus(Allies actor, StatusEffects statusEffect) { int status = GetTrueStatus(actor); status |= (int)statusEffect; ApplyFullStatus(actor, status); }
public void RemoveActorStatus(Allies actor, StatusEffects statusEffect) { int status = GetTrueStatus(actor); status &= (int)~statusEffect; ApplyFullStatus(actor, status); }
private int GetTrueStatus(Allies actor) { var bytes = new byte[4]; _memoryAccessor.ReadMem(ProcessName, actor.SecondaryStatus.Address, bytes); int status = BitConverter.ToInt32(bytes); return(status); }
public void RemoveAlly(Guild g) { if (Allies.Contains(g)) { Allies.Remove(g); g.RemoveAlly(this); } }
public void AddAlly(Guild g) { if (!Allies.Contains(g)) { Allies.Add(g); g.AddAlly(this); } }
public bool IsAlly(Guild g) { if (NewGuildSystem) { return(Alliance != null && Alliance.IsMember(this) && Alliance.IsMember(g)); } return(Allies.Contains(g)); }
public void ClearAllies() { var temp = Allies.ToList(); foreach (var ally in temp) { RemoveAlly(ally); } }
public void ClearNegativeStatuses(Allies actor) { StatusEffects negativeEffects = StatusEffects.Sleep | StatusEffects.Poison | StatusEffects.Sadness | StatusEffects.Fury | StatusEffects.Confusion | StatusEffects.Silence | StatusEffects.Frog | StatusEffects.Small | StatusEffects.Petrify | StatusEffects.Berserk | StatusEffects.Paralyzed | StatusEffects.Darkness; RemoveActorStatus(actor, negativeEffects); }
public Entity UpdateAlly(Position start, Position end) { ImmutableDictionary <Position, int> .Builder tmpa = Allies.ToBuilder(); if (tmpa.ContainsKey(start)) { tmpa.Remove(start); } tmpa[end] = Dungeon.Wall; return(UpdateWith(obstacles: tmpa.ToImmutable())); }
public void Draw() { Globals.SpriteDrawer.Begin(); Globals.Map.Draw(); Entities.ForEach(b => b.Draw()); Enemies.ForEach(b => b.DrawHealthbar()); Allies.ForEach(b => b.DrawHealthbar()); DamageTexts.ForEach(d => d.Draw()); Globals.SpriteDrawer.End(); }
/// <summary> /// When navigate to this page, request an api based on the given url /// If this character has url-based detail, requests those too /// </summary> /// <param name="parameter"></param> /// <param name="mode"></param> /// <param name="state"></param> /// <returns></returns> public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { try { var characterUrl = (string)parameter; var service = new ThroneService(); Character = await service.GetCharacterAsync(characterUrl); Father = await service.GetCharacterAsync(Character.Father); Mother = await service.GetCharacterAsync(Character.Mother); Spouse = await service.GetCharacterAsync(Character.Spouse); if (Character.Allegiances.Length != 0) { Allies.Clear(); foreach (String url in Character.Allegiances) { House newHouse = await service.GetHouseAsync(url); Allies.Add(newHouse); } } if (Character.Books.Length != 0) { Books.Clear(); foreach (String url in Character.Books) { Book newBook = await service.GetBookAsync(url); Books.Add(newBook); } } if (Character.PovBooks.Length != 0) { PovBooks.Clear(); foreach (String url in Character.PovBooks) { Book newBook = await service.GetBookAsync(url); PovBooks.Add(newBook); } } await base.OnNavigatedToAsync(parameter, mode, state); } catch (RedirectMainException) { NavigationService.Navigate(typeof(MainPage)); } }
public static AITargets FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject val = Extensions.Value <JObject>((IEnumerable <JToken>)token); JToken val2 = default(JToken); if (!val.TryGetValue("type", ref val2)) { Debug.LogWarning((object)"Malformed json: no 'type' property in object of class AITargets"); return(null); } string text = Extensions.Value <string>((IEnumerable <JToken>)val2); AITargets aITargets; switch (text) { case "Nothing": aITargets = new Nothing(); break; case "All": aITargets = new All(); break; case "Allies": aITargets = new Allies(); break; case "AlliesWounded": aITargets = new AlliesWounded(); break; case "Opponents": aITargets = new Opponents(); break; case "SameAsActionTargets": aITargets = new SameAsActionTargets(); break; default: Debug.LogWarning((object)("Unknown type: " + text)); return(null); } aITargets.PopulateFromJson(val); return(aITargets); }
public void AddAlly(PoliticalGroup other) { if (Allies.Contains(other)) { return; } Allies.Add(other); AlliesRev.Add(other); other.AddAlly(this); }
public void RemoveAlly(PoliticalGroup other) { if (!Allies.Contains(other)) { return; } Allies.Remove(other); AlliesRev.Remove(other); other.RemoveAlly(this); }
private static void GameOnOnGameLoad(EventArgs args) { if (Player.ChampionName != "Quinn") { return; } enemySpawn = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy); Q = new Spell(SpellSlot.Q); E = new Spell(SpellSlot.E); W = new Spell(SpellSlot.W); R = new Spell(SpellSlot.R); Config = new Menu("奎因", "YuleQuinn", true); Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking")); Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking")); new Quinn().LoadQuinn(); Config.SubMenu("Misc").SubMenu("Prediction").AddItem(new MenuItem("PredictionMODE", "Prediction MODE", true).SetValue(new StringList(new[] { "Common prediction", "神预判" }, 1))); Config.SubMenu("Misc").SubMenu("Prediction").AddItem(new MenuItem("HitChance", "Hit Chance", true).SetValue(new StringList(new[] { "Very High", "High", "Medium" }, 0))); Config.SubMenu("Misc").AddItem(new MenuItem("comboDisableMode", "Disable auto-attack in combo mode", true).SetValue(false)); Config.SubMenu("Misc").AddItem(new MenuItem("manaDisable", "Disable mana manager in combo", true).SetValue(false)); Config.SubMenu("Misc").AddItem(new MenuItem("collAA", "Disable auto-attack if Yasuo wall collision", true).SetValue(true)); foreach (var hero in ObjectManager.Get <Obj_AI_Hero>()) { if (hero.IsEnemy) { Enemies.Add(hero); } if (hero.IsAlly) { Allies.Add(hero); } } new WardUsing().LoadWard(); new Tracker().LoadTrack(); Config.AddToMainMenu(); Game.OnUpdate += OnUpdate; Orbwalking.BeforeAttack += Orbwalking_BeforeAttack; }
/// <summary> /// Chamado a cada frame se o <see cref="MonoBehaviour"/> está ativo /// </summary> public void Update() { Allies.RemoveAll(c => c.State == StateCharacter.Die); Enemies.RemoveAll(c => c.State == StateCharacter.Die); foreach (var ally in Allies) { ally.Target = Enemies.OrderBy(c => c.Self.DistanceTo(ally.Self)).FirstOrDefault(); } foreach (var enemy in Enemies) { enemy.Target = Allies.OrderBy(c => c.Self.DistanceTo(enemy.Self)).FirstOrDefault(); } }
public bool RemoveActorStatus(Allies actor, StatusEffects statusEffect) { int status = GetTrueStatus(actor); if ((status & (int)statusEffect) == 0) // they don't have the status { return(false); } status &= (int)~statusEffect; ApplyFullStatus(actor, status); return(true); }