internal static void Load(Level context) { FrostbyteLevel l = context as FrostbyteLevel; l.Theme = Element.None; l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator(); l.DiaryEntries.MoveNext(); This.Game.AudioManager.AddBackgroundMusic("Music/TitleScreenBG"); This.Game.AudioManager.PlayBackgroundMusic("Music/TitleScreenBG", 0.1f); Viewport v = This.Game.GraphicsDevice.Viewport; scroller = new TextScroller("intro_text", v.Width * 3 / 4, v.Height * 3 / 4); scroller.Pos.X = v.Width / 8; scroller.Pos.Y = v.Height / 8; scroller.Static = true; scroller.ScrollText(l.DiaryEntries.Current); if (GamePad.GetState(PlayerIndex.One).IsConnected) { gamePads.Add(new GamePadController(PlayerIndex.One)); } if (GamePad.GetState(PlayerIndex.Two).IsConnected) { gamePads.Add(new GamePadController(PlayerIndex.Two)); } }
public async void GetLevels() { // After accepting invite string inviteAcceptedJWT = "Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VyQWNjb3VudCI6ImNhNDRkNzhkLWZlZTktNDMwNS1hNWFkLWU4ZTc3ODZkOTA5ZSIsIk9yZ2FuaXNhdGlvbiI6ImY2MjU5ZGE4LWZkZmQtNDA1Yy1iM2RjLTZkMDVlNjA0NTAzZiIsImV4cCI6MTU4NDE5Mzg4MywiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo3MDcxIiwiYXVkIjoiTXlBdWRpZW5jZSJ9.V6PWzQY0I7WoDm97ULxlDExa70tdyVaYR87S7vS82X8"; Mock <HttpRequest> mockRequest = MoqHelper.CreateMockRequest(inviteAcceptedJWT); var levelFunctions = new LevelFunctions(); ObjectResult response = (ObjectResult)await levelFunctions.GetAllLevels(mockRequest.Object, logger); Assert.True(response.StatusCode == 200); }
internal static void Load(Level context) { FrostbyteLevel l = context as FrostbyteLevel; l.Theme = Element.Earth; XDocument doc = XDocument.Load(@"Content/EarthLevel.xml"); l.Load(doc); l.HUD.LoadCommon(new GenericTheme()); l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator(); l.ExitPortalSpawnPoint = new Vector2(7776, 2700); Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White); mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(108 * Tile.TileSize, 119 * Tile.TileSize); //mage.SpawnPoint = new Vector2(7776, 2684); // Boss spot mage.Speed = 1; mage.Scale = 0.7f; l.HUD.AddPlayer(mage); Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White); mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(108 * Tile.TileSize, 121 * Tile.TileSize); //mage2.SpawnPoint = new Vector2(7756, 2684); // Boss spot mage2.Speed = 1; mage2.Scale = 0.7f; l.HUD.AddPlayer(mage2); This.Game.AudioManager.AddBackgroundMusic("Music/EarthBG"); This.Game.AudioManager.PlayBackgroundMusic("Music/EarthBG", 0.1f); l.isPauseEnabled = true; l.HUD.FadeText("Chapter I: Solum's Forest"); #region loadeffects etc l.GetEffect("ParticleSystem"); #endregion loadeffects etc #region load textures l.GetTexture("Blank"); l.GetTexture("blood"); l.GetTexture("boulder"); l.GetTexture("dirtParticle"); l.GetTexture("Earth"); l.GetTexture("Earthquake Rock"); l.GetTexture("earthquake"); l.GetTexture("evil"); l.GetTexture("fire darker"); l.GetTexture("fire"); l.GetTexture("fireParticle"); l.GetTexture("ice"); l.GetTexture("lava"); l.GetTexture("Lightning"); l.GetTexture("maroon fire"); l.GetTexture("Normal"); l.GetTexture("poison"); l.GetTexture("red fire"); l.GetTexture("regen"); l.GetTexture("smoke"); l.GetTexture("snowflake"); l.GetTexture("sparkball"); l.GetTexture("water stream"); l.GetTexture("water"); l.GetTexture("waterParticle"); l.GetTexture("WaterTexture"); #endregion load textures Collision.Lists.Add(new KeyValuePair <int, int>(1, 2)); Collision.Lists.Add(new KeyValuePair <int, int>(1, 3)); Collision.Lists.Add(new KeyValuePair <int, int>(2, 3)); }
internal static void Load(Level context) { FrostbyteLevel l = context as FrostbyteLevel; l.Theme = Element.Water; XDocument doc = XDocument.Load(@"Content/WaterLevel.xml"); l.Load(doc); l.HUD.LoadCommon(new WaterTheme()); l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator(); l.ExitPortalSpawnPoint = new Vector2(10123, 3771); Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White); mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(6 * Tile.TileSize, 52 * Tile.TileSize); // mage.SpawnPoint = new Vector2(10143, 3771); // mage.SpawnPoint = new Vector2(147*64+32, 67*64+32); mage.Speed = 1; mage.Scale = 0.7f; l.HUD.AddPlayer(mage); Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White); mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(6 * Tile.TileSize, 53 * Tile.TileSize); //mage2.SpawnPoint = new Vector2(147*64+32, 68*64+32); mage2.Speed = 1; mage2.Scale = 0.7f; l.HUD.AddPlayer(mage2); This.Game.AudioManager.AddBackgroundMusic("Music/WaterBG"); This.Game.AudioManager.PlayBackgroundMusic("Music/WaterBG", 0.3f); l.isPauseEnabled = true; l.HUD.FadeText("Chapter III: Mercutio's Temple of Ice"); #region loadeffects etc l.GetEffect("ParticleSystem"); #endregion loadeffects etc #region load textures l.GetTexture("Blank"); l.GetTexture("blood"); l.GetTexture("boulder"); l.GetTexture("dirtParticle"); l.GetTexture("Earth"); l.GetTexture("Earthquake Rock"); l.GetTexture("earthquake"); l.GetTexture("evil"); l.GetTexture("fire darker"); l.GetTexture("fire"); l.GetTexture("fireParticle"); l.GetTexture("ice"); l.GetTexture("lava"); l.GetTexture("Lightning"); l.GetTexture("maroon fire"); l.GetTexture("Normal"); l.GetTexture("poison"); l.GetTexture("red fire"); l.GetTexture("regen"); l.GetTexture("smoke"); l.GetTexture("snowflake"); l.GetTexture("sparkball"); l.GetTexture("water stream"); l.GetTexture("water"); l.GetTexture("waterParticle"); l.GetTexture("WaterTexture"); #endregion load textures #region add applicable spells Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.LightningOne | Spells.LightningTwo; #endregion add applicable spells Collision.Lists.Add(new KeyValuePair <int, int>(1, 2)); Collision.Lists.Add(new KeyValuePair <int, int>(1, 3)); Collision.Lists.Add(new KeyValuePair <int, int>(2, 3)); }
protected override void updateAttack() { FrostbyteLevel l = (This.Game.CurrentLevel as FrostbyteLevel); Sprite currentTarget = GetClosestTarget(l.allies); int attackFrame = 0; if (attackWait < This.gameTime.TotalGameTime) { int randAttack = This.Game.rand.Next(14); if (randAttack < 10) { #region Fire Tier 1 int attackRange = 11; //Create Earth Tier 1 Particle Emmiter Effect particleEffect = l.GetEffect("ParticleSystem"); Texture2D snowflake = l.GetTexture("fireParticle"); foreach (TimeSpan delay in new TimeSpan[] { TimeSpan.Zero, new TimeSpan(0, 0, 0, 0, 500), new TimeSpan(0, 0, 1), }) { ParticleEmitter particleFireTier1 = new ParticleEmitter(500, particleEffect, snowflake); particleFireTier1.effectTechnique = "FadeAtXPercent"; particleFireTier1.fadeStartPercent = .98f; particleFireTier1.blendState = BlendState.Additive; (particleFireTier1.collisionObjects.First() as Collision_BoundingCircle).Radius = attackRange; (particleFireTier1.collisionObjects.First() as Collision_BoundingCircle).createDrawPoints(); particleEmitters.Add(particleFireTier1); mAttacks.Add(LevelFunctions.DelayEnumerable <bool>(Attacks.T1Projectile(currentTarget, this, 20, attackFrame, new TimeSpan(0, 0, 0, 1, 150), attackRange, 9f, false, delegate(OurSprite attacker, Vector2 direction, float projectileSpeed, ParticleEmitter particleEmitter) { Random randPosition = new Random(); particleEmitter.createParticles(direction * projectileSpeed, Vector2.Zero, particleEmitter.GroundPos, 10, 10); Vector2 tangent = new Vector2(-direction.Y, direction.X); for (int i = -5; i < 6; i++) { particleEmitter.createParticles(-direction * projectileSpeed * .75f, tangent * -i * 40, particleEmitter.GroundPos + tangent * i * ParticleEmitter.EllipsePerspectiveModifier + (float)randPosition.NextDouble() * direction * 8f, 10.0f, This.Game.rand.Next(10, 300)); } }, particleFireTier1, new Vector2(0, -38), Element.Fire ), delay).GetEnumerator()); } This.Game.AudioManager.PlaySoundEffect("Effects/Fire_T1"); #endregion Fire Tier 1 } else if (randAttack < 11) { #region Fire Tier 3 mAttacks.Add(Attacks.FirePillar(currentTarget, this, 30, attackFrame, Element.Fire).GetEnumerator()); This.Game.AudioManager.PlaySoundEffect("Effects/Fire_T3"); #endregion Fire Tier 3 } else if (randAttack < 14) { mAttacks.Add(Attacks.RammingAttack(currentTarget, this, 5, new TimeSpan(0, 0, 0, 0, 500)).GetEnumerator()); } attackWait = This.gameTime.TotalGameTime + new TimeSpan(0, 0, This.Game.rand.Next(5, 8)); } }
internal static void Load(Level context) { FrostbyteLevel l = context as FrostbyteLevel; l.Theme = Element.Fire; XDocument doc = XDocument.Load(@"Content/FireLevel.xml"); l.Load(doc); l.HUD.LoadCommon(new GenericTheme()); l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator(); l.ExitPortalSpawnPoint = new Vector2(7776, 2700); Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White); mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(59 * Tile.TileSize, 56 * Tile.TileSize); //mage.SpawnPoint = new Vector2(8264, 6574); // Boss spawn mage.Speed = 1; mage.Scale = 0.7f; l.HUD.AddPlayer(mage); Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White); mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(61 * Tile.TileSize, 56 * Tile.TileSize); //mage2.SpawnPoint = new Vector2(8264, 6574); // Boss spawn mage2.Speed = 1; mage2.Scale = 0.7f; l.HUD.AddPlayer(mage2); SimpleDistanceTrigger trigger = new SimpleDistanceTrigger("Boss Room", 32); trigger.SpawnPoint = new Vector2(130 * 64 + 32, 105 * 64); trigger.TriggerCondition = delegate() { if (trigger.SpritesInRange.Count > 0) { return(new TriggerMultipleTargetEventArgs(trigger.SpritesInRange)); } return(null); }; trigger.TriggerEffect += delegate(object ob, TriggerEventArgs ta) { (This.Game.CurrentLevel as FrostbyteLevel).LevelCompleted = true; //This.Game.CurrentLevel.Unload(); //LevelFunctions.LoadNextLevel(); }; This.Game.AudioManager.AddBackgroundMusic("Music/FireBG"); This.Game.AudioManager.PlayBackgroundMusic("Music/FireBG", 0.03f); l.isPauseEnabled = true; l.HUD.FadeText("Chapter IV: Exuro's Volcano"); #region loadeffects etc l.GetEffect("ParticleSystem"); #endregion loadeffects etc #region load textures l.GetTexture("Blank"); l.GetTexture("blood"); l.GetTexture("boulder"); l.GetTexture("dirtParticle"); l.GetTexture("Earth"); l.GetTexture("Earthquake Rock"); l.GetTexture("earthquake"); l.GetTexture("evil"); l.GetTexture("fire darker"); l.GetTexture("fire"); l.GetTexture("fireParticle"); l.GetTexture("ice"); l.GetTexture("lava"); l.GetTexture("Lightning"); l.GetTexture("maroon fire"); l.GetTexture("Normal"); l.GetTexture("poison"); l.GetTexture("red fire"); l.GetTexture("regen"); l.GetTexture("smoke"); l.GetTexture("snowflake"); l.GetTexture("sparkball"); l.GetTexture("water stream"); l.GetTexture("water"); l.GetTexture("waterParticle"); l.GetTexture("WaterTexture"); #endregion load textures #region add applicable spells Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.LightningOne | Spells.LightningTwo | Spells.WaterOne | Spells.WaterTwo; #endregion add applicable spells Collision.Lists.Add(new KeyValuePair <int, int>(1, 2)); Collision.Lists.Add(new KeyValuePair <int, int>(1, 3)); Collision.Lists.Add(new KeyValuePair <int, int>(2, 3)); }
internal static void Load(Level context) { FrostbyteLevel l = context as FrostbyteLevel; l.Theme = Element.Normal; XDocument doc = XDocument.Load(@"Content/FinalLevel.xml"); l.Load(doc); l.HUD.LoadCommon(new GenericTheme()); l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator(); l.ExitPortalSpawnPoint = new Vector2(7776, 2700); Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White); mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(62 * Tile.TileSize, 46 * Tile.TileSize); // mage.SpawnPoint = new Vector2(1855, 2640); mage.Speed = 1; mage.Scale = 0.7f; l.HUD.AddPlayer(mage); Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White); mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(62 * Tile.TileSize, 48 * Tile.TileSize); //mage2.SpawnPoint = new Vector2(1875, 2640); mage2.Speed = 1; mage2.Scale = 0.7f; l.HUD.AddPlayer(mage2); Enemies.FinalBoss b = new Enemies.FinalBoss("DarkLink", new Vector2(1855, 2340)); b.mColor = Color.Black; This.Game.AudioManager.AddBackgroundMusic("Music/FinalCastleBG"); This.Game.AudioManager.PlayBackgroundMusic("Music/FinalCastleBG", 0.1f); l.isPauseEnabled = true; l.HUD.FadeText("Final Chapter: Caelestis' Castle"); #region loadeffects etc l.GetEffect("ParticleSystem"); #endregion loadeffects etc #region load textures l.GetTexture("Blank"); l.GetTexture("blood"); l.GetTexture("boulder"); l.GetTexture("dirtParticle"); l.GetTexture("Earth"); l.GetTexture("Earthquake Rock"); l.GetTexture("earthquake"); l.GetTexture("evil"); l.GetTexture("fire darker"); l.GetTexture("fire"); l.GetTexture("fireParticle"); l.GetTexture("ice"); l.GetTexture("lava"); l.GetTexture("Lightning"); l.GetTexture("maroon fire"); l.GetTexture("Normal"); l.GetTexture("poison"); l.GetTexture("red fire"); l.GetTexture("regen"); l.GetTexture("smoke"); l.GetTexture("snowflake"); l.GetTexture("sparkball"); l.GetTexture("water stream"); l.GetTexture("water"); l.GetTexture("waterParticle"); l.GetTexture("WaterTexture"); #endregion load textures #region add applicable spells Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.EarthThree | Spells.LightningOne | Spells.LightningTwo | Spells.LightningThree | Spells.WaterOne | Spells.WaterTwo | Spells.WaterThree | Spells.FireOne | Spells.FireTwo | Spells.FireThree; #endregion add applicable spells Collision.Lists.Add(new KeyValuePair <int, int>(1, 2)); Collision.Lists.Add(new KeyValuePair <int, int>(1, 3)); Collision.Lists.Add(new KeyValuePair <int, int>(2, 3)); }
internal static void Unload() { string nextlevel = LevelFunctions.LoadNextLevel(); This.Game.SetCurrentLevel(nextlevel); }
protected override void updateAttack() { if (isAttackAnimDone && attackWait < This.gameTime.TotalGameTime) { attackWait = This.gameTime.TotalGameTime + new TimeSpan(0, 0, This.Game.rand.Next(2, 5)); int AttackChoice = This.Game.rand.Next(7); if (AttackChoice <= 0 && OuterCrystals.Count > 0) { foreach (Crystal c in OuterCrystals) { mAttacks.Add(Attacks.LightningSpan(c, this, 5, 0).GetEnumerator()); } } else if (AttackChoice <= 1 && OuterCrystals.Count > 0) { Crystal target = OuterCrystals.GetRandomElement(); if (target != null) { mAttacks.Add(Attacks.LightningSpan(target, this, 7, 0).GetEnumerator()); } } else if (AttackChoice <= 2) { AttackRotation rot; if (This.Game.rand.Next(2) == 0) { rot = AttackRotation.Clockwise; } else { rot = AttackRotation.CounterClockwise; } foreach (Crystal c in OuterCrystals) { mAttacks.Add(Attacks.LightningSpan(c, this, 7, 0, rotation: rot).GetEnumerator()); } } else { attackStartTime = This.gameTime.TotalGameTime; Effect particleEffect = This.Game.CurrentLevel.GetEffect("ParticleSystem"); Texture2D lightning = This.Game.CurrentLevel.GetTexture("sparkball"); foreach (TimeSpan delay in new TimeSpan[] { TimeSpan.Zero, new TimeSpan(0, 0, 0, 0, 500), new TimeSpan(0, 0, 1), }) { Sprite target = (This.Game.CurrentLevel as FrostbyteLevel).allies.Where(x => x.State != SpriteState.Dead).GetRandomElement(); ParticleEmitter particleEmitterLightning = new ParticleEmitter(1000, particleEffect, lightning); particleEmitterLightning.effectTechnique = "FadeAtXPercent"; particleEmitterLightning.fadeStartPercent = .98f; particleEmitterLightning.blendState = BlendState.Additive; (particleEmitterLightning.collisionObjects.First() as Collision_BoundingCircle).Radius = 10; (particleEmitterLightning.collisionObjects.First() as Collision_BoundingCircle).createDrawPoints(); particleEmitters.Add(particleEmitterLightning); mAttacks.Add(LevelFunctions.DelayEnumerable <bool>(Attacks.LightningProjectile(target, currentCrystal, 5, 0, new TimeSpan(0, 0, 0, 5), int.MaxValue, 2.5f, true, delegate(OurSprite attacker, Vector2 direction, float projectileSpeed, ParticleEmitter particleEmitter) { Vector2 tangent = new Vector2(-direction.Y, direction.X); for (int i = -5; i < 6; i++) { particleEmitter.createParticles(-direction * projectileSpeed * 5, tangent * -i * 40, particleEmitter.GroundPos + tangent * i * ParticleEmitter.EllipsePerspectiveModifier - direction * (Math.Abs(i) * 7), 4, 300); } }, particleEmitterLightning, Vector2.Zero), delay).GetEnumerator()); } } } }
internal static void Load(Level context) { FrostbyteLevel l = context as FrostbyteLevel; l.Theme = Element.Fire; XDocument doc = XDocument.Load(@"Content/FireLevel-BossRoom.xml"); l.Load(doc); l.HUD.LoadCommon(new GenericTheme()); l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator(); l.ExitPortalSpawnPoint = new Vector2(7776, 2700); Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White); //mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(59 * Tile.TileSize, 56 * Tile.TileSize); mage.SpawnPoint = new Vector2(130 * 64, 105 * 64); // Boss spawn mage.Speed = 1; mage.Scale = 0.7f; l.HUD.AddPlayer(mage); Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White); //mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(61 * Tile.TileSize, 56 * Tile.TileSize); mage2.SpawnPoint = new Vector2(130 * 64, (105) * 64); // Boss spawn mage2.Speed = 1; mage2.Scale = 0.7f; l.HUD.AddPlayer(mage2); This.Game.AudioManager.AddBackgroundMusic("Music/FireBG"); This.Game.AudioManager.PlayBackgroundMusic("Music/FireBG", 0.03f); Obstacles.Obstacle rock = new Obstacles.Rock("rock"); rock.SpawnPoint += new Vector2(130 * 64 + 32, 106 * 64 + 32); rock.Respawn(); l.isPauseEnabled = true; #region loadeffects etc l.GetEffect("ParticleSystem"); #endregion loadeffects etc #region load textures l.GetTexture("Blank"); l.GetTexture("blood"); l.GetTexture("boulder"); l.GetTexture("dirtParticle"); l.GetTexture("Earth"); l.GetTexture("Earthquake Rock"); l.GetTexture("earthquake"); l.GetTexture("evil"); l.GetTexture("fire darker"); l.GetTexture("fire"); l.GetTexture("fireParticle"); l.GetTexture("ice"); l.GetTexture("lava"); l.GetTexture("Lightning"); l.GetTexture("maroon fire"); l.GetTexture("Normal"); l.GetTexture("poison"); l.GetTexture("red fire"); l.GetTexture("regen"); l.GetTexture("smoke"); l.GetTexture("snowflake"); l.GetTexture("sparkball"); l.GetTexture("water stream"); l.GetTexture("water"); l.GetTexture("waterParticle"); l.GetTexture("WaterTexture"); #endregion load textures #region add applicable spells Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.LightningOne | Spells.LightningTwo | Spells.WaterOne | Spells.WaterTwo; #endregion add applicable spells Collision.Lists.Add(new KeyValuePair <int, int>(1, 2)); Collision.Lists.Add(new KeyValuePair <int, int>(1, 3)); Collision.Lists.Add(new KeyValuePair <int, int>(2, 3)); }
protected override void updateAttack() { if (attackWait < This.gameTime.TotalGameTime) { if (isAttackAnimDone && !IsSubmerged) { if (HasVomited || This.Game.rand.Next(4) != 0) { #region Spew List <Sprite> targets = (This.Game.CurrentLevel as FrostbyteLevel).allies; Sprite target = GetClosestTarget(targets); if (target != null) { int attackRange = 11; //Create Particle Emitter Effect particleEffect = This.Game.CurrentLevel.GetEffect("ParticleSystem"); Texture2D boulder = This.Game.CurrentLevel.GetTexture("boulder"); foreach (TimeSpan delay in new TimeSpan[] { TimeSpan.Zero, new TimeSpan(0, 0, 0, 1, 500), new TimeSpan(0, 0, 3), }) { ParticleEmitter particleEmitterEarth = new ParticleEmitter(1000, particleEffect, boulder); particleEmitterEarth.effectTechnique = "NoSpecialEffect"; particleEmitterEarth.blendState = BlendState.AlphaBlend; (particleEmitterEarth.collisionObjects.First() as Collision_BoundingCircle).Radius = attackRange; (particleEmitterEarth.collisionObjects.First() as Collision_BoundingCircle).createDrawPoints(); particleEmitters.Add(particleEmitterEarth); Vector2 oldDirection = Direction; double angle = Math.Atan2(Direction.Y, Direction.X); SpriteFrame frame = GetAnimation(); for (int x = 0; x < 3; x++) { mAttacks.Add(LevelFunctions.DelayEnumerable <bool>(Attacks.T1Projectile(target, this, 5, 20, new TimeSpan(0, 0, 0, 1, 750), attackRange, 6f, false, delegate(OurSprite attacker, Vector2 direction, float projectileSpeed, ParticleEmitter particleEmitter) { Random randPosition = new Random(); particleEmitter.createParticles(direction * projectileSpeed, Vector2.Zero, particleEmitterEarth.GroundPos, 10, 10); Vector2 tangent = new Vector2(-direction.Y, direction.X); for (int i = -5; i < 6; i++) { particleEmitter.createParticles(-direction * projectileSpeed * 5, tangent * -i * 40, particleEmitter.GroundPos + tangent * i * ParticleEmitter.EllipsePerspectiveModifier + (float)randPosition.NextDouble() * direction * 8f, 1.5f, 300); } }, particleEmitterEarth, new Vector2(0, -20)), delay).GetEnumerator()); } } } #endregion } else { SetAnimation(18); mAttacks.Add(Attacks.WormVomit(this, 18, 1, 24).GetEnumerator()); HasVomited = true; } } attackWait = This.gameTime.TotalGameTime + new TimeSpan(0, 0, rng.Next(1, 3)); } }