public override object Clone() { BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS)base.Clone(); if (CSBullet != null) { baseEmitterCs.CSBullet = (BaseBullet_CS)CSBullet.Clone(); } if (CSLaserS != null) { baseEmitterCs.CSLaserS = (BaseStraightLaser_CS)CSLaserS.Clone(); } if (CSLaserR != null) { baseEmitterCs.CSLaserR = (BaseRadialLaser_CS)CSLaserR.Clone(); } if (CSLaserB != null) { baseEmitterCs.CSLaserB = (BaseBendLaser_CS)CSLaserB.Clone(); } if (CSEnemy != null) { baseEmitterCs.CSEnemy = (BaseEnemyPlane_Touhou)CSEnemy.Clone(); } if (CSEffect != null) { baseEmitterCs.CSEffect = (BaseEffect_CS)CSEffect.Clone(); } return(baseEmitterCs); }
public override void Shoot() { if (Time >= CSData.TimeTotal) { Time -= CSData.TimeTotal; } if (OnRoad && Boss != null) { return; } CSData.EmitterList.ForEach(em => { if (em.BindingID != -1 || em.StartTime != Time) { return; } BaseEmitter_CS baseEmitterCs1 = (BaseEmitter_CS)em.Clone(); if (BossBinding && Boss != null) { BaseEmitter_CS baseEmitterCs2 = baseEmitterCs1; float x1 = baseEmitterCs1.OriginalPosition.X; PointF originalPosition1 = Boss.OriginalPosition; float x2 = originalPosition1.X; float num1 = x1 + x2; originalPosition1 = BaseOriginalPosition; float x3 = originalPosition1.X; float num2 = num1 - x3; float y1 = baseEmitterCs1.OriginalPosition.Y; PointF originalPosition2 = Boss.OriginalPosition; float y2 = originalPosition2.Y; float num3 = y1 + y2; originalPosition2 = BaseOriginalPosition; float y3 = originalPosition2.Y; float num4 = num3 - y3; PointF pointF = new PointF(num2, num4); baseEmitterCs2.OriginalPosition = pointF; baseEmitterCs1.EmitPoint = new PointF(-99998f, -99998f); baseEmitterCs1.SetBinding(Boss); } baseEmitterCs1.Time = Time; StageData.EnemyPlaneList.Add(baseEmitterCs1); }); }
public override void Shoot() { if (this.Time >= this.CSData.TimeTotal) { this.Time -= this.CSData.TimeTotal; } if (this.OnRoad && this.Boss != null) { return; } this.CSData.EmitterList.ForEach((Action <BaseEmitter_CS>)(em => { if (em.BindingID != -1 || em.StartTime != this.Time) { return; } BaseEmitter_CS baseEmitterCs1 = (BaseEmitter_CS)em.Clone(); if (this.BossBinding && this.Boss != null) { BaseEmitter_CS baseEmitterCs2 = baseEmitterCs1; double x1 = (double)baseEmitterCs1.OriginalPosition.X; PointF originalPosition1 = this.Boss.OriginalPosition; double x2 = (double)originalPosition1.X; double num1 = x1 + x2; originalPosition1 = this.BaseOriginalPosition; double x3 = (double)originalPosition1.X; double num2 = num1 - x3; double y1 = (double)baseEmitterCs1.OriginalPosition.Y; PointF originalPosition2 = this.Boss.OriginalPosition; double y2 = (double)originalPosition2.Y; double num3 = y1 + y2; originalPosition2 = this.BaseOriginalPosition; double y3 = (double)originalPosition2.Y; double num4 = num3 - y3; PointF pointF = new PointF((float)num2, (float)num4); baseEmitterCs2.OriginalPosition = pointF; baseEmitterCs1.EmitPoint = new PointF(-99998f, -99998f); baseEmitterCs1.SetBinding((BaseObject)this.Boss); } baseEmitterCs1.Time = this.Time; this.StageData.EnemyPlaneList.Add((BaseEnemyPlane)baseEmitterCs1); })); }
public void ShootBullet() { float x = EmitPoint.X; float y = EmitPoint.Y; PointF originalPosition; float num1; if (x == -99999.0) { originalPosition = MyPlane.OriginalPosition; num1 = originalPosition.X; } else if (x == -99998.0) { originalPosition = this.OriginalPosition; num1 = originalPosition.X; } else { num1 = (float)(x - 320.0 + 192.0); } float num2; if (y == -99999.0) { originalPosition = MyPlane.OriginalPosition; num2 = originalPosition.Y; } else if (y == -99998.0) { originalPosition = this.OriginalPosition; num2 = originalPosition.Y; } else { num2 = (float)(y - 240.0 + 224.0); } if (EmitterMode == EmitterMode.StraightLaser || EmitterMode == EmitterMode.RadialLaser || EmitterMode == EmitterMode.BendLaser) { originalPosition = this.OriginalPosition; num1 = originalPosition.X; originalPosition = this.OriginalPosition; num2 = originalPosition.Y; } PointF OriginalPosition = new PointF(num1 + RanX * (float)Ran.NextPMDouble(), num2 + RanY * (float)Ran.NextPMDouble()); double edi = EmitDirection != -99999.0 ? (EmitDirection + RanEmitDirection * Ran.NextPMDouble() + SubBullet.RanDirection * Ran.NextPMDouble()) * Math.PI / 180.0 : GetDirection(MyPlane) + (RanEmitDirection * Ran.NextPMDouble() + SubBullet.RanDirection * Ran.NextPMDouble()) * Math.PI / 180.0; double num3 = RadiusDirection != -99999.0 ? (RadiusDirection + RanRadiusDirection * Ran.NextPMDouble()) * Math.PI / 180.0 : GetDirection(MyPlane) + RanRadiusDirection * Ran.NextPMDouble() * Math.PI / 180.0; float num4 = EmitRadius + RanRadius * (float)Ran.NextPMDouble(); int num5 = Way + (int)(RanWay * Ran.NextPMDouble()); float num6 = SubBullet.Velocity + SubBullet.RanVelocity * (float)Ran.NextPMDouble(); float num7 = SubBullet.AccelerateCS + SubBullet.RanAccelerate * (float)Ran.NextPMDouble(); double num8 = SubBullet.AccDirection + SubBullet.RanAccDirection; double num9 = Range + RanRange * Ran.NextPMDouble(); if (RDirectionWithDirection) { num3 += edi; } double num10 = num9 * Math.PI / 180.0 / num5; edi -= (num5 - 1) * num10 / 2.0; double num11 = num3 - (num5 - 1) * num10 / 2.0; if (EffectType == 2) { EmitterSaveEnegy3D emitterSaveEnegy3D = new EmitterSaveEnegy3D(StageData, OriginalPosition, CSEffect.ColorValue); StageData.SoundPlay("se_ch02.wav"); } else if (EffectType == 3) { EmitterGiveOutEnegy3D emitterGiveOutEnegy3D = new EmitterGiveOutEnegy3D(StageData, OriginalPosition, CSEffect.ColorValue); StageData.SoundPlay("se_cat00.wav"); StageData.SoundPlay("se_enep02.wav"); } else { for (int index1 = 0; index1 < num5; ++index1) { PointF p = new PointF(OriginalPosition.X + num4 * (float)Math.Cos(num11), OriginalPosition.Y + num4 * (float)Math.Sin(num11)); for (int index2 = 0; index2 < Count; ++index2) { if (EmitterMode == EmitterMode.Bullet || EmitterMode == EmitterMode.StraightLaser || EmitterMode == EmitterMode.RadialLaser || EmitterMode == EmitterMode.BendLaser) { BaseBullet_Touhou b = new BaseBullet_Touhou(StageData); if (CSBullet != null) { b = (BaseBullet_Touhou)CSBullet.Clone(); b.OriginalPosition = p; b.GhostingCount = b.GhostingCount; b.AngleDegree += CSBullet.RanAngle * Ran.NextPMDouble(); } else if (CSLaserS != null) { b = (BaseBullet_Touhou)CSLaserS.Clone(); b.OriginalPosition = p; b.Angle = -1.0 * Math.PI / 2.0; b.Active = true; } else if (CSLaserR != null) { b = (BaseBullet_Touhou)CSLaserR.Clone(); b.OriginalPosition = p; b.Angle = Math.PI / 2.0; b.UnRemoveable = true; b.Active = true; } else if (CSLaserB != null) { b = (BaseBullet_Touhou)CSLaserB.Clone(); b.OriginalPosition = p; b.UnRemoveable = true; b.Active = true; } b.GhostingCount = b.GhostingCount; b.Velocity = num6 - index2 * DeltaV; b.Direction = edi; b.AccelerateCS = num7; b.AccDirection = num8; b.ID = ID; b.LayerID = LayerID; if (MotionBinding) { b.SetBinding(this); } BulletList.Add(b); if (EmitterMode == EmitterMode.Bullet) { CSData.EmitterList.ForEach(em => { if (em.BindingID != ID) { return; } b.UnRemoveable = true; BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS)em.Clone(); StageData.EnemyPlaneList.Add(baseEmitterCs); baseEmitterCs.OriginalPosition = p; baseEmitterCs.LifeTime = SubBullet.LifeTime; baseEmitterCs.ColorValue = SubBullet.ColorValue; baseEmitterCs.TransparentValueF = SubBullet.TransparentValueF; baseEmitterCs.Direction = edi; baseEmitterCs.DestPoint = SubBullet.DestPoint; baseEmitterCs.Active = SubBullet.Active; baseEmitterCs.OutBound = SubBullet.OutBound; if (baseEmitterCs.BindWithDirection) { baseEmitterCs.EmitDirection += edi * 180.0 / Math.PI; } baseEmitterCs.SetBinding(b); if (!baseEmitterCs.DeepBinding) { baseEmitterCs.Time = Time; baseEmitterCs.LifeTime = Math.Min(SubBullet.LifeTime + Time, em.StartTime + em.Duration); } }); } } else if (EmitterMode == EmitterMode.Enemy) { BaseEnemyPlane_Touhou enemy = (BaseEnemyPlane_Touhou)SubBullet.Clone(); enemy.LifeTime = 0; enemy.OriginalPosition = p; enemy.GhostingCount = enemy.GhostingCount; enemy.Velocity = num6 - index2 * DeltaV; enemy.Direction = edi; enemy.AccelerateCS = num7; enemy.AccDirection = num8; enemy.ID = ID; enemy.LayerID = LayerID; if (MotionBinding) { enemy.SetBinding(this); } EnemyPlaneList.Add(enemy); CSData.EmitterList.ForEach(em => { if (em.BindingID != ID) { return; } BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS)em.Clone(); StageData.EnemyPlaneList.Add(baseEmitterCs); baseEmitterCs.OriginalPosition = p; baseEmitterCs.LifeTime = SubBullet.LifeTime; baseEmitterCs.ColorValue = SubBullet.ColorValue; baseEmitterCs.TransparentValueF = SubBullet.TransparentValueF; baseEmitterCs.Direction = edi; baseEmitterCs.DestPoint = SubBullet.DestPoint; baseEmitterCs.Active = SubBullet.Active; baseEmitterCs.OutBound = SubBullet.OutBound; baseEmitterCs.SetBinding(enemy); if (baseEmitterCs.BindWithDirection) { baseEmitterCs.EmitDirection += edi * 180.0 / Math.PI; } if (!baseEmitterCs.DeepBinding) { baseEmitterCs.Time = Time; baseEmitterCs.LifeTime = Math.Min(SubBullet.LifeTime + Time, em.StartTime + em.Duration); } }); } else if (EmitterMode == EmitterMode.Effect) { BaseEffect_CS baseEffectCs = (BaseEffect_CS)CSEffect.Clone(); baseEffectCs.OriginalPosition = p; baseEffectCs.GhostingCount = baseEffectCs.GhostingCount; baseEffectCs.AngleDegree += CSEffect.RanAngle * Ran.NextPMDouble(); baseEffectCs.Velocity = num6 - index2 * DeltaV; baseEffectCs.Direction = edi; baseEffectCs.AccelerateCS = num7; baseEffectCs.AccDirection = num8; baseEffectCs.ID = ID; baseEffectCs.LayerID = LayerID; if (MotionBinding) { baseEffectCs.SetBinding(this); } EffectList.Add(baseEffectCs); } } num11 += num10; edi += num10; if (SpecifySE) { StageData.SoundPlay(SoundName); } else if (EmitterMode == EmitterMode.Bullet) { StageData.SoundPlay("se_tan00a.wav", OriginalPosition.X / BoundRect.Width); } else if (EmitterMode == EmitterMode.StraightLaser || EmitterMode == EmitterMode.RadialLaser) { StageData.SoundPlay("se_lazer00.wav", OriginalPosition.X / BoundRect.Width); } } } }
public void String2Data(StageDataPackage StageData) { EmitterList.Clear(); int num1 = 0; string[] mbGtext1 = MBGtext; int index1 = num1; int num2 = index1 + 1; if (mbGtext1[index1] != "Crazy Storm Data 1.01") { int num3 = (int)MessageBox.Show("当前暂不支持除1.01以外的数据格式", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand); } else { string[] mbGtext2 = MBGtext; int index2 = num2; int num4 = index2 + 1; string str1 = mbGtext2[index2]; if (str1.Contains("Types")) { int num5 = int.Parse(str1.Split(' ')[0]); for (int index3 = 0; index3 < num5; ++index3) { MBGtext[num4++].Split('_'); } str1 = MBGtext[num4++]; } if (str1.Contains("GlobalEvents")) { int num5 = int.Parse(str1.Split(' ')[0]); for (int index3 = 0; index3 < num5; ++index3) { string str2 = MBGtext[num4++]; } str1 = MBGtext[num4++]; } if (str1.Contains("Sounds")) { int num5 = int.Parse(str1.Split(' ')[0]); for (int index3 = 0; index3 < num5; ++index3) { string str2 = MBGtext[num4++]; } string str3 = MBGtext[num4++]; } string[] mbGtext3 = MBGtext; int index4 = num4; int num6 = index4 + 1; TimeTotal = int.Parse(mbGtext3[index4].Split(':')[1]); for (int index3 = 0; index3 < 4; ++index3) { string str2 = MBGtext[num6++]; if (str2.Split(':')[1].Split(',')[0] != "empty") { int num5 = int.Parse(str2.Split(':')[1].Split(',')[3]); for (int index5 = 0; index5 < num5; ++index5) { string[] strArray = MBGtext[num6++].Split(','); EmitterMode EmitterMode = EmitterMode.Bullet; if (strArray.Length > 91) { if (bool.Parse(strArray[81])) { EmitterMode = EmitterMode.Enemy; } else if (int.Parse(strArray[91]) > 0) { EmitterMode = EmitterMode.Effect; } } BaseEmitter_CS baseEmitterCs = new BaseEmitter_CS(StageData, this, EmitterMode); if (baseEmitterCs.EmitterMode == EmitterMode.Enemy) { EnemyFactory ef = new EnemyFactory(strArray[82]); ef.HealthPoint = int.Parse(strArray[83]); ef.RedCount = int.Parse(strArray[84]); ef.BlueCount = int.Parse(strArray[85]); ef.ColorType = byte.Parse(strArray[86]); ef.BackFire = bool.Parse(strArray[87]); ef.ClearRadius = int.Parse(strArray[88]); ef.GreenCount = int.Parse(strArray[89]); ef.StarFall = (strArray[90] != "0"); baseEmitterCs.SubBullet = ef.GenerateEnemy(StageData); } baseEmitterCs.ID = int.Parse(strArray[0]); baseEmitterCs.LayerID = int.Parse(strArray[1]); baseEmitterCs.BindingState = bool.Parse(strArray[2]); baseEmitterCs.BindingID = int.Parse(strArray[3]); baseEmitterCs.BindWithDirection = bool.Parse(strArray[4]); baseEmitterCs.CS_Position = new PointF(float.Parse(strArray[6]), float.Parse(strArray[7])); baseEmitterCs.StartTime = int.Parse(strArray[8]); baseEmitterCs.Duration = int.Parse(strArray[9]); baseEmitterCs.EmitPoint = new PointF(float.Parse(strArray[10]), float.Parse(strArray[11])); baseEmitterCs.EmitRadius = (float)int.Parse(strArray[12]); baseEmitterCs.RadiusDirection = (double)float.Parse(strArray[13]); string str3 = strArray[14].Replace("{", "").Replace("}", ""); baseEmitterCs.RadiusDirectionPoint = new PointF(float.Parse(str3.Split(' ')[0].Split(':')[1]), float.Parse(str3.Split(' ')[1].Split(':')[1])); baseEmitterCs.Way = int.Parse(strArray[15]); baseEmitterCs.Circle = int.Parse(strArray[16]); baseEmitterCs.EmitDirection = (double)float.Parse(strArray[17]); string str4 = strArray[18].Replace("{", "").Replace("}", ""); baseEmitterCs.EmitDirectionPoint = new PointF(float.Parse(str4.Split(' ')[0].Split(':')[1]), float.Parse(str4.Split(' ')[1].Split(':')[1])); baseEmitterCs.Range = (double)int.Parse(strArray[19]); baseEmitterCs.Velocity = float.Parse(strArray[20]); baseEmitterCs.DirectionDegree = (double)float.Parse(strArray[21]); string str5 = strArray[22].Replace("{", "").Replace("}", ""); baseEmitterCs.DestPoint = new PointF(float.Parse(str5.Split(' ')[0].Split(':')[1]), float.Parse(str5.Split(' ')[1].Split(':')[1])); baseEmitterCs.AccelerateCS = float.Parse(strArray[23]); baseEmitterCs.AccDirection = (double)float.Parse(strArray[24]); baseEmitterCs.SubBullet.LifeTime = int.Parse(strArray[26]); baseEmitterCs.SubBullet.Type = int.Parse(strArray[27]); baseEmitterCs.SubBullet.ScaleWidth = float.Parse(strArray[28]); baseEmitterCs.SubBullet.ScaleLength = float.Parse(strArray[29]); baseEmitterCs.SubBullet.ColorValue = Color.FromArgb(int.Parse(strArray[30]), int.Parse(strArray[31]), int.Parse(strArray[32])); baseEmitterCs.SubBullet.TransparentValueF = (float)(int.Parse(strArray[33]) * (int)byte.MaxValue / 100); baseEmitterCs.SubBullet.AngleDegree = (double)float.Parse(strArray[34]) + 180.0; baseEmitterCs.SubBullet.AngleWithDirection = bool.Parse(strArray[36]); baseEmitterCs.SubBullet.Velocity = float.Parse(strArray[37]); baseEmitterCs.SubBullet.DirectionDegree = (double)float.Parse(strArray[38]); baseEmitterCs.SubBullet.DestPoint = new PointF(float.Parse(str5.Split(' ')[0].Split(':')[1]), float.Parse(str5.Split(' ')[1].Split(':')[1])); baseEmitterCs.SubBullet.AccelerateCS = float.Parse(strArray[40]); baseEmitterCs.SubBullet.AccDirection = (double)float.Parse(strArray[41]); baseEmitterCs.SubBullet.ScaleX = float.Parse(strArray[43]); baseEmitterCs.SubBullet.ScaleY = float.Parse(strArray[44]); baseEmitterCs.SubBullet.BeginningEffect = bool.Parse(strArray[45]); baseEmitterCs.SubBullet.EndingEffect = bool.Parse(strArray[46]); baseEmitterCs.SubBullet.Active = bool.Parse(strArray[47]); baseEmitterCs.SubBullet.Ghosting = bool.Parse(strArray[48]); baseEmitterCs.SubBullet.OutBound = bool.Parse(strArray[49]); baseEmitterCs.SubBullet.UnRemoveable = bool.Parse(strArray[50]); string str6 = strArray[51]; int index6 = 0; while (true) { if (index6 < str6.Split('&').Length - 1) { string str7 = str6.Split('&')[index6]; EventGroup eventGroup = new EventGroup(); eventGroup.index = index6; eventGroup.tag = str7.Split('|')[0]; eventGroup.t = int.Parse(str7.Split('|')[1]); eventGroup.addtime = int.Parse(str7.Split('|')[2]); int index7 = 0; while (true) { if (index7 < str7.Split('|')[3].Split(';').Length - 1) { Event @event = new Event(); @event.EventString = str7.Split('|')[3].Split(';')[index7]; @event.String2EmitterEvent(); eventGroup.EventList.Add(@event); ++index7; } else { break; } } baseEmitterCs.EventGroupList.Add(eventGroup); ++index6; } else { break; } } string str8 = strArray[52]; int index8 = 0; while (true) { if (index8 < str8.Split('&').Length - 1) { string str7 = str8.Split('&')[index8]; EventGroup eventGroup = new EventGroup(); eventGroup.index = index8; eventGroup.tag = str7.Split('|')[0]; eventGroup.t = int.Parse(str7.Split('|')[1]); eventGroup.addtime = int.Parse(str7.Split('|')[2]); int index7 = 0; while (true) { if (index7 < str7.Split('|')[3].Split(';').Length - 1) { Event @event = new Event(); @event.EventString = str7.Split('|')[3].Split(';')[index7]; @event.String2BulletEvent(); eventGroup.EventList.Add(@event); ++index7; } else { break; } } baseEmitterCs.SubBullet.EventGroupList.Add(eventGroup); ++index8; } else { break; } } baseEmitterCs.RanX = float.Parse(strArray[53]); baseEmitterCs.RanY = float.Parse(strArray[54]); baseEmitterCs.RanRadius = (float)int.Parse(strArray[55]); baseEmitterCs.RanRadiusDirection = (double)float.Parse(strArray[56]); baseEmitterCs.RanWay = int.Parse(strArray[57]); baseEmitterCs.RanCircle = int.Parse(strArray[58]); baseEmitterCs.RanEmitDirection = (double)float.Parse(strArray[59]); baseEmitterCs.RanRange = (double)int.Parse(strArray[60]); baseEmitterCs.RanVelocity = float.Parse(strArray[61]); baseEmitterCs.RanDirection = (double)float.Parse(strArray[62]); baseEmitterCs.RanAccelerate = float.Parse(strArray[63]); baseEmitterCs.RanAccDirection = (double)float.Parse(strArray[64]); baseEmitterCs.SubBullet.RanAngle = (double)float.Parse(strArray[65]); baseEmitterCs.SubBullet.RanVelocity = float.Parse(strArray[66]); baseEmitterCs.SubBullet.RanDirection = (double)float.Parse(strArray[67]); baseEmitterCs.SubBullet.RanAccelerate = float.Parse(strArray[68]); baseEmitterCs.SubBullet.RanAccDirection = (double)float.Parse(strArray[69]); if (strArray.Length > 72) { baseEmitterCs.SubBullet.Cover = bool.Parse(strArray[70]); baseEmitterCs.SubBullet.Rebound = bool.Parse(strArray[71]); baseEmitterCs.SubBullet.Force = bool.Parse(strArray[72]); } if (strArray.Length > 73) { baseEmitterCs.DeepBinding = bool.Parse(strArray[73]); } if (strArray.Length > 79) { baseEmitterCs.MotionBinding = bool.Parse(strArray[74]); if (baseEmitterCs.SubBullet is BaseBullet_Touhou) { ((BaseBullet_Touhou)baseEmitterCs.SubBullet).Reflect = byte.Parse(strArray[75]); ((BaseBullet_Touhou)baseEmitterCs.SubBullet).Layer = int.Parse(strArray[78]); } baseEmitterCs.SoundName = strArray[76]; baseEmitterCs.SpecifySE = bool.Parse(strArray[77]); if (int.Parse(strArray[79]) != 0) { baseEmitterCs.SubBullet.Region = int.Parse(strArray[79]); ((BaseBullet_Touhou)baseEmitterCs.SubBullet).SizeValue = baseEmitterCs.SubBullet.Region * 2; } } if (strArray.Length > 95) { baseEmitterCs.EffectType = int.Parse(strArray[91]); if (strArray[92] != null && StageData.TextureObjectDictionary.ContainsKey(strArray[92])) { baseEmitterCs.SubBullet.TxtureObject = StageData.TextureObjectDictionary[strArray[92]]; } baseEmitterCs.Count = int.Parse(strArray[94]); baseEmitterCs.Count = baseEmitterCs.Count < 1 ? 1 : baseEmitterCs.Count; baseEmitterCs.DeltaV = float.Parse(strArray[95]); } if (strArray.Length > 110) { baseEmitterCs.RDirectionWithDirection = !(strArray[96] == "0"); } EmitterList.Add(baseEmitterCs); if (EmitterMode == EmitterMode.Bullet) { BaseEmitter_CS b2 = new BaseEmitter_CS(StageData, this, EmitterMode); b2 = (BaseEmitter_CS)baseEmitterCs.Clone(); b2.SubBullet.Velocity = baseEmitterCs.SubBullet.Velocity * 1.5f; b2.SubBullet.AccelerateCS = baseEmitterCs.SubBullet.AccelerateCS * 1.5f; EmitterList.Add(b2); } } if (str2.Split(':')[1].Split(',').Length >= 7) { int num7 = int.Parse(str2.Split(':')[1].Split(',')[4]); for (int index5 = 0; index5 < num7; ++index5) { string str3 = MBGtext[num6++]; string[] strArray = str3.Split(','); BaseEmitter_CS baseEmitterCs = !bool.Parse(strArray[29]) ? (strArray.Length <= 61 ? new BaseEmitter_CS(StageData, this, EmitterMode.StraightLaser) : (!bool.Parse(strArray[61]) ? new BaseEmitter_CS(StageData, this, EmitterMode.StraightLaser) : new BaseEmitter_CS(StageData, this, EmitterMode.BendLaser))) : new BaseEmitter_CS(StageData, this, EmitterMode.RadialLaser); baseEmitterCs.ID = int.Parse(strArray[0]); baseEmitterCs.LayerID = int.Parse(strArray[1]); baseEmitterCs.BindingState = bool.Parse(strArray[2]); baseEmitterCs.BindingID = int.Parse(strArray[3]); baseEmitterCs.BindWithDirection = bool.Parse(strArray[4]); baseEmitterCs.CS_Position = new PointF(float.Parse(strArray[6]), float.Parse(strArray[7])); baseEmitterCs.StartTime = int.Parse(strArray[8]); baseEmitterCs.Duration = int.Parse(strArray[9]); baseEmitterCs.EmitRadius = (float)int.Parse(strArray[10]); baseEmitterCs.RadiusDirection = (double)float.Parse(strArray[11]); baseEmitterCs.Way = int.Parse(strArray[13]); baseEmitterCs.Circle = int.Parse(strArray[14]); baseEmitterCs.EmitDirection = (double)float.Parse(strArray[15]); baseEmitterCs.Range = (double)int.Parse(strArray[17]); baseEmitterCs.Velocity = float.Parse(strArray[18]); baseEmitterCs.DirectionDegree = (double)float.Parse(strArray[19]); baseEmitterCs.AccelerateCS = float.Parse(strArray[21]); baseEmitterCs.AccDirection = (double)float.Parse(strArray[22]); baseEmitterCs.SubBullet.LifeTime = int.Parse(strArray[24]); baseEmitterCs.SubBullet.Type = int.Parse(strArray[25]); if (baseEmitterCs.EmitterMode == EmitterMode.StraightLaser || baseEmitterCs.EmitterMode == EmitterMode.BendLaser) { baseEmitterCs.SubBullet.ScaleLength = float.Parse(strArray[26]); baseEmitterCs.SubBullet.GhostingCount = int.Parse(strArray[27]); } else { baseEmitterCs.SubBullet.MaxScaleW = (float)int.Parse(strArray[27]) / 256f; baseEmitterCs.SubBullet.ScaleWidth = baseEmitterCs.SubBullet.MaxScaleW; baseEmitterCs.SubBullet.MaxScaleL = 1f; baseEmitterCs.SubBullet.ScaleLength = 0.2f; } baseEmitterCs.SubBullet.TransparentValueF = (float)(int.Parse(strArray[28]) * (int)byte.MaxValue / 100); baseEmitterCs.SubBullet.Velocity = float.Parse(strArray[30]); baseEmitterCs.SubBullet.DirectionDegree = (double)float.Parse(strArray[31]); baseEmitterCs.SubBullet.AccelerateCS = float.Parse(strArray[33]); baseEmitterCs.SubBullet.AccDirection = (double)float.Parse(strArray[34]); baseEmitterCs.SubBullet.Active = bool.Parse(strArray[38]); baseEmitterCs.SubBullet.UnRemoveable = bool.Parse(strArray[40]); string str4 = strArray[42]; int index6 = 0; while (true) { if (index6 < str4.Split('&').Length - 1) { string str5 = str4.Split('&')[index6]; EventGroup eventGroup = new EventGroup(); eventGroup.index = index6; eventGroup.tag = str5.Split('|')[0]; eventGroup.t = int.Parse(str5.Split('|')[1]); eventGroup.addtime = int.Parse(str5.Split('|')[2]); int index7 = 0; while (true) { if (index7 < str5.Split('|')[3].Split(';').Length - 1) { Event @event = new Event(); @event.EventString = str5.Split('|')[3].Split(';')[index7]; @event.String2EmitterEvent(); eventGroup.EventList.Add(@event); ++index7; } else { break; } } baseEmitterCs.EventGroupList.Add(eventGroup); ++index6; } else { break; } } string str6 = strArray[43]; int index8 = 0; while (true) { if (index8 < str6.Split('&').Length - 1) { string str5 = str6.Split('&')[index8]; EventGroup eventGroup = new EventGroup(); eventGroup.index = index8; eventGroup.tag = str5.Split('|')[0]; eventGroup.t = int.Parse(str5.Split('|')[1]); eventGroup.addtime = int.Parse(str5.Split('|')[2]); int index7 = 0; while (true) { if (index7 < str5.Split('|')[3].Split(';').Length - 1) { Event @event = new Event(); @event.EventString = str5.Split('|')[3].Split(';')[index7]; @event.String2BulletEvent(); eventGroup.EventList.Add(@event); ++index7; } else { break; } } baseEmitterCs.SubBullet.EventGroupList.Add(eventGroup); ++index8; } else { break; } } baseEmitterCs.RanRadius = (float)int.Parse(strArray[44]); baseEmitterCs.RanRadiusDirection = (double)float.Parse(strArray[45]); baseEmitterCs.RanWay = int.Parse(strArray[46]); baseEmitterCs.RanCircle = int.Parse(strArray[47]); baseEmitterCs.RanEmitDirection = (double)float.Parse(strArray[48]); baseEmitterCs.RanRange = (double)int.Parse(strArray[49]); baseEmitterCs.RanVelocity = float.Parse(strArray[50]); baseEmitterCs.RanDirection = (double)float.Parse(strArray[51]); baseEmitterCs.RanAccelerate = float.Parse(strArray[52]); baseEmitterCs.RanAccDirection = (double)float.Parse(strArray[53]); baseEmitterCs.SubBullet.RanVelocity = float.Parse(strArray[54]); baseEmitterCs.SubBullet.RanDirection = (double)float.Parse(strArray[55]); baseEmitterCs.SubBullet.RanAccelerate = float.Parse(strArray[56]); baseEmitterCs.SubBullet.RanAccDirection = (double)float.Parse(strArray[57]); if (strArray.Length > 58) { baseEmitterCs.DeepBinding = bool.Parse(strArray[58]); } if (strArray.Length > 62) { if (baseEmitterCs.SubBullet is BaseBullet_Touhou) { ((BaseBullet_Touhou)baseEmitterCs.SubBullet).Reflect = byte.Parse(str3.Split(',')[59]); } baseEmitterCs.MotionBinding = (bool.Parse(str3.Split(',')[60]) ? 1 : 0) != 0; if (baseEmitterCs.EmitterMode == EmitterMode.StraightLaser) { ((Bullet_StraightLaser)baseEmitterCs.SubBullet).LaserHead = (bool.Parse(str3.Split(',')[62]) ? 1 : 0) != 0; } } EmitterList.Add(baseEmitterCs); } int num8 = int.Parse(str2.Split(':')[1].Split(',')[5]); for (int index5 = 0; index5 < num8; ++index5) { string[] strArray = MBGtext[num6++].Split(','); BaseCover_CS baseCoverCs = new BaseCover_CS(StageData); baseCoverCs.MaxScale = 1000f; baseCoverCs.ID = int.Parse(strArray[0]); baseCoverCs.LayerID = int.Parse(strArray[1]); baseCoverCs.CS_Position = new PointF(float.Parse(strArray[2]), float.Parse(strArray[3])); baseCoverCs.StartTime = int.Parse(strArray[4]); baseCoverCs.Duration = int.Parse(strArray[5]); baseCoverCs.ScaleWidth = (float)int.Parse(strArray[6]); baseCoverCs.ScaleLength = (float)int.Parse(strArray[7]); baseCoverCs.Roundness = bool.Parse(strArray[8]); baseCoverCs.Type = int.Parse(strArray[9]); baseCoverCs.CtrlID = int.Parse(strArray[10]); baseCoverCs.Velocity = float.Parse(strArray[11]); baseCoverCs.DirectionDegree = (double)float.Parse(strArray[12]); baseCoverCs.AccelerateCS = float.Parse(strArray[14]); baseCoverCs.AccDirection = (double)float.Parse(strArray[15]); string str3 = strArray[17]; int index6 = 0; while (true) { if (index6 < str3.Split('&').Length - 1) { string str4 = str3.Split('&')[index6]; EventGroup eventGroup = new EventGroup(); eventGroup.index = index6; eventGroup.tag = str4.Split('|')[0]; eventGroup.t = int.Parse(str4.Split('|')[1]); eventGroup.addtime = int.Parse(str4.Split('|')[2]); int index7 = 0; while (true) { if (index7 < str4.Split('|')[3].Split(';').Length - 1) { Event @event = new Event(); @event.EventString = str4.Split('|')[3].Split(';')[index7]; @event.String2EmitterEvent(); eventGroup.EventList.Add(@event); ++index7; } else { break; } } baseCoverCs.EventGroupList.Add(eventGroup); ++index6; } else { break; } } string str5 = strArray[18]; int index8 = 0; while (true) { if (index8 < str5.Split('&').Length - 1) { string str4 = str5.Split('&')[index8]; EventGroup eventGroup = new EventGroup(); eventGroup.index = index8; eventGroup.tag = str4.Split('|')[0]; eventGroup.t = int.Parse(str4.Split('|')[1]); eventGroup.addtime = int.Parse(str4.Split('|')[2]); int index7 = 0; while (true) { if (index7 < str4.Split('|')[3].Split(';').Length - 1) { Event @event = new Event(); @event.EventString = str4.Split('|')[3].Split(';')[index7]; @event.String2BulletEvent(); eventGroup.EventList.Add(@event); ++index7; } else { break; } } baseCoverCs.SubEventGroupList.Add(eventGroup); ++index8; } else { break; } } baseCoverCs.RanVelocity = float.Parse(strArray[19]); baseCoverCs.RanDirection = (double)float.Parse(strArray[20]); baseCoverCs.RanAccelerate = float.Parse(strArray[21]); baseCoverCs.RanAccDirection = (double)float.Parse(strArray[22]); if (strArray.Length >= 24) { baseCoverCs.BindingID = int.Parse(strArray[23]); } if (strArray.Length >= 25 && strArray[24] != "") { baseCoverCs.DeepBinding = bool.Parse(strArray[24]); } EmitterList.Add((BaseEmitter_CS)baseCoverCs); } int num9 = int.Parse(str2.Split(':')[1].Split(',')[6]); string str7; for (int index5 = 0; index5 < num9; ++index5) { str7 = MBGtext[num6++]; } int num10 = int.Parse(str2.Split(':')[1].Split(',')[7]); for (int index5 = 0; index5 < num10; ++index5) { str7 = MBGtext[num6++]; } } } } } }
public void Update(BaseEmitter_CS CS_Emitter) { if (CS_Emitter.Time < 1) { CS_Emitter.Time = 1; } float[] conditions = new float[13]; float[] numArray1 = new float[33]; conditions[0] = CS_Emitter.Time - CS_Emitter.StartTime + 1; float[] numArray2 = conditions; PointF csPosition = CS_Emitter.CS_Position; double x1 = csPosition.X; numArray2[1] = (float)x1; float[] numArray3 = conditions; csPosition = CS_Emitter.CS_Position; double y1 = csPosition.Y; numArray3[2] = (float)y1; conditions[3] = CS_Emitter.EmitRadius; conditions[4] = (float)CS_Emitter.RadiusDirection; conditions[5] = CS_Emitter.Way; conditions[6] = CS_Emitter.Circle; conditions[7] = (float)CS_Emitter.EmitDirection; conditions[8] = (float)CS_Emitter.Range; conditions[9] = CS_Emitter.SubBullet.ScaleWidth; conditions[10] = CS_Emitter.SubBullet.ScaleLength; conditions[11] = CS_Emitter.SubBullet.TransparentValueF; conditions[12] = (float)CS_Emitter.SubBullet.AngleDegree; numArray1[0] = CS_Emitter.CS_Position.X; numArray1[1] = CS_Emitter.CS_Position.Y; numArray1[2] = CS_Emitter.EmitRadius; numArray1[3] = (float)CS_Emitter.RadiusDirection; numArray1[4] = CS_Emitter.Way; numArray1[5] = CS_Emitter.Circle; numArray1[6] = (float)CS_Emitter.EmitDirection; numArray1[7] = (float)CS_Emitter.Range; numArray1[8] = CS_Emitter.Velocity; numArray1[9] = (float)CS_Emitter.DirectionDegree; numArray1[10] = CS_Emitter.AccelerateCS; numArray1[11] = (float)CS_Emitter.AccDirection; numArray1[12] = CS_Emitter.SubBullet.LifeTime; numArray1[13] = CS_Emitter.SubBullet.Type; numArray1[14] = CS_Emitter.SubBullet.ScaleLength; numArray1[15] = CS_Emitter.SubBullet.ScaleLength; numArray1[16] = CS_Emitter.SubBullet.ColorValue.R; float[] numArray4 = numArray1; Color colorValue = CS_Emitter.SubBullet.ColorValue; double g = colorValue.G; numArray4[17] = (float)g; float[] numArray5 = numArray1; colorValue = CS_Emitter.SubBullet.ColorValue; double b = colorValue.B; numArray5[18] = (float)b; numArray1[19] = CS_Emitter.SubBullet.TransparentValueF; numArray1[20] = (float)CS_Emitter.SubBullet.AngleDegree; numArray1[21] = CS_Emitter.SubBullet.Velocity; numArray1[22] = (float)CS_Emitter.SubBullet.DirectionDegree; numArray1[23] = CS_Emitter.SubBullet.AccelerateCS; numArray1[24] = (float)CS_Emitter.SubBullet.AccDirection; numArray1[25] = CS_Emitter.SubBullet.ScaleX; numArray1[26] = CS_Emitter.SubBullet.ScaleY; numArray1[27] = 0.0f; numArray1[28] = 0.0f; numArray1[29] = 0.0f; numArray1[30] = 0.0f; numArray1[31] = 0.0f; numArray1[32] = 0.0f; if (t < 1) { t = 1; } if ((CS_Emitter.Time - CS_Emitter.StartTime + 1) % t == 0) { ++loop; } foreach (Event ev in EventList) { if (CheckCondition(conditions, ev)) { PointF pointF; if (ev.special == 3) { if (ev.changevalue == 0) { Event @event = ev; pointF = CS_Emitter.CS_Position; double num = pointF.X - 4.0; @event.res = (float)num; } if (ev.changevalue == 1) { Event @event = ev; pointF = CS_Emitter.CS_Position; double num = pointF.Y + 16.0; @event.res = (float)num; } if (ev.changevalue == 6 || ev.changevalue == 24) { Event @event = ev; pointF = CS_Emitter.OriginalPosition; double num1 = pointF.X - 4.0; pointF = CS_Emitter.OriginalPosition; double num2 = pointF.Y + 16.0; pointF = CS_Emitter.OriginalPosition; double x2 = pointF.X; pointF = CS_Emitter.OriginalPosition; double y2 = pointF.Y; double num3 = Twopointangle((float)num1, (float)num2, (float)x2, (float)y2) * 180.0 / 3.14159274101257; @event.res = (float)num3; } } else if (ev.special == 4) { if (ev.changevalue == 0) { Event @event = ev; pointF = CS_Emitter.MyPlane.OriginalPosition; double num = pointF.X + 320.0 - 192.0; @event.res = (float)num; } if (ev.changevalue == 1) { Event @event = ev; pointF = CS_Emitter.MyPlane.OriginalPosition; double num = pointF.Y + 240.0 - 224.0; @event.res = (float)num; } if (ev.changevalue == 3 || ev.changevalue == 6 || (ev.changevalue == 9 || ev.changevalue == 11) || ev.changevalue == 24) { Event @event = ev; pointF = CS_Emitter.MyPlane.OriginalPosition; double x2 = pointF.X; pointF = CS_Emitter.MyPlane.OriginalPosition; double y2 = pointF.Y; pointF = CS_Emitter.OriginalPosition; double x3 = pointF.X; pointF = CS_Emitter.OriginalPosition; double y3 = pointF.Y; double num = Twopointangle((float)x2, (float)y2, (float)x3, (float)y3) * 180.0 / 3.14159274101257; @event.res = (float)num; } } if (ev.special != 1) { if (ev.special == 2) { CS_Emitter.ShootBullet(); } else { Execution execution = new Execution(); if (!ev.noloop) { if (ev.time > 0) { --ev.time; if (ev.time == 0) { ev.noloop = true; } } execution.parentid = CS_Emitter.LayerID; execution.id = CS_Emitter.ID; execution.change = ev.change; execution.changetype = ev.changetype; execution.changevalue = ev.changevalue; execution.value = ev.rand == 0.0 ? ev.res : ev.res + ev.rand * (float)CS_Emitter.Ran.NextPMDouble(); execution.region = numArray1[ev.changename].ToString(); execution.time = ev.times; execution.ctime = execution.time; CS_Emitter.EventsExecutionList.Add(execution); } } } } } }
public void Update(BaseEmitter_CS objects) { switch (changevalue) { case 0: PointF csPosition1 = objects.CS_Position; float x = csPosition1.X; BaseEmitter_CS baseEmitterCs1 = objects; double num1 = ChangeValue(x); csPosition1 = objects.CS_Position; double y1 = csPosition1.Y; PointF pointF1 = new PointF((float)num1, (float)y1); baseEmitterCs1.CS_Position = pointF1; break; case 1: PointF csPosition2 = objects.CS_Position; float y2 = csPosition2.Y; BaseEmitter_CS baseEmitterCs2 = objects; csPosition2 = objects.CS_Position; PointF pointF2 = new PointF(csPosition2.X, ChangeValue(y2)); baseEmitterCs2.CS_Position = pointF2; break; case 2: objects.EmitRadius = ChangeValue(objects.EmitRadius); break; case 3: objects.RadiusDirection = ChangeValue(objects.RadiusDirection); break; case 4: objects.Way = ChangeValue(objects.Way); break; case 5: objects.Circle = ChangeValue(objects.Circle); break; case 6: objects.EmitDirection = ChangeValue(objects.EmitDirection); break; case 7: objects.Range = ChangeValue(objects.Range); break; case 8: objects.Velocity = ChangeValue(objects.Velocity); break; case 9: objects.DirectionDegree = ChangeValue(objects.DirectionDegree); break; case 10: objects.AccelerateCS = ChangeValue(objects.AccelerateCS); break; case 11: objects.AccDirection = ChangeValue(objects.AccDirection); break; case 12: objects.SubBullet.LifeTime = ChangeValue(objects.SubBullet.LifeTime); break; case 13: objects.SubBullet.Type = ChangeValue(objects.SubBullet.Type); break; case 14: objects.SubBullet.ScaleWidth = ChangeValue(objects.SubBullet.ScaleWidth); break; case 15: objects.SubBullet.ScaleLength = ChangeValue(objects.SubBullet.ScaleLength); break; case 16: int num2 = ChangeValue(objects.SubBullet.ColorValue.R); int num3 = num2 < 0 ? 0 : num2; int red = num3 > byte.MaxValue ? byte.MaxValue : num3; objects.SubBullet.ColorValue = Color.FromArgb(red, objects.SubBullet.ColorValue.G, objects.SubBullet.ColorValue.B); break; case 17: int num4 = ChangeValue(objects.SubBullet.ColorValue.G); int num5 = num4 < 0 ? 0 : num4; int green = num5 > byte.MaxValue ? byte.MaxValue : num5; objects.SubBullet.ColorValue = Color.FromArgb(objects.SubBullet.ColorValue.R, green, objects.SubBullet.ColorValue.B); break; case 18: int num6 = ChangeValue(objects.SubBullet.ColorValue.B); int num7 = num6 < 0 ? 0 : num6; int blue = num7 > byte.MaxValue ? byte.MaxValue : num7; objects.SubBullet.ColorValue = Color.FromArgb(objects.SubBullet.ColorValue.R, objects.SubBullet.ColorValue.G, blue); break; case 19: objects.SubBullet.TransparentValueF = ChangeValue(objects.SubBullet.TransparentValueF); break; case 20: objects.SubBullet.AngleDegree = ChangeValue(objects.SubBullet.AngleDegree); break; case 21: objects.SubBullet.Velocity = ChangeValue(objects.SubBullet.Velocity); break; case 22: objects.SubBullet.DirectionDegree = ChangeValue(objects.SubBullet.DirectionDegree); break; case 23: objects.SubBullet.AccelerateCS = ChangeValue(objects.SubBullet.AccelerateCS); break; case 24: objects.SubBullet.AccDirection = ChangeValue(objects.SubBullet.AccDirection); break; case 25: objects.SubBullet.ScaleX = ChangeValue(objects.SubBullet.ScaleX); break; case 26: objects.SubBullet.ScaleY = ChangeValue(objects.SubBullet.ScaleY); break; case 27: objects.SubBullet.BeginningEffect = value > 0.0; break; case 28: objects.SubBullet.EndingEffect = value > 0.0; break; case 29: objects.SubBullet.Active = value > 0.0; break; case 30: objects.SubBullet.Ghosting = value > 0.0; break; case 31: objects.SubBullet.OutBound = value > 0.0; break; case 32: objects.SubBullet.UnRemoveable = value > 0.0; break; } --ctime; if (!(changetype == 2 & ctime == -1) && !(changetype != 2 & ctime == 0)) { return; } objects.EventsExecutionList.Remove(this); }
public void ShootBullet() { float x = this.EmitPoint.X; float y = this.EmitPoint.Y; PointF originalPosition; float num1; if ((double) x == -99999.0) { originalPosition = this.MyPlane.OriginalPosition; num1 = originalPosition.X; } else if ((double) x == -99998.0) { originalPosition = this.OriginalPosition; num1 = originalPosition.X; } else num1 = (float) ((double) x - 320.0 + 192.0); float num2; if ((double) y == -99999.0) { originalPosition = this.MyPlane.OriginalPosition; num2 = originalPosition.Y; } else if ((double) y == -99998.0) { originalPosition = this.OriginalPosition; num2 = originalPosition.Y; } else num2 = (float) ((double) y - 240.0 + 224.0); if (this.EmitterMode == EmitterMode.StraightLaser || this.EmitterMode == EmitterMode.RadialLaser || this.EmitterMode == EmitterMode.BendLaser) { originalPosition = this.OriginalPosition; num1 = originalPosition.X; originalPosition = this.OriginalPosition; num2 = originalPosition.Y; } PointF OriginalPosition = new PointF(num1 + this.RanX * (float) this.Ran.NextPMDouble(), num2 + this.RanY * (float) this.Ran.NextPMDouble()); double edi = this.EmitDirection != -99999.0 ? (this.EmitDirection + this.RanEmitDirection * this.Ran.NextPMDouble() + this.SubBullet.RanDirection * this.Ran.NextPMDouble()) * Math.PI / 180.0 : this.GetDirection((BaseObject) this.MyPlane) + (this.RanEmitDirection * this.Ran.NextPMDouble() + this.SubBullet.RanDirection * this.Ran.NextPMDouble()) * Math.PI / 180.0; double num3 = this.RadiusDirection != -99999.0 ? (this.RadiusDirection + this.RanRadiusDirection * this.Ran.NextPMDouble()) * Math.PI / 180.0 : this.GetDirection((BaseObject) this.MyPlane) + this.RanRadiusDirection * this.Ran.NextPMDouble() * Math.PI / 180.0; float num4 = this.EmitRadius + this.RanRadius * (float) this.Ran.NextPMDouble(); int num5 = this.Way + (int) ((double) this.RanWay * this.Ran.NextPMDouble()); float num6 = this.SubBullet.Velocity + this.SubBullet.RanVelocity * (float) this.Ran.NextPMDouble(); float num7 = this.SubBullet.AccelerateCS + this.SubBullet.RanAccelerate * (float) this.Ran.NextPMDouble(); double num8 = this.SubBullet.AccDirection + this.SubBullet.RanAccDirection; double num9 = this.Range + this.RanRange * this.Ran.NextPMDouble(); if (this.RDirectionWithDirection) num3 += edi; double num10 = num9 * Math.PI / 180.0 / (double) num5; edi -= (double) (num5 - 1) * num10 / 2.0; double num11 = num3 - (double) (num5 - 1) * num10 / 2.0; if (this.EffectType == 2) { EmitterSaveEnegy3D emitterSaveEnegy3D = new EmitterSaveEnegy3D(this.StageData, OriginalPosition, this.CSEffect.ColorValue); this.StageData.SoundPlay("se_ch02.wav"); } else if (this.EffectType == 3) { EmitterGiveOutEnegy3D emitterGiveOutEnegy3D = new EmitterGiveOutEnegy3D(this.StageData, OriginalPosition, this.CSEffect.ColorValue); this.StageData.SoundPlay("se_cat00.wav"); this.StageData.SoundPlay("se_enep02.wav"); } else { for (int index1 = 0; index1 < num5; ++index1) { PointF p = new PointF(OriginalPosition.X + num4 * (float) Math.Cos(num11), OriginalPosition.Y + num4 * (float) Math.Sin(num11)); for (int index2 = 0; index2 < this.Count; ++index2) { if (this.EmitterMode == EmitterMode.Bullet || this.EmitterMode == EmitterMode.StraightLaser || this.EmitterMode == EmitterMode.RadialLaser || this.EmitterMode == EmitterMode.BendLaser) { BaseBullet_Touhou b = new BaseBullet_Touhou(this.StageData); if (this.CSBullet != null) { b = (BaseBullet_Touhou) this.CSBullet.Clone(); b.OriginalPosition = p; b.GhostingCount = b.GhostingCount; b.AngleDegree += this.CSBullet.RanAngle * this.Ran.NextPMDouble(); } else if (this.CSLaserS != null) { b = (BaseBullet_Touhou) this.CSLaserS.Clone(); b.OriginalPosition = p; b.Angle = -1.0 * Math.PI / 2.0; b.Active = true; } else if (this.CSLaserR != null) { b = (BaseBullet_Touhou) this.CSLaserR.Clone(); b.OriginalPosition = p; b.Angle = Math.PI / 2.0; b.UnRemoveable = true; b.Active = true; } else if (this.CSLaserB != null) { b = (BaseBullet_Touhou) this.CSLaserB.Clone(); b.OriginalPosition = p; b.UnRemoveable = true; b.Active = true; } b.GhostingCount = b.GhostingCount; b.Velocity = num6 - (float) index2 * this.DeltaV; b.Direction = edi; b.AccelerateCS = num7; b.AccDirection = num8; b.ID = this.ID; b.LayerID = this.LayerID; if (this.MotionBinding) b.SetBinding((BaseObject) this); this.BulletList.Add(b); if (this.EmitterMode == EmitterMode.Bullet) this.CSData.EmitterList.ForEach((Action<BaseEmitter_CS>) (em => { if (em.BindingID != this.ID) return; b.UnRemoveable = true; BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS) em.Clone(); this.StageData.EnemyPlaneList.Add((BaseEnemyPlane) baseEmitterCs); baseEmitterCs.OriginalPosition = p; baseEmitterCs.LifeTime = this.SubBullet.LifeTime; baseEmitterCs.ColorValue = this.SubBullet.ColorValue; baseEmitterCs.TransparentValueF = this.SubBullet.TransparentValueF; baseEmitterCs.Direction = edi; baseEmitterCs.DestPoint = this.SubBullet.DestPoint; baseEmitterCs.Active = this.SubBullet.Active; baseEmitterCs.OutBound = this.SubBullet.OutBound; if (baseEmitterCs.BindWithDirection) baseEmitterCs.EmitDirection += edi * 180.0 / Math.PI; baseEmitterCs.SetBinding((BaseObject) b); if (!baseEmitterCs.DeepBinding) { baseEmitterCs.Time = this.Time; baseEmitterCs.LifeTime = Math.Min(this.SubBullet.LifeTime + this.Time, em.StartTime + em.Duration); } })); } else if (this.EmitterMode == EmitterMode.Enemy) { BaseEnemyPlane_Touhou enemy = (BaseEnemyPlane_Touhou) this.SubBullet.Clone(); enemy.LifeTime = 0; enemy.OriginalPosition = p; enemy.GhostingCount = enemy.GhostingCount; enemy.Velocity = num6 - (float) index2 * this.DeltaV; enemy.Direction = edi; enemy.AccelerateCS = num7; enemy.AccDirection = num8; enemy.ID = this.ID; enemy.LayerID = this.LayerID; if (this.MotionBinding) enemy.SetBinding((BaseObject) this); this.EnemyPlaneList.Add((BaseEnemyPlane) enemy); this.CSData.EmitterList.ForEach((Action<BaseEmitter_CS>) (em => { if (em.BindingID != this.ID) return; BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS) em.Clone(); this.StageData.EnemyPlaneList.Add((BaseEnemyPlane) baseEmitterCs); baseEmitterCs.OriginalPosition = p; baseEmitterCs.LifeTime = this.SubBullet.LifeTime; baseEmitterCs.ColorValue = this.SubBullet.ColorValue; baseEmitterCs.TransparentValueF = this.SubBullet.TransparentValueF; baseEmitterCs.Direction = edi; baseEmitterCs.DestPoint = this.SubBullet.DestPoint; baseEmitterCs.Active = this.SubBullet.Active; baseEmitterCs.OutBound = this.SubBullet.OutBound; baseEmitterCs.SetBinding((BaseObject) enemy); if (baseEmitterCs.BindWithDirection) baseEmitterCs.EmitDirection += edi * 180.0 / Math.PI; if (!baseEmitterCs.DeepBinding) { baseEmitterCs.Time = this.Time; baseEmitterCs.LifeTime = Math.Min(this.SubBullet.LifeTime + this.Time, em.StartTime + em.Duration); } })); } else if (this.EmitterMode == EmitterMode.Effect) { BaseEffect_CS baseEffectCs = (BaseEffect_CS) this.CSEffect.Clone(); baseEffectCs.OriginalPosition = p; baseEffectCs.GhostingCount = baseEffectCs.GhostingCount; baseEffectCs.AngleDegree += this.CSEffect.RanAngle * this.Ran.NextPMDouble(); baseEffectCs.Velocity = num6 - (float) index2 * this.DeltaV; baseEffectCs.Direction = edi; baseEffectCs.AccelerateCS = num7; baseEffectCs.AccDirection = num8; baseEffectCs.ID = this.ID; baseEffectCs.LayerID = this.LayerID; if (this.MotionBinding) baseEffectCs.SetBinding((BaseObject) this); this.EffectList.Add((BaseEffect) baseEffectCs); } } num11 += num10; edi += num10; if (this.SpecifySE) this.StageData.SoundPlay(this.SoundName); else if (this.EmitterMode == EmitterMode.Bullet) this.StageData.SoundPlay("se_tan00a.wav", OriginalPosition.X / (float) this.BoundRect.Width); else if (this.EmitterMode == EmitterMode.StraightLaser || this.EmitterMode == EmitterMode.RadialLaser) this.StageData.SoundPlay("se_lazer00.wav", OriginalPosition.X / (float) this.BoundRect.Width); } } }
public void String2Data(StageDataPackage StageData) { EmitterList.Clear(); int num1 = 0; string[] mbGtext1 = MBGtext; int index1 = num1; int num2 = index1 + 1; if (mbGtext1[index1] != "Crazy Storm Data 1.01") { MessageBox.Show("当前暂不支持除1.01以外的数据格式", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand); } else { string[] mbGtext2 = MBGtext; int index2 = num2; int num4 = index2 + 1; string str1 = mbGtext2[index2]; if (str1.Contains("Types")) { int num5 = int.Parse(str1.Split(' ')[0]); for (int index3 = 0; index3 < num5; ++index3) { MBGtext[num4++].Split('_'); } str1 = MBGtext[num4++]; } if (str1.Contains("GlobalEvents")) { int num5 = int.Parse(str1.Split(' ')[0]); for (int index3 = 0; index3 < num5; ++index3) { string str2 = MBGtext[num4++]; } str1 = MBGtext[num4++]; } if (str1.Contains("Sounds")) { int num5 = int.Parse(str1.Split(' ')[0]); for (int index3 = 0; index3 < num5; ++index3) { string str2 = MBGtext[num4++]; } string str3 = MBGtext[num4++]; } string[] mbGtext3 = MBGtext; int index4 = num4; int num6 = index4 + 1; TimeTotal = int.Parse(mbGtext3[index4].Split(':')[1]); for (int index3 = 0; index3 < 4; ++index3) { string str2 = MBGtext[num6++]; if (str2.Split(':')[1].Split(',')[0] != "empty") { int num5 = int.Parse(str2.Split(':')[1].Split(',')[3]); for (int index5 = 0; index5 < num5; ++index5) { string[] strArray = MBGtext[num6++].Split(','); EmitterMode EmitterMode = EmitterMode.Bullet; if (strArray.Length > 91) { if (bool.Parse(strArray[81])) { EmitterMode = EmitterMode.Enemy; } else if (int.Parse(strArray[91]) > 0) { EmitterMode = EmitterMode.Effect; } } BaseEmitter_CS baseEmitterCs = new BaseEmitter_CS(StageData, this, EmitterMode); if (baseEmitterCs.EmitterMode == EmitterMode.Enemy) { baseEmitterCs.SubBullet = new EnemyFactory(strArray[82]) { HealthPoint = int.Parse(strArray[83]), RedCount = int.Parse(strArray[84]), BlueCount = int.Parse(strArray[85]), ColorType = byte.Parse(strArray[86]), BackFire = bool.Parse(strArray[87]), ClearRadius = int.Parse(strArray[88]), GreenCount = int.Parse(strArray[89]), StarFall = (strArray[90] != "0") } }