public override void Shoot() { if (this.Time % 20 != 0) { return; } for (int index = 0; index < 3; ++index) { StageDataPackage stageData = this.StageData; MyRandom ran1 = this.Ran; Rectangle boundRect = this.BoundRect; int left = boundRect.Left; boundRect = this.BoundRect; int right = boundRect.Right; double num1 = (double)ran1.Next(left, right); MyRandom ran2 = this.Ran; boundRect = this.BoundRect; int top = boundRect.Top; boundRect = this.BoundRect; int maxValue = boundRect.Bottom / 3; double num2 = (double)ran2.Next(top, maxValue); PointF Position = new PointF((float)num1, (float)num2); double num3 = (double)this.Ran.Next(10, 20) / 10.0; double Diretion = Math.PI / 2.0 + 0.5 * this.Ran.NextDouble(); ParticleBack particleBack = new ParticleBack(stageData, "snow", Position, (float)num3, Diretion); particleBack.LifeTime = 200; particleBack.AngularVelocity = (float)this.Ran.Next(20) / 1000f; particleBack.Scale = (float)this.Ran.Next(2, 10) / 10f; particleBack.Active = true; } }
public override void Shoot() { if (this.Time % 1 != 0) { return; } for (int index = 0; index < 2; ++index) { StageDataPackage stageData = this.StageData; MyRandom ran1 = this.StageData.Ran; int minValue1 = (int)this.OriginalPosition.X - 20; PointF originalPosition = this.OriginalPosition; int maxValue1 = (int)originalPosition.X + 20; double num1 = (double)ran1.Next(minValue1, maxValue1); MyRandom ran2 = this.StageData.Ran; originalPosition = this.OriginalPosition; int minValue2 = (int)originalPosition.Y - 20; originalPosition = this.OriginalPosition; int maxValue2 = (int)originalPosition.Y + 20; double num2 = (double)ran2.Next(minValue2, maxValue2); PointF OriginalPosition = new PointF((float)num1, (float)num2); double num3 = (double)this.StageData.Ran.Next(10, 30) / 10.0; double direction = this.Direction; int LifeTime = 100 + this.Ran.Next(60); Particle3D3 particle3D3 = new Particle3D3(stageData, "Petal30", OriginalPosition, (float)num3, direction, LifeTime); particle3D3.Angle = (double)this.StageData.Ran.Next(0, 360) * 3.14159274101257 / 180.0; particle3D3.AngularVelocity3D = (float)this.StageData.Ran.Next(10) / 100f; particle3D3.Scale = (float)this.StageData.Ran.Next(5, 8) / 10f; particle3D3.RotatingAxis = new Vector3((float)this.StageData.Ran.Next(-100, 100), (float)this.StageData.Ran.Next(-100, 100), (float)this.StageData.Ran.Next(-100, 100)); particle3D3.MaxTransparent = (int)byte.MaxValue; } }
public override void Shoot() { if (this.Time % 1 != 0) { return; } for (int index = 0; index < 8; ++index) { StageDataPackage stageData = this.StageData; MyRandom ran = this.StageData.Ran; int minValue = (int)this.OriginalPosition.X - 60; PointF originalPosition = this.OriginalPosition; int maxValue = (int)originalPosition.X - 35; double num1 = (double)ran.Next(minValue, maxValue); originalPosition = this.OriginalPosition; double y = (double)(int)originalPosition.Y; PointF OriginalPosition = new PointF((float)num1, (float)y); double num2 = (double)this.StageData.Ran.Next(10, 30) / 10.0; int LifeTime = 100 + this.Ran.Next(40); Particle3D4 particle3D4 = new Particle3D4(stageData, "Petal00", OriginalPosition, (float)num2, Math.PI / 2.0, LifeTime); particle3D4.Angle = (double)this.StageData.Ran.Next(0, 360) * 3.14159274101257 / 180.0; particle3D4.AngularVelocity3D = (float)this.StageData.Ran.Next(10) / 100f; particle3D4.Scale = (float)this.StageData.Ran.Next(5, 8) / 10f; particle3D4.RotatingAxis = new Vector3((float)this.StageData.Ran.Next(-100, 100), (float)this.StageData.Ran.Next(-100, 100), (float)this.StageData.Ran.Next(-100, 100)); particle3D4.MaxTransparent = (int)byte.MaxValue; particle3D4.Depth = (float)this.Ran.Next((int)this.Depth - 50, (int)this.Depth - 50); } }
public void RandomMove1(int T, float velocity) { if (this.Time % T == 0) { double x1 = (double)this.OriginalPosition.X; Rectangle boundRect = this.BoundRect; double num1 = (double)(boundRect.Width / 2 - 50); if (x1 < num1) { MyRandom ran1 = this.Ran; boundRect = this.BoundRect; int minValue1 = boundRect.Width / 2 + 50; boundRect = this.BoundRect; int maxValue1 = boundRect.Width - 110; double num2 = (double)ran1.Next(minValue1, maxValue1); MyRandom ran2 = this.Ran; boundRect = this.BoundRect; int minValue2 = boundRect.Top + 100; boundRect = this.BoundRect; int maxValue2 = boundRect.Top + 150; double num3 = (double)ran2.Next(minValue2, maxValue2); this.DestPoint = new PointF((float)num2, (float)num3); } else { double x2 = (double)this.OriginalPosition.X; boundRect = this.BoundRect; double num2 = (double)(boundRect.Width / 2 + 50); if (x2 > num2) { MyRandom ran1 = this.Ran; boundRect = this.BoundRect; int maxValue1 = boundRect.Width / 2 - 50; double num3 = (double)ran1.Next(110, maxValue1); MyRandom ran2 = this.Ran; boundRect = this.BoundRect; int minValue = boundRect.Top + 100; boundRect = this.BoundRect; int maxValue2 = boundRect.Top + 150; double num4 = (double)ran2.Next(minValue, maxValue2); this.DestPoint = new PointF((float)num3, (float)num4); } else { double x3 = (double)this.MyPlane.OriginalPosition.X; boundRect = this.BoundRect; double num3 = (double)(boundRect.Width / 2); if (x3 < num3) { MyRandom ran1 = this.Ran; boundRect = this.BoundRect; int maxValue1 = boundRect.Width / 2 - 50; double num4 = (double)ran1.Next(110, maxValue1); MyRandom ran2 = this.Ran; boundRect = this.BoundRect; int minValue = boundRect.Top + 100; boundRect = this.BoundRect; int maxValue2 = boundRect.Top + 150; double num5 = (double)ran2.Next(minValue, maxValue2); this.DestPoint = new PointF((float)num4, (float)num5); } else { MyRandom ran1 = this.Ran; boundRect = this.BoundRect; int minValue1 = boundRect.Width / 2 + 50; boundRect = this.BoundRect; int maxValue1 = boundRect.Width - 110; double num4 = (double)ran1.Next(minValue1, maxValue1); MyRandom ran2 = this.Ran; boundRect = this.BoundRect; int minValue2 = boundRect.Top + 100; boundRect = this.BoundRect; int maxValue2 = boundRect.Top + 150; double num5 = (double)ran2.Next(minValue2, maxValue2); this.DestPoint = new PointF((float)num4, (float)num5); } } } this.Velocity = velocity; } this.MoveToPoint(this.DestPoint); }
public override void Ctrl() { base.Ctrl(); if (!this.OnSpell) { this.Armon = 0.0f; } switch (this.Life) { case 0: this.Velocity = 0.0f; this.DestPoint = (PointF) new Point(this.Ran.Next(100, this.BoundRect.Width - 100), this.Ran.Next(70, 200)); break; case 1: this.Ctrl1(); break; case 2: this.Ctrl2(); break; case 3: this.Ctrl3(); break; case 4: this.Ctrl4(); break; case 5: this.Ctrl5(); break; } this.MoveToPoint(this.DestPoint); if (!this.OnSpell) { if ((double)this.HealthPoint >= (double)this.SpellcardHP && this.Time <= this.SpellTime) { return; } this.HealthPoint = (float)this.SpellcardHP; this.Time = 0; this.OnSpell = true; ShootingStarShard shootingStarShard = new ShootingStarShard(this.StageData, new PointF((float)(this.BoundRect.Width / 2), 0.0f)); } else if ((double)this.HealthPoint <= 0.0 || this.Time > this.SpellTime) { --this.Life; Rectangle boundRect; if ((double)this.HealthPoint <= 0.0 && this.Life >= -1) { this.GiveItems(); StageDataPackage stageData = this.StageData; boundRect = this.BoundRect; PointF OriginalPosition = new PointF((float)(boundRect.Width / 2), 0.0f); ShootingStarShard shootingStarShard = new ShootingStarShard(stageData, OriginalPosition); } if (this.Life <= 0) { if (this.Life == 0) { int x = this.Ran.Next((int)this.OriginalPosition.X - 30, (int)this.OriginalPosition.X + 30); MyRandom ran = this.Ran; PointF originalPosition = this.OriginalPosition; int minValue = (int)originalPosition.Y + 30; originalPosition = this.OriginalPosition; int maxValue = (int)originalPosition.Y + 50; int y = ran.Next(minValue, maxValue); this.DestPoint = (PointF) new Point(x, y); this.Velocity = 0.5f; BulletRemover2 bulletRemover2 = new BulletRemover2(this.StageData, this.OriginalPosition); this.HealthPoint = 0.0f; this.GiveEndEffect(); this.Life = -1; } } else { BulletRemover2 bulletRemover2 = new BulletRemover2(this.StageData, this.OriginalPosition); this.StageData.SoundPlay("se_tan00.wav"); this.HealthPoint = (float)this.MaxHP; this.Time = 0; this.OnSpell = false; boundRect = this.BoundRect; this.DestPoint = (PointF) new Point(boundRect.Width / 2, 120); this.Velocity = 4f; } } }
public Spell_AyaB_Laser(StageDataPackage StageData, PointF OriginalPosition, bool Left) { this.StageData = StageData; this.SpellList.Add((BaseObject)this); this.OriginalPosition = OriginalPosition; this.Damage = 50; this.Region = 25; this.LifeTime = 20; this.Velocity = 50f; this.ScaleLength = 2f; this.ScaleWidth = 1f; this.TxtureObject = this.TextureObjectDictionary["Laser"]; if (this.Boss != null && ((double)this.Boss.OriginalPosition.X > 0.0 && (double)this.Boss.OriginalPosition.X < (double)this.BoundRect.Width && (double)this.Boss.OriginalPosition.Y > 0.0 && (double)this.Boss.OriginalPosition.Y < (double)this.BoundRect.Height)) { this.Target = (BaseObject)this.Boss; } if (this.Target == null) { double dist = 500.0; this.EnemyPlaneList.ForEach((Action <BaseEnemyPlane>)(x => { double distance = this.GetDistance((BaseObject)x); if (distance >= dist) { return; } this.Target = (BaseObject)x; dist = distance; })); } PointF originalPosition; Rectangle boundRect; if (this.Target == null) { this.Target = new BaseObject() { OriginalPosition = new PointF(OriginalPosition.X + (float)this.Ran.Next(-80, 80), OriginalPosition.Y + (float)this.Ran.Next(-80, 80)) }; originalPosition = this.Target.OriginalPosition; if ((double)originalPosition.Y < 0.0) { BaseObject target = this.Target; originalPosition = this.Target.OriginalPosition; PointF pointF = new PointF(originalPosition.X, 0.0f); target.OriginalPosition = pointF; } else { originalPosition = this.Target.OriginalPosition; if ((double)originalPosition.Y > (double)this.BoundRect.Height) { BaseObject target = this.Target; originalPosition = this.Target.OriginalPosition; double x = (double)originalPosition.X; boundRect = this.BoundRect; double height = (double)boundRect.Height; PointF pointF = new PointF((float)x, (float)height); target.OriginalPosition = pointF; } } } int num1; if (!Left) { boundRect = this.BoundRect; num1 = boundRect.Width + 150; } else { num1 = -150; } double num2 = (double)num1; MyRandom ran = this.Ran; originalPosition = this.Target.OriginalPosition; int minValue = (int)originalPosition.Y - 80; originalPosition = this.Target.OriginalPosition; int maxValue = (int)originalPosition.Y + 80; double num3 = (double)ran.Next(minValue, maxValue); this.OriginalPosition = new PointF((float)num2, (float)num3); this.Direction = this.GetDirection(this.Target); this.SpellList[0].OriginalPosition = this.Target.OriginalPosition; }
public override void UpdateData() { if (TimeMain == 50) { BaseEffect baseEffect = new BaseEffect(StageData, "woshixingtu", new PointF(385f, 240f), 4f, 0.0); baseEffect.AngleDegree = 90.0; baseEffect.Active = false; baseEffect.DestPoint = new PointF(320f, 240f); baseEffect.AngleWithDirection = false; baseEffect.Scale = 1f; baseEffect.TransparentValueF = 0.0f; baseEffect.TransparentVelocity = 5f; } else if (TimeMain == 100) { BaseEffect baseEffect = new BaseEffect(StageData, "woshibiaotihebaisi", new PointF(385f, 240f), 4f, 0.0); baseEffect.AngleDegree = 90.0; baseEffect.Active = false; baseEffect.DestPoint = new PointF(320f, 240f); baseEffect.AngleWithDirection = false; baseEffect.Scale = 1f; baseEffect.TransparentValueF = 0.0f; baseEffect.TransparentVelocity = 5f; EmitterTitleStarFall emitterTitleStarFall = new EmitterTitleStarFall(StageData); StageData.MenuGroupList.Add(new MenuGroup_Main(StageData)); } else if (TimeMain == 130) { SelectBox selectBox = new SelectBox(StageData); selectBox.Velocity = 100f; selectBox.OriginalPosition = new PointF(0.0f, 500f); SelectFrame = selectBox; } if (StageData.MenuGroupList.Count > 0) { BaseMenuItem menuItem1 = StageData.MenuGroupList[StageData.MenuGroupList.Count - 1].MenuItemList[StageData.MenuGroupList[StageData.MenuGroupList.Count - 1].MenuSelectIndex]; PointF pointF1; if (StageData.MenuGroupList.Count == 1 || StageData.MenuGroupList[StageData.MenuGroupList.Count - 1] is MenuOption) { StageDataPackage stageData = StageData; MyRandom ran = Ran; pointF1 = menuItem1.OriginalPosition; int minValue = (int)pointF1.X - 10; pointF1 = menuItem1.OriginalPosition; int maxValue = (int)pointF1.X + menuItem1.TxtureObject.PosRect.Width + 10; double num1 = ran.Next(minValue, maxValue); pointF1 = menuItem1.OriginalPosition; double num2 = pointF1.Y + 20.0; PointF Position = new PointF((float)num1, (float)num2); double num3 = StageData.Ran.Next(10, 20) / 10; double Direction = -1.0 * Math.PI / 2.0 - StageData.Ran.Next(1, 5) / 10.0; Particle particle = new Particle(stageData, "Star", Position, (float)num3, Direction); particle.Active = true; particle.Scale = StageData.Ran.Next(15, 40) / 100f; particle.LifeTime = 20; } if (SelectFrame != null) { BaseMenuItem menuItem2 = StageData.MenuGroupList[0].MenuItemList[StageData.MenuGroupList[0].MenuSelectIndex]; pointF1 = SelectFrame.DestPoint; double y1 = pointF1.Y; pointF1 = menuItem2.OriginalPosition; double y2 = pointF1.Y; if (Math.Abs((float)(y1 - y2 - 6.0)) >= 1.0) { BaseEffect selectFrame = SelectFrame; pointF1 = SelectFrame.DestPoint; double y3 = pointF1.Y; pointF1 = menuItem2.OriginalPosition; double y4 = pointF1.Y; double num = Math.Abs((float)(y3 - y4 - 6.0)) / 5.0; selectFrame.Velocity = (float)num; if (SelectFrame.Velocity > 16.0) { SelectFrame.Velocity = 16f; } else if (SelectFrame.Velocity < 2.0) { SelectFrame.Velocity = 2f; } } BaseEffect selectFrame1 = SelectFrame; pointF1 = menuItem2.OriginalPosition; PointF pointF2 = new PointF(0.0f, (float)(pointF1.Y + 6.0)); selectFrame1.DestPoint = pointF2; } } base.UpdateData(); if (0 <= TimeMain && TimeMain < 130) { BackgroundLight += 4; if (BackgroundLight <= byte.MaxValue) { return; } BackgroundLight = byte.MaxValue; } else { BackgroundLight = byte.MaxValue; } }