public BigDaddy(object sprite, Vector2 speed, Vector2 locate, float enemySize, float enemySize2, AIBase.FaceSide face, AIBase.ID id) : base(sprite, speed, locate, 0, enemySize, enemySize2, face, id) { LeftBody = new List<Texture2D>(); RightBody = new List<Texture2D>(); LeftDriver = new List<Texture2D>(); RightDriver = new List<Texture2D>(); ScenceList = new List<ScenceNode>(); ElecList = new List<ElecBall>(); this.Name = AIBase.BossID.StrikeBoss; this.CurrentStatus = BigDaddyStatus.Best; this.Status = AIBase.Status.Alarm; AIBase.ScenceList = this.ScenceList; this.Current = 0; this.BeAttack = false; }
public void AttackStyle1Update(GameTime gameTime) { switch (this.Attack1Status) { case AttackStyle1.Charge: if (this.Current <= 3 * BigDaddy.Duration) { this.Speed = AIBase.Player.Locate - this.Locate; this.Current++; } else { this.Speed.Length = this.Speed.Length / 2 + 200; this.Attack1Status = AttackStyle1.Strike; this.Current = 0; } break; case AttackStyle1.Strike: this.PostionGenerate(gameTime); if (!AIBase.SenceManager.IntersectPixels(this.Postion, (int)(this.EnemySize + 30))) { this.LocateConfirm(); } else { this.Attack1Status = AttackStyle1.Judge; } break; case AttackStyle1.Judge: foreach (var ptr in ScenceList) { Console.WriteLine(this.GetZuanTouPostion()); if (this.GetZuanTouPostion().X > ptr.Area.X && this.GetZuanTouPostion().X < ptr.Area.X + ptr.Area.Width && this.GetZuanTouPostion().Y > ptr.Area.Y && this.GetZuanTouPostion().Y < ptr.Area.Y + ptr.Area.Height ) { this.Attack1Status = AttackStyle1.Stucked; ptr.Status = false; break; } else { this.Attack1Status = AttackStyle1.Backward; this.BeAttack = false; } } break; case AttackStyle1.Stucked: if (this.Current <= BigDaddy.Duration * 4) { this.Current++; if ((this.GetWeakPostion() - AIBase.Player.Locate).Length() < 80 && AIBase.Player.Status == AIBase.Status.Attck ) { if (this.CurrentStatus == BigDaddyStatus.Best && !this.BeAttack) { this.CurrentStatus = BigDaddyStatus.Good; this.BeAttack = true; } else if (this.CurrentStatus == BigDaddyStatus.Good && !this.BeAttack) { this.CurrentStatus = BigDaddyStatus.Weak; this.BeAttack = true; } else if (this.CurrentStatus == BigDaddyStatus.Weak && !this.BeAttack) { this.CurrentStatus = BigDaddyStatus.Bad; this.BeAttack = true; } } } else { this.Current = 0; this.Attack1Status = AttackStyle1.Backward; } break; case AttackStyle1.Backward: if (this.Current <= BigDaddy.Duration * 2) { this.Speed = new Vector2(512) - this.Postion; this.PostionGenerate(gameTime); this.LocateConfirm(); this.Current++; } else { this.Status = AIBase.Status.Alarm; this.Current = 0; } break; } }