public void Update( Boss b, EnemyManager em, Cname t, int id_i, int l, Vector2 pos, bool Ban) { this.player = pos; if (id_i != this.id || l != this.level) { this.Reinit(); } this.level = l; this.id = id_i; switch (t) { case Cname.REIMU: if (this.id == 0) { this.H_AMULET(l, pos, Ban); break; } break; case Cname.MARISA: if (this.id == 0) { this.D_TORPEDO(l, pos, Ban); break; } break; case Cname.SANAE: if (this.id == 0) { this.S_BOMB(l, pos, Ban); break; } break; default: if (this.id == 0) { this.EM_BLAST(b, em, l, pos, Ban); break; } break; } if (!Ban && (Main.IsKeyDown(Keys.Z) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Confirm))) { EquipShoot.CEquipShoot(this.tex, t, this.id, pos, this.sprites); } this.time += Time.Stop; }
public void Update(CSManager csm, EnemyManager e, Boss b) { praticle.posrect = new Vector4(body.position.X, body.position.Y, 0.0f, 0.0f); equip.Update(b, e, type, mattribute.CHILDREN, eqlevel, body.position, Dis | Ban | BanShoot); SelfBarrageManager.Update(e, b, this); ++f; if (f % 3 == 0) { if (flash <= 40) { ++flash; } if (flash % 2 == 0) { body.color.r = 0.0f; body.color.g = 0.0f; } else { body.color.r = 1f; body.color.g = 1f; } } if (f == 6) { f = 0; ++ani; if (ani == 7) { ani = 0; } } eqlevel = Program.game.game.Point / 50; runtime += Time.Stop; if (body.position.X >= rangex.X && body.position.X <= rangex.Y && (body.position.Y >= rangey.X && body.position.Y <= rangey.Y)) { int num1 = -1; if (!Dis) { if (Main.IsKeyDown(Keys.Up) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Up)) { num1 = -90; change = false; } if (Main.IsKeyDown(Keys.Down) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Down)) { num1 = 90; change = false; } if (Main.IsKeyDown(Keys.Left) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Left)) { num1 = 180; if (Main.IsKeyDown(Keys.Up) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Up)) { num1 = 225; } if (Main.IsKeyDown(Keys.Down) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Down)) { num1 = 135; } } if (Main.IsKeyDown(Keys.Right) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Right)) { num1 = 0; if (Main.IsKeyDown(Keys.Up) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Up)) { num1 = -45; } if (Main.IsKeyDown(Keys.Down) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Down)) { num1 = 45; } } } if (num1 != -1) { if (runtime - runtimebf >= 1.0) { if (num1 == 225 || num1 == 135 || (num1 == 180 || num1 == 0) || (num1 == -45 || num1 == 45)) { ansave = num1; change = true; f3 = 1; ++f2; if (f2 == 3) { switch (num1) { case -45: case 0: case 45: body.rect = new Rectangle(660, (int)(type - 1) * 60, 60, 60); break; case 135: case 180: case 225: body.rect = new Rectangle(420, (int)(type - 1) * 60, 60, 60); break; } } else if (f2 == 7) { ++ani2; if (ani2 >= 4) { ani2 = 1; } switch (num1) { case -45: case 0: case 45: body.rect = new Rectangle((11 + ani2) * 60, (int)(type - 1) * 60, 60, 60); break; case 135: case 180: case 225: body.rect = new Rectangle((7 + ani2) * 60, (int)(type - 1) * 60, 60, 60); break; } f2 = 4; } } else { change = false; } } float num2; if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow)) { num2 = Characters.attribute[(int)(type - 1 + 4)].MOVE * 0.5f * speedadd.X; shifted = true; } else { num2 = (float)(1.0 + Characters.attribute[(int)(type - 1)].MOVE * 0.5 * speedadd.Y); } body.position.X = MathHelper.Clamp(body.position.X + num2 * (float)Math.Cos(num1 * Math.PI / 180.0) * Time.Stop, rangex.X, rangex.Y); body.position.Y = MathHelper.Clamp(body.position.Y + num2 * (float)Math.Sin(num1 * Math.PI / 180.0) * Time.Stop, rangey.X, rangey.Y); } else { change = false; f2 = 0; ani2 = 0; } if (runtime - runtimebf >= 1.0) { if (!change && f3 == 0) { body.rect = new Rectangle(ani * 60, (int)(type - 1) * 60, 60, 60); } else if (!change && f3 >= 1) { if (ansave == 225 || ansave == 135 || ansave == 180) { body.rect = new Rectangle(420, (int)(type - 1) * 60, 60, 60); } else if (ansave == 0 || ansave == -45 || ansave == 45) { body.rect = new Rectangle(660, (int)(type - 1) * 60, 60, 60); } ++f3; if (f3 == 4) { f3 = 0; } } runtimebf = runtime; } Program.game.achivmanager.Check(AchievementType.Hidden, 3, new Hashtable() { ["itemline"] = Main.gn.Itemline[(int)(Main.Character - 1)], ["y"] = body.position.Y }); } if ((Dis || free) && Time.Stop == 1.0) { ++time; if (time > 30 && time <= 100) { for (int index = 0; index < e.EnemyArray.Count; ++index) { if (!e.EnemyArray[index].IsInWudi() && !e.EnemyArray[index].die && (e.EnemyArray[index].hp > 0 && !Main.IsOut(e.EnemyArray[index].Position)) && Math.Sqrt((e.EnemyArray[index].Position.X - body.position.X) * (e.EnemyArray[index].Position.X - body.position.X) + (e.EnemyArray[index].Position.Y - body.position.Y) * (e.EnemyArray[index].Position.Y - body.position.Y)) < Math.Abs((time - 10) * 10)) { e.EnemyArray[index].deadkill = true; e.EnemyArray[index].hp -= 2; } } } if (time == 1) { Program.game.achivmanager.Check(AchievementType.Challenge, 9, new Hashtable() { ["missorjust"] = true }); CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "14", new Vector2(body.position.X + 93f, body.position.Y - 13f)); crazyStorm.BanSound(true); crazyStorm.effect = true; Program.game.game.PlaySound("pldead00", true, body.position.X); body.color.a = 0.0f; } else if (time == 30) { if (Program.game.game.Point >= 50) { Program.game.game.DeathItem(); } Program.game.game.SpecialSystemReset(); dead = true; havedead = true; Program.game.game.Life -= 5; if (Program.game.game.Bomb < 10) { Program.game.game.Bomb = 10 + Program.game.game.Bomb % 5; } if (Program.game.game.Life == 0) { Program.game.game.Life = 0; if (!makeup) { Program.game.game.Point = 150; } makeup = true; } else if (Program.game.game.Life < 0) { alreadycal = true; Program.game.game.PlaySound("pldead01", true, body.position.X); Program.game.game.Life = -5; Program.game.game.Bomb = 0; Program.game.game.BanPause = true; makeup = false; } } else if (time > 30) { if (time == 31) { body.position.X = 224f; body.position.Y = 510f; } else if (Program.game.game.Life >= 0 && body.position.Y > 420.0 && !free) { body.position.Y -= 2f; if (body.position.Y <= 420.0) { body.position.Y = 420f; } } if (Program.game.game.Life >= 0) { if (time % 6 < 3) { body.color.r = 0.0f; body.color.g = 0.0f; } else { body.color.r = 1f; body.color.g = 1f; } } body.color.a = 1f; } if (time == 95) { if (!alreadycal) { Program.game.game.AddStgData(1, 0, 0); } else { alreadycal = false; } Dis = false; free = true; if (Program.game.game.Life == -5) { free = false; Dis = true; time = 50; Program.game.game.DeathProcess(); } } if (time > 280) { free = false; time = 0; } } if (!Ban && !Dis && !BanShoot | type == Cname.PATCHOULI && (Main.IsKeyDown(Keys.Z) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Confirm))) { BEquipShoot(selfb, type, mattribute.BODY, body.position); shot = true; } if (bomb != null && !bomb.Die) { bomb.Update(this, csm, e, b); } else if (bomb != null) { bomb = null; Wudi = false; Auto = false; } int num = type != Cname.SANAE || Main.Mode != Modes.SINGLE || (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift)) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow) ? 5 : 3; if (!Ban && (jue <= 10 || free) && (Program.game.game.Bomb >= num && bomb == null) && ((Main.IsKeyPressed(Keys.X) || !Main.Replay && PadState.IsKeyPressed(JOYKEYS.Special, Main.prepadstat)) && Time.Stop != 0.0)) { bombed = true; BanShoot = true; body.color = new Colors(1f, 1f, 1f, 1f); if (b != null) { Program.game.game.AddStgData(0, 1, 0); } Program.game.game.Bomb -= num; if (Program.game.game.Bomb <= 0) { Program.game.game.Bomb = 0; } if (!free) { Dis = false; time = 0; Program.game.achivmanager.Check(AchievementType.Challenge, 9, new Hashtable() { ["missorjust"] = false }); } Program.game.game.PlaySound("slash", true, body.position.X); bomb = new SingleBomb(type, body.position + new Vector2(93f, -13f)); Wudi = true; Auto = true; } if (Dis || free) { ++jue; } else { jue = 0; } if (itemm == null) { return; } foreach (ItemManager itemManager in itemm) { if (!Dis) { itemManager.Ban(false); } else { itemManager.Ban(true); } itemManager.Transpos(body.position.X, body.position.Y); } }
public static bool IsKeyUp(JOYKEYS key) { return(!PadState.IsKeyDown(key)); }
public SingleBomb(Cname type_C, Vector2 pos) { this.type = type_C; if (this.type != Cname.SANAE) { Program.game.game.PlaySound("nep00", true, pos.X); this.cs = Program.game.game.PlayEffect(false, ((int)(14 + this.type)).ToString(), new Vector2(pos.X, pos.Y)); this.cs.BanSound(true); this.cs.effect = true; this.cs.clearb = true; this.cs.bomb = true; } switch (this.type) { case Cname.REIMU: this.tex = new Sprite(); this.target = new Character(this.tex); this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>() { (byte)0, (byte)1, (byte)2, (byte)3, (byte)10, (byte)11, (byte)17, (byte)17, (byte)17, (byte)17, (byte)17, (byte)17 }); break; case Cname.MARISA: Program.game.game.Quake((int)((double)this.cs.time.total * 0.949999988079071), 2); this.cs.SetOPos(new Vector2(pos.X, pos.Y)); this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>() { (byte)2, (byte)30 }); break; case Cname.SANAE: if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow)) { this.cs = Program.game.game.PlayEffect(false, "19", new Vector2(pos.X, pos.Y)); this.cs.SetOPos(pos); } else { Program.game.game.PlaySound("nep00", true, pos.X); Program.game.game.Quake(250, 2); this.cs = Program.game.game.PlayEffect(false, ((int)(14 + this.type)).ToString(), new Vector2(pos.X, pos.Y)); this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>() { (byte)0, (byte)125 }); this.cs.clearb = true; } this.cs.BanSound(true); this.cs.effect = true; this.cs.bomb = true; break; case Cname.PATCHOULI: Program.game.game.Quake((int)((double)this.cs.time.total * 0.949999988079071), 2); this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>() { (byte)2, (byte)3, (byte)9, (byte)9 }); break; } this.time = 0; }
private static void H_AMULET(Texture2D s, Vector2 p, List <Sprite> sprt) { if ((double)EquipShoot.ctime < 7.0) { return; } for (int index = 0; index < sprt.Count; ++index) { SelfBarrage selfBarrage = new SelfBarrage(s, new Rectangle(22, 111, 13, 42), new Vector2(6f, 20f), sprt[index].position + p, 1f, new Vector2(1f, 1f)); selfBarrage.chase = true; selfBarrage.further = true; if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow)) { selfBarrage.further = false; } selfBarrage.speed = 9f; selfBarrage.speedd = 270f; selfBarrage.power = 12; } EquipShoot.ctime = 0.0f; }
public void Update(Texture2D bgmt, int stage) { ++this.time; if (this.now2 != -1 && !this.namestart) { bool flag = false; foreach (int num in Dialog.already) { if (this.now == num) { flag = true; break; } } if (!flag) { this.namestart = true; this.nameid = this.now; } } if (this.namestart && !this.close && !this.next) { ++this.nametime; if (this.nametime > 60 && this.nametime <= 80) { this.namecolor += 0.05f; } if (this.nametime > 220 && this.nametime <= 240) { this.namecolor -= 0.05f; } } else { this.namecolor -= 0.1f; if ((double)this.namecolor <= 0.0) { this.namecolor = 0.0f; } } if (!this.close && !this.next) { if (this.time <= 10) { this.start = false; this.tex.color.a += 0.1f; if ((double)this.tex.color.a >= 1.0) { this.tex.color.a = 1f; } this.dalpha += 0.1f; if ((double)this.dalpha >= 1.0) { this.dalpha = 1f; } if (this.now2 != -1) { this.db[this.now].color.a += 0.1f; if ((double)this.db[this.now].color.a >= 1.0) { this.db[this.now].color.a = 1f; } this.colorb += 0.1f; if ((double)this.colorb >= 1.0) { this.colorb = 1f; } this.colorm -= 0.1f; if ((double)this.colorm <= 0.5) { this.colorm = 0.5f; } } else { this.dm.color.a += 0.1f; if ((double)this.dm.color.a >= 1.0) { this.dm.color.a = 1f; } this.colorb -= 0.1f; if ((double)this.colorb <= 0.5) { this.colorb = 0.5f; } this.colorm += 0.1f; if ((double)this.colorm >= 1.0) { this.colorm = 1f; } } } if (this.time >= 11 && Main.IsKeyUp(Keys.Z) && (Main.Replay || PadState.IsKeyUp(JOYKEYS.Confirm)) && !this.start) { this.start = true; } else if (this.time >= 11 && (Main.IsKeyDown(Keys.Z) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Confirm)) && this.start) { Program.game.game.PlaySound("plst", false, 0.0f); this.time = 0; this.dalpha = 0.0f; this.n = this.sr.ReadLine(); if (this.n == "PAUSE") { this.next = true; this.start = false; } else if (this.n == "MUSIC") { BGM.Disposes(); if (stage != 7) { BGM bgm1 = new BGM(bgmt, 3 + (stage - 1) * 2); } else { BGM bgm2 = new BGM(bgmt, 16); } Music.BGM.Play(); this.n = this.sr.ReadLine(); if (this.n == null) { this.close = true; } else { this.Read(); } } else if (this.n == null) { this.close = true; } else { this.Read(); } } this.tex.position.Y += (float)((370.0 - (double)this.tex.position.Y) / 5.0); if (this.now2 == -1) { this.left.X += (float)((0.0 - (double)this.left.X) / 5.0); this.left.Y += (float)((62.0 - (double)this.left.Y) / 5.0); this.right.X += (float)((210.0 - (double)this.right.X) / 5.0); this.right.Y += (float)((92.0 - (double)this.right.Y) / 5.0); } else { this.left.X += (float)((-30.0 - (double)this.left.X) / 5.0); this.left.Y += (float)((92.0 - (double)this.left.Y) / 5.0); this.right.X += (float)((180.0 - (double)this.right.X) / 5.0); this.right.Y += (float)((62.0 - (double)this.right.Y) / 5.0); } } else if (this.time <= 10) { this.tex.color.a -= 0.1f; if ((double)this.tex.color.a <= 0.0) { this.tex.color.a = 0.0f; } this.tex.position.Y += (float)((380.0 - (double)this.tex.position.Y) / 5.0); this.left.X -= 4f; this.right.X += 4f; this.dm.color.a -= 0.1f; if ((double)this.dm.color.a <= 0.0) { this.dm.color.a = 0.0f; } for (int index = 0; index < this.db.Length; ++index) { if (this.db[index] != null) { this.db[index].color.a -= 0.1f; if ((double)this.db[index].color.a <= 0.0) { this.db[index].color.a = 0.0f; } } } } else { if (this.time < 11) { return; } for (int index = 0; index < this.db.Length; ++index) { if (this.db[index] != null) { --this.db[index].color.r; this.db[index].color.b = 1f; this.db[index].color.g = 1f; } } this.ok = true; if (this.namestart) { Dialog.already.Add(this.nameid); } this.tex.color.a = 0.0f; this.time = 11; if (!this.close) { return; } Program.game.game.Drawevents -= new Game.DrawDelegate(this.Draw); } }
private void EM_BLAST(Boss b, EnemyManager em, int l, Vector2 p, bool Ban) { if (this.ps != null && !this.ps.allpan && (double)this.ptime <= 30.0) { ++this.ptime; int num1 = int.Parse(this.ps.Id.Split('e')[1]) - 19; int power = 30 + num1 * 12; int num2 = 15 + (num1 - 1) * 5; foreach (Enemy enemy in em.EnemyArray) { if (!enemy.IsInWudi() && (double)Math.Abs(enemy.Position.X - p.X) <= (double)num2 && ((double)enemy.Position.Y >= 0.0 && (double)enemy.Position.Y <= (double)p.Y)) { enemy.hp -= power; Program.game.game.Score += 10L; } } if (b != null && (double)Math.Abs(b.Position.X - p.X) <= (double)num2 && ((double)b.Position.Y >= 0.0 && (double)b.Position.Y <= (double)p.Y)) { Program.game.game.Score += 10L; if (b.CardArray.Count >= 1) { b.CardArray[0].DeHp(power, this.ps.isforshoot); } } } else if (this.ps != null && this.ps.allpan && (double)this.ptime <= 10.0) { ++this.ptime; if ((double)this.ptime == 10.0) { this.ps.shoot.AddRange((IEnumerable <byte>) new List <byte>() { (byte)0, (byte)37 }); } } CrazyStorm effect = Program.game.game.FindEffect("e2"); if (effect != null) { this.time2 += Time.Stop; effect.SetPos(new Vector2(p.X + 93f, p.Y - 13f), true); if (Main.IsKeyUp(Keys.Z) && (Main.Replay || PadState.IsKeyUp(JOYKEYS.Confirm))) { Program.game.game.StopSound("ch"); if ((double)this.time2 >= 90.0 && l >= 1) { if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow)) { this.ps = Program.game.game.PlayEffect(true, (2 + l).ToString(), new Vector2(p.X + 93f, p.Y - 13f)); this.ps.allpan = true; } else { this.ps = Program.game.game.PlayEffect(true, (19 + l).ToString(), new Vector2(p.X + 93f, p.Y - 13f)); } this.ptime = 0.0f; this.ps.isforshoot = true; this.ps.BanSound(true); this.ps.effect = true; this.ps.bomb = true; Program.game.game.PlaySound("slash", true, p.X); this.time2 = 0.0f; } effect.Break(); } if (Ban) { effect.Break(); } } else if (!Ban && l >= 1 && (Main.IsKeyDown(Keys.Z) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Confirm)) && effect == null) { this.time2 = 0.0f; CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "2", new Vector2(p.X + 93f, p.Y - 13f)); crazyStorm.isforshoot = true; crazyStorm.BanSound(true); crazyStorm.effect = true; crazyStorm.specialnotkill = true; crazyStorm.SetOPos(new Vector2(p.X + 93f, p.Y - 13f)); Program.game.game.PlaySound("ch", true, p.X); } if (!this.inited) { this.inited = true; for (int index = 0; index < l; ++index) { this.sprites.Add(new Sprite(this.tex, new Rectangle(59, 61, 41, 41))); this.sprites[this.sprites.Count - 1].origin = new Vector2(21f, 21f); this.sprites[this.sprites.Count - 1].scale = Vector2.Zero; this.sprites[this.sprites.Count - 1].color.a = 1f; } switch (l) { case 1: this.sprites[0].position = new Vector2(0.0f, -30f); break; case 2: this.sprites[0].position = new Vector2(-30f, 0.0f); this.sprites[1].position = new Vector2(30f, 0.0f); break; case 3: this.sprites[0].position = new Vector2(0.0f, -30f); this.sprites[1].position = new Vector2(-30f, 0.0f); this.sprites[2].position = new Vector2(30f, 0.0f); break; case 4: this.sprites[0].position = new Vector2(0.0f, -30f); this.sprites[1].position = new Vector2(0.0f, 30f); this.sprites[2].position = new Vector2(-30f, 0.0f); this.sprites[3].position = new Vector2(30f, 0.0f); break; } } for (int index = 0; index < this.sprites.Count; ++index) { this.sprites[index].scale += new Vector2(0.06f, 0.06f); if ((double)this.sprites[index].scale.X >= 0.800000011920929) { this.sprites[index].scale = new Vector2(0.8f, 0.8f); } this.sprites[index].rotation = 10f * (float)Math.Sin((double)this.time / 40.0 * Math.PI); } }
private void S_BOMB(int l, Vector2 p, bool Ban) { if (!this.inited) { this.inited = true; for (int index = 0; index < l; ++index) { this.sprites.Add(new Sprite(this.tex, new Rectangle(103, 61, 41, 41))); this.sprites[this.sprites.Count - 1].origin = new Vector2(20f, 21f); this.sprites[this.sprites.Count - 1].scale = Vector2.Zero; this.sprites[this.sprites.Count - 1].color.a = 1f; } switch (l) { case 1: this.sprites[0].position = new Vector2(0.0f, -30f); break; case 2: this.sprites[0].position = new Vector2(-30f, 0.0f); this.sprites[1].position = new Vector2(30f, 0.0f); break; case 3: this.sprites[0].position = new Vector2(0.0f, -30f); this.sprites[1].position = new Vector2(-30f, 0.0f); this.sprites[2].position = new Vector2(30f, 0.0f); break; case 4: this.sprites[0].position = new Vector2(-22f, 10f); this.sprites[1].position = new Vector2(22f, 10f); this.sprites[2].position = new Vector2(-40f, 0.0f); this.sprites[3].position = new Vector2(40f, 0.0f); break; } } for (int index = 0; index < this.sprites.Count; ++index) { this.sprites[index].scale += new Vector2(0.06f, 0.06f); if ((double)this.sprites[index].scale.X >= 0.800000011920929) { this.sprites[index].scale = new Vector2(0.8f, 0.8f); } this.sprites[index].rotation += 10f * Time.Stop; } if ((double)Time.Stop == 1.0) { if (!Ban && (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow))) { switch (l) { case 1: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); break; case 2: this.sprites[0].position.X += (float)((-17.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-11.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((17.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-11.0 - (double)this.sprites[1].position.Y) / 5.0); break; case 3: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((-20.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-10.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((20.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((-10.0 - (double)this.sprites[2].position.Y) / 5.0); break; case 4: this.sprites[0].position.X += (float)((-12.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-25.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((12.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-25.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((-26.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((-5.0 - (double)this.sprites[2].position.Y) / 5.0); this.sprites[3].position.X += (float)((26.0 - (double)this.sprites[3].position.X) / 5.0); this.sprites[3].position.Y += (float)((-5.0 - (double)this.sprites[3].position.Y) / 5.0); break; } } else { switch (l) { case 1: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); break; case 2: this.sprites[0].position.X += (float)((-30.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((0.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((30.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0); break; case 3: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((-30.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((30.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0); break; case 4: this.sprites[0].position.X += (float)((-22.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((10.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((22.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((10.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((-40.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0); this.sprites[3].position.X += (float)((40.0 - (double)this.sprites[3].position.X) / 5.0); this.sprites[3].position.Y += (float)((0.0 - (double)this.sprites[3].position.Y) / 5.0); break; } } } foreach (SelfBarrage sb in SelfBarrageManager.SBArray) { if (sb.label == 1 && ((double)sb.time >= 60.0 || sb.Judged)) { Program.game.game.PlaySound("explo", true, sb.Position.X); CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "1", new Vector2(sb.Position.X + 93f, sb.Position.Y - 13f)); crazyStorm.isforshoot = true; crazyStorm.BanSound(true); crazyStorm.shoot.AddRange((IEnumerable <byte>) new List <byte>() { (byte)0, (byte)1 }); crazyStorm.effect = true; crazyStorm.allpan = true; crazyStorm.bomb = true; sb.Judged = true; sb.label = 0; } } }
private void D_TORPEDO(int l, Vector2 p, bool Ban) { if (!this.inited) { this.inited = true; for (int index = 0; index < l; ++index) { this.sprites.Add(new Sprite(this.tex, new Rectangle(146, 61, 41, 40))); this.sprites[this.sprites.Count - 1].origin = new Vector2(21f, 20f); this.sprites[this.sprites.Count - 1].scale = Vector2.Zero; this.sprites[this.sprites.Count - 1].color.a = 1f; } switch (l) { case 1: this.sprites[0].position = new Vector2(0.0f, -30f); break; case 2: this.sprites[0].position = new Vector2(-20f, 0.0f); this.sprites[1].position = new Vector2(20f, 0.0f); break; case 3: this.sprites[0].position = new Vector2(0.0f, -30f); this.sprites[1].position = new Vector2(-20f, 0.0f); this.sprites[2].position = new Vector2(20f, 0.0f); break; case 4: this.sprites[0].position = new Vector2(-14f, -25f); this.sprites[1].position = new Vector2(14f, -25f); this.sprites[2].position = new Vector2(-30f, 0.0f); this.sprites[3].position = new Vector2(30f, 0.0f); break; } } for (int index = 0; index < this.sprites.Count; ++index) { this.sprites[index].scale += new Vector2(0.06f, 0.06f); if ((double)this.sprites[index].scale.X >= 0.5) { this.sprites[index].scale = new Vector2((float)(0.5 + 0.300000011920929 * (double)Math.Abs((float)Math.Sin((double)this.time / 40.0 * Math.PI))), (float)(0.5 + 0.300000011920929 * (double)Math.Abs((float)Math.Sin((double)this.time / 40.0 * Math.PI)))); } } if ((double)Time.Stop == 1.0) { if (!Ban && (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow))) { switch (l) { case 1: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); break; case 2: this.sprites[0].position.X += (float)((-1.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((1.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-30.0 - (double)this.sprites[1].position.Y) / 5.0); break; case 3: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((-1.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-30.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((1.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((-30.0 - (double)this.sprites[2].position.Y) / 5.0); break; case 4: this.sprites[0].position.X += (float)((-1.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((1.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-30.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((-2.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((-30.0 - (double)this.sprites[2].position.Y) / 5.0); this.sprites[3].position.X += (float)((2.0 - (double)this.sprites[3].position.X) / 5.0); this.sprites[3].position.Y += (float)((-30.0 - (double)this.sprites[3].position.Y) / 5.0); break; } } else { switch (l) { case 1: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); break; case 2: this.sprites[0].position.X += (float)((-20.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((0.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((20.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0); break; case 3: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((-20.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((20.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0); break; case 4: this.sprites[0].position.X += (float)((-14.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-25.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((14.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-25.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((-30.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0); this.sprites[3].position.X += (float)((30.0 - (double)this.sprites[3].position.X) / 5.0); this.sprites[3].position.Y += (float)((0.0 - (double)this.sprites[3].position.Y) / 5.0); break; } } } foreach (SelfBarrage sb in SelfBarrageManager.SBArray) { if (sb.label == 2 && Main.IsKeyUp(Keys.Z) && (Main.Replay || PadState.IsKeyUp(JOYKEYS.Confirm))) { sb.Judged = true; } else if (sb.label == 2 && sb.Judged) { sb.color.g -= 0.1f; sb.color.b -= 0.1f; if ((double)sb.color.g <= 0.0) { sb.color = new Colors(1f, 0.0f, 0.0f, 1f); } } } }
private void H_AMULET(int l, Vector2 p, bool Ban) { if (!this.inited) { this.inited = true; for (int index = 0; index < l; ++index) { this.sprites.Add(new Sprite(this.tex, new Rectangle(12, 63, 45, 41))); this.sprites[this.sprites.Count - 1].origin = new Vector2(23f, 21f); this.sprites[this.sprites.Count - 1].scale = Vector2.Zero; this.sprites[this.sprites.Count - 1].color.a = 1f; } switch (l) { case 1: this.sprites[0].position = new Vector2(0.0f, -30f); break; case 2: this.sprites[0].position = new Vector2(-30f, 0.0f); this.sprites[1].position = new Vector2(30f, 0.0f); break; case 3: this.sprites[0].position = new Vector2(0.0f, -30f); this.sprites[1].position = new Vector2(-30f, 0.0f); this.sprites[2].position = new Vector2(30f, 0.0f); break; case 4: this.sprites[0].position = new Vector2(-20f, -25f); this.sprites[1].position = new Vector2(20f, -25f); this.sprites[2].position = new Vector2(-35f, 0.0f); this.sprites[3].position = new Vector2(35f, 0.0f); break; } } for (int index = 0; index < this.sprites.Count; ++index) { this.sprites[index].scale += new Vector2(0.06f, 0.06f); if ((double)this.sprites[index].scale.X >= 0.800000011920929) { this.sprites[index].scale = new Vector2(0.8f, 0.8f); } this.sprites[index].rotation -= 5f * Time.Stop; if ((double)this.sprites[index].rotation < 0.0) { this.sprites[index].rotation = 360f - this.sprites[index].rotation; } } if ((double)Time.Stop != 1.0) { return; } if (!Ban && (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow))) { switch (l) { case 1: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); break; case 2: this.sprites[0].position.X += (float)((-5.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((5.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-30.0 - (double)this.sprites[1].position.Y) / 5.0); break; case 3: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((-10.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-25.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((10.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((-25.0 - (double)this.sprites[2].position.Y) / 5.0); break; case 4: this.sprites[0].position.X += (float)((-15.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-25.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((15.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-25.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((-5.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((-30.0 - (double)this.sprites[2].position.Y) / 5.0); this.sprites[3].position.X += (float)((5.0 - (double)this.sprites[3].position.X) / 5.0); this.sprites[3].position.Y += (float)((-30.0 - (double)this.sprites[3].position.Y) / 5.0); break; } } else { switch (l) { case 1: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); break; case 2: this.sprites[0].position.X += (float)((-30.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((0.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((30.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0); break; case 3: this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((-30.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((30.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0); break; case 4: this.sprites[0].position.X += (float)((-20.0 - (double)this.sprites[0].position.X) / 5.0); this.sprites[0].position.Y += (float)((-25.0 - (double)this.sprites[0].position.Y) / 5.0); this.sprites[1].position.X += (float)((20.0 - (double)this.sprites[1].position.X) / 5.0); this.sprites[1].position.Y += (float)((-25.0 - (double)this.sprites[1].position.Y) / 5.0); this.sprites[2].position.X += (float)((-35.0 - (double)this.sprites[2].position.X) / 5.0); this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0); this.sprites[3].position.X += (float)((35.0 - (double)this.sprites[3].position.X) / 5.0); this.sprites[3].position.Y += (float)((0.0 - (double)this.sprites[3].position.Y) / 5.0); break; } } }
public void Update(ItemManager im, ItemTipManager itm, Vector2 ppos, bool ban, bool auto) { if (Main.IsYDownOut(this.pos.Y)) { this.die = true; } if (!this.die && !ban && ppos != Vector2.Zero) { if (this.type == ItemType.Green && this.time >= 50) { this.ok = true; } if ((double)ppos.Y <= (double)Main.gn.Itemline[(int)(Main.Character - 1)] || auto) { this.ok = true; this.max = true; } if (((double)this.pos.X - (double)ppos.X) * ((double)this.pos.X - (double)ppos.X) + ((double)this.pos.Y - (double)ppos.Y) * ((double)this.pos.Y - (double)ppos.Y) <= (double)(Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow) ? 3600 : 900)) { this.ok = true; } if (this.ok) { if (!this.ok) { this.pos.X += (float)(5.0 * Math.Cos((double)Main.Twopointangle(ppos.X, ppos.Y, this.pos.X, this.pos.Y))) * Time.Stop; this.pos.Y += (float)(5.0 * Math.Sin((double)Main.Twopointangle(ppos.X, ppos.Y, this.pos.X, this.pos.Y))) * Time.Stop; } else { this.pos.X += (float)(10.0 * Math.Cos((double)Main.Twopointangle(ppos.X, ppos.Y, this.pos.X, this.pos.Y))) * Time.Stop; this.pos.Y += (float)(10.0 * Math.Sin((double)Main.Twopointangle(ppos.X, ppos.Y, this.pos.X, this.pos.Y))) * Time.Stop; } if (Math.Abs((int)this.pos.X - (int)ppos.X) <= 4 && Math.Abs((int)this.pos.Y - (int)ppos.Y) <= 4) { Program.game.game.PlaySound("item", true, ppos.X); switch (this.type) { case ItemType.BigBlue: int num1 = (double)ppos.Y < (double)Main.gn.Itemline[(int)(Main.Character - 1)] || this.max ? 20000 + Program.game.game.MaxBlue : 50 * (545 - (int)ppos.Y) + Program.game.game.MaxBlue; int score_i1 = num1 - num1 % 10; Program.game.game.Score += (long)score_i1; ItemTip itemTip1 = new ItemTip(itm, this.pos, score_i1, (double)ppos.Y >= (double)Main.gn.Itemline[(int)(Main.Character - 1)] & !this.max); break; case ItemType.Blue: int num2 = (double)ppos.Y < (double)Main.gn.Itemline[(int)(Main.Character - 1)] || this.max ? 10000 + Program.game.game.MaxBlue : 25 * (545 - (int)ppos.Y) + Program.game.game.MaxBlue; int score_i2 = num2 - num2 % 10; Program.game.game.Score += (long)score_i2; ItemTip itemTip2 = new ItemTip(itm, this.pos, score_i2, (double)ppos.Y >= (double)Main.gn.Itemline[(int)(Main.Character - 1)] & !this.max); break; case ItemType.BigRed: Program.game.game.Score += 200000L; if (Program.game.game.Point < 200) { Program.game.game.Point += 20; if (Program.game.game.Point >= 200) { Program.game.game.Point = 200; ItemTip itemTip3 = new ItemTip(itm, this.pos, TipType.FullPower, false); } if (Program.game.game.Point % 50 == 0) { Program.game.game.PlaySound("powerup", true, ppos.X); break; } break; } break; case ItemType.Red: Program.game.game.Score += 10000L; if (Program.game.game.Point < 200) { ++Program.game.game.Point; if (Program.game.game.Point >= 200) { Program.game.game.Point = 200; ItemTip itemTip3 = new ItemTip(itm, this.pos, TipType.FullPower, false); } if (Program.game.game.Point % 50 == 0) { Program.game.game.PlaySound("powerup", true, ppos.X); break; } break; } break; case ItemType.Full: Program.game.game.Score += 2000000L; if (Program.game.game.Point < 200) { Program.game.game.PlaySound("powerup", true, ppos.X); } Program.game.game.Point = 200; ItemTip itemTip4 = new ItemTip(itm, this.pos, TipType.FullPower, false); break; case ItemType.BigUp: Program.game.game.Score += 1000000L; Program.game.game.Life += 5; Program.game.game.PlaySound("extend", true, ppos.X); break; case ItemType.Up: ++Program.game.game.Life; if (Program.game.game.Life % 5 == 0) { Program.game.game.Score += 1000000L; Program.game.game.PlaySound("extend", true, ppos.X); break; } break; case ItemType.BigBomb: Program.game.game.Bomb += 5; Program.game.game.PlaySound("cardget", true, ppos.X); break; case ItemType.Bomb: ++Program.game.game.Bomb; if (Program.game.game.Bomb % 5 == 0) { Program.game.game.PlaySound("cardget", true, ppos.X); break; } break; case ItemType.Green: Program.game.game.Score += 100L; Program.game.game.MaxBlue += 5; break; } this.die = true; } } } else { this.ok = false; } if ((double)this.speed.Y <= 0.0) { this.rotate += 1f * Time.Stop; } else { this.rotate = 0.0f; } if ((double)this.speed.Y < 1.5) { this.speed.Y += 0.07f; } else { this.speed.X -= 0.01f; if ((double)this.speed.X <= 0.0) { this.speed.X = 0.0f; } } this.pos.X += this.speed.X * Time.Stop; this.pos.Y += this.speed.Y * Time.Stop; if ((double)this.pos.Y >= 500.0) { this.die = true; } ++this.time; }