public CrazyDoc(Vector2 scroll, String[] flags) : base(scroll) { //Source sprite //Body this.sRect = new Rectangle(0, 0, 256, 256); this.Scale = new Vector2(0.75f,0.75f); this.ttl = InfiniteTimeToLive; //Stats this.wpn = null; this.hp = DocHP; this.maxLifebarValue = this.hp; this.points = 182000; this.faceState = CrazyDocFaceState.Normal; this.flagsOnDeath = flags; this.Flip = SpriteEffects.None; this.InfiniteMovePattern = true; this.hitbox = new SquareHitbox(this, new Vector2(0.2f, 0.2f)); this.speed = new Vector2(150f, 140.0f); this.DrawWarning = true; this.DrawLifebar = true; this.attackCooldown = 4000f; this.Pattern = new MovePattern(); this.Pattern.AddPoint(new Point(850, 85)); this.Pattern.AddPoint(new Point(750, 650)); this.wpn = null; }
public CrazyDoc(Vector2 scroll, String[] flags) : base(scroll) { //Source sprite //Body this.sRect = new Rectangle(0, 0, 256, 256); this.Scale = new Vector2(0.75f, 0.75f); this.ttl = InfiniteTimeToLive; //Stats this.wpn = null; this.hp = DocHP; this.maxLifebarValue = this.hp; this.points = 182000; this.faceState = CrazyDocFaceState.Normal; this.flagsOnDeath = flags; this.Flip = SpriteEffects.None; this.InfiniteMovePattern = true; this.hitbox = new SquareHitbox(this, new Vector2(0.2f, 0.2f)); this.speed = new Vector2(150f, 140.0f); this.DrawWarning = true; this.DrawLifebar = true; this.attackCooldown = 4000f; this.Pattern = new MovePattern(); this.Pattern.AddPoint(new Point(850, 85)); this.Pattern.AddPoint(new Point(750, 650)); this.wpn = null; }
public override void Update(GameTime gameTime) { bool attack = true; //Decrease cooldowns if (this.faceCooldown > 0f) { this.faceCooldown -= gameTime.ElapsedGameTime.TotalMilliseconds; } if (this.attackCooldown > 0f) { this.attackCooldown -= gameTime.ElapsedGameTime.TotalMilliseconds; attack = false; } //Boss is hit : change face if (IsHit) { this.faceState = CrazyDocFaceState.Hit; this.faceCooldown = 500f; } //Change state is necessary else if (this.faceCooldown < 0f) { this.faceState = CrazyDocFaceState.Normal; } //Random Pattern if (this.Pattern.Points.Count < 3) { for (int i = 0; i < 5; i++) { this.movePattern.AddPoint(new Point( RandomMachine.GetRandomInt(this.DstRect.Width, TGPAContext.Instance.ScreenWidth), RandomMachine.GetRandomInt(this.DstRect.Height, TGPAContext.Instance.ScreenHeight))); } } //*************************************************************************** //Find a new attack if (attack) { //(Re)Initialisation this.faceState = CrazyDocFaceState.Attack; this.faceCooldown = 2000f; int rand = RandomMachine.GetRandomInt(0, 6); this.speed = new Vector2(150f, 140.0f); // Circular attack //**************************************************** if ((rand < 3) && (this.attackType != CrazyDocAttacks.Circular)) { this.attackType = CrazyDocAttacks.Circular; this.wpn = new CrazyDocCircularWeapon(); this.speed = Vector2.Zero; this.attackCooldown = 2500f; } // Wave attack //**************************************************** else if ((rand <= 5) && (this.attackType != CrazyDocAttacks.Wave)) { this.attackType = CrazyDocAttacks.Wave; this.wpn = new CrazyDocWaveWeapon(); this.speed.X/=2; this.attackCooldown = 3500f; } // Random shots attack //**************************************************** else { this.attackType = CrazyDocAttacks.Random; this.wpn = new CrazyDocRandomWeapon(); this.attackCooldown = 2000f; } } //Sprite updates //************************************************ //Facial animation switch (this.faceState) { case CrazyDocFaceState.Normal: this.sRect.Y = 0; break; case CrazyDocFaceState.Hit: this.sRect.Y = 256; break; } base.Update(gameTime); }
public override void Update(GameTime gameTime) { bool attack = true; //Decrease cooldowns if (this.faceCooldown > 0f) { this.faceCooldown -= gameTime.ElapsedGameTime.TotalMilliseconds; } if (this.attackCooldown > 0f) { this.attackCooldown -= gameTime.ElapsedGameTime.TotalMilliseconds; attack = false; } //Boss is hit : change face if (IsHit) { this.faceState = CrazyDocFaceState.Hit; this.faceCooldown = 500f; } //Change state is necessary else if (this.faceCooldown < 0f) { this.faceState = CrazyDocFaceState.Normal; } //Random Pattern if (this.Pattern.Points.Count < 3) { for (int i = 0; i < 5; i++) { this.movePattern.AddPoint(new Point( RandomMachine.GetRandomInt(this.DstRect.Width, TGPAContext.Instance.ScreenWidth), RandomMachine.GetRandomInt(this.DstRect.Height, TGPAContext.Instance.ScreenHeight))); } } //*************************************************************************** //Find a new attack if (attack) { //(Re)Initialisation this.faceState = CrazyDocFaceState.Attack; this.faceCooldown = 2000f; int rand = RandomMachine.GetRandomInt(0, 6); this.speed = new Vector2(150f, 140.0f); // Circular attack //**************************************************** if ((rand < 3) && (this.attackType != CrazyDocAttacks.Circular)) { this.attackType = CrazyDocAttacks.Circular; this.wpn = new CrazyDocCircularWeapon(); this.speed = Vector2.Zero; this.attackCooldown = 2500f; } // Wave attack //**************************************************** else if ((rand <= 5) && (this.attackType != CrazyDocAttacks.Wave)) { this.attackType = CrazyDocAttacks.Wave; this.wpn = new CrazyDocWaveWeapon(); this.speed.X /= 2; this.attackCooldown = 3500f; } // Random shots attack //**************************************************** else { this.attackType = CrazyDocAttacks.Random; this.wpn = new CrazyDocRandomWeapon(); this.attackCooldown = 2000f; } } //Sprite updates //************************************************ //Facial animation switch (this.faceState) { case CrazyDocFaceState.Normal: this.sRect.Y = 0; break; case CrazyDocFaceState.Hit: this.sRect.Y = 256; break; } base.Update(gameTime); }