Beispiel #1
0
        void Init()
        {
            InitSkills();
            Khazix = ObjectManager.Player;

            foreach (var t in ObjectManager.Get <Obj_AI_Turret>().Where(t => t.IsEnemy))
            {
                EnemyTurrets.Add(t);
            }

            var shop = ObjectManager.Get <Obj_Shop>().FirstOrDefault(o => o.IsAlly);

            if (shop != null)
            {
                NexusPosition = shop.Position;
            }

            HeroList = HeroManager.AllHeroes;
        }
Beispiel #2
0
        private void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            AllObjects.Add(sender);

            var hero = sender as AIHeroClient;

            if (hero != null)
            {
                AllHeroes.Add(hero);
                if (hero.IsEnemy)
                {
                    EnemyHeroes.Add(hero);
                    AllEnemies.Add(hero);
                }
                else
                {
                    AllyHeroes.Add(hero);
                    AllAllies.Add(hero);
                }

                return;
            }

            var minion = sender as Obj_AI_Minion;

            if (minion != null)
            {
                if (minion.Team != GameObjectTeam.Neutral)
                {
                    if (minion.GetMinionType().HasFlag(Extensions.MinionTypes.Ward))
                    {
                        AllWards.Add(minion);
                        if (minion.IsEnemy)
                        {
                            EnemyWards.Add(minion);
                        }
                        else
                        {
                            AllyWards.Add(minion);
                        }
                    }
                    else
                    {
                        AllMinions.Add(minion);
                        if (minion.IsEnemy)
                        {
                            EnemyMinions.Add(minion);
                            AllEnemies.Add(minion);
                        }
                        else
                        {
                            AllyMinions.Add(minion);
                            AllAllies.Add(minion);
                        }
                    }
                }
                else if (minion.Name != "WardCorpse")
                {
                    switch (minion.GetJungleType())
                    {
                    case Extensions.JungleType.Small:
                        SmallJungleMinions.Add(minion);
                        break;

                    case Extensions.JungleType.Large:
                        LargeJungleMinions.Add(minion);
                        break;

                    case Extensions.JungleType.Epic:
                        EpicJungleMinions.Add(minion);
                        break;

                    case Extensions.JungleType.Legendary:
                        LegendaryJungleMinions.Add(minion);
                        break;
                    }

                    AllJungleMinions.Add(minion);
                }

                return;
            }

            var particle = sender as Obj_GeneralParticleEmitter;

            if (particle != null)
            {
                AllParticleEmitters.Add(particle);
                return;
            }

            var turret = sender as Obj_AI_Turret;

            if (turret != null)
            {
                AllTurrets.Add(turret);

                if (turret.IsEnemy)
                {
                    EnemyTurrets.Add(turret);
                }
                else
                {
                    AllyTurrets.Add(turret);
                }

                return;
            }

            var shop = sender as Obj_Shop;

            if (shop != null)
            {
                AllShops.Add(shop);

                if (shop.IsAlly)
                {
                    AllyShops.Add(shop);
                }
                else
                {
                    EnemyShops.Add(shop);
                }

                return;
            }

            var spawnPoint = sender as Obj_SpawnPoint;

            if (spawnPoint != null)
            {
                AllSpawnPoints.Add(spawnPoint);

                if (spawnPoint.IsAlly)
                {
                    AllySpawnPoints.Add(spawnPoint);
                }
                else
                {
                    EnemySpawnPoints.Add(spawnPoint);
                }
            }

            var inhibitor = sender as Obj_BarracksDampener;

            if (inhibitor != null)
            {
                AllInhibitors.Add(inhibitor);

                if (inhibitor.IsAlly)
                {
                    AllyInhibitors.Add(inhibitor);
                }
                else
                {
                    EnemyInhibitors.Add(inhibitor);
                }
            }

            var nexus = sender as Obj_HQ;

            if (nexus != null)
            {
                AllNexus.Add(nexus);

                if (nexus.IsAlly)
                {
                    AllyNexus = nexus;
                }
                else
                {
                    EnemyNexus = nexus;
                }
            }

            var missile = sender as MissileClient;

            if (missile != null)
            {
                AllMissiles.Add(missile);

                if (missile.IsAlly)
                {
                    AllyMissiles.Add(missile);
                }
                else
                {
                    EnemyMissiles.Add(missile);
                }
            }
        }