Exemplo n.º 1
0
 // Use this for initialization
 void Start()        // commment
 {
     CM                       = GameObject.FindWithTag("CreepManager").GetComponent <CreepManager>();
     whereToSpawn             = transform;
     numberOfUniqueCreepTypes = creeps.Length;
     // sendCreepWave();
 }
Exemplo n.º 2
0
 // Use this for initialization
 protected void Start()
 {
     creepManager   = FindObjectOfType <CreepManager>();
     player         = FindObjectOfType <PlayerStats>();
     audioSource    = GetComponent <AudioSource>();
     enemiesInRange = GetComponentInChildren <CountEnemiesInCollider>();
 }
Exemplo n.º 3
0
 protected void Start()
 {
     audioSource  = GetComponent <AudioSource>();
     creepManager = FindObjectOfType <CreepManager>();
     playerStats  = FindObjectOfType <PlayerStats>();
     // corners = FindObjectOfType<LevelManager>().getCoreners();
     creepManager.addCreepToActiveList(gameObject);
 }
Exemplo n.º 4
0
 void Awake()
 {
     if (s_Instance == null)
     {
         s_Instance = this;
     }
     DontDestroyOnLoad(this);
     Init();
 }
Exemplo n.º 5
0
        public Unit GetTarget()
        {
            try
            {
                switch (Mode)
                {
                case OrbwalkingMode.Pushing:
                    var barracks =
                        ObjectManager.GetEntitiesFast <Building>()
                        .FirstOrDefault(unit => unit.IsValid && unit.Team != Owner.Team && !(unit is Tower) && Owner.IsValidOrbwalkingTarget(unit));

                    if (barracks != null)
                    {
                        return(barracks);
                    }

                    var jungleMob =
                        CreepManager.GetCreepManager().GetCreeps.FirstOrDefault(
                            unit => unit.IsValid && unit.IsNeutral && Owner.IsValidOrbwalkingTarget(unit));

                    if (jungleMob != null)
                    {
                        return(jungleMob);
                    }

                    var creep =
                        CreepManager.GetCreepManager().GetCreeps.Where(
                            unit =>
                            unit.IsValid && unit.Team != Owner.Team && (Owner.IsValidOrbwalkingTarget(unit) || Owner.Distance2D(unit) <= 500)).OrderBy(x => x.Health).FirstOrDefault();

                    if (creep != null)
                    {
                        return(creep);
                    }

                    var tower =
                        ObjectManager.GetEntitiesFast <Tower>()
                        .FirstOrDefault(unit => unit.IsValid && unit.Team != Owner.Team && Owner.IsValidOrbwalkingTarget(unit));

                    if (tower != null)
                    {
                        return(tower);
                    }
                    break;

                case OrbwalkingMode.Combo:
                    return(Core.Target);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            return(null);
        }
Exemplo n.º 6
0
    private void Awake()
    {
        creepManager    = FindObjectOfType <CreepManager>();
        waypointManager = FindObjectOfType <WaypointManager>();

        unitStatsComponent = GetComponent <UnitStats>();
        if (unitStatsComponent)
        {
            unitStatsComponent.SubscribeViewer(this);
        }
    }
Exemplo n.º 7
0
    protected bool isActive; // for example when in ghost mode

    protected virtual void Awake()
    {
        if (bypassEditor)
        {
            Enable();
        }
        else
        {
            Disable();
        }

        creepManager = FindObjectOfType <CreepManager>();
    }
Exemplo n.º 8
0
 protected void Start()
 {
     agent = GetComponent <NavMeshAgent>();
     if (corners.Length > 0)
     {
         agent.SetDestination(corners[corners.Length - 1].position);
     }
     ThisCreepHasDied += dieHorribly;
     audioSource       = GetComponent <AudioSource>();
     creepManager      = FindObjectOfType <CreepManager>();
     playerStats       = FindObjectOfType <PlayerStats>();
     // corners = FindObjectOfType<LevelManager>().getCoreners();
     creepManager.addCreepToActiveList(gameObject);
 }
Exemplo n.º 9
0
    //~ private static List<Tower> towerList=new List<Resource>();

    // Add menu named "PerkEditor" to the Window menu
    //[MenuItem ("TDTK/PerkEditor")]
    public static void Init()
    {
        // Get existing open window or if none, make a new one:
        window         = (CreepManager)EditorWindow.GetWindow(typeof(CreepManager));
        window.minSize = new Vector2(375, 449);
        window.maxSize = new Vector2(375, 800);

        GameObject obj = Resources.Load("PrefabListCreep", typeof(GameObject)) as GameObject;

        if (obj == null)
        {
            obj = CreatePrefab();
        }

        prefab = obj.GetComponent <CreepListPrefab>();
        if (prefab == null)
        {
            prefab = obj.AddComponent <CreepListPrefab>();
        }

        creepList = prefab.creepList;

        for (int i = 0; i < creepList.Count; i++)
        {
            //creepList[i].prefabID=i;
            if (creepList[i] != null)
            {
                creepIDList.Add(creepList[i].prefabID);
            }
            else
            {
                creepList.RemoveAt(i);
                i -= 1;
            }
        }



        //~ resourceList.Add(new Resource());

        //~ Load();

        //AssetDatabase.GetAssetPath

        //~ for(int i=0; i<towerList.Count; i++) EditorUtility.SetDirty(towerList[i]);
    }
Exemplo n.º 10
0
 private void MidasChecker()
 {
     if (!Me.IsAlive || Me.IsInvisible())
     {
         return;
     }
     if (Midas != null && Midas.CanBeCasted() && !_sleeper.Sleeping)
     {
         var creep =
             CreepManager.GetCreepManager()
             .GetCreeps.Where(x => x.IsValid && x.Team != Me.Team && Midas.CanHit(x) && !x.IsAncient)
             .OrderByDescending(x => x.Health).FirstOrDefault();
         if (creep != null)
         {
             Midas.UseAbility(creep);
             _sleeper.Sleep(500);
         }
     }
 }
Exemplo n.º 11
0
 static void OpenCreepManager()
 {
     CreepManager.Init();
 }
Exemplo n.º 12
0
        public override void Execute()
        {
            if (Core.TempestHero != null && Core.TempestHero.IsAlive)
            {
                if (Core.TempestHero.Orbwalker.GetTarget() == null)
                {
                    ClosestLane = GetClosestLane();
                    var lastPoint = ClosestLane.Points[ClosestLane.Points.Count - 1];
                    ClosestLane.ClosestPosition =
                        ClosestLane.Points.Where(
                            x =>
                            x.Distance2D(lastPoint) < Core.TempestHero.Hero.Position.Distance2D(lastPoint) - 300)
                        .OrderBy(CheckForDist)
                        .FirstOrDefault();

                    if (ClosestLane.ClosestPosition != null && !ClosestLane.ClosestPosition.IsZero)
                    {
                        if (MenuManager.UseTravels)
                        {
                            var travels = Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots) ??
                                          Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots_2);
                            if (travels != null && travels.CanBeCasted() && !_sleeper.Sleeping)
                            {
                                var temp = ClosestLane.Points.ToList();
                                temp.Reverse();
                                var enemyCreeps =
                                    CreepManager.GetCreepManager()
                                    .GetCreeps.Where(x => x.Team != ObjectManager.LocalHero.Team);
                                Creep creepForTravels = null;

                                foreach (var v in temp)
                                {
                                    creepForTravels = CreepManager.GetCreepManager()
                                                      .GetCreeps.FirstOrDefault(
                                        y =>
                                        y.IsValid && y.HealthPercent() > 0.75 && v.IsInRange(y.Position, 1500) &&
                                        y.Team == ObjectManager.LocalHero.Team &&
                                        enemyCreeps.Any(z => z.IsInRange(y, 1500)));
                                    if (creepForTravels != null)
                                    {
                                        break;
                                    }
                                }
                                if (creepForTravels != null && creepForTravels.Distance2D(Core.TempestHero.Hero) > 1500)
                                {
                                    travels.UseAbility(creepForTravels);
                                    _sleeper.Sleep(500);
                                }
                            }
                        }
                        if (_sleeper.Sleeping)
                        {
                            return;
                        }
                        _sleeper.Sleep(250);
                        Core.TempestHero.Hero.Move(ClosestLane.ClosestPosition);
                        ClosestPosition = ClosestLane.ClosestPosition;
                    }
                }
                else if (!_sleeper.Sleeping)
                {
                    if (Core.TempestHero.Spark.CanBeCasted())
                    {
                        Core.TempestHero.Spark.UseAbility(Core.TempestHero.Orbwalker.GetTarget().Position);
                        _sleeper.Sleep(500);
                    }

                    var mjol = Core.TempestHero.Hero.GetItemById(ItemId.item_mjollnir);
                    if (mjol != null && mjol.CanBeCasted())
                    {
                        var allyCreep =
                            CreepManager.GetCreepManager()
                            .GetCreeps
                            .FirstOrDefault(
                                x =>
                                x.Team == ObjectManager.LocalHero.Team &&
                                x.IsInRange(Core.TempestHero.Hero, 500) && x.HealthPercent() <= 0.92 && x.IsMelee);
                        if (allyCreep != null)
                        {
                            mjol.UseAbility(allyCreep);
                            _sleeper.Sleep(500);
                        }
                    }

                    if (Core.TempestHero.Orbwalker.GetTarget() is Tower)
                    {
                        var field = Core.TempestHero.MagneticField;
                        if (field.CanBeCasted())
                        {
                            var pos = (Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - Core.TempestHero.Hero.NetworkPosition).Normalized();
                            pos *= (280 + 150);
                            pos  = Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - pos;
                            field.UseAbility(pos);
                            _sleeper.Sleep(1000);
                        }
                    }
                }
                if (MenuManager.AutoPushingTargetting)
                {
                    var enemyHero =
                        Heroes.GetByTeam(ObjectManager.LocalHero.GetEnemyTeam())
                        .FirstOrDefault(x => Core.TempestHero.Hero.IsValidOrbwalkingTarget(x));
                    if (enemyHero != null)
                    {
                        //OrderManager.ChangeOrder(OrderManager.Orders.SparkSpamTempest);
                        Core.Target = enemyHero;
                        MenuManager.TempestCombo.SetValue(new KeyBind(MenuManager.TempestCombo.GetValue <KeyBind>().Key,
                                                                      KeyBindType.Toggle, true));
                        Core.Target = enemyHero;
                    }
                }
            }
        }
Exemplo n.º 13
0
 private void Awake()
 {
     waypointManager = FindObjectOfType <WaypointManager>();
     creepManager    = FindObjectOfType <CreepManager>();
 }
Exemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     creepManager = FindObjectOfType <CreepManager>();
     buttonText   = GetComponentInChildren <Text>();
 }
Exemplo n.º 15
0
 // Use this for initialization
 void Start()
 {
     creepManager = FindObjectOfType <CreepManager>();
 }
Exemplo n.º 16
0
 private void Awake()
 {
     creepManager    = FindObjectOfType <CreepManager>();
     attackComponent = GetComponent <Attack>();
 }