public static new BossStand Instance() { if (bossStand == null) { bossStand = ScriptableObject.CreateInstance("BossStand") as BossStand; } return(bossStand); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player").transform; nav = GetComponent <NavMeshAgent>(); health = GetComponent <EnemyHealth>(); currentState = BossStand.Instance(); hellephantAi = GetComponent <HellephantAI>(); eq_Range = Resources.Load("Prefabs/Skill/BossSkill/EQ_Range") as GameObject; eq_Particle = Resources.Load("Prefabs/Skill/BossSkill/EQ_Particle") as GameObject; r_Range = Resources.Load("Prefabs/Skill/BossSkill/Rush_Range") as GameObject; r_Particle = Resources.Load("Prefabs/Skill/BossSkill/Rush_Particle") as GameObject; skillTimer = new float[4]; skillActive = new bool[4] { true, true, true, true }; active = 2; }
public virtual void PlaceRewards() { var exit = new Exit(); Area.Add(exit); exit.To = Run.Depth + 1; var center = GetComponent <RoomComponent>().Room.Center; var x = (int)Math.Floor(center.X / 16); var y = (int)Math.Floor(center.Y / 16); var p = new Vector2(x * 16 + 8, y * 16 + 8); exit.Center = p; Painter.Fill(Run.Level, x - 1, y - 1, 3, 3, Tiles.RandomFloor()); Painter.Fill(Run.Level, x - 1, y - 3, 3, 3, Tiles.RandomFloor()); Run.Level.ReTileAndCreateBodyChunks(x - 1, y - 1, 3, 7); var w = p - new Vector2(0, 32f); if (!(this is DM || this is BkHead || Run.Type == RunType.BossRush)) { var stand = new BossStand(); Area.Add(stand); stand.Center = w; stand.SetItem(Items.CreateAndAdd(Items.Generate(ItemPool.Boss), Area), null); } var rewards = new List <string>(); var c = Run.Type == RunType.BossRush ? 2 : Rnd.Int(2, 10); if (Run.Type != RunType.BossRush && !(this is DM || this is BkHead)) { for (var i = 0; i < c; i++) { rewards.Add("bk:emerald"); } var q = Rnd.Int(4, 10); for (var i = 0; i < q; i++) { rewards.Add("bk:copper_coin"); } } if (Run.Type != RunType.BossRush) { var cn = Rnd.Int(0, 3); for (var i = 0; i < cn; i++) { rewards.Add("bk:heart"); } } else { var cn = Rnd.Int(20, 30); for (var i = 0; i < cn; i++) { rewards.Add("bk:coin"); } } var j = 0; foreach (var reward in rewards) { var item = Items.CreateAndAdd(reward, Area); item.Center = w + MathUtils.CreateVector(j / ((float)rewards.Count) * Math.PI * 2 + Rnd.Float(-0.1f, 0.1f), Rnd.Float(12, 18)); j++; } }