/// <summary> /// Spawns the Passed in Enemy into the Scene, Checking to Make Sure /// Nothing is Null /// </summary> /// <param name="enemy">The Enemy to be Spawned In</param> private void SpawnEnemy(minion enemy) { if (!MINION_SPAWN_OVERRIDE) { if (!enemy) { return; } Vector3 spawnLoc = Camera.main.ScreenToWorldPoint( new Vector3( Random.Range(Screen.width * 0.2f, Screen.width * 0.8f), Screen.height * 0.8f, 10)); activeMinions.Add(enemy); if (activePool.Contains(enemy)) { activePool.Remove(enemy); } enemy.gameObject.transform.position = spawnLoc; enemy.gameObject.SetActive(true); } }
public void SetUp() { passiveSkill p = new passiveSkill(passiveSkill.passive.atkUp, 30); List <passiveSkill> PL = new List <passiveSkill> (); PL.Add(p); minion M = new minion(minion.miniontype.ATK, 100); Character a = new Character(0, Character.Rarity.SSR, Character.World.Sorrow, Character.Type.God, "jj", 1, 14, 1, 30, 1, M, "eat shit", PL); Character CB = new Character(1, Character.Rarity.SSR, Character.World.Sorrow, Character.Type.God, "jj", 1, 14, 1, 30, 1, M, "eat shit", PL); Character CC = new Character(2, Character.Rarity.SSR, Character.World.Sorrow, Character.Type.God, "jj", 1, 14, 1, 30, 1, M, "eat shit", PL); Character CD = new Character(3, Character.Rarity.SSR, Character.World.Sorrow, Character.Type.God, "jj", 1, 14, 1, 30, 1, M, "eat shit", PL); Enemy B = new Enemy(11, Character.World.Fear, Character.Type.Demon, "Demon", 1000, 1, 100, 20, 1, M, "real Demono"); MGM.CreateMap(MapX, MapY); //CGM.Addchararcter (a,3,3); CGM.Addchararcter(B, 2, 1); Clist.Add(a); Clist.Add(CB); Clist.Add(CC); Clist.Add(CD); for (int i = 0; i < Clist.Count; i++) { Clist [i].Teamid = i; } CGM.AddCharacterDropBox(Clist); }
// Use this for initialization void Start() { stats = GetComponent <minion>(); _controller = GetComponent <CharacterController2D>(); actionTimer = stats.actionDelay; attackTimer = 0.25f; attackCountdown = false; }
/// <summary> /// Will return the object to the current pool if it is considered an 'active' minion. /// </summary> /// <param name="minion"></param> public void ReturnToPool(minion minion) { if (activeMinions.Contains(minion)) { activePool.Add(minion); } activeMinions.Remove(minion); minion.gameObject.SetActive(false); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "enemy" && collision.gameObject.GetComponent <minion> ()) { minion enemy = collision.gameObject.GetComponent <minion>(); enemy.ResetSelf(); spawnEnemies.instance.ReturnToPool(enemy); } if (collision.tag == "enemyProjectile") { Destroy(collision.gameObject); } }
public Enemy(int ID_, Character.World WORLD_, Character.Type TYPE_, string Name_, int HP_, int ATK_, int DEF_, int COURAGE_, int MANA_, minion M, string description_) { ID = ID_; WORLD = WORLD_; TYPE = TYPE_; Name = Name_; HP = HP_ + (int)Mathf.Round(M.gethp()); ATK = ATK_ + (int)Mathf.Round(M.getatk()); DEF = DEF_ + (int)Mathf.Round(M.gethp()); COURAGE = COURAGE_; MANA = MANA_; minion = M; Description = description_; }
public void Initialize() { //instantiating the object pools into your scene. //You can 'load' these pools in during gameplay to change the availability of different tile sets. for (int i = 0; i < testMinions.Count; i++) { minion newMinion = Instantiate(testMinions[i]); newMinion.gameObject.name = "Test Minion (" + i + ")"; i_testMinions.Add(newMinion); newMinion.gameObject.SetActive(false); } { boss newBoss = Instantiate(testBoss); newBoss.gameObject.name = "Test Boss"; i_testBoss = newBoss; newBoss.gameObject.SetActive(false); } //instantiating the object pools into your scene. //You can 'load' these pools in during gameplay to change the availability of different tile sets. for (int i = 0; i < grassMinions.Count; i++) { minion newMinion = Instantiate(grassMinions[i]); newMinion.gameObject.name = "Grass Minion (" + i + ")"; i_grassMinions.Add(newMinion); newMinion.gameObject.SetActive(false); } { boss newBoss = Instantiate(grassBoss); newBoss.gameObject.name = "Grass Boss"; i_grassBoss = newBoss; newBoss.gameObject.SetActive(false); } }
// Use this for initialization void Start() { minion = GetComponent <minion>(); anim = GetComponent <Animator>(); }
public Character(int ID_, Rarity Rare_, World WORLD_, Type TYPE_, string Name_, int HP_, int ATK_, int DEF_, int COURAGE_, int MANA_, minion M, string description_, List <passiveSkill> PskL) { ID = ID_; Rare = Rare_; WORLD = WORLD_; TYPE = TYPE_; Name = Name_; PSkill = PskL; GetSkillList(PSkill); HP = HP_ + (int)(Mathf.Round(M.gethp()) + hpBuff); ATK = ATK_ + (int)(Mathf.Round(M.getatk()) + atkBuff); DEF = DEF_ + (int)(Mathf.Round(M.gethp()) + defbuff); COURAGE = COURAGE_; MANA = MANA_; Description = description_; }