public static void OnUpdate() { var target = GameObjects.EnemyHeroes.FirstOrDefault(x => x.IsValidTarget(SpellConfig.Q.Range)); if (target == null || Global.Orbwalker.IsWindingUp || Global.Player.IsDead) { return; } if (SpellConfig.Q.Ready && target.Health < Global.Player.GetSpellDamage(target, SpellSlot.Q) && MenuConfig.Killsteal["Q"].Enabled) { SpellConfig.CastQ(target); } else if (SpellConfig.E.Ready && target.Health < Global.Player.GetSpellDamage(target, SpellSlot.E) && MenuConfig.Killsteal["E"].Enabled) { var nearest = SoldierManager.GetSoldierNearestTo(target.ServerPosition); if (nearest != Vector3.Zero) { SpellConfig.E.Cast(nearest); } } }
public static void SetSoldierTodayList() { soldiersToday.Clear(); int[] randomPerc = { 2, 3, 4 }; //Fixed : Random (ex 2:8, 3:7, 4:6) int todaysRandomPerc = randomPerc[UnityEngine.Random.Range(0, randomPerc.Length)]; soldierNum = UnityEngine.Random.Range(10, 15); //Total number of soldiers int todaysFixedNum = soldierNum * todaysRandomPerc / 10; //Fixed Soldiers int todaysRandomNum = soldierNum - todaysFixedNum; //Random Soldiers soldiersToday.AddRange(SoldierManager.PickSoldiers(todaysFixedNum)); //Add Fixed Soldiers var randomSoldiers = new List <Soldier>(); //Make Random Soldiers for (int i = 0; i < todaysRandomNum; i++) { randomSoldiers.Add(new Soldier()); } soldiersToday.AddRange(randomSoldiers); //Add Random Soldiers Useful.Shuffle(soldiersToday); //Shuffle List soldierNum = todaysFixedNum + todaysRandomNum; var imsiString = ""; foreach (var s in soldiersToday) { imsiString += (((s.Name == null) ? "R" : s.Name) + s.Rank + " / "); } Debug.Log("고정군인 : " + todaysFixedNum + " 랜덤군인 : " + todaysRandomNum + "||||||| " + imsiString); }
public static void OnUpdate() { if (MenuConfig.Lane["Check"].Enabled && Global.Player.CountEnemyHeroesInRange(2000) > 0) { return; } if (SpellConfig.Q.Ready && MenuConfig.Lane["Q"].Enabled && Global.Player.ManaPercent() > MenuConfig.Lane["Q"].Value) { var minion = GameObjects.EnemyMinions.LastOrDefault(x => x.Distance(Global.Player) <= SpellConfig.Q.Range && x.MaxHealth > 10 && x.IsValid && !x.IsDead); if (minion == null) { return; } var soldier = SoldierManager.GetSoldierNearestTo(minion.ServerPosition); AzirHelper.Rect = new Geometry.Rectangle(soldier.To2D(), minion.ServerPosition.To2D(), SpellConfig.Q.Width + 65); var count = GameObjects.EnemyMinions.Count(x => AzirHelper.Rect.IsInside(x.ServerPosition.To2D())); if (count >= MenuConfig.Lane["QHit"].Value) { SpellConfig.Q.Cast(minion); } } if (SpellConfig.W.Ready && MenuConfig.Lane["W"].Enabled && Global.Player.ManaPercent() > MenuConfig.Lane["W"].Value) { var minion = GameObjects.EnemyMinions.FirstOrDefault(x => x.Distance(Global.Player) <= SpellConfig.W.Range && x.MaxHealth > 10 && x.IsValid && !x.IsDead); if (minion == null || SoldierManager.Soldiers.Count >= 2) { return; } var circle = new Geometry.Circle(minion.ServerPosition.To2D(), 265); if (GameObjects.EnemyMinions.Count(x => circle.Center.Distance(x.ServerPosition) <= circle.Radius) >= 3 && Global.Player.GetSpell(SpellSlot.W).Ammo > 1) { SpellConfig.W.Cast(Global.Player.ServerPosition.Extend(minion.ServerPosition, SpellConfig.W.Range)); } } if (SpellConfig.E.Ready && MenuConfig.Lane["E"].Enabled && Global.Player.ManaPercent() > MenuConfig.Lane["E"].Value) { foreach (var soldier in SoldierManager.Soldiers) { AzirHelper.Rect = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), soldier.ServerPosition.To2D(), SpellConfig.E.Width); var count = GameObjects.EnemyMinions.Count(x => AzirHelper.Rect.IsInside(x.ServerPosition.To2D())); if (count >= MenuConfig.Lane["EHit"].Value) { SpellConfig.E.Cast(soldier.ServerPosition); } } } }
void Awake() { { enemyController = GameObject.FindGameObjectWithTag("EnemyController").GetComponent<EnemyController>(); soldierManager = GameObject.FindObjectOfType<SoldierManager>(); soldierManager.Attach(enemyController); } }
public static SoldierManager getInstance() { if (instance == null) { GameObject go = GameObject.Find("GameManager"); instance = go.AddComponent <SoldierManager>(); } return(instance); }
private void Awake() { if (null == m_instance) { m_instance = this; LoadData(); DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
public void NewLevel(int currentLevel, ContentManager content, Texture2D buttonTexture) { this.currentLevel = currentLevel; enemies = new List <Enemy>(); if (playerTower == null) { playerTower = new Tower(content, new Vector2(0.0f, 280f), "playerTower"); } enemyTower = new Tower(content, new Vector2(730f, 280f), "enemyTower"); corpses = new List <Corpse>(); playerQueue = new List <Queueable>(); enemyQueue = new List <Queueable>(); queue = new Queue(content); inputManager = new BattleInputManager(buttonTexture, content); soldierManager = new SoldierManager(); if (currentLevel < 1) { return; } StreamReader reader = new StreamReader(Environment.CurrentDirectory + "/Level Data/level" + currentLevel.ToString() + ".txt"); string[] strArray = reader.ReadToEnd().Split('\n'); for (int index = 0; index < strArray.Length; index += 2) { enemies.Add(new Enemy(Convert.ToInt32(strArray[index]), Convert.ToInt32(strArray[index + 1]))); } if (hasTurretOne) { playerTurretOne = new Turret(content, playerTower.Rectangle, 3, "turretRightStraight"); } if (hasTurretTwo) { playerTurretTwo = new Turret(playerTower.Rectangle, content, 1, "turretRightDown"); } if (hasWizardTower) { wizardTower = new WizardTower(content, new Vector2(playerTower.Position.X, playerTower.Position.Y)); } if (hasArcher) { aimableArcher = new AimableArcher(content); } }
// Use this for initialization void Awake() { SwarmSpawner[] spawnersArr=GameObject.FindObjectsOfType<SwarmSpawner>(); spawners = new List<SwarmSpawner>(spawnersArr); soldierManager = GameObject.FindObjectOfType<SoldierManager>(); upgradeManager = GameObject.FindObjectOfType<UpgradeManager>(); foreach (SwarmSpawner spawner in spawners) { spawner.Attach(this); Health health = spawner.GetComponent<Health>(); health.Attach(this); health.Attach(upgradeManager); } }
IEnumerator Start() { yield return(new WaitWhile(() => FoodManager.foodDict == null)); FoodManager.ReadFoods(); FoodManager.SetTodaysMenu(); SoldierManager.ReadSoldiers(); SoldierManager.SetMoreSoldiers(); SoldierManager.SetSoldierTodayList(); DialogueManager.LoadTexts(); DialogueManager.Read(); DialogueManager.ReadD(); yield return(null); }
public static void Jump(Vector3 pos) { if (SpellConfig.W.Ready || Game.TickCount - AzirHelper.LastW <= 1000) { var extend = Global.Player.ServerPosition.Extend(pos, SpellConfig.W.Range); if (SoldierManager.Soldiers.Count == 0) { SpellConfig.W.Cast(extend); } DelayAction.Queue(350, () => SpellConfig.Q.Cast(pos), new CancellationToken(false)); DelayAction.Queue(150, () => SpellConfig.E.Cast(extend), new CancellationToken(false)); } else if (SoldierManager.GetSoldierNearestTo(pos).Distance(pos) <= 300) { var extend = SoldierManager.GetSoldierNearestTo(pos).Extend(pos, SpellConfig.Q.Range); if (SoldierManager.Soldiers.Count == 0) { SpellConfig.W.Cast(extend); } DelayAction.Queue(350, () => SpellConfig.Q.Cast(pos), new CancellationToken(false)); DelayAction.Queue(150, () => SpellConfig.E.Cast(extend), new CancellationToken(false)); } }
public ENDGAMERESULT CheckForEndGame(ContentManager content) { ENDGAMERESULT result = ENDGAMERESULT.NONE; if (enemyTower.Health <= 0) { result = ENDGAMERESULT.WIN; playerQueue = new List <Queueable>(); enemyQueue = new List <Queueable>(); soldierManager = new SoldierManager(); if (chargeInstance != null) { chargeInstance.Stop(); } queue.Clear(); if (hasWizardTower) { wizardTower.Stop(); } corpses = new List <Corpse>(); if (hasWizardTower) { wizardTower = new WizardTower(content, new Vector2(playerTower.Position.X, playerTower.Position.Y)); } if (hasArcher && aimableArcher.IsActive) { aimableArcher.Activate(); } } else if (playerTower.Health <= 0) { result = ENDGAMERESULT.LOSS; soldierManager = new SoldierManager(); playerQueue = new List <Queueable>(); enemyQueue = new List <Queueable>(); corpses = new List <Corpse>(); if (hasWizardTower) { wizardTower = new WizardTower(content, new Vector2(playerTower.Position.X, playerTower.Position.Y)); } playerTower.Health = 1; if (hasArcher && aimableArcher.IsActive) { aimableArcher.Activate(); } if (chargeInstance != null) { chargeInstance.Stop(); } queue.Clear(); if (hasWizardTower) { wizardTower.Stop(); } } return(result); }
void Awake() { controller = GetComponent<CharacterController>(); selectionBox = GetComponentInChildren<Projector>(); line = GetComponent<LineRenderer>(); sight = soldierSight.GetComponent<SoldierSight>(); soldierManager = GameObject.FindGameObjectWithTag("GameController").GetComponent<SoldierManager>(); }
public static void OnKeyPressed() { var target = Global.TargetSelector.GetSelectedTarget(); if (target != null && (AzirHelper.InsecMode.Active || MenuConfig.InsecMenu["Auto"].Enabled && MenuConfig.InsecMenu["Auto"].Value <= target.CountEnemyHeroesInRange(500))) { var dist = Global.Player.Distance(target); var allyT = GameObjects.AllyTurrets.OrderBy(x => x.Distance(Global.Player)).FirstOrDefault(x => x.IsValid && !x.IsDead).ServerPosition; var targetPos = target.ServerPosition; var soldierPos = SoldierManager.GetSoldierNearestTo(target.ServerPosition); var targetExtend = Global.Player.ServerPosition.Extend(allyT, SpellConfig.R.Range - target.BoundingRadius - 30); AzirHelper.Rect = new Geometry.Rectangle(targetExtend.To2D(), Global.Player.ServerPosition.Extend(allyT, -SpellConfig.R.Width / 2f).To2D(), SpellConfig.R.Width / 2f); if (SpellConfig.Q.Ready) { if (soldierPos.Distance(target) <= 200) { if (dist <= MenuConfig.InsecMenu["Range"].Value) { SpellConfig.Q.Cast(allyT.Extend(Game.CursorPos, -600)); } } else if (soldierPos.Distance(Global.Player) <= MenuConfig.InsecMenu["Range"].Value) { SpellConfig.Q.Cast(targetPos); } } if (dist > InsecRange()) { return; } if (soldierPos != Vector3.Zero) { SpellConfig.E.Cast(soldierPos); } else { SpellConfig.W.Cast(Global.Player.ServerPosition.Extend(targetPos, SpellConfig.W.Range)); } if (AzirHelper.Rect.IsInside(target.ServerPosition.To2D())) { if (SpellConfig.E.Ready && soldierPos.Distance(Global.Player) > 600) { SpellConfig.E.Cast(allyT); } if (SpellConfig.R.Ready) { SpellConfig.R.Cast(allyT); } } if (SummonerSpells.IsValid(SummonerSpells.Flash) && MenuConfig.InsecMenu["Flash"].Enabled && SpellConfig.R.Ready && !SpellConfig.Q.Ready && !SpellConfig.E.Ready && dist > 450 && soldierPos.Distance(target) > 450 && !Global.Player.IsDashing()) { if (Game.TickCount - AzirHelper.LastE <= 900 || Game.TickCount - AzirHelper.LastQ <= 900) { return; } SummonerSpells.Flash.Cast(target.ServerPosition); } } }
public Engine() { this.manager = new SoldierManager(); this.output = new StringBuilder(); }
public void Load() { LoadMap(); SoldierManager.getInstance().LoadSoldiers(); }
// Use this for initialization void Awake() { soldierController = gameObject.GetComponent<SoldierManager>(); cameraMover = Camera.main.GetComponent<CameraMover>(); upgradeManager = GameObject.FindObjectOfType<UpgradeManager>().GetComponent<UpgradeManager>(); }
void Awake() { switch (tag) { case "Enemy": drone = gameObject.GetComponent<DroneBehavior>(); boxCol = gameObject.GetComponent<BoxCollider>(); break; case "EnemyStructure": spawner = gameObject.GetComponent<SwarmSpawner>(); boxCol = GetComponent<BoxCollider>(); break; case "Soldier": soldier = GetComponent<Soldier>(); soldierManager = GameObject.FindObjectOfType<SoldierManager>(); break; default: break; } }
void Awake() { soldierManager = GameObject.FindGameObjectWithTag("GameController").GetComponent<SoldierManager>(); }