public override void step(Minions.Minion minion) { minion.dealDamage(new Damage(DAMAGE_OVER_1_SEC * Chronos.deltaTime, damageType),ownerPlayer, false); if (minion.minionState == Minion.MinionState.DEAD) { // if the minion is killed by this virus then infect this virus to nearby minions Vector3 minionPos = minion.getWorldPosition(); foreach (var m in minion.position.board.minions) { if (m.Value.minionState == Minion.MinionState.DEAD) continue; // calculate the distance of each minion to this minion var dist = (m.Value.getWorldPosition() - minionPos).magnitude; // if the minion in the range then add the effect if (dist < INFECTION_RANGE) // belli rangedeki minionlari bulmak icin target strategy kullanilabilir. { ContagiousEffect contEffect = new ContagiousEffect(ownerPlayer); if (m.Value.addEffect(contEffect)) Messages.OutgoingMessages.Game.GAddEffectOnMinion.sendMessage(m.Value.game.players, m.Value, contEffect); return; } } } }
public TargetDto(NPC target, ParsedLog log, bool cr, ActorDetailsDto details) { Name = target.Character; Icon = GeneralHelper.GetIcon(target); Health = target.GetHealth(log.CombatData); HbHeight = target.HitboxHeight; HbWidth = target.HitboxWidth; Tough = target.Toughness; Details = details; if (cr) { CombatReplayID = target.GetCombatReplayID(log); } if (log.FightData.Success) { HpLeft = 0; } else { List <HealthUpdateEvent> hpUpdates = log.CombatData.GetHealthUpdateEvents(target.AgentItem); if (hpUpdates.Count > 0) { HpLeft = hpUpdates.Last().HPPercent; } } Percent = Math.Round(100.0 - HpLeft, 2); foreach (KeyValuePair <long, Minions> pair in target.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Key, Name = pair.Value.Character }); } }
/// <summary> /// Automated events. /// </summary> /// <param name="args"> /// The <see cref="EventArgs" /> instance containing the event data. /// </param> private void AutoEvents(EventArgs args) { if (!Handler.CheckAutoEvents()) { return; } if (!_tearFull) { if (!StaticObjects.Player.IsRecalling()) { var basename = BaseName + "Misc."; if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ.TearStack").GetValue <bool>() && (_manaManager.ManaPercent >= StaticObjects.ProjectMenu.Item($"{basename}.UseQ.TearStack.MinMana").GetValue <Slider>().Value)) { if (Items.HasItem(ItemData.Tear_of_the_Goddess.Id) || Items.HasItem(ItemData.Manamune.Id)) { if ((Minions.GetEnemyMinions2(1500).Count < 1) && (Functions.Objects.Heroes.GetEnemies(1500).Count < 1) && (MinionManager.GetMinions(1500, MinionTypes.All, MinionTeam.Neutral).Count < 1)) { Q.Cast(Game.CursorPos); } } } } } Handler.UseAutoEvent(); }
/// <summary> /// On Clear /// </summary> private void Clear() { var basename = BaseName + "Clear."; if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ").GetValue <bool>()) { if (_manaManager.CheckClearQ()) { if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ.Minon.LastHit").GetValue <bool>()) { foreach (var target in Minions.GetEnemyMinions2(Q.Range).Where(x => (x.Health < Q.GetDamage(x)) && (x.Health > 30)).OrderBy(hp => hp.Health)) { if (!StaticObjects.Player.Spellbook.IsAutoAttacking && (StaticObjects.Player.GetAutoAttackDamage(target) < target.Health + 25) && (StaticObjects.Player.Distance(target) < StaticObjects.Player.AttackRange)) { continue; } Q.Cast(target); return; } } if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ.OnJungle").GetValue <bool>()) { foreach (var target in MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.Neutral).Where(x => x.IsValidTarget(Q.Range)).OrderBy(hp => hp.Health)) { Q.Cast(target); return; } } } } }
public PlayerDto(Player player, ParsedLog log, bool cr, ActorDetailsDto details) { Group = player.Group; Name = player.Character; Acc = player.Account; Profession = player.Prof; Condi = player.Condition; Conc = player.Concentration; Heal = player.Healing; Tough = player.Toughness; ColTarget = GeneralHelper.GetLink("Color-" + player.Prof); ColCleave = GeneralHelper.GetLink("Color-" + player.Prof + "-NonBoss"); ColTotal = GeneralHelper.GetLink("Color-" + player.Prof + "-Total"); IsConjure = (player.IsFakeActor); BuildWeaponSets(player, log); Details = details; if (cr && !IsConjure) { CombatReplayID = player.GetCombatReplayID(log); } foreach (KeyValuePair <long, Minions> pair in player.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Key, Name = pair.Value.Character }); } }
public override void step(Minions.Minion minion) { for (int i = 0; i < minion.stats.resistancesDivider.Count; i++) minion.stats.resistancesDivider[i] *= 0.5f; minion.stats.stunned = true; //stun. }
public static void RunScenarios() { using (new SampleScenarioScope("Search")) { var view = Proxy.GetEntityView( ShopsContainer, string.Empty, "Indexes", string.Empty, string.Empty); view.Should().NotBeNull(); view.ChildViews.Should().NotBeNull(); view.ChildViews.Should().NotBeEmpty(); foreach (var entityView in view.ChildViews.OfType <EntityView>()) { view = new EntityView { Name = "Index", DisplayName = "Index", EntityId = entityView.EntityId, Action = "DeleteSearchIndex" }; var result = Proxy.DoCommand(ShopsContainer.DoAction(view)); result.Messages.Should().NotContainErrors(); } Minions.RunFullIndexMinions(Constants.AWMinionsEnvironmentName); Minions.RunFullIndexMinions(Constants.HabitatMinionsEnvironmentName); } }
private void Clear() { var basename = BaseName + "Clear."; var validMinions = Minions.GetEnemyMinions2(W.Range); if (StaticObjects.ProjectMenu.Item($"{basename}.UseW").GetValue <bool>()) { if (_manaManager.CheckClearW()) { var pos = W.GetLineFarmLocation(validMinions); _minonsHit = pos.MinionsHit; if (pos.MinionsHit >= StaticObjects.ProjectMenu.Item($"{basename}.UseW.Minions").GetValue <Slider>().Value) { W.Cast(pos.Position); } } } if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ").GetValue <bool>()) { if (_manaManager.CheckClearQ()) { var aaMinons = validMinions.Where(x => x.Distance(StaticObjects.Player) < StaticObjects.Player.AttackRange); if (aaMinons.Count() >= StaticObjects.ProjectMenu.Item($"{basename}.UseQ.Minions").GetValue <Slider>().Value) { Q.Cast(); } } } }
static void DoLaneClear() { if (Q.Ready && (QData.Active || myHero.ManaPercent >= myMenu.Get <MenuSlider>("lcMPQ").CurrentValue) && myMenu.Get <MenuCheckbox>("lcQ").Checked) { var pred = GetLineFarmPosition(myHero.Position, Minions, 90f); if (pred.Hits >= myMenu.Get <MenuSlider>("lcHitQ").CurrentValue) { if (!QData.Active) { Q.Data.Cast(Game.CursorPosition); } else if (Q.Data.Range >= myHero.Distance(pred.Position)) { myHero.Spellbook.UpdateChargedSpell(SpellSlot.Q, pred.Position, true); } return; } } if (W.Ready && myHero.ManaPercent >= myMenu.Get <MenuSlider>("lcMPW").CurrentValue&& myMenu.Get <MenuCheckbox>("lcW").Checked) { var pred = GetFarmPosition(myHero.Position, Minions.FindAll((x) => x.Distance3D(myHero) <= W.Data.Range), 250f); if (pred.Hits >= myMenu.Get <MenuSlider>("lcHitW").CurrentValue) { W.Data.Cast(pred.Position); } } }
protected Base() { ObjConstants = new Constants(); ObjHeroes = new Heroes(); ObjMinions = new Minions(); ObjTurrets = new Turrets(); Menu = new Menu("AIM", "AIM", true); //AIM Settings Menu.AddItem(new MenuItem("Enabled", "Enabled").SetValue(new KeyBind(32, KeyBindType.Toggle))); Menu.AddItem(new MenuItem("LowHealth", "Self Low Health %").SetValue(new Slider(20, 10, 50))); //Humanizer var move = Menu.AddSubMenu(new Menu("Humanizer", "humanizer")); move.AddItem(new MenuItem("MovementEnabled", "Enabled").SetValue(true)); move.AddItem(new MenuItem("MovementDelay", "Movement Delay")).SetValue(new Slider(400, 0, 1000)); Menu.AddToMainMenu(); Console.WriteLine("Menu Init Success!"); ObjHQ = new HQ(); Orbwalker = Menu.AddSubMenu(new Menu("Orbwalker", "Orbwalker")); OrbW = new Orbwalking.Orbwalker(Orbwalker); Obj_AI_Base.OnIssueOrder += Obj_AI_Base_OnIssueOrder; }
public List <Body> GenerateRandomSpawn(int numCreatures, Vector3 position) { if (Race.CreatureTypes.Count == 0) { return(new List <Body>()); } List <Body> toReturn = new List <Body>(); for (int i = 0; i < numCreatures; i++) { string creature = Race.CreatureTypes[MathFunctions.Random.Next(Race.CreatureTypes.Count)]; Vector3 offset = MathFunctions.RandVector3Cube() * 5; Voxel voxel = new Voxel(); if (World.ChunkManager.ChunkData.GetFirstVoxelUnder(position + offset, ref voxel, true)) { Body body = EntityFactory.CreateEntity <Body>(creature, position + offset); CreatureAI ai = body.GetChildrenOfType <CreatureAI>().FirstOrDefault(); if (ai != null) { ai.Faction.Minions.Remove(ai); Minions.Add(ai); ai.Faction = this; ai.Creature.Allies = Name; } toReturn.Add(body); } } return(toReturn); }
void IncreaseMinionAge() { Console.Write("Enter Minions IDs, separte by space = "); string ids = Console.ReadLine(); int[] idArr = ids.Split(" ").Select(n => Convert.ToInt32(n)).ToArray(); foreach (int id in idArr) { var collection = from m in minionsRepositroy.GetAll() where m.Id == id select new { name = m.Name, age = m.Age, m.Id, m.TownId, }; foreach (var item in collection) { Minions minions = new Minions(); minions.Id = item.Id; minions.Name = item.name; minions.Age = item.age + 1; minions.TownId = item.TownId; minionsRepositroy.Update(minions); } } foreach (var item in minionsRepositroy.GetAll()) { Console.WriteLine($"{item.Name} \t {item.Age}"); } }
public void Setup() { rayoCongelante = new Armas("Rayo congelante", 100); torpedo = new Armas("Torpedo", 250); desinflaInador = new Armas("Desinfla-Inador", 150); objetos = new List <string> { "Piramide", "Suero mutante", "La luna" }; ciudad = new Ciudad(300, objetos, 150); armas = new List <Armas> { rayoCongelante, torpedo, desinflaInador }; bob = new Minions("Amarillo", 350, torpedo); kevin = new Minions("Amarillo", 150, rayoCongelante); stuart = new Minions("Violeta", 400, desinflaInador); minions = new List <Minions> { bob, kevin, stuart }; gru = new Villanos(minions, ciudad); }
public override void step(Minions.Minion minion) { for (int i = 0; i < minion.stats.resistancesMult.Count; ++i ) { minion.stats.resistancesMult[i] *= 1.3f; } }
private void OnCollisionEnter2D(Collision2D collision) { Minions min = collision.gameObject.GetComponent <Minions>(); if (slope > 0) { if (min.getDirection().x == 0) { if (min.getDirection().y < 0) { min.setDirection(new Vector2(1, 0)); } else { min.setDirection(new Vector2(-1, 0)); } } else { if (min.getDirection().x > 0) { min.setDirection(new Vector2(0, -1)); } else { min.setDirection(new Vector2(0, 1)); } } } else if (slope < 0) { if (min.getDirection().x == 0) { if (min.getDirection().y < 0) { min.setDirection(new Vector2(-1, 0)); } else { min.setDirection(new Vector2(1, 0)); } } else { if (min.getDirection().x > 0) { min.setDirection(new Vector2(0, 1)); } else { min.setDirection(new Vector2(0, -1)); } } } else { min.setDirection(-min.getDirection()); } }
protected Base() { ObjConstants = new Constants(); ObjHeroes = new Heroes(); ObjMinions = new Minions(); ObjTurrets = new Turrets(); OrbW = new Orbwalker(); }
public static IMinion CreateMinion(GameObject entityRoot, Minions minion, IHero owner, Vector2 position) { var prefab = Game.Resources.LoadPrefab <Minion>(minionPaths[minion]); entityRoot.AddChild(prefab); prefab.Initialize(owner, position); return(prefab); }
public void Update(DwarfTime time) { RoomBuilder.Faction = this; RoomBuilder.CheckRemovals(); Minions.RemoveAll(m => m.IsDead); SelectedMinions.RemoveAll(m => m.IsDead); if (this == World.PlayerFaction) { foreach (var m in Minions.Where(c => !SelectedMinions.Contains(c))) { if (m.Creature.SelectionCircle != null) { m.Creature.DeleteSelectionCircle(); } m.Creature.Sprite.DrawSilhouette = false; } ; foreach (CreatureAI creature in SelectedMinions) { if (creature.Creature.SelectionCircle == null) { creature.Creature.Physics.AddChild(new SelectionCircle(creature.Manager)); } creature.Creature.SelectionCircle.SetFlagRecursive(GameComponent.Flag.Visible, true); creature.Creature.Sprite.DrawSilhouette = true; } } foreach (Room zone in GetRooms()) { zone.ZoneBodies.RemoveAll(body => body.IsDead); } Designations.CleanupDesignations(); foreach (var zone in RoomBuilder.DesignatedRooms) { zone.Update(); } if (HandleThreatsTimer == null) { HandleThreatsTimer = new Timer(1.0f, false, Timer.TimerMode.Real ); } HandleThreatsTimer.Update(time); if (HandleThreatsTimer.HasTriggered) { HandleThreats(); } OwnedObjects.RemoveAll(obj => obj.IsDead); }
public void Add(Type type) { Type pretype = type; Type parent = type; while (parent.BaseType != typeof(object)) { pretype = parent; parent = parent.BaseType; } if (parent == typeof(Card)) { if (pretype == typeof(Spell)) { Spells.Add(type); Registry.Spells.Reg(type); } else { throw new NotImplementedException(); } } else if (parent == typeof(Creature)) { if (pretype == typeof(Minion)) { Minions.Add(type); Registry.Minions.Reg(type); } else if (pretype == typeof(Hero)) { Heroes.Add(type); } else { throw new NotImplementedException(); } } else if (parent == typeof(RandomEvent)) { RandomEvents.Add(type); Registry.RandomEvents.Reg(type); } else if (parent == typeof(Player)) { Players.Add(type); } else if (parent == typeof(Hero.HeroPower)) { } else { throw new NotImplementedException(); } }
void Update() { if ((Time.time - LastSpawnAt) > SpawnInterval) { LastSpawnAt = Time.time; Minions.SpawnAllLanes(true, UnitsPerLane); Minions.SpawnAllLanes(false, UnitsPerLane); } }
private List <JsonDamageDist>[] BuildDamageDist(Minions p, Target target) { List <JsonDamageDist>[] res = new List <JsonDamageDist> [_phases.Count]; for (int i = 0; i < _phases.Count; i++) { PhaseData phase = _phases[i]; res[i] = BuildDamageDist(p.GetDamageLogs(target, _log, phase.Start, phase.End)); } return(res); }
private Dictionary <string, JsonDamageDist>[] BuildDamageDist(Minions p, Target target) { Dictionary <string, JsonDamageDist>[] res = new Dictionary <string, JsonDamageDist> [_statistics.Phases.Count]; for (int i = 0; i < _statistics.Phases.Count; i++) { PhaseData phase = _statistics.Phases[i]; res[i] = BuildDamageDist(p.GetDamageLogs(target, _log, phase.Start, phase.End)); } return(res); }
public static Weapon Create(GameObject prefab, Minions target, Transform shootPoint, int damage) { var inst = Instantiate(prefab, shootPoint); var weapon = inst.GetComponent <Weapon>(); weapon.Target = target; weapon.Origin = shootPoint.position; weapon.Damage = damage; return(weapon); }
private Dictionary <string, JsonDamageDist>[][] BuildDamageDist(Minions p) { Dictionary <string, JsonDamageDist>[][] res = new Dictionary <string, JsonDamageDist> [_log.FightData.Logic.Targets.Count][]; for (int i = 0; i < _log.FightData.Logic.Targets.Count; i++) { Target target = _log.FightData.Logic.Targets[i]; res[i] = BuildDamageDist(p, target); } return(res); }
void AddMinion() { Minions minions = new Minions(); Console.Write("Enter minions name ="); minions.Name = Console.ReadLine(); Console.Write("Enter minions age ="); minions.Age = Convert.ToInt32(Console.ReadLine()); Towns towns = new Towns(); Console.Write("Enter minions town ="); towns.Name = Console.ReadLine(); Villains villains = new Villains(); Console.Write("Enter villains name ="); villains.Name = Console.ReadLine(); var checkVillainsName = from v in villainsRepository.GetAll() where v.Name.ToLower() == villains.Name.ToLower() select v.Name; int countVillains = checkVillainsName.Count(); if (countVillains == 0) { villains.EvilnessFactorId = 4; villainsRepository.Insert(villains); Console.WriteLine($"Villain {villains.Name} was added to the database."); } var checkTownsName = from t in townsRepository.GetAll() where t.Name.ToLower() == towns.Name.ToLower() select t.Name; int countTowns = checkTownsName.Count(); if (countTowns == 0) { towns.CountryCode = 4; townsRepository.Insert(towns); Console.WriteLine($"Town {towns.Name} was added to the database."); } foreach (var item in townsRepository.GetAll()) { if (item.Name.ToLower() == towns.Name.ToLower()) { minions.TownId = item.Id; } } minionsRepositroy.Insert(minions); Console.WriteLine($"Successfully added {minions.Name} to be minion of {villains.Name}."); }
public void ProcessQueues() { lock (QueuedMovements) { foreach (KeyValuePair <WebsocketMinionControl, float[]> item in QueuedMovements) { if (item.Key.AssociatedMinion == null) { Debug.LogWarning("[WEB] User sent movement without registering."); } NavMeshHit hit; NavMesh.SamplePosition( new Vector3( item.Value[0] * 50, 0, item.Value[1] * 25 ), out hit, 2.0f, NavMesh.AllAreas ); Debug.Log(string.Format("[WEB] Moving '{0}' to [{1}, {2}] ([])", item.Key.AssociatedMinion.name, item.Value[0] * 50, item.Value[1] * 25, item.Value[0], item.Value[1])); item.Key.AssociatedMinion.GetComponent <NavMeshAgent>().SetDestination( hit.position ); } QueuedMovements.Clear(); } lock (QueuedAssociations) { foreach (WebsocketMinionControl item in QueuedAssociations) { Debug.Log("[WEB] Registration: " + item.Context.Host); GameObject minion = Minions.GetControllableMinion(); if (minion != null) { Debug.Log(string.Format("[WEB] {0} now controls minion {1}", item.Context.Host, minion.name), minion); item.AssociatedMinion = minion; item.AssociatedMinion.name = "[C]" + item.AssociatedMinion.name; item.AssociatedMinion.GetComponent <MeshRenderer>().material.color = new Color(0.27f, 0.61f, 0.1333f, 1.0f); } else { Debug.Log(string.Format("[WEB] {0} couldn't get a minion: No minions left", item.Context.Host)); } } QueuedAssociations.Clear(); } }
private void Start() { m_info = transform.parent.GetComponent <Minions>(); charstat = transform.parent.GetComponent <CharacterStats>(); if (!canDmg) { BoxCollider2D col = gameObject.AddComponent <BoxCollider2D>(); col.size = new Vector2(m_info.cellsFree, m_info.cellsFree); col.isTrigger = true; } }
private void GenerateMinions() { Minions = Enumerable.Repeat(0, MPL).Select(_ => Minion.GenerateMinion(Level)).ToList(); foreach (var minion in Minions) { minion.OnDeath += Minion_OnDeath; minion.TookDamage += Minion_TookDamage; } _currentMonster = Minions.First(); }
static void Clear() { if (R.IsReady() && E.IsReady() && getSliderItem(clearMenu, "Clear.Mana") <= EloBuddy.Player.Instance.ManaPercent && RSpellFR) { if (Minions.Any()) { if (Minions.Count() >= 3) { R.Cast(); } } else if (JungleMinions.Any()) { R.Cast(); } } if (Q.IsReady() && getSliderItem(clearMenu, "Clear.Mana") <= EloBuddy.Player.Instance.ManaPercent && QSpellFR) { if (Minions.Any()) { Q.Cast(Minions[0].ServerPosition); } if (JungleMinions.Any()) { Q.Cast(JungleMinions[0].ServerPosition); } } if (W.IsReady() && getSliderItem(clearMenu, "Clear.Mana") <= EloBuddy.Player.Instance.ManaPercent && WSpellFR) { if (Minions.Any()) { W.Cast(Minions[0]); } if (JungleMinions.Any()) { W.Cast(JungleMinions[0]); } } if (E.IsReady() && getSliderItem(clearMenu, "Clear.Mana") <= EloBuddy.Player.Instance.ManaPercent && ESpellFR) { if (Minions.Any()) { E.Cast(Minions[0]); } else if (JungleMinions.Any()) { E.Cast(JungleMinions[0]); } } }
protected ActorDto(AbstractSingleActor actor, ParsedEvtcLog log, ActorDetailsDto details) { Name = actor.Character; Tough = actor.Toughness; Details = details; UniqueID = actor.UniqueID; foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Key, Name = pair.Value.Character }); } }
public void OnDeserialized(StreamingContext ctx) { World = ((WorldManager)ctx.Context); HandleThreatsTimer = new Timer(1.0f, false, Timer.TimerMode.Real); if (Threats == null) { Threats = new List <Creature>(); } if (Minions == null) { Minions = new List <CreatureAI>(); } Threats.RemoveAll(threat => threat == null || threat.IsDead); Minions.RemoveAll(minion => minion == null || minion.IsDead); }
private void Minion_OnDeath(IMonster minion, ulong reward) { OnMonsterDeath?.Invoke(minion, reward); Minions.Remove((Minion)minion); if (Minions.Count == 0) { _currentMonster = Boss; } else { _currentMonster = Minions.First(); } OnNewMonster?.Invoke(_currentMonster); }
void OnTriggerEnter(Collider other) { if (!CanRun) { return; } if (other.tag == "Minion") { Minions opponent = other.GetComponent <Minions>(); if (opponent.PlayerIndex != PlayerIndex && opponent.state != MinionState.fighting) { LaunchFight(opponent); } } }
public override void step(Minions.Minion minion) { minion.dealDamage( new Damage( DAMAGE_OVER_1_SEC * Chronos.deltaTime, damageType)); }
protected override Missile createMissile(Minions.Minion m) { return new Contagious_effectiveMissile(this, m); }
protected override Missile createMissile(Minions.Minion m) { return new Ballista_fireBoltMissile(this, m); }
public override void step(Minions.Minion minion) { minion.stats.movementSpeedMult *= slowAmount; //movement speedi %30'una artırır. }
public override void step(Minions.Minion minion) { minion.stats.movementSpeedMult *= slowAmount; }
public override void step(Minions.Minion minion) { minion.stats.invulnerable = true; }
public override void step(Minions.Minion minion) { minion.stats.healthRegenMult *= 1.2f; //health regeni %20 artırır. minion.stats.movementSpeedMult *= 1.3f; //movement speedi %30'una artırır. }
protected override Missiles.Missile createMissile(Minions.Minion m) { return new OneToAll_strongMissile(this, m); }
public override void step(Minions.Minion minion) { minion.stats.movementDirection = -1.0f; }
public void LaunchFight(Minions otherFighter) { if (!CanRun) { return; } if (state == MinionState.fighting) { return; } opponent = otherFighter; opponent.opponent = this; transform.LookAt(opponent.transform); opponent.transform.LookAt(transform); setupFight(); opponent.setupFight(); Invoke("Attack", minionsInformations.firstAttackSpeed); }